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
private AuthorityInfo parseAuthority(XmlPullParser parser, int version) { AuthorityInfo authority = null; int id = -1; try { id = Integer.parseInt(parser.getAttributeValue(null, "id")); } catch (NumberFormatException e) { Log.e(TAG, "error parsing the id of the authority", e); } catch (NullPointerException e) { Log.e(TAG, "the id of the authority is null", e); } if (id >= 0) { String authorityName = parser.getAttributeValue(null, "authority"); String enabled = parser.getAttributeValue(null, XML_ATTR_ENABLED); String syncable = parser.getAttributeValue(null, "syncable"); String accountName = parser.getAttributeValue(null, "account"); String accountType = parser.getAttributeValue(null, "type"); String user = parser.getAttributeValue(null, XML_ATTR_USER); String packageName = parser.getAttributeValue(null, "package"); String className = parser.getAttributeValue(null, "class"); int userId = user == null ? 0 : Integer.parseInt(user); if (accountType == null && packageName == null) { accountType = "com.google"; syncable = "unknown"; } authority = mAuthorities.get(id); if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) { Log.v(TAG_FILE, "Adding authority:" + " account=" + accountName + " accountType=" + accountType + " auth=" + authorityName + " package=" + packageName + " class=" + className + " user=" + userId + " enabled=" + enabled + " syncable=" + syncable); } if (authority == null) { if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) { Log.v(TAG_FILE, "Creating authority entry"); } EndPoint info; if (accountName != null && authorityName != null) { info = new EndPoint( new Account(accountName, accountType), authorityName, userId); } else { info = new EndPoint( new ComponentName(packageName, className), userId); } authority = getOrCreateAuthorityLocked(info, id, false); // If the version is 0 then we are upgrading from a file format that did not // know about periodic syncs. In that case don't clear the list since we // want the default, which is a daily periodic sync. // Otherwise clear out this default list since we will populate it later with // the periodic sync descriptions that are read from the configuration file. if (version > 0) { authority.periodicSyncs.clear(); } } if (authority != null) { authority.enabled = enabled == null || Boolean.parseBoolean(enabled); if ("unknown".equals(syncable)) { authority.syncable = -1; } else { authority.syncable = (syncable == null || Boolean.parseBoolean(syncable)) ? 1 : 0; } } else { Log.w(TAG, "Failure adding authority: account=" + accountName + " auth=" + authorityName + " enabled=" + enabled + " syncable=" + syncable); } } return authority; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseAuthority 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
parseAuthority
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@Override public List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(String uriScheme, String callingPackage) { synchronized (mLock) { if (!canReadPhoneState(callingPackage, "getPhoneAccountsSupportingScheme")) { return Collections.emptyList(); } long token = Binder.clearCallingIdentity(); try { // TODO: Does this isVisible check actually work considering we are clearing // the calling identity? return filterForAccountsVisibleToCaller( mPhoneAccountRegistrar.getCallCapablePhoneAccounts(uriScheme, false)); } catch (Exception e) { Log.e(this, e, "getPhoneAccountsSupportingScheme %s", uriScheme); throw e; } finally { Binder.restoreCallingIdentity(token); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPhoneAccountsSupportingScheme 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
getPhoneAccountsSupportingScheme
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
@ManagedAttribute("Whether the acknowledgement extension is enabled") public boolean isAckExtensionEnabled() { return _ackExtensionEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAckExtensionEnabled File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
isAckExtensionEnabled
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
@Override protected BroadcastFilter newResult(@NonNull Computer computer, BroadcastFilter filter, int match, int userId, long customFlags) { if (userId == UserHandle.USER_ALL || filter.owningUserId == UserHandle.USER_ALL || userId == filter.owningUserId) { return super.newResult(computer, filter, match, userId, customFlags); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newResult File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
newResult
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@RequiresApi(api = Build.VERSION_CODES.M) public static boolean checkIfWeAreAuthenticated(String screenLockTimeout) { try { KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); keyStore.load(null); SecretKey secretKey = (SecretKey) keyStore.getKey(CREDENTIALS_KEY, null); Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_GCM + "/" + KeyProperties.ENCRYPTION_PADDING_NONE); // Try encrypting something, it will only work if the user authenticated within // the last AUTHENTICATION_DURATION_SECONDS seconds. cipher.init(Cipher.ENCRYPT_MODE, secretKey); cipher.doFinal(SECRET_BYTE_ARRAY); cryptoObject = new BiometricPrompt.CryptoObject(cipher); // If the user has recently authenticated, we will reach here return true; } catch (UserNotAuthenticatedException e) { // User is not authenticated, let's authenticate with device credentials. return false; } catch (KeyPermanentlyInvalidatedException e) { // This happens if the lock screen has been disabled or reset after the key was // generated after the key was generated. // Shouldnt really happen because we regenerate the key every time an activity // is created, but oh well // Create key, and attempt again createKey(screenLockTimeout); return false; } catch (BadPaddingException | IllegalBlockSizeException | KeyStoreException | CertificateException | UnrecoverableKeyException | IOException | NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException e) { return false; } }
Vulnerability Classification: - CWE: CWE-284 - CVE: CVE-2023-22473 - Severity: LOW - CVSS Score: 2.1 Description: fix to move controllers to top add logging Signed-off-by: Marcel Hibbe <dev@mhibbe.de> Function: checkIfWeAreAuthenticated File: app/src/main/java/com/nextcloud/talk/utils/SecurityUtils.java Repository: nextcloud/talk-android Fixed Code: @RequiresApi(api = Build.VERSION_CODES.M) public static boolean checkIfWeAreAuthenticated(String screenLockTimeout) { try { KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); keyStore.load(null); SecretKey secretKey = (SecretKey) keyStore.getKey(CREDENTIALS_KEY, null); Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_GCM + "/" + KeyProperties.ENCRYPTION_PADDING_NONE); // Try encrypting something, it will only work if the user authenticated within // the last AUTHENTICATION_DURATION_SECONDS seconds. cipher.init(Cipher.ENCRYPT_MODE, secretKey); cipher.doFinal(SECRET_BYTE_ARRAY); cryptoObject = new BiometricPrompt.CryptoObject(cipher); // If the user has recently authenticated, we will reach here return true; } catch (UserNotAuthenticatedException e) { // User is not authenticated, let's authenticate with device credentials. return false; } catch (KeyPermanentlyInvalidatedException e) { // This happens if the lock screen has been disabled or reset after the key was // generated. // Shouldn't really happen because we regenerate the key every time an activity // is created, but oh well // Create key, and attempt again createKey(screenLockTimeout); return false; } catch (BadPaddingException | IllegalBlockSizeException | KeyStoreException | CertificateException | UnrecoverableKeyException | IOException | NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException e) { return false; } }
[ "CWE-284" ]
CVE-2023-22473
LOW
2.1
nextcloud/talk-android
checkIfWeAreAuthenticated
app/src/main/java/com/nextcloud/talk/utils/SecurityUtils.java
12cb7e423bcb3cc8def9a41d3e4a9bb75738b6a9
1
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") @RequestMapping("delete") @Csrf public String delete(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, Short id, HttpServletRequest request, ModelMap model) { if (ControllerUtils.verifyCustom("noright", !siteComponent.isMaster(site.getId()), model)) { return CommonConstants.TEMPLATE_ERROR; } SysSite entity = service.getEntity(id); if (null != entity) { service.delete(id); Long userId = admin.getId(); Date now = CommonUtils.getDate(); String ip = RequestUtils.getIpAddress(request); for (SysDomain domain : (List<SysDomain>) domainService.getPage(entity.getId(), null, null, null).getList()) { domainService.delete(domain.getName()); logOperateService.save(new LogOperate(site.getId(), userId, LogLoginService.CHANNEL_WEB_MANAGER, "delete.domain", ip, now, JsonUtils.getString(entity))); } logOperateService.save(new LogOperate(site.getId(), userId, LogLoginService.CHANNEL_WEB_MANAGER, "delete.site", ip, now, JsonUtils.getString(entity))); } return CommonConstants.TEMPLATE_DONE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/SysSiteAdminController.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
delete
publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/SysSiteAdminController.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
public String getDescription() { return description; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescription File: server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-94" ]
CVE-2021-21248
MEDIUM
6.5
theonedev/onedev
getDescription
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
public ArrayList<CharSequence> getLines() { return mTexts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLines File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getLines
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_PROFILE_INTERACTION, conditional = true) public boolean removeCrossProfileWidgetProvider(@Nullable ComponentName admin, String packageName) { throwIfParentInstance("removeCrossProfileWidgetProvider"); if (mService != null) { try { return mService.removeCrossProfileWidgetProvider(admin, mContext.getPackageName(), packageName); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeCrossProfileWidgetProvider File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
removeCrossProfileWidgetProvider
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInPictureInPictureMode(IBinder token) { final long origId = Binder.clearCallingIdentity(); try { synchronized(this) { final ActivityStack stack = ActivityRecord.getStackLocked(token); if (stack == null) { return false; } return stack.mStackId == PINNED_STACK_ID; } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInPictureInPictureMode File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
isInPictureInPictureMode
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public TopLevelItem getItem(String name) { if (name==null) return null; TopLevelItem item = items.get(name); if (item==null) return null; if (!item.hasPermission(Item.READ)) { if (item.hasPermission(Item.DISCOVER)) { throw new AccessDeniedException("Please login to access job " + name); } return null; } return item; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getItem 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
getItem
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private static final String yamlValue(String key, Object value, int offset, boolean isList) { return new StringBuilder() .append(new String(new char[offset]).replace('\0', ' ')) .append(isList ? "- " : "") .append(key).append(": ") .append(value) .append("\n").toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: yamlValue File: ff4j-config-yaml/src/main/java/org/ff4j/parser/yaml/YamlParser.java Repository: ff4j The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
yamlValue
ff4j-config-yaml/src/main/java/org/ff4j/parser/yaml/YamlParser.java
991df72725f78adbc413d9b0fbb676201f1882e0
0
Analyze the following code function for security vulnerabilities
public void setJDOMFactory(final JDOMFactory factory) { this.jdomfac = factory; engine = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setJDOMFactory File: core/src/java/org/jdom2/input/SAXBuilder.java Repository: hunterhacker/jdom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33813
MEDIUM
5
hunterhacker/jdom
setJDOMFactory
core/src/java/org/jdom2/input/SAXBuilder.java
bd3ab78370098491911d7fe9d7a43b97144a234e
0
Analyze the following code function for security vulnerabilities
private void buildApk(File outApk) throws AndrolibException { LOGGER.info("Building apk file..."); if (outApk.exists()) { //noinspection ResultOfMethodCallIgnored outApk.delete(); } else { File outDir = outApk.getParentFile(); if (outDir != null && !outDir.exists()) { //noinspection ResultOfMethodCallIgnored outDir.mkdirs(); } } File assetDir = new File(mApkDir, "assets"); if (!assetDir.exists()) { assetDir = null; } try (ZipOutputStream zipOutputStream = new ZipOutputStream(Files.newOutputStream(outApk.toPath()))) { // zip all AAPT-generated files ZipUtils.zipFoldersPreserveStream(new File(mApkDir, APK_DIRNAME), zipOutputStream, assetDir, mApkInfo.doNotCompress); // we must copy some files manually // this is because Aapt won't add files it doesn't know (ex unknown files) if (mApkInfo.unknownFiles != null) { LOGGER.info("Copying unknown files/dir..."); copyUnknownFiles(zipOutputStream, mApkInfo.unknownFiles); } } catch (IOException | BrutException e) { throw new AndrolibException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildApk File: brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
buildApk
brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
private int getIndexOf(String uuid, List<Message> messages) { if (uuid == null) { return messages.size() - 1; } for (int i = 0; i < messages.size(); ++i) { if (uuid.equals(messages.get(i).getUuid())) { return i; } else { Message next = messages.get(i); while (next != null && next.wasMergedIntoPrevious()) { if (uuid.equals(next.getUuid())) { return i; } next = next.next(); } } } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIndexOf 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
getIndexOf
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public Class<T> getType() { return type; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getType File: core/src/main/java/io/micronaut/core/type/DefaultArgument.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
getType
core/src/main/java/io/micronaut/core/type/DefaultArgument.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@Override // Binder call public void setActiveUser(final int userId) { checkPermission(MANAGE_FINGERPRINT); mHandler.post(new Runnable() { @Override public void run() { updateActiveGroup(userId, null); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActiveUser File: services/core/java/com/android/server/fingerprint/FingerprintService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
setActiveUser
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Deprecated public String checkHealth() { if (usingBytes) { if (bcdLong != 0) return "Value in bcdLong but we are in byte mode"; if (precision == 0) return "Zero precision but we are in byte mode"; if (precision > bcdBytes.length) return "Precision exceeds length of byte array"; if (getDigitPos(precision - 1) == 0) return "Most significant digit is zero in byte mode"; if (getDigitPos(0) == 0) return "Least significant digit is zero in long mode"; for (int i = 0; i < precision; i++) { if (getDigitPos(i) >= 10) return "Digit exceeding 10 in byte array"; if (getDigitPos(i) < 0) return "Digit below 0 in byte array"; } for (int i = precision; i < bcdBytes.length; i++) { if (getDigitPos(i) != 0) return "Nonzero digits outside of range in byte array"; } } else { if (bcdBytes != null) { for (int i = 0; i < bcdBytes.length; i++) { if (bcdBytes[i] != 0) return "Nonzero digits in byte array but we are in long mode"; } } if (precision == 0 && bcdLong != 0) return "Value in bcdLong even though precision is zero"; if (precision > 16) return "Precision exceeds length of long"; if (precision != 0 && getDigitPos(precision - 1) == 0) return "Most significant digit is zero in long mode"; if (precision != 0 && getDigitPos(0) == 0) return "Least significant digit is zero in long mode"; for (int i = 0; i < precision; i++) { if (getDigitPos(i) >= 10) return "Digit exceeding 10 in long"; if (getDigitPos(i) < 0) return "Digit below 0 in long (?!)"; } for (int i = precision; i < 16; i++) { if (getDigitPos(i) != 0) return "Nonzero digits outside of range in long"; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkHealth File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
checkHealth
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
public Stage saveBuildingStage(String pipelineName, String stageName) throws SQLException { Pipeline pipeline = saveTestPipeline(pipelineName, stageName); Stage stage = saveBuildingStage(pipeline.getStages().byName(stageName)); for (JobInstance job : stage.getJobInstances()) { job.setIdentifier(new JobIdentifier(pipeline, stage, job)); } return stage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveBuildingStage File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
saveBuildingStage
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
@Override public Configuration updateOrientationFromAppTokens( Configuration currentConfig, IBinder freezeThisOneIfNeeded) { if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, "updateOrientationFromAppTokens()")) { throw new SecurityException("Requires MANAGE_APP_TOKENS permission"); } Configuration config = null; long ident = Binder.clearCallingIdentity(); synchronized(mWindowMap) { config = updateOrientationFromAppTokensLocked(currentConfig, freezeThisOneIfNeeded); } Binder.restoreCallingIdentity(ident); return config; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateOrientationFromAppTokens File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
updateOrientationFromAppTokens
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public static String getRelativeResource(Class<?> cls, String path) throws ContentError { String sret = null; try { if (path.contains("..")) { path = (new File(path)).getCanonicalPath(); } InputStream fis = cls.getResourceAsStream(path); sret = readInputStream(fis); } catch (Exception ex) { throw new ContentError("ResourceAccess - can't get resource " + path + " relative to " + cls + ": " + ex); } return sret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelativeResource File: src/main/java/org/lemsml/jlems/io/util/JUtil.java Repository: LEMS/jLEMS The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-4583
HIGH
8.8
LEMS/jLEMS
getRelativeResource
src/main/java/org/lemsml/jlems/io/util/JUtil.java
8c224637d7d561076364a9e3c2c375daeaf463dc
0
Analyze the following code function for security vulnerabilities
public boolean startInstrumentation(ComponentName className, String profileFile, int flags, Bundle arguments, IInstrumentationWatcher watcher, IUiAutomationConnection uiAutomationConnection, int userId, String abiOverride) { enforceNotIsolatedCaller("startInstrumentation"); userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, ALLOW_FULL_ONLY, "startInstrumentation", null); // Refuse possible leaked file descriptors if (arguments != null && arguments.hasFileDescriptors()) { throw new IllegalArgumentException("File descriptors passed in Bundle"); } synchronized(this) { InstrumentationInfo ii = null; ApplicationInfo ai = null; try { ii = mContext.getPackageManager().getInstrumentationInfo( className, STOCK_PM_FLAGS); ai = AppGlobals.getPackageManager().getApplicationInfo( ii.targetPackage, STOCK_PM_FLAGS, userId); } catch (PackageManager.NameNotFoundException e) { } catch (RemoteException e) { } if (ii == null) { reportStartInstrumentationFailureLocked(watcher, className, "Unable to find instrumentation info for: " + className); return false; } if (ai == null) { reportStartInstrumentationFailureLocked(watcher, className, "Unable to find instrumentation target package: " + ii.targetPackage); return false; } if (!ai.hasCode()) { reportStartInstrumentationFailureLocked(watcher, className, "Instrumentation target has no code: " + ii.targetPackage); return false; } int match = mContext.getPackageManager().checkSignatures( ii.targetPackage, ii.packageName); if (match < 0 && match != PackageManager.SIGNATURE_FIRST_NOT_SIGNED) { String msg = "Permission Denial: starting instrumentation " + className + " from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingPid() + " not allowed because package " + ii.packageName + " does not have a signature matching the target " + ii.targetPackage; reportStartInstrumentationFailureLocked(watcher, className, msg); throw new SecurityException(msg); } final long origId = Binder.clearCallingIdentity(); // Instrumentation can kill and relaunch even persistent processes forceStopPackageLocked(ii.targetPackage, -1, true, false, true, true, false, userId, "start instr"); ProcessRecord app = addAppLocked(ai, false, abiOverride); app.instrumentationClass = className; app.instrumentationInfo = ai; app.instrumentationProfileFile = profileFile; app.instrumentationArguments = arguments; app.instrumentationWatcher = watcher; app.instrumentationUiAutomationConnection = uiAutomationConnection; app.instrumentationResultClass = className; Binder.restoreCallingIdentity(origId); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startInstrumentation File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
startInstrumentation
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public String getUserClass() { return userClass; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserClass File: src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java Repository: Bricco/authenticator-plugin The code follows secure coding practices.
[ "CWE-89" ]
CVE-2013-10013
MEDIUM
5.2
Bricco/authenticator-plugin
getUserClass
src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java
a5456633ff75e8f13705974c7ed1ce77f3f142d5
0
Analyze the following code function for security vulnerabilities
public void addCookie(Cookie c, boolean addToWebViewCookieManager, boolean sync) { if(addToWebViewCookieManager) { CookieManager mgr; CookieSyncManager syncer; try { syncer = CookieSyncManager.getInstance(); mgr = getCookieManager(); } catch(IllegalStateException ex) { syncer = CookieSyncManager.createInstance(this.getContext()); mgr = getCookieManager(); } java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss z"); format.setTimeZone(TimeZone.getTimeZone("GMT")); addCookie(c, mgr, format); if(sync) { syncer.sync(); } } super.addCookie(c); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addCookie 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
addCookie
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void removeWindow(Session session, IWindow client) { synchronized(mWindowMap) { WindowState win = windowForClientLocked(session, client, false); if (win == null) { return; } removeWindowLocked(win); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeWindow File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
removeWindow
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override public int checkPermission(@NonNull String packageName, @NonNull String permissionName, @UserIdInt int userId) { return PermissionManagerService.this.checkPermission(packageName, permissionName, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermission File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
checkPermission
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
protected URL getURL(String fileName) { return classLoadHelper.getResource(fileName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java Repository: quartz-scheduler/quartz The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-13990
HIGH
7.5
quartz-scheduler/quartz
getURL
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
0
Analyze the following code function for security vulnerabilities
@Override public void scheduleDestroyAllActivities(String reason) { synchronized (mGlobalLock) { mRootWindowContainer.scheduleDestroyAllActivities(reason); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleDestroyAllActivities File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
scheduleDestroyAllActivities
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void loadDataWithBaseUrlSync(final AwContents awContents, CallbackHelper onPageFinishedHelper, final String data, final String mimeType, final boolean isBase64Encoded, final String baseUrl, final String historyUrl) throws Throwable { int currentCallCount = onPageFinishedHelper.getCallCount(); loadDataWithBaseUrlAsync(awContents, data, mimeType, isBase64Encoded, baseUrl, historyUrl); onPageFinishedHelper.waitForCallback(currentCallCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadDataWithBaseUrlSync File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5155
MEDIUM
4.3
chromium
loadDataWithBaseUrlSync
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
0
Analyze the following code function for security vulnerabilities
@Nullable public String getText() { int id = nativeGetText(mParseState); return id >= 0 ? getSequenceString(mStrings.getSequence(id)) : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getText File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getText
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public Mac getMac() { return mac; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMac File: core/src/main/java/org/bouncycastle/crypto/engines/IESEngine.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
getMac
core/src/main/java/org/bouncycastle/crypto/engines/IESEngine.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
@Override public long getPositionFingerprint() { long fingerprint = 0; fingerprint ^= lOptPos; fingerprint ^= (lReqPos << 16); fingerprint ^= ((long) rReqPos << 32); fingerprint ^= ((long) rOptPos << 48); return fingerprint; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPositionFingerprint File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
getPositionFingerprint
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
@Override public void swapConference(String conferenceCallId, Session.Info info) throws RemoteException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: swapConference File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
swapConference
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override public List<ProjectFacade> getChildren(Long projectId) { cacheLock.readLock().lock(); try { List<ProjectFacade> children = new ArrayList<>(); for (ProjectFacade facade: cache.values()) { if (projectId.equals(facade.getParentId())) children.add(facade); } Collections.sort(children, new Comparator<ProjectFacade>() { @Override public int compare(ProjectFacade o1, ProjectFacade o2) { return o1.getName().compareTo(o2.getName()); } }); return children; } finally { cacheLock.readLock().unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChildren File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
getChildren
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
private String makeFunctionName(List<Element> elements, ExpressionProperties p) { ArrayList<String> args = new ArrayList<>(); for (int i = 0; i < p.args; i++) { final Element arg = XmlUtils.removeLast(elements); if (arg != null) { ExpressionProperties argProp = new ExpressionProperties(arg); if (argProp.isOperand()) { args.add(0, argProp.text); } } } if (p.isArray() && !args.isEmpty()) { String retValue = args.get(0) + "["; for (int i = 1; i < args.size(); i++) { retValue += (i > 1 ? "," : "") + args.get(i); } return retValue + "]"; } else { String retValue = p.text + "("; for (int i = 0; i < args.size(); i++) { retValue += (i > 0 ? "," : "") + args.get(i); } return retValue + ")"; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeFunctionName File: app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java Repository: mkulesh/microMathematics The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000821
HIGH
7.5
mkulesh/microMathematics
makeFunctionName
app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
5c05ac8de16c569ff0a1816f20be235090d3dd9d
0
Analyze the following code function for security vulnerabilities
protected void performRemoveNotification(StatusBarNotification n) { Entry entry = mNotificationData.get(n.getKey()); if (mRemoteInputController.isRemoteInputActive(entry)) { mRemoteInputController.removeRemoteInput(entry, null); } // start old BaseStatusBar.performRemoveNotification. final String pkg = n.getPackageName(); final String tag = n.getTag(); final int id = n.getId(); final int userId = n.getUserId(); try { mBarService.onNotificationClear(pkg, tag, id, userId); if (FORCE_REMOTE_INPUT_HISTORY && mKeysKeptForRemoteInput.contains(n.getKey())) { mKeysKeptForRemoteInput.remove(n.getKey()); } removeNotification(n.getKey(), null); } catch (RemoteException ex) { // system process is dead if we're here. } // end old BaseStatusBar.performRemoveNotification. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performRemoveNotification 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
performRemoveNotification
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@JsonProperty("id") public String getId() { return id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getId File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getId
base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("resource") private static String parseGwtRpcMethodName(InputStream stream, String charEncoding) { //commented out code uses GWT-user library for a more 'proper' approach. //GWT-user library approach is more future-proof, but requires more dependency management. // RPCRequest decodeRequest = RPC.decodeRequest(readLine); // gwtmethodname = decodeRequest.getMethod().getName(); try { final Scanner scanner; if (charEncoding == null) { scanner = new Scanner(stream); } else { scanner = new Scanner(stream, charEncoding); } scanner.useDelimiter(GWT_RPC_SEPARATOR_CHAR_PATTERN); //AbstractSerializationStream.RPC_SEPARATOR_CHAR //AbstractSerializationStreamReader.prepareToRead(...) scanner.next(); //stream version number scanner.next(); //flags //ServerSerializationStreamReader.deserializeStringTable() scanner.next(); //type name count //ServerSerializationStreamReader.preapreToRead(...) scanner.next(); //module base URL scanner.next(); //strong name //RPC.decodeRequest(...) scanner.next(); //service interface name return "." + scanner.next(); //service method name //note we don't close the scanner because we don't want to close the underlying stream } catch (final NoSuchElementException e) { LOG.debug("Unable to parse GWT-RPC request", e); //code above is best-effort - we were unable to parse GWT payload so //treat as a normal HTTP request return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseGwtRpcMethodName File: javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java Repository: javamelody The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-15531
HIGH
7.5
javamelody
parseGwtRpcMethodName
javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java
ef111822562d0b9365bd3e671a75b65bd0613353
0
Analyze the following code function for security vulnerabilities
public void setSelectionLimit(int selectionLimit) { if (selectionLimit < 0) { throw new IllegalArgumentException( "The selection limit must be non-negative"); } this.selectionLimit = selectionLimit; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSelectionLimit 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
setSelectionLimit
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public @NotNull DragonflyBuilder setTimeout(int timeout) { this.timeout = timeout; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTimeout File: src/main/java/dev/hypera/dragonfly/DragonflyBuilder.java Repository: HyperaDev/Dragonfly The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-41967
HIGH
7.5
HyperaDev/Dragonfly
setTimeout
src/main/java/dev/hypera/dragonfly/DragonflyBuilder.java
9661375e1135127ca6cdb5712e978bec33cc06b3
0
Analyze the following code function for security vulnerabilities
public Integer getMinTimeFrameValue() { return minTimeFrameValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMinTimeFrameValue File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4727
MEDIUM
6.1
openmrs/openmrs-module-appointmentscheduling
getMinTimeFrameValue
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
public List<String> getConfiguredLocales() { List<String> tmp = new LinkedList<String>(); for (Iterator<String> iter = this.supportedLocales.keySet().iterator(); iter .hasNext();) { String key = iter.next(); LocaleInfo li = this.supportedLocales.get(key); if (!li.isAlias()) { tmp.add(key); } } Collections.sort(tmp); return Collections.unmodifiableList(tmp); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguredLocales File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java Repository: spacewalkproject/spacewalk The code follows secure coding practices.
[ "CWE-79" ]
CVE-2016-3079
MEDIUM
4.3
spacewalkproject/spacewalk
getConfiguredLocales
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
7b9ff9ad
0
Analyze the following code function for security vulnerabilities
public String getName() { return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getName
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
void unlock() { stateLock.unlock(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unlock File: src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
unlock
src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
public final GenericUrl getTokenServerUrl() { return tokenServerUrl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTokenServerUrl File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java Repository: googleapis/google-oauth-java-client The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-7692
MEDIUM
6.4
googleapis/google-oauth-java-client
getTokenServerUrl
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
13433cd7dd06267fc261f0b1d4764f8e3432c824
0
Analyze the following code function for security vulnerabilities
public static Map<String, String> getNodeAttributes(Node node) { Map<String, String> ret = new HashMap<String, String>(); NamedNodeMap atts = node.getAttributes(); for (int i = 0; i < atts.getLength(); i++) { Node attribute = atts.item(i); ret.put(attribute.getNodeName(), attribute.getNodeValue()); } return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNodeAttributes File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
getNodeAttributes
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
public static String addSuffix(int n, String singular, String plural) { StringBuilder buf = new StringBuilder(); buf.append(n).append(' '); if(n==1) buf.append(singular); else buf.append(plural); return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addSuffix 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
addSuffix
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
@Override public void intercept(Invocation ai) { String actionKey = ai.getActionKey(); if (actionKey.startsWith("/install")) { installPermission(ai); } else { if (ZrLogConfig.isInstalled()) { if (actionKey.startsWith("/api")) { apiPermission(ai); } else if (actionKey.startsWith("/")) { visitorPermission(ai); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: intercept File: web/src/main/java/com/zrlog/web/interceptor/VisitorInterceptor.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21316
MEDIUM
4.3
94fzb/zrlog
intercept
web/src/main/java/com/zrlog/web/interceptor/VisitorInterceptor.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
private JsonArray readArray() throws IOException { read(); JsonArray array=new JsonArray(); skipWhiteSpace(); if (readIf(']')) { return array; } while (true) { skipWhiteSpace(); array.add(readValue()); skipWhiteSpace(); if (readIf(',')) skipWhiteSpace(); // , is optional if (readIf(']')) break; else if (isEndOfText()) throw error("End of input while parsing an array (did you forget a closing ']'?)"); } return array; }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2023-34620 - Severity: HIGH - CVSS Score: 7.5 Description: Fixing vulnerability CVE-2023-34620 in hjson library by adding the implementation of maximum depth while parsing input JSON. Function: readArray File: src/main/org/hjson/HjsonParser.java Repository: hjson/hjson-java Fixed Code: private JsonArray readArray(int depth) throws IOException { read(); JsonArray array=new JsonArray(); skipWhiteSpace(); if (readIf(']')) { return array; } while (true) { skipWhiteSpace(); array.add(readValue(depth)); skipWhiteSpace(); if (readIf(',')) skipWhiteSpace(); // , is optional if (readIf(']')) break; else if (isEndOfText()) throw error("End of input while parsing an array (did you forget a closing ']'?)"); } return array; }
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
readArray
src/main/org/hjson/HjsonParser.java
a16cb6a6078d76ddeaf715059213878d0ec7e057
1
Analyze the following code function for security vulnerabilities
private Object interceptPublisher(MethodInvocationContext<Object, Object> context, ReturnType returnTypeObject, Class returnType) { if (!Publishers.isSingle(returnType) && !context.isAnnotationPresent(SingleResult.class)) { throw new CacheSystemException("Only Reactive types that emit a single result can currently be cached. Use either Single, Maybe or Mono for operations that cache."); } CacheOperation cacheOperation = new CacheOperation(context, returnType); AnnotationValue<Cacheable> cacheable = cacheOperation.cacheable; if (cacheable != null) { Publisher<Object> publisher = buildCacheablePublisher(context, returnTypeObject, cacheOperation, cacheable); return Publishers.convertPublisher(publisher, returnType); } else { final List<AnnotationValue<CachePut>> putOperations = cacheOperation.putOperations; if (CollectionUtils.isNotEmpty(putOperations)) { final Publisher<Object> publisher = buildCachePutPublisher(context, cacheOperation, putOperations); return Publishers.convertPublisher(publisher, returnType); } else { final List<AnnotationValue<CacheInvalidate>> invalidateOperations = cacheOperation.invalidateOperations; if (CollectionUtils.isNotEmpty(invalidateOperations)) { final Publisher<Object> publisher = buildCacheInvalidatePublisher(context, cacheOperation, invalidateOperations); return Publishers.convertPublisher(publisher, returnType); } else { return context.proceed(); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: interceptPublisher File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
interceptPublisher
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@Sessional @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String clientIp = request.getHeader("X-Forwarded-For"); if (clientIp == null) clientIp = request.getRemoteAddr(); if (!InetAddress.getByName(clientIp).isLoopbackAddress()) { response.sendError(HttpServletResponse.SC_FORBIDDEN, "Git hook callbacks can only be accessed from localhost."); return; } List<String> fields = StringUtils.splitAndTrim(request.getPathInfo(), "/"); Preconditions.checkState(fields.size() == 2); SecurityUtils.getSubject().runAs(SecurityUtils.asPrincipal(Long.valueOf(fields.get(1)))); try { Project project = projectManager.load(Long.valueOf(fields.get(0))); String refUpdateInfo = null; /* * Since git 2.11, pushed commits will be placed in to a QUARANTINE directory when pre-receive hook * is fired. Current version of jgit does not pick up objects in this directory so we should call * native git instead with various environments passed from pre-receive hook */ Map<String, String> gitEnvs = new HashMap<>(); Enumeration<String> paramNames = request.getParameterNames(); while (paramNames.hasMoreElements()) { String paramName = paramNames.nextElement(); if (paramName.contains(" ")) { refUpdateInfo = paramName; } else if (paramName.startsWith("ENV_")) { String paramValue = request.getParameter(paramName); if (StringUtils.isNotBlank(paramValue)) gitEnvs.put(paramName.substring("ENV_".length()), paramValue); } } Preconditions.checkState(refUpdateInfo != null, "Git ref update information is not available"); Output output = new Output(response.getOutputStream()); /* * If multiple refs are updated, the hook stdin will put each ref update info into * a separate line, however the line breaks is omitted when forward the hook stdin * to curl via "@-", below logic is used to parse these info correctly even * without line breaks. */ refUpdateInfo = StringUtils.reverse(StringUtils.remove(refUpdateInfo, '\n')); fields = StringUtils.splitAndTrim(refUpdateInfo, " "); int pos = 0; while (true) { String refName = StringUtils.reverse(fields.get(pos)); pos++; ObjectId newObjectId = ObjectId.fromString(StringUtils.reverse(fields.get(pos))); pos++; String field = fields.get(pos); ObjectId oldObjectId = ObjectId.fromString(StringUtils.reverse(field.substring(0, 40))); User user = Preconditions.checkNotNull(SecurityUtils.getUser()); if (refName.startsWith(PullRequest.REFS_PREFIX) || refName.startsWith(PullRequestUpdate.REFS_PREFIX)) { if (!user.asSubject().isPermitted(new ProjectPermission(project, new ManageProject()))) { error(output, refName, Lists.newArrayList("Only project administrators can update onedev refs.")); break; } } else if (refName.startsWith(Constants.R_HEADS)) { String branchName = Preconditions.checkNotNull(GitUtils.ref2branch(refName)); List<String> errorMessages = new ArrayList<>(); BranchProtection protection = project.getHierarchyBranchProtection(branchName, user); if (oldObjectId.equals(ObjectId.zeroId())) { if (protection.isPreventCreation()) { errorMessages.add("Can not create this branch according to branch protection setting"); } else if (protection.isSignatureRequired() && !project.hasValidCommitSignature(newObjectId, gitEnvs)) { errorMessages.add("Can not create this branch as branch protection setting " + "requires valid signature on head commit"); } } else if (newObjectId.equals(ObjectId.zeroId())) { if (protection.isPreventDeletion()) errorMessages.add("Can not delete this branch according to branch protection setting"); } else if (protection.isPreventForcedPush() && !GitUtils.isMergedInto(project.getRepository(), gitEnvs, oldObjectId, newObjectId)) { errorMessages.add("Can not force-push to this branch according to branch protection setting"); } else if (protection.isSignatureRequired() && !project.hasValidCommitSignature(newObjectId, gitEnvs)) { errorMessages.add("Can not push to this branch as branch protection rule requires " + "valid signature for head commit"); } else if (protection.isReviewRequiredForPush(user, project, branchName, oldObjectId, newObjectId, gitEnvs)) { errorMessages.add("Review required for your change. Please submit pull request instead"); } if (errorMessages.isEmpty() && !oldObjectId.equals(ObjectId.zeroId()) && !newObjectId.equals(ObjectId.zeroId()) && project.isBuildRequiredForPush(user, branchName, oldObjectId, newObjectId, gitEnvs)) { errorMessages.add("Build required for your change. Please submit pull request instead"); } if (errorMessages.isEmpty() && newObjectId.equals(ObjectId.zeroId())) { try { projectManager.onDeleteBranch(project, branchName); } catch (ExplicitException e) { errorMessages.addAll(Splitter.on("\n").splitToList(e.getMessage())); } } if (!errorMessages.isEmpty()) error(output, refName, errorMessages); } else if (refName.startsWith(Constants.R_TAGS)) { String tagName = Preconditions.checkNotNull(GitUtils.ref2tag(refName)); List<String> errorMessages = new ArrayList<>(); TagProtection protection = project.getHierarchyTagProtection(tagName, user); if (oldObjectId.equals(ObjectId.zeroId())) { if (protection.isPreventCreation()) { errorMessages.add("Can not create this tag according to tag protection setting"); } else if (protection.isSignatureRequired() && !project.hasValidTagSignature(newObjectId, gitEnvs)) { errorMessages.add("Can not create this tag as tag protection setting requires " + "valid tag signature"); } } else if (newObjectId.equals(ObjectId.zeroId())) { if (protection.isPreventDeletion()) errorMessages.add("Can not delete this tag according to tag protection setting"); } else if (protection.isPreventUpdate()) { errorMessages.add("Can not update this tag according to tag protection setting"); } else if (protection.isSignatureRequired() && !project.hasValidTagSignature(newObjectId, gitEnvs)) { errorMessages.add("Can not update this tag as tag protection setting requires " + "valid tag signature"); } if (errorMessages.isEmpty() && newObjectId.equals(ObjectId.zeroId())) { try { projectManager.onDeleteTag(project, tagName); } catch (ExplicitException e) { errorMessages.addAll(Splitter.on("\n").splitToList(e.getMessage())); } } if (!errorMessages.isEmpty()) error(output, refName, errorMessages); } field = field.substring(40); if (field.length() == 0) break; else fields.set(pos, field); } } finally { SecurityUtils.getSubject().releaseRunAs(); } }
Vulnerability Classification: - CWE: CWE-287 - CVE: CVE-2022-39205 - Severity: CRITICAL - CVSS Score: 9.8 Description: Fix security vulnerability related to Git pre/post receive callback Function: doPost File: server-core/src/main/java/io/onedev/server/git/hookcallback/GitPreReceiveCallback.java Repository: theonedev/onedev Fixed Code: @Sessional @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<String> fields = StringUtils.splitAndTrim(request.getPathInfo(), "/"); Preconditions.checkState(fields.size() == 3); if (!fields.get(2).equals(GitUtils.HOOK_TOKEN)) { response.sendError(HttpServletResponse.SC_FORBIDDEN, "Git hook callbacks can only be accessed by OneDev itself"); return; } SecurityUtils.getSubject().runAs(SecurityUtils.asPrincipal(Long.valueOf(fields.get(1)))); try { Project project = projectManager.load(Long.valueOf(fields.get(0))); String refUpdateInfo = null; /* * Since git 2.11, pushed commits will be placed in to a QUARANTINE directory when pre-receive hook * is fired. Current version of jgit does not pick up objects in this directory so we should call * native git instead with various environments passed from pre-receive hook */ Map<String, String> gitEnvs = new HashMap<>(); Enumeration<String> paramNames = request.getParameterNames(); while (paramNames.hasMoreElements()) { String paramName = paramNames.nextElement(); if (paramName.contains(" ")) { refUpdateInfo = paramName; } else if (paramName.startsWith("ENV_")) { String paramValue = request.getParameter(paramName); if (StringUtils.isNotBlank(paramValue)) gitEnvs.put(paramName.substring("ENV_".length()), paramValue); } } Preconditions.checkState(refUpdateInfo != null, "Git ref update information is not available"); Output output = new Output(response.getOutputStream()); /* * If multiple refs are updated, the hook stdin will put each ref update info into * a separate line, however the line breaks is omitted when forward the hook stdin * to curl via "@-", below logic is used to parse these info correctly even * without line breaks. */ refUpdateInfo = StringUtils.reverse(StringUtils.remove(refUpdateInfo, '\n')); fields = StringUtils.splitAndTrim(refUpdateInfo, " "); int pos = 0; while (true) { String refName = StringUtils.reverse(fields.get(pos)); pos++; ObjectId newObjectId = ObjectId.fromString(StringUtils.reverse(fields.get(pos))); pos++; String field = fields.get(pos); ObjectId oldObjectId = ObjectId.fromString(StringUtils.reverse(field.substring(0, 40))); User user = Preconditions.checkNotNull(SecurityUtils.getUser()); if (refName.startsWith(PullRequest.REFS_PREFIX) || refName.startsWith(PullRequestUpdate.REFS_PREFIX)) { if (!user.asSubject().isPermitted(new ProjectPermission(project, new ManageProject()))) { error(output, refName, Lists.newArrayList("Only project administrators can update onedev refs.")); break; } } else if (refName.startsWith(Constants.R_HEADS)) { String branchName = Preconditions.checkNotNull(GitUtils.ref2branch(refName)); List<String> errorMessages = new ArrayList<>(); BranchProtection protection = project.getHierarchyBranchProtection(branchName, user); if (oldObjectId.equals(ObjectId.zeroId())) { if (protection.isPreventCreation()) { errorMessages.add("Can not create this branch according to branch protection setting"); } else if (protection.isSignatureRequired() && !project.hasValidCommitSignature(newObjectId, gitEnvs)) { errorMessages.add("Can not create this branch as branch protection setting " + "requires valid signature on head commit"); } } else if (newObjectId.equals(ObjectId.zeroId())) { if (protection.isPreventDeletion()) errorMessages.add("Can not delete this branch according to branch protection setting"); } else if (protection.isPreventForcedPush() && !GitUtils.isMergedInto(project.getRepository(), gitEnvs, oldObjectId, newObjectId)) { errorMessages.add("Can not force-push to this branch according to branch protection setting"); } else if (protection.isSignatureRequired() && !project.hasValidCommitSignature(newObjectId, gitEnvs)) { errorMessages.add("Can not push to this branch as branch protection rule requires " + "valid signature for head commit"); } else if (protection.isReviewRequiredForPush(user, project, branchName, oldObjectId, newObjectId, gitEnvs)) { errorMessages.add("Review required for your change. Please submit pull request instead"); } if (errorMessages.isEmpty() && !oldObjectId.equals(ObjectId.zeroId()) && !newObjectId.equals(ObjectId.zeroId()) && project.isBuildRequiredForPush(user, branchName, oldObjectId, newObjectId, gitEnvs)) { errorMessages.add("Build required for your change. Please submit pull request instead"); } if (errorMessages.isEmpty() && newObjectId.equals(ObjectId.zeroId())) { try { projectManager.onDeleteBranch(project, branchName); } catch (ExplicitException e) { errorMessages.addAll(Splitter.on("\n").splitToList(e.getMessage())); } } if (!errorMessages.isEmpty()) error(output, refName, errorMessages); } else if (refName.startsWith(Constants.R_TAGS)) { String tagName = Preconditions.checkNotNull(GitUtils.ref2tag(refName)); List<String> errorMessages = new ArrayList<>(); TagProtection protection = project.getHierarchyTagProtection(tagName, user); if (oldObjectId.equals(ObjectId.zeroId())) { if (protection.isPreventCreation()) { errorMessages.add("Can not create this tag according to tag protection setting"); } else if (protection.isSignatureRequired() && !project.hasValidTagSignature(newObjectId, gitEnvs)) { errorMessages.add("Can not create this tag as tag protection setting requires " + "valid tag signature"); } } else if (newObjectId.equals(ObjectId.zeroId())) { if (protection.isPreventDeletion()) errorMessages.add("Can not delete this tag according to tag protection setting"); } else if (protection.isPreventUpdate()) { errorMessages.add("Can not update this tag according to tag protection setting"); } else if (protection.isSignatureRequired() && !project.hasValidTagSignature(newObjectId, gitEnvs)) { errorMessages.add("Can not update this tag as tag protection setting requires " + "valid tag signature"); } if (errorMessages.isEmpty() && newObjectId.equals(ObjectId.zeroId())) { try { projectManager.onDeleteTag(project, tagName); } catch (ExplicitException e) { errorMessages.addAll(Splitter.on("\n").splitToList(e.getMessage())); } } if (!errorMessages.isEmpty()) error(output, refName, errorMessages); } field = field.substring(40); if (field.length() == 0) break; else fields.set(pos, field); } } finally { SecurityUtils.getSubject().releaseRunAs(); } }
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
doPost
server-core/src/main/java/io/onedev/server/git/hookcallback/GitPreReceiveCallback.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
1
Analyze the following code function for security vulnerabilities
public void removeRunningDevServerPort() { FileUtils.deleteQuietly(devServerPortFile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeRunningDevServerPort File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
removeRunningDevServerPort
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
public static ObjectStreamClass lookupAny(Class<?> cl) { return lookupStreamClass(cl); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookupAny File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
lookupAny
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage public boolean isUpToDate() { synchronized (this) { if (!mOpen) { return false; } for (ApkAssets apkAssets : mApkAssets) { if (!apkAssets.isUpToDate()) { return false; } } return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUpToDate File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
isUpToDate
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
protected int skipNewlines() throws IOException { if (DEBUG_BUFFER) { fCurrentEntity.debugBufferIfNeeded("(skipNewlines: "); } if (!fCurrentEntity.hasNext()) { if (fCurrentEntity.load(0) == -1) { if (DEBUG_BUFFER) { fCurrentEntity.debugBufferIfNeeded(")skipNewlines: "); } return 0; } } char c = fCurrentEntity.getCurrentChar(); int newlines = 0; int offset = fCurrentEntity.offset; if (c == '\n' || c == '\r') { do { c = fCurrentEntity.getNextChar(); if (c == '\r') { newlines++; if (fCurrentEntity.offset == fCurrentEntity.length) { offset = 0; fCurrentEntity.offset = newlines; if (fCurrentEntity.load(newlines) == -1) { break; } } if (fCurrentEntity.getCurrentChar() == '\n') { fCurrentEntity.offset++; fCurrentEntity.characterOffset_++; offset++; } } else if (c == '\n') { newlines++; if (fCurrentEntity.offset == fCurrentEntity.length) { offset = 0; fCurrentEntity.offset = newlines; if (fCurrentEntity.load(newlines) == -1) { break; } } } else { fCurrentEntity.rewind(); break; } } while (fCurrentEntity.offset < fCurrentEntity.length - 1); fCurrentEntity.incLine(newlines); } if (DEBUG_BUFFER) { fCurrentEntity.debugBufferIfNeeded(")skipNewlines: ", " -> " + newlines); } return newlines; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: skipNewlines File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
skipNewlines
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public Builder setIdleConnectionTimeoutInMs(int idleConnectionTimeoutInMs) { this.idleConnectionTimeoutInMs = idleConnectionTimeoutInMs; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIdleConnectionTimeoutInMs 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
setIdleConnectionTimeoutInMs
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public static int uncompressedLength(byte[] input, int offset, int length) throws IOException { if (input == null) { throw new NullPointerException("input is null"); } return impl.uncompressedLength(input, offset, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uncompressedLength File: src/main/java/org/xerial/snappy/Snappy.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34454
HIGH
7.5
xerial/snappy-java
uncompressedLength
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
private void addAttachment(XWikiDocument targetDocument, XWikiAttachment oldAttachment, String newName) throws IOException, XWikiException { // Clone the attachment and its history to the new document, with the new name. XWikiAttachment newAttachment = oldAttachment.clone(newName, this.xcontextProvider.get()); newAttachment.setDoc(targetDocument); targetDocument.setAttachment(newAttachment); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAttachment File: xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/src/main/java/org/xwiki/attachment/internal/refactoring/job/MoveAttachmentJob.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-37910
HIGH
8.1
xwiki/xwiki-platform
addAttachment
xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/src/main/java/org/xwiki/attachment/internal/refactoring/job/MoveAttachmentJob.java
d7720219d60d7201c696c3196c9d4a86d0881325
0
Analyze the following code function for security vulnerabilities
private static void fillTags(String suffix, String baseUrl, List<Tag> tags) { for (Tag tag : tags) { try { String tagUri = baseUrl + Constants.getArticleUri() + "tag/" + URLEncoder.encode(tag.get("text"), "UTF-8") + suffix; tag.put("url", tagUri); } catch (UnsupportedEncodingException e) { LOGGER.error("", e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fillTags File: web/src/main/java/com/zrlog/web/interceptor/TemplateHelper.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21316
MEDIUM
4.3
94fzb/zrlog
fillTags
web/src/main/java/com/zrlog/web/interceptor/TemplateHelper.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
public int getColumnNumber() { return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getColumnNumber File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getColumnNumber
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public List<String> getShellCommandLine( String... arguments ) { List<String> commandLine = new ArrayList<String>(); if ( getShellCommand() != null ) { commandLine.add( getShellCommand() ); } if ( getShellArgs() != null ) { commandLine.addAll( getShellArgsList() ); } commandLine.addAll( getCommandLine( executable, arguments ) ); return commandLine; }
Vulnerability Classification: - CWE: CWE-116 - CVE: CVE-2022-29599 - Severity: HIGH - CVSS Score: 7.5 Description: [MSHARED-297] - Minor code cleanup Function: getShellCommandLine File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils Fixed Code: public List<String> getShellCommandLine( String... arguments ) { List<String> commandLine = new ArrayList<>(); if ( getShellCommand() != null ) { commandLine.add( getShellCommand() ); } if ( getShellArgs() != null ) { commandLine.addAll( getShellArgsList() ); } commandLine.addAll( getCommandLine( executable, arguments ) ); return commandLine; }
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
getShellCommandLine
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
bb6b6a4bf44cc09f120068bd29fed3e9ab10eb6f
1
Analyze the following code function for security vulnerabilities
public Cursor query(String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy) { return query(false, table, columns, selection, selectionArgs, groupBy, having, orderBy, null /* limit */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: query 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
query
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public static void addFactoryIteratorProvider(final FactoryIteratorProvider provider) { FactoryIteratorProviders.addFactoryIteratorProvider(provider); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addFactoryIteratorProvider File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java Repository: geotools The code follows secure coding practices.
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
addFactoryIteratorProvider
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
@Override public CodeComment getOpenComment() { if (state.commentId != null) return OneDev.getInstance(CodeCommentManager.class).load(state.commentId); else return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOpenComment 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
getOpenComment
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
@Override public ServletOutputStream getOutputStream() throws IOException { return this.response.getOutputStream(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOutputStream 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
getOutputStream
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 T getReply(int timeout) throws ShutdownSignalException, TimeoutException { return _blocker.uninterruptibleGetValue(timeout); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReply File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
getReply
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@JRubyMethod(meta=true) public static IRubyObject read_memory(ThreadContext context, IRubyObject klazz, IRubyObject content) { String data = content.convertToString().asJavaString(); return getSchema(context, (RubyClass) klazz, new StreamSource(new StringReader(data))); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2020-26247 - Severity: MEDIUM - CVSS Score: 4.0 Description: feat: XML::Schema and RelaxNG creation accept optional ParseOptions I'm trying out a new pattern, which is that the parsed object carries around the ParseOptions it was created with, which should make some testing a bit easier. I'm also not implementing the "config block" pattern in use for Documents, because I think the UX is weird and I'm hoping to change everything to use kwargs in a 2.0 release, anyway. Function: read_memory File: ext/java/nokogiri/XmlSchema.java Repository: sparklemotion/nokogiri Fixed Code: @JRubyMethod(meta=true, required=1, optional=1) public static IRubyObject read_memory(ThreadContext context, IRubyObject klazz, IRubyObject[] args) { IRubyObject content = args[0]; IRubyObject parseOptions = null; if (args.length > 1) { parseOptions = args[1]; } String data = content.convertToString().asJavaString(); return getSchema(context, (RubyClass) klazz, new StreamSource(new StringReader(data)), parseOptions); }
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
read_memory
ext/java/nokogiri/XmlSchema.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
1
Analyze the following code function for security vulnerabilities
public void unRegisterCallback() { debugLog("unRegisterCallback()"); // remove callbacks _before_ tossing old connection try { mXMPPConnection.getRoster().removeRosterListener(mRosterListener); mXMPPConnection.removePacketListener(mPacketListener); mXMPPConnection.removePacketListener(mPresenceListener); mXMPPConnection.removePacketListener(mPongListener); unregisterPongListener(); } catch (Exception e) { // ignore it! e.printStackTrace(); } requestConnectionState(ConnectionState.OFFLINE); setStatusOffline(); mService.unregisterReceiver(mPingAlarmReceiver); mService.unregisterReceiver(mPongTimeoutAlarmReceiver); // multiUserChats.clear(); // TODO: right place this.mServiceCallBack = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unRegisterCallback 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
unRegisterCallback
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
private boolean isRoamIndForHomeSystem(String roamInd) { // retrieve the carrier-specified list of ERIs for home system String[] homeRoamIndicators = mPhone.getContext().getResources() .getStringArray(com.android.internal.R.array.config_cdma_home_system); if (homeRoamIndicators != null) { // searches through the comma-separated list for a match, // return true if one is found. for (String homeRoamInd : homeRoamIndicators) { if (homeRoamInd.equals(roamInd)) { return true; } } // no matches found against the list! return false; } // no system property found for the roaming indicators for home system return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRoamIndForHomeSystem File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
isRoamIndForHomeSystem
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
private boolean readWildCardToken(PathTokenAppender appender) { boolean inBracket = path.currentCharIs(OPEN_SQUARE_BRACKET); if (inBracket && !path.nextSignificantCharIs(WILDCARD)) { return false; } if (!path.currentCharIs(WILDCARD) && path.isOutOfBounds(path.position() + 1)) { return false; } if (inBracket) { int wildCardIndex = path.indexOfNextSignificantChar(WILDCARD); if (!path.nextSignificantCharIs(wildCardIndex, CLOSE_SQUARE_BRACKET)) { int offset = wildCardIndex + 1; throw new InvalidPathException("Expected wildcard token to end with ']' on position " + offset); } int bracketCloseIndex = path.indexOfNextSignificantChar(wildCardIndex, CLOSE_SQUARE_BRACKET); path.setPosition(bracketCloseIndex + 1); } else { path.incrementPosition(1); } appender.appendPathToken(PathTokenFactory.createWildCardPathToken()); return path.currentIsTail() || readNextToken(appender); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readWildCardToken File: json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java Repository: json-path/JsonPath The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-51074
MEDIUM
5.3
json-path/JsonPath
readWildCardToken
json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java
f49ff25e3bad8c8a0c853058181f2c00b5beb305
0
Analyze the following code function for security vulnerabilities
public final int getDegree() { return mDegree; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDegree File: core/src/main/java/org/bouncycastle/pqc/math/linearalgebra/GF2nField.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
getDegree
core/src/main/java/org/bouncycastle/pqc/math/linearalgebra/GF2nField.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
@CalledByNative public int getViewportHeightPix() { return mViewportHeightPix; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getViewportHeightPix 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
getViewportHeightPix
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private String getProfileOwnerNameUnchecked(int userHandle) { ComponentName profileOwner = getProfileOwnerAsUser(userHandle); if (profileOwner == null) { return null; } return getApplicationLabel(profileOwner.getPackageName(), userHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProfileOwnerNameUnchecked 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
getProfileOwnerNameUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected static void writePrimitive(Object s, ObjectOutput out, boolean allowSerializable) throws IOException, MessageFormatException { if (s == null) { out.writeByte(-1); } else if (s instanceof Boolean) { out.writeByte(1); out.writeBoolean((Boolean) s); } else if (s instanceof Byte) { out.writeByte(2); out.writeByte((Byte) s); } else if (s instanceof Short) { out.writeByte(3); out.writeShort(((Short) s)); } else if (s instanceof Integer) { out.writeByte(4); out.writeInt((Integer) s); } else if (s instanceof Long) { out.writeByte(5); out.writeLong((Long) s); } else if (s instanceof Float) { out.writeByte(6); out.writeFloat((Float) s); } else if (s instanceof Double) { out.writeByte(7); out.writeDouble((Double) s); } else if (s instanceof String) { out.writeByte(8); out.writeUTF((String) s); } else if (s instanceof Character) { out.writeByte(9); out.writeChar((Character) s); } else if (s instanceof byte[]) { out.writeByte(10); out.writeInt(((byte[]) s).length); out.write(((byte[]) s)); } else if (allowSerializable && s instanceof Serializable){ out.writeByte(Byte.MAX_VALUE); out.writeObject(s); } else { throw new MessageFormatException(s + " is not a recognized primitive type."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writePrimitive 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
writePrimitive
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity<?> entity) { Response response; if ("POST".equals(method)) { response = invocationBuilder.post(entity); } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else { response = invocationBuilder.method(method); } return response; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendRequest File: samples/client/petstore/java/okhttp-gson-dynamicOperations/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
sendRequest
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override // Binder call public void rename(final int fingerId, final int groupId, final String name) { checkPermission(MANAGE_FINGERPRINT); if (!isCurrentUserOrProfile(groupId)) { return; } mHandler.post(new Runnable() { @Override public void run() { mFingerprintUtils.renameFingerprintForUser(mContext, fingerId, groupId, name); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rename File: services/core/java/com/android/server/fingerprint/FingerprintService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
rename
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private void changeState(ReadyState readyState, int status, String statusMessage, byte[] bytes) { synchronized (this) { this.readyState = readyState; this.status = status; this.statusText = statusMessage; this.responseBytes = bytes; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: changeState File: Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
changeState
Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Override public byte[] getWidgetState(String packageName, int userId) { return mBackupRestoreController.getWidgetState(packageName, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWidgetState File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
getWidgetState
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public void use(String className, int nb) { this.currentObj = getObject(className, nb); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: use 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
use
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
void pushUserControlDisabledPackagesLocked(int userId) { final int targetUserId; final ActiveAdmin owner; if (getDeviceOwnerUserIdUncheckedLocked() == userId) { owner = getDeviceOwnerAdminLocked(); targetUserId = UserHandle.USER_ALL; } else { owner = getProfileOwnerAdminLocked(userId); targetUserId = userId; } List<String> protectedPackages = (owner == null || owner.protectedPackages == null) ? Collections.emptyList() : owner.protectedPackages; mInjector.binderWithCleanCallingIdentity(() -> mInjector.getPackageManagerInternal().setOwnerProtectedPackages( targetUserId, protectedPackages)); mUsageStatsManagerInternal.setAdminProtectedPackages(new ArraySet(protectedPackages), targetUserId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pushUserControlDisabledPackagesLocked 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
pushUserControlDisabledPackagesLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setAllowMultipleDelete(boolean theAllowMultipleDelete) { myAllowMultipleDelete = theAllowMultipleDelete; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowMultipleDelete File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setAllowMultipleDelete
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
public AsyncHttpClientConfig build() { if (reaper == null) { reaper = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(), new ThreadFactory() { public Thread newThread(Runnable r) { Thread t = new Thread(r, "AsyncHttpClient-Reaper"); t.setDaemon(true); return t; } }); } if (proxyServerSelector == null && useProxySelector) { proxyServerSelector = ProxyUtils.getJdkDefaultProxyServerSelector(); } if (proxyServerSelector == null && useProxyProperties) { proxyServerSelector = ProxyUtils.createProxyServerSelector(System.getProperties()); } if (proxyServerSelector == null) { proxyServerSelector = ProxyServerSelector.NO_PROXY_SELECTOR; } return new AsyncHttpClientConfig(maxTotalConnections, // maxConnectionPerHost, // connectionTimeOutInMs, // webSocketIdleTimeoutInMs, // idleConnectionInPoolTimeoutInMs, // idleConnectionTimeoutInMs, // requestTimeoutInMs, // maxConnectionLifeTimeInMs, // redirectEnabled, // maxRedirects, // compressionEnabled, // userAgent, // allowPoolingConnection, // reaper, // applicationThreadPool, // proxyServerSelector, // sslContext, // sslEngineFactory, // providerConfig, // realm, // requestFilters, // responseFilters, // ioExceptionFilters, // requestCompressionLevel, // maxRequestRetry, // allowSslConnectionPool, // useRawUrl, // removeQueryParamOnRedirect, // hostnameVerifier, // ioThreadMultiplier, // strict302Handling, // useRelativeURIsWithSSLProxies, // spdyEnabled, // spdyInitialWindowSize, // spdyMaxConcurrentStreams, // timeConverter); }
Vulnerability Classification: - CWE: CWE-345 - CVE: CVE-2013-7397 - Severity: MEDIUM - CVSS Score: 4.3 Description: Introduce acceptAnyCertificate config, defaulting to false, close #526, close #352 Function: build File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client Fixed Code: public AsyncHttpClientConfig build() { if (reaper == null) { reaper = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(), new ThreadFactory() { public Thread newThread(Runnable r) { Thread t = new Thread(r, "AsyncHttpClient-Reaper"); t.setDaemon(true); return t; } }); } if (proxyServerSelector == null && useProxySelector) { proxyServerSelector = ProxyUtils.getJdkDefaultProxyServerSelector(); } if (proxyServerSelector == null && useProxyProperties) { proxyServerSelector = ProxyUtils.createProxyServerSelector(System.getProperties()); } if (proxyServerSelector == null) { proxyServerSelector = ProxyServerSelector.NO_PROXY_SELECTOR; } return new AsyncHttpClientConfig(maxTotalConnections, // maxConnectionPerHost, // connectionTimeOutInMs, // webSocketIdleTimeoutInMs, // idleConnectionInPoolTimeoutInMs, // idleConnectionTimeoutInMs, // requestTimeoutInMs, // maxConnectionLifeTimeInMs, // redirectEnabled, // maxRedirects, // compressionEnabled, // userAgent, // allowPoolingConnection, // reaper, // applicationThreadPool, // proxyServerSelector, // sslContext, // sslEngineFactory, // providerConfig, // realm, // requestFilters, // responseFilters, // ioExceptionFilters, // requestCompressionLevel, // maxRequestRetry, // allowSslConnectionPool, // useRawUrl, // removeQueryParamOnRedirect, // hostnameVerifier, // ioThreadMultiplier, // strict302Handling, // useRelativeURIsWithSSLProxies, // spdyEnabled, // spdyInitialWindowSize, // spdyMaxConcurrentStreams, // timeConverter, // acceptAnyCertificate); }
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
build
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
1
Analyze the following code function for security vulnerabilities
public boolean isInInvalidMsgState(String pkg, int uid) { try { return sINM.isInInvalidMsgState(pkg, uid); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInInvalidMsgState File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
isInInvalidMsgState
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
public ChangeLogParser createChangeLogParser() { return new SubversionChangeLogParser(ignoreDirPropChanges); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createChangeLogParser File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
createChangeLogParser
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
boolean super_dispatchKeyEventPreIme(KeyEvent event);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: super_dispatchKeyEventPreIme 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
super_dispatchKeyEventPreIme
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private ReplyFromAccount getReplyFromAccountFromDraft(final Message msg) { final Address[] draftFroms = Address.parse(msg.getFrom()); final String sender = draftFroms.length > 0 ? draftFroms[0].getAddress() : ""; ReplyFromAccount replyFromAccount = null; // Do not try to check against the "default" account because the default might be an alias. for (ReplyFromAccount fromAccount : mFromSpinner.getReplyFromAccounts()) { if (TextUtils.equals(fromAccount.address, sender)) { replyFromAccount = fromAccount; break; } } return replyFromAccount; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReplyFromAccountFromDraft File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
getReplyFromAccountFromDraft
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public static String makeQueryString(final HttpServletRequest request) { return (makeQueryString(request, EMPTY_MAP, EMPTY_STRING_ARRAY)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeQueryString File: opennms-web-api/src/main/java/org/opennms/web/api/Util.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-0869
MEDIUM
6.1
OpenNMS/opennms
makeQueryString
opennms-web-api/src/main/java/org/opennms/web/api/Util.java
66b4ba96a18b9952f25a350bbccc2a7e206238d1
0
Analyze the following code function for security vulnerabilities
private void doStepJump(Context context, HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo, SubmissionStepConfig currentStepConfig) throws ServletException, IOException, SQLException, AuthorizeException { // Find the button that was pressed. It would start with // "submit_jump_". String buttonPressed = UIUtil.getSubmitButton(request, ""); int nextStep = -1; // next step to load int nextPage = -1; // page within the nextStep to load if (buttonPressed.startsWith("submit_jump_")) { // Button on progress bar pressed try { // get step & page info (in form: stepNum.pageNum) after // "submit_jump_" String stepAndPage = buttonPressed.substring(12); // split into stepNum and pageNum String[] fields = stepAndPage.split("\\."); // split on period nextStep = Integer.parseInt(fields[0]); nextPage = Integer.parseInt(fields[1]); } catch (NumberFormatException ne) { // mangled number nextStep = -1; nextPage = -1; } // Integrity check: make sure they aren't going // forward or backward too far if ((!subInfo.isInWorkflow() && nextStep < FIRST_STEP) || (subInfo.isInWorkflow() && nextStep < WORKFLOW_FIRST_STEP)) { nextStep = -1; nextPage = -1; } // if trying to jump to a step you haven't been to yet if (!subInfo.isInWorkflow() && (nextStep > getStepReached(subInfo))) { nextStep = -1; } } if (nextStep == -1) { // Either no button pressed, or an illegal stage // reached. UI doesn't allow this, so something's // wrong if that happens. log.warn(LogManager.getHeader(context, "integrity_error", UIUtil .getRequestLogInfo(request))); JSPManager.showIntegrityError(request, response); } else { int result = doSaveCurrentState(context, request, response, subInfo, currentStepConfig); // Now, if the request was a multi-part (file upload), we need to // get the original request back out, as the wrapper causes problems // further down the line. if (request instanceof FileUploadRequest) { FileUploadRequest fur = (FileUploadRequest) request; request = fur.getOriginalRequest(); } int currStep = currentStepConfig.getStepNumber(); int currPage = AbstractProcessingStep.getCurrentPage(request); double currStepAndPage = Double.parseDouble(currStep + "." + currPage); // default value if we are in workflow double stepAndPageReached = -1; if (!subInfo.isInWorkflow()) { stepAndPageReached = Double.parseDouble(getStepReached(subInfo)+"."+JSPStepManager.getPageReached(subInfo)); } if (result != AbstractProcessingStep.STATUS_COMPLETE && currStepAndPage != stepAndPageReached) { doStep(context, request, response, subInfo, currStep); } else { // save page info to request (for the step to access) AbstractProcessingStep.setCurrentPage(request, nextPage); // flag that we are going back to the start of this step (for // JSPStepManager class) setBeginningOfStep(request, true); log.debug("Jumping to Step " + nextStep + " and Page " + nextPage); // do the step (the step should take care of going to // the specified page) doStep(context, request, response, subInfo, nextStep); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doStepJump 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
doStepJump
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
public void setServiceRegistry(ServiceRegistry serviceRegistry) { this.serviceRegistry = serviceRegistry; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServiceRegistry File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-21318
MEDIUM
5.5
opencast
setServiceRegistry
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
b18c6a7f81f08ed14884592a6c14c9ab611ad450
0
Analyze the following code function for security vulnerabilities
@Nullable @Override public final Integer getInt(CharSequence name) { final String v = get(name); return toInteger(v); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInt 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
getInt
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
public boolean canDelete(Post showPost, Profile authUser, String approvedAnswerId) { if (authUser == null) { return false; } if (CONF.deleteProtectionEnabled()) { if (showPost.isReply()) { return isMine(showPost, authUser) && !StringUtils.equals(approvedAnswerId, showPost.getId()); } else { return isMine(showPost, authUser) && showPost.getAnswercount() == 0; } } return isMine(showPost, authUser); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canDelete File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
canDelete
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public void setBleTurningOn(boolean isBleTurningOn) { mIsBleTurningOn = isBleTurningOn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBleTurningOn File: src/com/android/bluetooth/btservice/AdapterState.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
setBleTurningOn
src/com/android/bluetooth/btservice/AdapterState.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@TestApi public long getLastSecurityLogRetrievalTime() { try { return mService.getLastSecurityLogRetrievalTime(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastSecurityLogRetrievalTime File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getLastSecurityLogRetrievalTime
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String username = request.getParameter("username"); //Gets all the parameters String password = request.getParameter("password"); Properties prop = System.getProperties(); try { prop.put("mail.user", username); prop.put("mail.password", password); prop.put("mail.smtp.auth", "true"); prop.put("mail.smtp.starttls.enable", "true"); prop.put("mail.smtp.host", "smtp.gmail.com"); prop.put("mail.smtp.port", "587"); prop.put("mail.store.protocol", "imaps"); Session session = Session.getDefaultInstance(prop); Store store = session.getStore("imaps"); store.connect("imap.googlemail.com", username, password); request.getSession().setAttribute("session", session); RequestDispatcher dispatcher = request.getRequestDispatcher("email.html"); dispatcher.forward(request, response); } catch (MessagingException e) { RequestDispatcher dispatcher = request.getRequestDispatcher("Error"); //New Request Dispatcher request.setAttribute("error", e.getMessage()); request.setAttribute("previous", request.getServletPath()); dispatcher.forward(request, response); } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2014-125075 - Severity: MEDIUM - CVSS Score: 5.2 Description: Added validation for contact adding and changed use of prepared statements to avoid SQL injection. Function: doPost File: src/Login.java Repository: ChrisMcMStone/gmail-servlet Fixed Code: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String username = request.getParameter("username"); //Gets all the parameters String password = request.getParameter("password"); Properties prop = System.getProperties(); try { prop.put("mail.user", username); prop.put("mail.password", password); prop.put("mail.smtp.auth", "true"); prop.put("mail.smtp.starttls.enable", "true"); prop.put("mail.smtp.host", "smtp.gmail.com"); prop.put("mail.smtp.port", "587"); prop.put("mail.store.protocol", "imaps"); Session session = Session.getDefaultInstance(prop); Store store = session.getStore("imaps"); store.connect("imap.googlemail.com", username, password); request.getSession().setAttribute("session", session); RequestDispatcher dispatcher = request.getRequestDispatcher("email.html"); dispatcher.forward(request, response); } catch (MessagingException e) { RequestDispatcher dispatcher = request.getRequestDispatcher("Error"); //New Request Dispatcher request.setAttribute("error", e.getMessage()); request.setAttribute("previous", "index.html"); dispatcher.forward(request, response); } }
[ "CWE-89" ]
CVE-2014-125075
MEDIUM
5.2
ChrisMcMStone/gmail-servlet
doPost
src/Login.java
5d72753c2e95bb373aa86824939397dc25f679ea
1
Analyze the following code function for security vulnerabilities
void dumpProto(@NonNull FileDescriptor fd) { ProtoOutputStream proto = new ProtoOutputStream(fd); synchronized (mLock) { SettingsProtoDumpUtil.dumpProtoLocked(mSettingsRegistry, proto); } proto.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpProto File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
dumpProto
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public static PSystemVersion createShowVersion2(UmlSource source) { final List<String> strings = new ArrayList<>(); strings.add("<b>PlantUML version " + Version.versionString() + "</b> (" + Version.compileTimeString() + ")"); strings.add("(" + License.getCurrent() + " source distribution)"); // :: uncomment when __CORE__ // strings.add(" "); // strings.add("Compiled with CheerpJ 2.3"); // strings.add("Powered by CheerpJ, a Leaning Technologies Java tool"); // :: done // :: comment when __CORE__ GraphvizCrash.checkOldVersionWarning(strings); if (OptionFlags.ALLOW_INCLUDE) { if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) strings.add("Loaded from " + Version.getJarPath()); if (OptionFlags.getInstance().isWord()) { strings.add("Word Mode"); strings.add("Command Line: " + Run.getCommandLine()); strings.add("Current Dir: " + new SFile(".").getAbsolutePath()); strings.add("plantuml.include.path: " + PreprocessorUtils.getenv(SecurityUtils.PATHS_INCLUDES)); } } strings.add(" "); GraphvizUtils.addDotStatus(strings, true); strings.add(" "); for (String name : OptionPrint.interestingProperties()) strings.add(name); for (String v : OptionPrint.interestingValues()) strings.add(v); // ::done return new PSystemVersion(source, true, strings); }
Vulnerability Classification: - CWE: CWE-284 - CVE: CVE-2023-3431 - Severity: MEDIUM - CVSS Score: 5.3 Description: feat: remove legacy ALLOW_INCLUDE use PLANTUML_SECURITY_PROFILE instead https://github.com/plantuml/plantuml-server/issues/232 Function: createShowVersion2 File: src/net/sourceforge/plantuml/version/PSystemVersion.java Repository: plantuml Fixed Code: public static PSystemVersion createShowVersion2(UmlSource source) { final List<String> strings = new ArrayList<>(); strings.add("<b>PlantUML version " + Version.versionString() + "</b> (" + Version.compileTimeString() + ")"); strings.add("(" + License.getCurrent() + " source distribution)"); // :: uncomment when __CORE__ // strings.add(" "); // strings.add("Compiled with CheerpJ 2.3"); // strings.add("Powered by CheerpJ, a Leaning Technologies Java tool"); // :: done // :: comment when __CORE__ GraphvizCrash.checkOldVersionWarning(strings); if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) { strings.add("Loaded from " + Version.getJarPath()); if (OptionFlags.getInstance().isWord()) { strings.add("Word Mode"); strings.add("Command Line: " + Run.getCommandLine()); strings.add("Current Dir: " + new SFile(".").getAbsolutePath()); strings.add("plantuml.include.path: " + PreprocessorUtils.getenv(SecurityUtils.PATHS_INCLUDES)); } } strings.add(" "); GraphvizUtils.addDotStatus(strings, true); strings.add(" "); for (String name : OptionPrint.interestingProperties()) strings.add(name); for (String v : OptionPrint.interestingValues()) strings.add(v); // ::done return new PSystemVersion(source, true, strings); }
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
createShowVersion2
src/net/sourceforge/plantuml/version/PSystemVersion.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
1
Analyze the following code function for security vulnerabilities
private void initializeTempDir(final ServletContextImpl servletContext, final DeploymentInfo deploymentInfo) { if (deploymentInfo.getTempDir() != null) { servletContext.setAttribute(ServletContext.TEMPDIR, deploymentInfo.getTempDir()); } else { servletContext.setAttribute(ServletContext.TEMPDIR, new File(SecurityActions.getSystemProperty("java.io.tmpdir"))); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeTempDir File: servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
initializeTempDir
servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
@Override public void onInit() { mSecurityViewFlipperController.init(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onInit File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21245
HIGH
7.8
android
onInit
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
a33159e8cb297b9eee6fa5c63c0e343d05fad622
0
Analyze the following code function for security vulnerabilities
private boolean requestPinItem(String callingPackage, int userId, ShortcutInfo shortcut, AppWidgetProviderInfo appWidget, Bundle extras, IntentSender resultIntent) { return requestPinItem(callingPackage, userId, shortcut, appWidget, extras, resultIntent, injectBinderCallingPid(), injectBinderCallingUid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestPinItem 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
requestPinItem
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public int getDuration() { if(nativeVideo != null){ return nativeVideo.getDuration(); } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDuration 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
getDuration
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0