instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override protected void formOK(UserRequest ureq) { List<Identity> tos = new ArrayList<>(toValues.size()); for(IdentityWrapper wrapper:toValues) { tos.add(wrapper.getIdentity()); } String subject = subjectElement.getValue(); String body = bodyElement.getValue(); sendEmail(tos, subject, body, ureq); fireEvent(ureq, FolderCommand.FOLDERCOMMAND_FINISHED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: formOK File: src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
formOK
src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
private int jjMoveStringLiteralDfa3_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(1, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(2, active0); return 3; } switch(curChar) { case 101: if ((active0 & 0x10000L) != 0L) return jjStartNfaWithStates_1(3, 16, 6); break; case 108: if ((active0 & 0x40000L) != 0L) return jjStartNfaWithStates_1(3, 18, 6); break; case 115: return jjMoveStringLiteralDfa4_1(active0, 0x20000L); case 116: return jjMoveStringLiteralDfa4_1(active0, 0x600000000000L); default : break; } return jjStartNfa_1(2, active0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jjMoveStringLiteralDfa3_1 File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
jjMoveStringLiteralDfa3_1
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
@Override public void cleanupStuckCalls() { Log.startSession("TCI.cSC"); try { synchronized (mLock) { enforceShellOnly(Binder.getCallingUid(), "cleanupStuckCalls"); Binder.withCleanCallingIdentity(() -> { for (Call call : mCallsManager.getCalls()) { call.cleanup(); if (call.getState() == CallState.DISCONNECTED || call.getState() == CallState.DISCONNECTING) { mCallsManager.markCallAsRemoved(call); } } mCallsManager.getInCallController().unbindFromServices(); }); } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanupStuckCalls File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
cleanupStuckCalls
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
private PageReferenceResolver<EntityReference> getPageReferenceResolver() { if (this.pageReferenceResolver == null) { this.pageReferenceResolver = Utils.getComponent(PageReferenceResolver.TYPE_REFERENCE); } return this.pageReferenceResolver; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageReferenceResolver File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getPageReferenceResolver
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public void setLocalizeTitle(boolean localizeTitle) { _localizeTitle = localizeTitle; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLocalizeTitle File: util-taglib/src/com/liferay/taglib/ui/HeaderTag.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
setLocalizeTitle
util-taglib/src/com/liferay/taglib/ui/HeaderTag.java
bd92daa70ab77a40eff0eb18e8e91f3e095694e1
0
Analyze the following code function for security vulnerabilities
@Test(expectedExceptions=IllegalArgumentException.class) public void testZipSlip() { // For CVE-2018-19859, issue #1840 ImportingUtilities.allocateFile(workspaceDir, "../../script.sh"); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2018-19859 - Severity: MEDIUM - CVSS Score: 4.0 Description: Create dedicated temporary dir for zip slip test Function: testZipSlip File: main/tests/server/src/com/google/refine/tests/importing/ImportingUtilitiesTests.java Repository: OpenRefine Fixed Code: @Test(expectedExceptions=IllegalArgumentException.class) public void testZipSlip() throws IOException { File tempDir = TestUtils.createTempDirectory("openrefine-zip-slip-test"); // For CVE-2018-19859, issue #1840 ImportingUtilities.allocateFile(tempDir, "../../tmp/script.sh"); }
[ "CWE-22" ]
CVE-2018-19859
MEDIUM
4
OpenRefine
testZipSlip
main/tests/server/src/com/google/refine/tests/importing/ImportingUtilitiesTests.java
79994e86da1a3eecc62723f4ba90f14a63ad0e72
1
Analyze the following code function for security vulnerabilities
public String serializeToString(Object obj, Map<String, Object> formParams, String contentType, boolean isBodyNullable) throws ApiException { try { if (contentType.startsWith("multipart/form-data")) { throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { String formString = ""; for (Entry<String, Object> param : formParams.entrySet()) { formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; } if (formString.length() == 0) { // empty string return formString; } else { return formString.substring(0, formString.length() - 1); } } else { if (isBodyNullable) { return obj == null ? "null" : json.getMapper().writeValueAsString(obj); } else { return obj == null ? "" : json.getMapper().writeValueAsString(obj); } } } catch (Exception ex) { throw new ApiException("Failed to perform serializeToString: " + ex.toString()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serializeToString File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
serializeToString
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void forceRemoveActiveAdmin(ComponentName adminReceiver, int userHandle) { if (!mHasFeature) { return; } Objects.requireNonNull(adminReceiver, "ComponentName is null"); Preconditions.checkCallAuthorization(isAdb(getCallerIdentity()) || hasCallingOrSelfPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS), "Caller must be shell or hold MANAGE_PROFILE_AND_DEVICE_OWNERS to call " + "forceRemoveActiveAdmin"); mInjector.binderWithCleanCallingIdentity(() -> { boolean isOrgOwnedProfile = false; synchronized (getLockObject()) { if (!isAdminTestOnlyLocked(adminReceiver, userHandle)) { throw new SecurityException("Attempt to remove non-test admin " + adminReceiver + " " + userHandle); } // If admin is a device or profile owner tidy that up first. if (isDeviceOwner(adminReceiver, userHandle)) { clearDeviceOwnerLocked(getDeviceOwnerAdminLocked(), userHandle); } if (isProfileOwner(adminReceiver, userHandle)) { isOrgOwnedProfile = isProfileOwnerOfOrganizationOwnedDevice(userHandle); final ActiveAdmin admin = getActiveAdminUncheckedLocked(adminReceiver, userHandle, /* parent */ false); clearProfileOwnerLocked(admin, userHandle); } } // Remove the admin skipping sending the broadcast. removeAdminArtifacts(adminReceiver, userHandle); // In case of PO on org owned device, clean device-wide policies and restrictions. if (isOrgOwnedProfile) { final UserHandle parentUser = UserHandle.of(getProfileParentId(userHandle)); clearOrgOwnedProfileOwnerUserRestrictions(parentUser); clearOrgOwnedProfileOwnerDeviceWidePolicies(parentUser.getIdentifier()); } Slogf.i(LOG_TAG, "Admin " + adminReceiver + " removed from user " + userHandle); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceRemoveActiveAdmin File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
forceRemoveActiveAdmin
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private boolean canHaveProfile(final int parentUserId) { final UserInfo userInfo = getUserManager().getUserInfo(parentUserId); return userInfo != null && userInfo.canHaveProfile(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canHaveProfile File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
canHaveProfile
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private void preparePlugins(XWikiContext context) { setPluginManager(new XWikiPluginManager(getXWikiPreference("plugins", context), context)); String plugins = getConfiguration().getProperty("xwiki.plugins", ""); if (!plugins.equals("")) { getPluginManager().addPlugins(StringUtils.split(plugins, " ,"), context); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: preparePlugins File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
preparePlugins
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private void scheduleWriteUserLocked(UserInfo userInfo) { if (!mHandler.hasMessages(WRITE_USER_MSG, userInfo)) { Message msg = mHandler.obtainMessage(WRITE_USER_MSG, userInfo); mHandler.sendMessageDelayed(msg, WRITE_USER_DELAY); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleWriteUserLocked File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
scheduleWriteUserLocked
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
private String getLocalePrefix(FacesContext context) { String localePrefix = null; localePrefix = context.getExternalContext().getRequestParameterMap().get("loc"); if(localePrefix != null){ return localePrefix; } String appBundleName = context.getApplication().getMessageBundle(); if (null != appBundleName) { Locale locale = null; if (context.getViewRoot() != null) { locale = context.getViewRoot().getLocale(); } else { locale = context.getApplication().getViewHandler().calculateLocale(context); } try { ResourceBundle appBundle = ResourceBundle.getBundle(appBundleName, locale, Util.getCurrentLoader(ResourceManager.class)); localePrefix = appBundle .getString(ResourceHandler.LOCALE_PREFIX); } catch (MissingResourceException mre) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "Ignoring missing resource", mre); } } } return localePrefix; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2018-14371 - Severity: MEDIUM - CVSS Score: 5.0 Description: fixing CTS failure issue in master branch Function: getLocalePrefix File: impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java Repository: eclipse-ee4j/mojarra Fixed Code: private String getLocalePrefix(FacesContext context) { String localePrefix = null; localePrefix = context.getExternalContext().getRequestParameterMap().get("loc"); if(localePrefix != null && !nameContainsForbiddenSequence(localePrefix)){ return localePrefix; } String appBundleName = context.getApplication().getMessageBundle(); if (null != appBundleName) { Locale locale = null; if (context.getViewRoot() != null) { locale = context.getViewRoot().getLocale(); } else { locale = context.getApplication().getViewHandler().calculateLocale(context); } try { ResourceBundle appBundle = ResourceBundle.getBundle(appBundleName, locale, Util.getCurrentLoader(ResourceManager.class)); localePrefix = appBundle .getString(ResourceHandler.LOCALE_PREFIX); } catch (MissingResourceException mre) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "Ignoring missing resource", mre); } } } return localePrefix; }
[ "CWE-22" ]
CVE-2018-14371
MEDIUM
5
eclipse-ee4j/mojarra
getLocalePrefix
impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
1b434748d9239f42eae8aa7d37d7a0930c061e24
1
Analyze the following code function for security vulnerabilities
private void updateClock(float alpha, float scale) { if (!mKeyguardStatusViewAnimating) { mKeyguardStatusView.setAlpha(alpha); } mKeyguardStatusView.setScaleX(scale); mKeyguardStatusView.setScaleY(scale); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateClock File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
updateClock
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public IndexPattern addMaskedFields(List<String> maskedFields) { if (maskedFields != null) { this.maskedFields.addAll(maskedFields); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addMaskedFields File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
addMaskedFields
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
private void handleTableSizeChange(ByteBuffer target) { if (newMaxHeaderSize == -1) { return; } if (minNewMaxHeaderSize != newMaxHeaderSize) { target.put((byte) (1 << 5)); encodeInteger(target, minNewMaxHeaderSize, 5); } target.put((byte) (1 << 5)); encodeInteger(target, newMaxHeaderSize, 5); maxTableSize = newMaxHeaderSize; runEvictionIfRequired(); newMaxHeaderSize = -1; minNewMaxHeaderSize = -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleTableSizeChange File: core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
handleTableSizeChange
core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
public void setCrumbIssuer(CrumbIssuer issuer) { crumbIssuer = issuer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCrumbIssuer File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
setCrumbIssuer
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
static IOException throwForInvalidTag(int depth, String tag) throws IOException { throw new IOException(String.format("Invalid tag '%s' found at depth %d", tag, depth)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: throwForInvalidTag File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
throwForInvalidTag
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private boolean isLockPatternEnabled(int mode, int userId) { return mode == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING && savedPatternExists(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLockPatternEnabled File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
isLockPatternEnabled
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public static String humanReadableByteSize(long size){ String measure = "B"; if(size < 1024){ return size + " " + measure; } Double number = new Double(size); if(number>=1024){ number = number/1024; measure = "KB"; if(number>=1024){ number = number/1024; measure = "MB"; if(number>=1024){ number=number/1024; measure = "GB"; } } } DecimalFormat format = new DecimalFormat("#0.00"); return format.format(number) + " " + measure; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: humanReadableByteSize File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
humanReadableByteSize
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
@Override public int getKeyCode(int gameAction) { switch (gameAction) { case Display.GAME_DOWN: return DROID_IMPL_KEY_DOWN; case Display.GAME_UP: return DROID_IMPL_KEY_UP; case Display.GAME_LEFT: return DROID_IMPL_KEY_LEFT; case Display.GAME_RIGHT: return DROID_IMPL_KEY_RIGHT; case Display.GAME_FIRE: return DROID_IMPL_KEY_FIRE; default: return 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyCode File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getKeyCode
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
boolean isUserRestricted(int userId, String restrictionKey) { Bundle restrictions = sUserManager.getUserRestrictions(userId); if (restrictions.getBoolean(restrictionKey, false)) { Log.w(TAG, "User is restricted: " + restrictionKey); return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUserRestricted File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
isUserRestricted
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserializeWithType File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
deserializeWithType
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
public String getLoggedInUserName() { By userAvatarInDrawer = By.id("tmUser"); if (!getDriver().hasElementWithoutWaiting(userAvatarInDrawer)) { // Guest return null; } WebElement element = getDriver().findElementWithoutWaiting(userAvatarInDrawer); String href = element.getAttribute("href"); String loggedInUserName = href.substring(href.lastIndexOf("/") + 1); // Return return loggedInUserName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLoggedInUserName File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getLoggedInUserName
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
boolean isNfcEnabledOrShuttingDown() { synchronized (this) { return (mState == NfcAdapter.STATE_ON || mState == NfcAdapter.STATE_TURNING_OFF); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNfcEnabledOrShuttingDown File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
isNfcEnabledOrShuttingDown
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
private final int ringAdvance(int x, final int increment, final int ringSize) { x += increment; if (x < 0) return (ringSize - 1); else if (x >= ringSize) return 0; else return x; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ringAdvance File: services/core/java/com/android/server/am/BroadcastQueue.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
ringAdvance
services/core/java/com/android/server/am/BroadcastQueue.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public List<Delta> getContentDiff(Document origdoc, Document newdoc) throws XWikiException, DifferentiationFailedException { try { if ((origdoc == null) && (newdoc == null)) { return Collections.emptyList(); } if (origdoc == null) { return this.doc.getContentDiff(new XWikiDocument(newdoc.getDocumentReference()), newdoc.doc, getXWikiContext()); } if (newdoc == null) { return this.doc.getContentDiff(origdoc.doc, new XWikiDocument(origdoc.getDocumentReference()), getXWikiContext()); } return this.doc.getContentDiff(origdoc.doc, newdoc.doc, getXWikiContext()); } catch (Exception e) { java.lang.Object[] args = { origdoc.getFullName(), origdoc.getVersion(), newdoc.getVersion() }; List list = new ArrayList(); XWikiException xe = new XWikiException(XWikiException.MODULE_XWIKI_DIFF, XWikiException.ERROR_XWIKI_DIFF_CONTENT_ERROR, "Error while making content diff of {0} between version {1} and version {2}", e, args); String errormsg = Util.getHTMLExceptionMessage(xe, getXWikiContext()); list.add(errormsg); return list; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentDiff File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getContentDiff
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
@Nullable static Intent parseIntentAttributeNoDefault(TypedXmlPullParser parser, String attribute) { final String value = parseStringAttribute(parser, attribute); Intent parsed = null; if (!TextUtils.isEmpty(value)) { try { parsed = Intent.parseUri(value, /* flags =*/ 0); } catch (URISyntaxException e) { Slog.e(TAG, "Error parsing intent", e); } } return parsed; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseIntentAttributeNoDefault File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
parseIntentAttributeNoDefault
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public void createUserSession(UserSessionModel userSession, boolean offline) { PersistentUserSessionAdapter adapter = new PersistentUserSessionAdapter(userSession); PersistentUserSessionModel model = adapter.getUpdatedModel(); PersistentUserSessionEntity entity = new PersistentUserSessionEntity(); entity.setUserSessionId(model.getUserSessionId()); entity.setCreatedOn(model.getStarted()); entity.setRealmId(adapter.getRealm().getId()); entity.setUserId(adapter.getUser().getId()); String offlineStr = offlineToString(offline); entity.setOffline(offlineStr); entity.setLastSessionRefresh(model.getLastSessionRefresh()); entity.setData(model.getData()); em.persist(entity); em.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createUserSession File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java Repository: keycloak The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-6563
HIGH
7.7
keycloak
createUserSession
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
11eb952e1df7cbb95b1e2c101dfd4839a2375695
0
Analyze the following code function for security vulnerabilities
private UriPermission findOrCreateUriPermissionLocked(String sourcePkg, String targetPkg, int targetUid, GrantUri grantUri) { ArrayMap<GrantUri, UriPermission> targetUris = mGrantedUriPermissions.get(targetUid); if (targetUris == null) { targetUris = Maps.newArrayMap(); mGrantedUriPermissions.put(targetUid, targetUris); } UriPermission perm = targetUris.get(grantUri); if (perm == null) { perm = new UriPermission(sourcePkg, targetPkg, targetUid, grantUri); targetUris.put(grantUri, perm); } return perm; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findOrCreateUriPermissionLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
findOrCreateUriPermissionLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
void launchVoiceAssistWithWakeLock(boolean keyguardActive) { Intent voiceIntent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE); voiceIntent.putExtra(RecognizerIntent.EXTRA_SECURE, keyguardActive); startActivityAsUser(voiceIntent, UserHandle.CURRENT_OR_SELF); mBroadcastWakeLock.release(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: launchVoiceAssistWithWakeLock File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
launchVoiceAssistWithWakeLock
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
private void handleFingerprintAuthenticated() { try { final int userId; try { userId = ActivityManagerNative.getDefault().getCurrentUser().id; } catch (RemoteException e) { Log.e(TAG, "Failed to get current user id: ", e); return; } if (isFingerprintDisabled(userId)) { Log.d(TAG, "Fingerprint disabled by DPM for userId: " + userId); return; } onFingerprintAuthenticated(userId); } finally { setFingerprintRunningState(FINGERPRINT_STATE_STOPPED); } }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3917 - Severity: HIGH - CVSS Score: 7.2 Description: Bind fingerprint when we start authentication This fixes a bug where it was possible to authenticate the wrong user. We now bind the userId when we start authentication and confirm it when authentication completes. Fixes bug 30744668 (Cherry pick from Change-Id: I346d92c301414ed81e11fa9c171584c7ae4341c2) Change-Id: I3584790c39eb2e8c435ad1b2d887bf9b8ebd36fe (cherry picked from commit 837d052ed4b5b75dfd4af44f5ad268e683bf2e13) Function: handleFingerprintAuthenticated File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android Fixed Code: private void handleFingerprintAuthenticated(int authUserId) { try { final int userId; try { userId = ActivityManagerNative.getDefault().getCurrentUser().id; } catch (RemoteException e) { Log.e(TAG, "Failed to get current user id: ", e); return; } if (userId != authUserId) { Log.d(TAG, "Fingerprint authenticated for wrong user: " + authUserId); return; } if (isFingerprintDisabled(userId)) { Log.d(TAG, "Fingerprint disabled by DPM for userId: " + userId); return; } onFingerprintAuthenticated(userId); } finally { setFingerprintRunningState(FINGERPRINT_STATE_STOPPED); } }
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
handleFingerprintAuthenticated
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
1
Analyze the following code function for security vulnerabilities
@Override public void alwaysShowUnsupportedCompileSdkWarning(ComponentName activity) { synchronized (this) { final long origId = Binder.clearCallingIdentity(); try { mAppWarnings.alwaysShowUnsupportedCompileSdkWarning(activity); } finally { Binder.restoreCallingIdentity(origId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: alwaysShowUnsupportedCompileSdkWarning File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
alwaysShowUnsupportedCompileSdkWarning
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void appendMemInfo(StringBuilder sb, ProcessMemInfo mi) { appendBasicMemEntry(sb, mi.oomAdj, mi.procState, mi.pss, mi.memtrack, mi.name); sb.append(" (pid "); sb.append(mi.pid); sb.append(") "); sb.append(mi.adjType); sb.append('\n'); if (mi.adjReason != null) { sb.append(" "); sb.append(mi.adjReason); sb.append('\n'); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendMemInfo File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
appendMemInfo
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static RouteWithFilter fallback(final Filter filter, final String method, final String path, final String name, final List<MediaType> produces) { return new FallbackRoute(name, method, path, produces, filter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fallback File: jooby/src/main/java/org/jooby/internal/RouteImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
fallback
jooby/src/main/java/org/jooby/internal/RouteImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
private void initServiceDiscovery() { // register connection features ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(mXMPPConnection); // init Entity Caps manager with storage in app's cache dir try { if (capsCacheDir == null) { capsCacheDir = new File(mService.getCacheDir(), "entity-caps-cache"); capsCacheDir.mkdirs(); EntityCapsManager.setPersistentCache(new SimpleDirectoryPersistentCache(capsCacheDir)); } } catch (java.io.IOException e) { Log.e(TAG, "Could not init Entity Caps cache: " + e.getLocalizedMessage()); } // reference PingManager, set ping flood protection to 10s PingManager.getInstanceFor(mXMPPConnection).disablePingFloodProtection(); // set Version for replies String app_name = mService.getString(R.string.app_name); String build_revision = mService.getString(R.string.build_revision); Version.Manager.getInstanceFor(mXMPPConnection).setVersion( new Version(app_name, build_revision, "Android")); // reference DeliveryReceiptManager, add listener DeliveryReceiptManager dm = DeliveryReceiptManager.getInstanceFor(mXMPPConnection); dm.addReceiptReceivedListener(new ReceiptReceivedListener() { // DOES NOT WORK IN CARBONS public void onReceiptReceived(String fromJid, String toJid, String receiptId) { Log.d(TAG, "got delivery receipt for " + receiptId); changeMessageDeliveryStatus(receiptId, ChatConstants.DS_ACKED); }}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initServiceDiscovery File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
initServiceDiscovery
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
protected void initInternal() throws ServletException { // :FIXME: Document UnavailableException try { internal = MessageResources.getMessageResources(internalName); } catch (MissingResourceException e) { log.error("Cannot load internal resources from '" + internalName + "'", e); throw new UnavailableException ("Cannot load internal resources from '" + internalName + "'"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initInternal File: src/share/org/apache/struts/action/ActionServlet.java Repository: kawasima/struts1-forever The code follows secure coding practices.
[ "CWE-Other", "CWE-20" ]
CVE-2016-1181
MEDIUM
6.8
kawasima/struts1-forever
initInternal
src/share/org/apache/struts/action/ActionServlet.java
eda3a79907ed8fcb0387a0496d0cb14332f250e8
0
Analyze the following code function for security vulnerabilities
public String getValueString() { T value = getValue(); return "" + value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValueString File: varexport/src/main/java/com/indeed/util/varexport/Variable.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
getValueString
varexport/src/main/java/com/indeed/util/varexport/Variable.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
private DiskLocationCache sourceCache() { if (sourceCache == null) initSourceCache(); return sourceCache; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sourceCache File: src/test/java/io/scif/util/DefaultSampleFilesService.java Repository: scifio The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-4493
CRITICAL
9.8
scifio
sourceCache
src/test/java/io/scif/util/DefaultSampleFilesService.java
fcb0dbca0ec72b22fe0c9ddc8abc9cb188a0ff31
0
Analyze the following code function for security vulnerabilities
public boolean filterMatches(Stanza packet) { return packetFilter == null || packetFilter.accept(packet); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filterMatches File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
filterMatches
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public void addClassProperty(String space, String page, String propertyName, String propertyType) { gotoPage(space, page, "propadd", "propname", propertyName, "proptype", propertyType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addClassProperty File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
addClassProperty
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public void endDefinitionTerm() { getXHTMLWikiPrinter().printXMLEndElement("dt"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: endDefinitionTerm File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
endDefinitionTerm
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
public boolean isDeviceOwner(ComponentName who, int userId) { synchronized (getLockObject()) { return mOwners.hasDeviceOwner() && mOwners.getDeviceOwnerUserId() == userId && mOwners.getDeviceOwnerComponent().equals(who); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDeviceOwner File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
isDeviceOwner
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean getAllowPoolingConnection() { return allowPoolingConnection; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllowPoolingConnection File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
getAllowPoolingConnection
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public boolean getHasCustomQuietPeriod() { return quietPeriod!=null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHasCustomQuietPeriod File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getHasCustomQuietPeriod
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { // Don't let anyone update the _data column if (values != null && values.containsKey(Part._DATA)) { return 0; } final int callerUid = Binder.getCallingUid(); final String callerPkg = getCallingPackage(); int match = sURLMatcher.match(uri); if (LOCAL_LOGV) { Log.v(TAG, "Update uri=" + uri + ", match=" + match); } boolean notify = false; String msgId = null; String table; switch (match) { case MMS_ALL_ID: case MMS_INBOX_ID: case MMS_SENT_ID: case MMS_DRAFTS_ID: case MMS_OUTBOX_ID: msgId = uri.getLastPathSegment(); // fall-through case MMS_ALL: case MMS_INBOX: case MMS_SENT: case MMS_DRAFTS: case MMS_OUTBOX: notify = true; table = TABLE_PDU; break; case MMS_MSG_PART: case MMS_PART_ID: table = TABLE_PART; break; case MMS_PART_RESET_FILE_PERMISSION: String path = getContext().getDir(PARTS_DIR_NAME, 0).getPath() + '/' + uri.getPathSegments().get(1); // Reset the file permission back to read for everyone but me. int result = FileUtils.setPermissions(path, 0644, -1, -1); if (LOCAL_LOGV) { Log.d(TAG, "MmsProvider.update setPermissions result: " + result + " for path: " + path); } return 0; default: Log.w(TAG, "Update operation for '" + uri + "' not implemented."); return 0; } String extraSelection = null; ContentValues finalValues; if (table.equals(TABLE_PDU)) { // Filter keys that we don't support yet. filterUnsupportedKeys(values); if (ProviderUtil.shouldRemoveCreator(values, callerUid)) { // CREATOR should not be changed by non-SYSTEM/PHONE apps Log.w(TAG, callerPkg + " tries to update CREATOR"); values.remove(Mms.CREATOR); } finalValues = new ContentValues(values); if (msgId != null) { extraSelection = Mms._ID + "=" + msgId; } } else if (table.equals(TABLE_PART)) { finalValues = new ContentValues(values); switch (match) { case MMS_MSG_PART: extraSelection = Part.MSG_ID + "=" + uri.getPathSegments().get(0); break; case MMS_PART_ID: extraSelection = Part._ID + "=" + uri.getPathSegments().get(1); break; default: break; } } else { return 0; } String finalSelection = concatSelections(selection, extraSelection); SQLiteDatabase db = mOpenHelper.getWritableDatabase(); int count = db.update(table, finalValues, finalSelection, selectionArgs); if (notify && (count > 0)) { notifyChange(uri); } return count; }
Vulnerability Classification: - CWE: CWE-362 - CVE: CVE-2016-3914 - Severity: HIGH - CVSS Score: 9.3 Description: 30481342: Security Vulnerability - TOCTOU in MmsProvider allows access to files as phone (radio) uid Problem: MmsProvider.openFile validated the current _data column in the DB and then called ContentProvider.openFileHelper which was again reading from the DB. A race condition could cause the second DB read to read an updated, malicious value. Fix: instead of doing the first DB check and calling ContentProvider.openFileHelper, we're now just calling MmsProvider.safeOpenFileHelper which does a single check. Test: used the POC provided for this incident. b/30481342 Change-Id: I653129359130b9fae59d4c355320b266c158a698 (cherry picked from commit 5bc7f9682d72c89ba252be6471b2db9b7e7815e3) Function: update File: src/com/android/providers/telephony/MmsProvider.java Repository: android Fixed Code: @Override public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { // The _data column is filled internally in MmsProvider, so this check is just to avoid // it from being inadvertently set. This is not supposed to be a protection against // malicious attack, since sql injection could still be attempted to bypass the check. On // the other hand, the MmsProvider does verify that the _data column has an allowed value // before opening any uri/files. if (values != null && values.containsKey(Part._DATA)) { return 0; } final int callerUid = Binder.getCallingUid(); final String callerPkg = getCallingPackage(); int match = sURLMatcher.match(uri); if (LOCAL_LOGV) { Log.v(TAG, "Update uri=" + uri + ", match=" + match); } boolean notify = false; String msgId = null; String table; switch (match) { case MMS_ALL_ID: case MMS_INBOX_ID: case MMS_SENT_ID: case MMS_DRAFTS_ID: case MMS_OUTBOX_ID: msgId = uri.getLastPathSegment(); // fall-through case MMS_ALL: case MMS_INBOX: case MMS_SENT: case MMS_DRAFTS: case MMS_OUTBOX: notify = true; table = TABLE_PDU; break; case MMS_MSG_PART: case MMS_PART_ID: table = TABLE_PART; break; case MMS_PART_RESET_FILE_PERMISSION: String path = getContext().getDir(PARTS_DIR_NAME, 0).getPath() + '/' + uri.getPathSegments().get(1); // Reset the file permission back to read for everyone but me. int result = FileUtils.setPermissions(path, 0644, -1, -1); if (LOCAL_LOGV) { Log.d(TAG, "MmsProvider.update setPermissions result: " + result + " for path: " + path); } return 0; default: Log.w(TAG, "Update operation for '" + uri + "' not implemented."); return 0; } String extraSelection = null; ContentValues finalValues; if (table.equals(TABLE_PDU)) { // Filter keys that we don't support yet. filterUnsupportedKeys(values); if (ProviderUtil.shouldRemoveCreator(values, callerUid)) { // CREATOR should not be changed by non-SYSTEM/PHONE apps Log.w(TAG, callerPkg + " tries to update CREATOR"); values.remove(Mms.CREATOR); } finalValues = new ContentValues(values); if (msgId != null) { extraSelection = Mms._ID + "=" + msgId; } } else if (table.equals(TABLE_PART)) { finalValues = new ContentValues(values); switch (match) { case MMS_MSG_PART: extraSelection = Part.MSG_ID + "=" + uri.getPathSegments().get(0); break; case MMS_PART_ID: extraSelection = Part._ID + "=" + uri.getPathSegments().get(1); break; default: break; } } else { return 0; } String finalSelection = concatSelections(selection, extraSelection); SQLiteDatabase db = mOpenHelper.getWritableDatabase(); int count = db.update(table, finalValues, finalSelection, selectionArgs); if (notify && (count > 0)) { notifyChange(uri); } return count; }
[ "CWE-362" ]
CVE-2016-3914
HIGH
9.3
android
update
src/com/android/providers/telephony/MmsProvider.java
3a3a5d145d380deef2d5b7c3150864cd04be397f
1
Analyze the following code function for security vulnerabilities
@Override public boolean isUseJvmChmod() { return useJvmChmod; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUseJvmChmod File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java Repository: codehaus-plexus/plexus-archiver The code follows secure coding practices.
[ "CWE-22", "CWE-61" ]
CVE-2023-37460
CRITICAL
9.8
codehaus-plexus/plexus-archiver
isUseJvmChmod
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
54759839fbdf85caf8442076f001d5fd64e0dcb2
0
Analyze the following code function for security vulnerabilities
private String macAddressFromRoute(String ipAddress) { String macAddress = null; BufferedReader reader = null; try { reader = mWifiInjector.createBufferedReader(ARP_TABLE_PATH); // Skip over the line bearing column titles String line = reader.readLine(); while ((line = reader.readLine()) != null) { String[] tokens = line.split("[ ]+"); if (tokens.length < 6) { continue; } // ARP column format is // IPAddress HWType Flags HWAddress Mask Device String ip = tokens[0]; String mac = tokens[3]; if (TextUtils.equals(ipAddress, ip)) { macAddress = mac; break; } } if (macAddress == null) { loge("Did not find remoteAddress {" + ipAddress + "} in /proc/net/arp"); } } catch (FileNotFoundException e) { loge("Could not open /proc/net/arp to lookup mac address"); } catch (IOException e) { loge("Could not read /proc/net/arp to lookup mac address"); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { // Do nothing } } return macAddress; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: macAddressFromRoute File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
macAddressFromRoute
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private Validator<?> createCDIValidator(String validatorId) { if (version.isJsf23()) { return CdiUtils.createValidator(getBeanManager(), validatorId); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createCDIValidator File: impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-14371
MEDIUM
5
eclipse-ee4j/mojarra
createCDIValidator
impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
1b434748d9239f42eae8aa7d37d7a0930c061e24
0
Analyze the following code function for security vulnerabilities
native boolean sdpSearchNative(byte[] address, byte[] uuid);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sdpSearchNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
sdpSearchNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
protected void choosePgpSignId(Account account) { xmppConnectionService.getPgpEngine().chooseKey(account, new UiCallback<Account>() { @Override public void success(Account account1) { } @Override public void error(int errorCode, Account object) { } @Override public void userInputRequried(PendingIntent pi, Account object) { try { startIntentSenderForResult(pi.getIntentSender(), REQUEST_CHOOSE_PGP_ID, null, 0, 0, 0); } catch (final SendIntentException ignored) { } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: choosePgpSignId File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
choosePgpSignId
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object that) { return that instanceof Secret && value.equals(((Secret)that).value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: core/src/main/java/hudson/util/Secret.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-326" ]
CVE-2017-2598
MEDIUM
4
jenkinsci/jenkins
equals
core/src/main/java/hudson/util/Secret.java
e6aa166246d1734f4798a9e31f78842f4c85c28b
0
Analyze the following code function for security vulnerabilities
private void bindFields(List<Field<?>> fields, Item itemDataSource) { for (Field<?> field : fields) { if (itemDataSource .getItemProperty(getPropertyId(field)) != null) { bind(field, getPropertyId(field)); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindFields File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
bindFields
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
private static String readHtmlFile(String templateName) { try { return IOUtils.toString( RouteNotFoundError.class.getResourceAsStream(templateName), StandardCharsets.UTF_8); } catch (IOException e) { LoggerFactory.getLogger(RouteNotFoundError.class) .error("Unable to read " + templateName, e); // Use a very simple error page if the real one could not be found return "Could not navigate to '{{path}}'"; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readHtmlFile File: flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-20" ]
CVE-2021-31412
MEDIUM
4.3
vaadin/flow
readHtmlFile
flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java
c79a7a8dbe1a494ff99a591d2e85b1100fc0aa15
0
Analyze the following code function for security vulnerabilities
public void showSurfaceBehindKeyguard() { mSurfaceBehindRemoteAnimationRequested = true; try { int flags = KEYGUARD_GOING_AWAY_FLAG_NO_WINDOW_ANIMATIONS | KEYGUARD_GOING_AWAY_FLAG_WITH_WALLPAPER; // If we are unlocking to the launcher, clear the snapshot so that any changes as part // of the in-window animations are reflected. This is needed even if we're not actually // playing in-window animations for this particular unlock since a previous unlock might // have changed the Launcher state. if (KeyguardUnlockAnimationController.Companion.isNexusLauncherUnderneath()) { flags |= KEYGUARD_GOING_AWAY_FLAG_TO_LAUNCHER_CLEAR_SNAPSHOT; } ActivityTaskManager.getService().keyguardGoingAway(flags); mKeyguardStateController.notifyKeyguardGoingAway(true); } catch (RemoteException e) { mSurfaceBehindRemoteAnimationRequested = false; e.printStackTrace(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showSurfaceBehindKeyguard File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
showSurfaceBehindKeyguard
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@Override protected void finish(Intent resultData) { if (mLockVirgin) { mUtils.setVisiblePatternEnabled(true, mUserId); } super.finish(resultData); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finish File: src/com/android/settings/password/ChooseLockPattern.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
finish
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
@XmlElement @Override public URI getURI() { return uri; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURI File: core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
getURI
core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
private void readObjectNoData(Object object, Class<?> cl, ObjectStreamClass classDesc) throws ObjectStreamException { if (!classDesc.isSerializable()) { return; } if (classDesc.hasMethodReadObjectNoData()){ final Method readMethod = classDesc.getMethodReadObjectNoData(); try { readMethod.invoke(object); } catch (InvocationTargetException e) { Throwable ex = e.getTargetException(); if (ex instanceof RuntimeException) { throw (RuntimeException) ex; } else if (ex instanceof Error) { throw (Error) ex; } throw (ObjectStreamException) ex; } catch (IllegalAccessException e) { throw new RuntimeException(e.toString()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readObjectNoData File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readObjectNoData
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public int getSystemDecorLayerLw() { if (mStatusBar != null) return mStatusBar.getSurfaceLayer(); if (mNavigationBar != null) return mNavigationBar.getSurfaceLayer(); return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSystemDecorLayerLw File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
getSystemDecorLayerLw
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@RequiresPermissions("tag:edit") @PostMapping("/edit") public String update(Integer id, String name, String description, Integer topicCount, MultipartFile file) { Tag tag = tagService.selectById(id); tag.setName(name); tag.setDescription(description); tag.setTopicCount(topicCount); String path = fileUtil.upload(file, null, "tag"); tag.setIcon(path); tagService.update(tag); return redirect("/admin/tag/list"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: update File: src/main/java/co/yiiu/pybbs/controller/admin/TagAdminController.java Repository: atjiu/pybbs The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
update
src/main/java/co/yiiu/pybbs/controller/admin/TagAdminController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
0
Analyze the following code function for security vulnerabilities
public void fromXML(InputStream is) throws XWikiException { fromXML(is, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromXML File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
fromXML
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
static ArrayList<DbStats> getDbStats() { ArrayList<DbStats> dbStatsList = new ArrayList<DbStats>(); for (SQLiteDatabase db : getActiveDatabases()) { db.collectDbStats(dbStatsList); } return dbStatsList; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDbStats File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
getDbStats
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
@Exported public View getPrimaryView() { return viewGroupMixIn.getPrimaryView(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPrimaryView File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getPrimaryView
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition complete(final String method, final String pattern, final Route.Complete handler) { return appendDefinition(method, pattern, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: complete File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
complete
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public void removeCallback(@NonNull Callback callback) { mCallbacks.remove(callback); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeCallback File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
removeCallback
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void initContentUrl(SysSite site, CmsContent entity) { if (!entity.isOnlyUrl()) { entity.setUrl(getUrl(site, entity.isHasStatic(), entity.getUrl())); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initContentUrl File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
initContentUrl
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
public void initialize(BlockAsyncRendererConfiguration configuration) { this.configuration = configuration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialize File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-26471
HIGH
8.8
xwiki/xwiki-platform
initialize
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java
00532d9f1404287cf3ec3a05056640d809516006
0
Analyze the following code function for security vulnerabilities
public int getSingleTapY() { return mSingleTapY; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSingleTapY File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getSingleTapY
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public RemoteInput[] getRemoteInputs() { return mRemoteInputs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRemoteInputs File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getRemoteInputs
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
void readMetadata(FileMetadata info, InputStream instream) throws IOException { // Fail on suspiciously large widget dump files if (info.size > 64 * 1024) { throw new IOException("Metadata too big; corrupt? size=" + info.size); } byte[] buffer = new byte[(int) info.size]; if (readExactly(instream, buffer, 0, (int)info.size) == info.size) { mBytes += info.size; } else throw new IOException("Unexpected EOF in widget data"); String[] str = new String[1]; int offset = extractLine(buffer, 0, str); int version = Integer.parseInt(str[0]); if (version == BACKUP_MANIFEST_VERSION) { offset = extractLine(buffer, offset, str); final String pkg = str[0]; if (info.packageName.equals(pkg)) { // Data checks out -- the rest of the buffer is a concatenation of // binary blobs as described in the comment at writeAppWidgetData() ByteArrayInputStream bin = new ByteArrayInputStream(buffer, offset, buffer.length - offset); DataInputStream in = new DataInputStream(bin); while (bin.available() > 0) { int token = in.readInt(); int size = in.readInt(); if (size > 64 * 1024) { throw new IOException("Datum " + Integer.toHexString(token) + " too big; corrupt? size=" + info.size); } switch (token) { case BACKUP_WIDGET_METADATA_TOKEN: { if (MORE_DEBUG) { Slog.i(TAG, "Got widget metadata for " + info.packageName); } mWidgetData = new byte[size]; in.read(mWidgetData); break; } default: { if (DEBUG) { Slog.i(TAG, "Ignoring metadata blob " + Integer.toHexString(token) + " for " + info.packageName); } in.skipBytes(size); break; } } } } else { Slog.w(TAG, "Metadata mismatch: package " + info.packageName + " but widget data for " + pkg); } } else { Slog.w(TAG, "Unsupported metadata version " + version); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readMetadata File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
readMetadata
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public void extract() throws IOException { log.debug("Extract content of '{}' to '{}'", source, destination); // delete destination directory if exists if (destination.exists() && destination.isDirectory()) { FileUtils.delete(destination.toPath()); } try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(source))) { ZipEntry zipEntry; while ((zipEntry = zipInputStream.getNextEntry()) != null) { File file = new File(destination, zipEntry.getName()); // create intermediary directories - sometimes zip don't add them File dir = new File(file.getParent()); mkdirsOrThrow(dir); if (zipEntry.isDirectory()) { mkdirsOrThrow(file); } else { byte[] buffer = new byte[1024]; int length; try (FileOutputStream fos = new FileOutputStream(file)) { while ((length = zipInputStream.read(buffer)) >= 0) { fos.write(buffer, 0, length); } } } } } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2023-40827 - Severity: HIGH - CVSS Score: 7.5 Description: Add security checks to prevent directory traversal when decompressing Function: extract File: pf4j/src/main/java/org/pf4j/util/Unzip.java Repository: pf4j Fixed Code: public void extract() throws IOException { log.debug("Extract content of '{}' to '{}'", source, destination); // delete destination directory if exists if (destination.exists() && destination.isDirectory()) { FileUtils.delete(destination.toPath()); } try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(source))) { ZipEntry zipEntry; while ((zipEntry = zipInputStream.getNextEntry()) != null) { File file = new File(destination, zipEntry.getName()); // add check if (zipEntry.getName().indexOf("..") != -1 && !file.getCanonicalPath().startsWith(destination.getCanonicalPath())) { throw new ZipException("The file "+zipEntry.getName()+" is trying to leave the target output directory of "+destination+". Ignoring this file."); } // create intermediary directories - sometimes zip don't add them File dir = new File(file.getParent()); mkdirsOrThrow(dir); if (zipEntry.isDirectory()) { mkdirsOrThrow(file); } else { byte[] buffer = new byte[1024]; int length; try (FileOutputStream fos = new FileOutputStream(file)) { while ((length = zipInputStream.read(buffer)) >= 0) { fos.write(buffer, 0, length); } } } } } }
[ "CWE-22" ]
CVE-2023-40827
HIGH
7.5
pf4j
extract
pf4j/src/main/java/org/pf4j/util/Unzip.java
ed9392069fe14c6c30d9f876710e5ad40f7ea8c1
1
Analyze the following code function for security vulnerabilities
@Override public void setLocale(Locale locale) { this.response.setLocale(locale); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLocale File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-601" ]
CVE-2022-23618
MEDIUM
5.8
xwiki/xwiki-platform
setLocale
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
5251c02080466bf9fb55288f04a37671108f8096
0
Analyze the following code function for security vulnerabilities
public String getValidityOperation() { return validityOperation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValidityOperation File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getValidityOperation
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public static ProjectBlobPage.State getState(CodeComment comment) { BlobIdent blobIdent = new BlobIdent(comment.getMark().getCommitHash(), comment.getMark().getPath(), FileMode.REGULAR_FILE.getBits()); ProjectBlobPage.State state = new ProjectBlobPage.State(blobIdent); state.commentId = comment.getId(); state.position = SourceRendererProvider.getPosition(comment.getMark().getRange()); return state; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getState File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-434" ]
CVE-2021-21245
HIGH
7.5
theonedev/onedev
getState
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
public String[] explodeAPIPath() { final String[] split = this.explodePath(); int index = 1; if (split.length < 1 || !split[0].toLowerCase().equals("api")) { throw new IllegalArgumentException("The URI does not start with \"/api\""); } if (split.length < 2) { // given "/api" final String[] root = { "" }; return root; } if (split[1].toLowerCase().startsWith("v") && split[1].length() > 1 && Character.isDigit(split[1].charAt(1))) { index = 2; } if (split.length - index == 0) { // given "/api/v#" final String[] root = { "" }; return root; } final String[] path = new String[split.length - index]; int path_idx = 0; for (int i = index; i < split.length; i++) { path[path_idx] = split[i]; path_idx++; } return path; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: explodeAPIPath File: src/tsd/HttpQuery.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
explodeAPIPath
src/tsd/HttpQuery.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
public static String toEmailSafeString(String projectName) { // TODO: escape non-ASCII characters StringBuilder buf = new StringBuilder(projectName.length()); for( int i=0; i<projectName.length(); i++ ) { char ch = projectName.charAt(i); if(('a'<=ch && ch<='z') || ('z'<=ch && ch<='Z') || ('0'<=ch && ch<='9') || "-_.".indexOf(ch)>=0) buf.append(ch); else buf.append('_'); // escape } return projectName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toEmailSafeString File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
toEmailSafeString
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public JComponent $$$getRootComponent$$$() { return SuperXray; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: $$$getRootComponent$$$ File: src/main/java/com/chaitin/xray/form/MainForm.java Repository: 4ra1n/super-xray The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-41958
HIGH
7.8
4ra1n/super-xray
$$$getRootComponent$$$
src/main/java/com/chaitin/xray/form/MainForm.java
4d0d59663596db03f39d7edd2be251d48b52dcfc
0
Analyze the following code function for security vulnerabilities
public boolean checkPassword(String password) throws XWikiException { EntityReference userReference = REFERENCE_RESOLVER.resolve(this.user.getUser()); EntityReference docReference = getXWikiContext().getDoc().getDocumentReference(); if (userReference.equals(getXWikiContext().getUserReference()) && userReference.equals(docReference)) { try { boolean result = false; XWikiDocument userDoc = getXWikiContext().getWiki().getDocument(userReference, getXWikiContext()); BaseObject obj = userDoc.getXObject(USERCLASS_REFERENCE); // We only allow empty password from users having a XWikiUsers object. if (obj != null) { final String stored = obj.getStringValue("password"); result = new PasswordClass().getEquivalentPassword(stored, password).equals(stored); } return result; } catch (Throwable e) { LOGGER.error("Failed to check password", e); return false; } } else { throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "You cannot use this method for checking another user password.", null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPassword File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/User.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-41929
MEDIUM
4.9
xwiki/xwiki-platform
checkPassword
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/User.java
0b732f2ef0224e2aaf10e2e1ef48dbd3fb6e10cd
0
Analyze the following code function for security vulnerabilities
private Intent createCrossUserServiceIntent( @NonNull Intent rawIntent, @NonNull String expectedPackageName, @UserIdInt int targetUserId) throws RemoteException, SecurityException { ResolveInfo info = mIPackageManager.resolveService( rawIntent, rawIntent.resolveTypeIfNeeded(mContext.getContentResolver()), 0, // flags targetUserId); if (info == null || info.serviceInfo == null) { Slogf.e(LOG_TAG, "Fail to look up the service: %s or user %d is not running", rawIntent, targetUserId); return null; } if (!expectedPackageName.equals(info.serviceInfo.packageName)) { throw new SecurityException("Only allow to bind service in " + expectedPackageName); } // STOPSHIP(b/37624960): Remove info.serviceInfo.exported before release. if (info.serviceInfo.exported && !BIND_DEVICE_ADMIN.equals(info.serviceInfo.permission)) { throw new SecurityException( "Service must be protected by BIND_DEVICE_ADMIN permission"); } // It is the system server to bind the service, it would be extremely dangerous if it // can be exploited to bind any service. Set the component explicitly to make sure we // do not bind anything accidentally. rawIntent.setComponent(info.serviceInfo.getComponentName()); return rawIntent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createCrossUserServiceIntent File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
createCrossUserServiceIntent
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
Map<String, Object> toAmqpHeaders() throws IOException, JMSException { Map<String, Object> hdrs = new HashMap<String, Object>(); // set non-null user properties for (Map.Entry<String, Serializable> e : this.userJmsProperties.entrySet()) { putIfNotNullAndAmqpType(hdrs, e.getKey(), e.getValue()); } // set (overwrite?) selectable JMS properties hdrs.put("JMSDeliveryMode", (this.getJMSDeliveryMode()==DeliveryMode.PERSISTENT ? "PERSISTENT": "NON_PERSISTENT")); putIfNotNull(hdrs, "JMSMessageID", this.getJMSMessageID()); hdrs.put("JMSTimestamp", this.getJMSTimestamp()); hdrs.put("JMSPriority", this.getJMSPriority()); putIfNotNull(hdrs, "JMSCorrelationID", this.getJMSCorrelationID()); putIfNotNull(hdrs, "JMSType", this.getJMSType()); return hdrs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toAmqpHeaders File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
toAmqpHeaders
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
@Override public Iterator<Node> iterator() { return new Iterator<Node>() { private int index; private Node next; public boolean hasNext() { next = null; for (; index < maximum; index++) { final Node item = wrapped.item(index); if (nodeType == 0 || item.getNodeType() == nodeType) { next = item; return true; } } return false; } public Node next() { if (hasNext()) { index++; return next; } throw new NoSuchElementException(); } public void remove() { throw new UnsupportedOperationException(); } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: iterator File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
iterator
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private boolean hasPermissions(int requestCode, String... permissions) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { final List<String> missingPermissions = new ArrayList<>(); for (String permission : permissions) { if (Config.ONLY_INTERNAL_STORAGE && permission.equals(Manifest.permission.WRITE_EXTERNAL_STORAGE)) { continue; } if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) { missingPermissions.add(permission); } } if (missingPermissions.size() == 0) { return true; } else { requestPermissions(missingPermissions.toArray(new String[missingPermissions.size()]), requestCode); return false; } } else { return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasPermissions File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
hasPermissions
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
protected Node composeSequenceNode(String anchor) { SequenceStartEvent startEvent = (SequenceStartEvent) parser.getEvent(); String tag = startEvent.getTag(); Tag nodeTag; boolean resolved = false; if (tag == null || tag.equals("!")) { nodeTag = resolver.resolve(NodeId.sequence, null, startEvent.getImplicit()); resolved = true; } else { nodeTag = new Tag(tag); } final ArrayList<Node> children = new ArrayList<Node>(); SequenceNode node = new SequenceNode(nodeTag, resolved, children, startEvent.getStartMark(), null, startEvent.getFlowStyle()); if (startEvent.isFlow()) { node.setBlockComments(blockCommentsCollector.consume()); } if (anchor != null) { node.setAnchor(anchor); anchors.put(anchor, node); } while (!parser.checkEvent(Event.ID.SequenceEnd)) { blockCommentsCollector.collectEvents(); if (parser.checkEvent(Event.ID.SequenceEnd)) { break; } children.add(composeNode(node)); } if (startEvent.isFlow()) { node.setInLineComments(inlineCommentsCollector.collectEvents().consume()); } Event endEvent = parser.getEvent(); node.setEndMark(endEvent.getEndMark()); inlineCommentsCollector.collectEvents(); if(!inlineCommentsCollector.isEmpty()) { node.setInLineComments(inlineCommentsCollector.consume()); } return node; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: composeSequenceNode File: src/main/java/org/yaml/snakeyaml/composer/Composer.java Repository: snakeyaml The code follows secure coding practices.
[ "CWE-776" ]
CVE-2022-25857
HIGH
7.5
snakeyaml
composeSequenceNode
src/main/java/org/yaml/snakeyaml/composer/Composer.java
fc300780da21f4bb92c148bc90257201220cf174
0
Analyze the following code function for security vulnerabilities
@Override public void clearSystemUpdatePolicyFreezePeriodRecord() { Preconditions.checkCallAuthorization(isAdb(getCallerIdentity()) || hasCallingOrSelfPermission(permission.CLEAR_FREEZE_PERIOD), "Caller must be shell, or hold CLEAR_FREEZE_PERIOD permission to call " + "clearSystemUpdatePolicyFreezePeriodRecord"); synchronized (getLockObject()) { // Print out current record to help diagnosed CTS failures Slogf.i(LOG_TAG, "Clear freeze period record: " + mOwners.getSystemUpdateFreezePeriodRecordAsString()); if (mOwners.setSystemUpdateFreezePeriodRecord(null, null)) { mOwners.writeDeviceOwner(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearSystemUpdatePolicyFreezePeriodRecord File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
clearSystemUpdatePolicyFreezePeriodRecord
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
final void setLong(CharSequence name, long value) { set(name, String.valueOf(value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLong File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
setLong
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder attribute(String name, String value);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attribute File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
attribute
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private boolean handleOnAttach() { assert isAttached(); boolean initialAttach = false; int newId = owner.register(this); if (newId != -1) { if (id == -1) { // Didn't have an id previously, set one now id = newId; initialAttach = true; } else if (newId != id) { throw new IllegalStateException( "Can't change id once it has been assigned"); } } // Ensure attach change is sent markAsDirty(); return initialAttach; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleOnAttach File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
handleOnAttach
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Override @NonNull public Account[] getAccountsAsUser(String type, int userId, String opPackageName) { int callingUid = Binder.getCallingUid(); mAppOpsManager.checkPackage(callingUid, opPackageName); return getAccountsAsUserForPackage(type, userId, opPackageName /* callingPackage */, -1, opPackageName, false /* includeUserManagedNotVisible */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAccountsAsUser File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
getAccountsAsUser
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public int getOffsetForHorizontal(int line, float horiz) { // TODO: use Paint.getOffsetForAdvance to avoid binary search int max = getLineEnd(line) - 1; int min = getLineStart(line); Directions dirs = getLineDirections(line); if (line == getLineCount() - 1) max++; int best = min; float bestdist = Math.abs(getPrimaryHorizontal(best) - horiz); for (int i = 0; i < dirs.mDirections.length; i += 2) { int here = min + dirs.mDirections[i]; int there = here + (dirs.mDirections[i+1] & RUN_LENGTH_MASK); int swap = (dirs.mDirections[i+1] & RUN_RTL_FLAG) != 0 ? -1 : 1; if (there > max) there = max; int high = there - 1 + 1, low = here + 1 - 1, guess; while (high - low > 1) { guess = (high + low) / 2; int adguess = getOffsetAtStartOf(guess); if (getPrimaryHorizontal(adguess) * swap >= horiz * swap) high = guess; else low = guess; } if (low < here + 1) low = here + 1; if (low < there) { low = getOffsetAtStartOf(low); float dist = Math.abs(getPrimaryHorizontal(low) - horiz); int aft = TextUtils.getOffsetAfter(mText, low); if (aft < there) { float other = Math.abs(getPrimaryHorizontal(aft) - horiz); if (other < dist) { dist = other; low = aft; } } if (dist < bestdist) { bestdist = dist; best = low; } } float dist = Math.abs(getPrimaryHorizontal(here) - horiz); if (dist < bestdist) { bestdist = dist; best = here; } } float dist = Math.abs(getPrimaryHorizontal(max) - horiz); if (dist <= bestdist) { bestdist = dist; best = max; } return best; }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2018-9452 - Severity: MEDIUM - CVSS Score: 4.3 Description: Optimise the hit test algorithm Layout#getOffsetForHorizontal was running in O(n^2) time, where n is the length of the current line. The method is used when a touch event happens on a text line, to compute the cursor offset (and the character) where it happened. Although this is not an issue in common usecases, where the number of characters on a line is relatively small, this can be very inefficient as a consequence of Unicode containing 0-width (invisible) characters. Specifically, there are characters defining the text direction (LTR or RTL), which cause our algorithm to touch the worst case quadratic runtime. For example, a person is able to send a message containing a few visible characters, and also a lot of these direction changing invisible ones. When the receiver touches the message (causing the Layout#getOffsetForHorizontal method to be called), the receiver's application would become not responsive. This CL optimizes the method to run in O(n) worst case. This is achieved by computing the measurements of all line prefixes at first, which can be done in a single pass. Then, all the prefix measurement queries will be answered in O(1), rather than O(n) as it was happening before. Bug: 79215201 Test: manual testing Change-Id: Ib66ef392c19c937718e7101f6d48fac3abe51ad0 Merged-In: Ib66ef392c19c937718e7101f6d48fac3abe51ad0 Function: getOffsetForHorizontal File: core/java/android/text/Layout.java Repository: android Fixed Code: public int getOffsetForHorizontal(int line, float horiz) { // TODO: use Paint.getOffsetForAdvance to avoid binary search int max = getLineEnd(line) - 1; int min = getLineStart(line); Directions dirs = getLineDirections(line); if (line == getLineCount() - 1) max++; final HorizontalMeasurementProvider horizontal = new HorizontalMeasurementProvider(line); int best = min; float bestdist = Math.abs(horizontal.get(best) - horiz); for (int i = 0; i < dirs.mDirections.length; i += 2) { int here = min + dirs.mDirections[i]; int there = here + (dirs.mDirections[i+1] & RUN_LENGTH_MASK); int swap = (dirs.mDirections[i+1] & RUN_RTL_FLAG) != 0 ? -1 : 1; if (there > max) there = max; int high = there - 1 + 1, low = here + 1 - 1, guess; while (high - low > 1) { guess = (high + low) / 2; int adguess = getOffsetAtStartOf(guess); if (horizontal.get(adguess) * swap >= horiz * swap) high = guess; else low = guess; } if (low < here + 1) low = here + 1; if (low < there) { low = getOffsetAtStartOf(low); float dist = Math.abs(horizontal.get(low) - horiz); int aft = TextUtils.getOffsetAfter(mText, low); if (aft < there) { float other = Math.abs(horizontal.get(aft) - horiz); if (other < dist) { dist = other; low = aft; } } if (dist < bestdist) { bestdist = dist; best = low; } } float dist = Math.abs(horizontal.get(here) - horiz); if (dist < bestdist) { bestdist = dist; best = here; } } float dist = Math.abs(horizontal.get(max) - horiz); if (dist <= bestdist) { bestdist = dist; best = max; } return best; }
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getOffsetForHorizontal
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
1
Analyze the following code function for security vulnerabilities
protected GetMethod executeGet(String uri, int... expectedCodes) throws Exception { return executeGet(uri, false, expectedCodes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeGet File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
executeGet
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public AuthorityInfo getAuthority(int authorityId) { synchronized (mAuthorities) { return mAuthorities.get(authorityId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthority File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
getAuthority
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@Override public void contextRefreshed() { contextLastRefreshedTime = System.currentTimeMillis(); // START HACK // since we're not using a Listener anymore, these are not set at startup try { Class<?> webConstants1x = Context.loadClass("org.openmrs.web.WebConstants"); String webappName = (String) webConstants1x.getField("WEBAPP_NAME").get(null); WebConstants.CONTEXT_PATH = webappName; WebConstants.WEBAPP_NAME = webappName; } catch (Exception ex) { log.error("Failed to get CONTEXT_PATH from WebConstants during UI Framework startup"); } // END HACK PageFactory pageFactory = getComponent(PageFactory.class); FragmentFactory fragmentFactory = getComponent(FragmentFactory.class); ResourceFactory resourceFactory = getComponent(ResourceFactory.class); // Register a standard resource provider that can load file-based resources resourceFactory.addResourceProvider(FileResourceProvider.RESOURCE_KEY, new FileResourceProvider()); List<UiContextRefreshedCallback> callbacks = Context.getRegisteredComponents(UiContextRefreshedCallback.class); for (UiContextRefreshedCallback callback : callbacks) { try { callback.afterContextRefreshed(pageFactory, fragmentFactory, resourceFactory); } catch (Exception ex) { log.error("Error in UiContextRefreshedCallback: " + callback, ex); } } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2020-24621 - Severity: MEDIUM - CVSS Score: 6.5 Description: UIFR-215: Do not allow loading arbitrary files Function: contextRefreshed File: api/src/main/java/org/openmrs/module/uiframework/UiFrameworkActivator.java Repository: openmrs/openmrs-module-uiframework Fixed Code: @Override public void contextRefreshed() { contextLastRefreshedTime = System.currentTimeMillis(); // START HACK // since we're not using a Listener anymore, these are not set at startup try { Class<?> webConstants1x = Context.loadClass("org.openmrs.web.WebConstants"); String webappName = (String) webConstants1x.getField("WEBAPP_NAME").get(null); WebConstants.CONTEXT_PATH = webappName; WebConstants.WEBAPP_NAME = webappName; } catch (Exception ex) { log.error("Failed to get CONTEXT_PATH from WebConstants during UI Framework startup"); } // END HACK PageFactory pageFactory = getComponent(PageFactory.class); FragmentFactory fragmentFactory = getComponent(FragmentFactory.class); ResourceFactory resourceFactory = getComponent(ResourceFactory.class); // Register a standard resource provider that can load file-based resources resourceFactory.addResourceProvider(ConfigurationResourceProvider.RESOURCE_KEY, new ConfigurationResourceProvider()); List<UiContextRefreshedCallback> callbacks = Context.getRegisteredComponents(UiContextRefreshedCallback.class); for (UiContextRefreshedCallback callback : callbacks) { try { callback.afterContextRefreshed(pageFactory, fragmentFactory, resourceFactory); } catch (Exception ex) { log.error("Error in UiContextRefreshedCallback: " + callback, ex); } } }
[ "CWE-22" ]
CVE-2020-24621
MEDIUM
6.5
openmrs/openmrs-module-uiframework
contextRefreshed
api/src/main/java/org/openmrs/module/uiframework/UiFrameworkActivator.java
0422fa52c7eba3d96cce2936cb92897dca4b680a
1
Analyze the following code function for security vulnerabilities
@Override public List<PhoneAccount> getAllPhoneAccounts() { synchronized (mLock) { try { List<PhoneAccount> allPhoneAccounts = mPhoneAccountRegistrar .getAllPhoneAccounts(); List<PhoneAccount> profilePhoneAccounts = new ArrayList<>( allPhoneAccounts.size()); for (PhoneAccount phoneAccount : allPhoneAccounts) { if (isVisibleToCaller(phoneAccount)) { profilePhoneAccounts.add(phoneAccount); } } return profilePhoneAccounts; } catch (Exception e) { Log.e(this, e, "getAllPhoneAccounts"); throw e; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllPhoneAccounts File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
getAllPhoneAccounts
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
private final long _slow64() throws IOException { return _long(_decode32Bits(), _decode32Bits()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _slow64 File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_slow64
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public boolean isRemoteInputHistory() { return mRemoteInputHistory; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRemoteInputHistory File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
isRemoteInputHistory
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private static void showProgressAwareJSP(HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo, String jspPath) throws ServletException, IOException { saveSubmissionInfo(request, subInfo); JSPManager.showJSP(request, response, jspPath); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showProgressAwareJSP File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
showProgressAwareJSP
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
@Override protected void appendPipelineUniqueCriteria(Map<String, Object> basicCriteria) { basicCriteria.put("dest", folder); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendPipelineUniqueCriteria File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
appendPipelineUniqueCriteria
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public void setExpireSessionWithToken(boolean expireSessionWithToken) { this.expireSessionWithToken = expireSessionWithToken; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExpireSessionWithToken File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
setExpireSessionWithToken
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
@Override public boolean isDrawShadowSupported() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDrawShadowSupported File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
isDrawShadowSupported
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void consumeHeaderFrame(Frame f) throws IOException { if (f.type == AMQP.FRAME_HEADER) { this.contentHeader = AMQImpl.readContentHeaderFrom(f.getInputStream()); this.remainingBodyBytes = this.contentHeader.getBodySize(); updateContentBodyState(); } else { throw new UnexpectedFrameError(f, AMQP.FRAME_HEADER); } }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-46120 - Severity: HIGH - CVSS Score: 7.5 Description: Add max inbound message size to ConnectionFactory To avoid OOM with a very large message. The default value is 64 MiB. Fixes #1062 (cherry picked from commit 9ed45fde52224ec74fc523321efdf9a157d5cfca) Function: consumeHeaderFrame File: src/main/java/com/rabbitmq/client/impl/CommandAssembler.java Repository: rabbitmq/rabbitmq-java-client Fixed Code: private void consumeHeaderFrame(Frame f) throws IOException { if (f.type == AMQP.FRAME_HEADER) { this.contentHeader = AMQImpl.readContentHeaderFrom(f.getInputStream()); long bodySize = this.contentHeader.getBodySize(); if (bodySize >= this.maxBodyLength) { throw new IllegalStateException(format( "Message body is too large (%d), maximum size is %d", bodySize, this.maxBodyLength )); } this.remainingBodyBytes = bodySize; updateContentBodyState(); } else { throw new UnexpectedFrameError(f, AMQP.FRAME_HEADER); } }
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
consumeHeaderFrame
src/main/java/com/rabbitmq/client/impl/CommandAssembler.java
714aae602dcae6cb4b53cadf009323ebac313cc8
1
Analyze the following code function for security vulnerabilities
@ApiOperation(value = "add link Operation") @RequestMapping(value = "/addLink", method = RequestMethod.POST) public String addLink(@RequestParam(value = "userId", required = true) String userId, @RequestParam(value = "solutionId", required = false) String solutionId, @RequestParam(value = "version", required = false) String version, @RequestParam(value = "cid", required = false) String cid, @RequestParam(value = "linkName", required = false) String linkName, @RequestParam(value = "linkId", required = true) String linkId, @RequestParam(value = "sourceNodeName", required = true) String sourceNodeName, @RequestParam(value = "sourceNodeId", required = true) String sourceNodeId, @RequestParam(value = "targetNodeName", required = true) String targetNodeName, @RequestParam(value = "targetNodeId", required = true) String targetNodeId, @RequestParam(value = "sourceNodeRequirement", required = true) String sourceNodeRequirement, @RequestParam(value = "targetNodeCapabilityName", required = true) String targetNodeCapabilityName, @RequestBody(required = false) @Valid org.acumos.designstudio.ce.vo.cdump.Property property) { // Change in API signature logger.debug(EELFLoggerDelegator.debugLogger, " addLink() : Begin"); String result = null; boolean linkAdded = false; String resultTemplate = "{\"success\" : \"%s\", \"errorDescription\" : \"%s\"}"; try { if (linkId != null && sourceNodeName != null && targetNodeName != null && targetNodeId != null && targetNodeCapabilityName != null) { if (validateProperty(property)) { linkAdded = solutionService.addLink(userId, solutionId, version, linkName, linkId, sourceNodeName, sourceNodeId, targetNodeName, targetNodeId, sourceNodeRequirement, targetNodeCapabilityName, cid, property); if (linkAdded) { result = String.format(resultTemplate, true, ""); } else { result = String.format(resultTemplate, false, "Link not added"); } } else { result = String.format(resultTemplate, false, "Invalid input: properties"); } } else { result = validateAddLinkInputs(sourceNodeName, linkId, targetNodeName, targetNodeCapabilityName, sourceNodeId); } } catch (Exception e) { logger.error(EELFLoggerDelegator.errorLogger, " Exception in addLink() ", e); } logger.debug(EELFLoggerDelegator.debugLogger, " addLink() : End"); return result; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2018-25097 - Severity: MEDIUM - CVSS Score: 4.0 Description: Senitization for CSS Vulnerability Issue-Id : ACUMOS-1650 Description : Senitization for CSS Vulnerability - Design Studio Change-Id: If8fd4b9b06f884219d93881f7922421870de8e3d Signed-off-by: Ramanaiah Pirla <RP00490596@techmahindra.com> Function: addLink File: ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java Repository: acumos/design-studio Fixed Code: @ApiOperation(value = "add link Operation") @RequestMapping(value = "/addLink", method = RequestMethod.POST) public String addLink(@RequestParam(value = "userId", required = true) String userId, @RequestParam(value = "solutionId", required = false) String solutionId, @RequestParam(value = "version", required = false) String version, @RequestParam(value = "cid", required = false) String cid, @RequestParam(value = "linkName", required = false) String linkName, @RequestParam(value = "linkId", required = true) String linkId, @RequestParam(value = "sourceNodeName", required = true) String sourceNodeName, @RequestParam(value = "sourceNodeId", required = true) String sourceNodeId, @RequestParam(value = "targetNodeName", required = true) String targetNodeName, @RequestParam(value = "targetNodeId", required = true) String targetNodeId, @RequestParam(value = "sourceNodeRequirement", required = true) String sourceNodeRequirement, @RequestParam(value = "targetNodeCapabilityName", required = true) String targetNodeCapabilityName, @RequestBody(required = false) @Valid org.acumos.designstudio.ce.vo.cdump.Property property) { // Change in API signature logger.debug(EELFLoggerDelegator.debugLogger, " addLink() : Begin"); String result = null; boolean linkAdded = false; String resultTemplate = "{\"success\" : \"%s\", \"errorDescription\" : \"%s\"}"; try { if (linkId != null && sourceNodeName != null && targetNodeName != null && targetNodeId != null && targetNodeCapabilityName != null) { if (validateProperty(property)) { linkAdded = solutionService.addLink(userId, SanitizeUtils.sanitize(solutionId), version, linkName, linkId, sourceNodeName, sourceNodeId, targetNodeName, targetNodeId, sourceNodeRequirement, targetNodeCapabilityName, cid, property); if (linkAdded) { result = String.format(resultTemplate, true, ""); } else { result = String.format(resultTemplate, false, "Link not added"); } } else { result = String.format(resultTemplate, false, "Invalid input: properties"); } } else { result = validateAddLinkInputs(sourceNodeName, linkId, targetNodeName, targetNodeCapabilityName, sourceNodeId); } } catch (Exception e) { logger.error(EELFLoggerDelegator.errorLogger, " Exception in addLink() ", e); } logger.debug(EELFLoggerDelegator.debugLogger, " addLink() : End"); return result; }
[ "CWE-79" ]
CVE-2018-25097
MEDIUM
4
acumos/design-studio
addLink
ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java
0df8a5e8722188744973168648e4c74c69ce67fd
1