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 String checkPackageFile(final File importSandboxDirectory, final URI href) throws AssessmentPackageDataImportException { final String hrefString = href.toString(); final URI sandboxUri = importSandboxDirectory.toURI(); final URI resolvedFileUri = sandboxUri.resolve(href); /* Make sure href points to something within the sandbox */ if (!resolvedFileUri.toString().startsWith(sandboxUri.toString())) { throw new AssessmentPackageDataImportException(ImportFailureReason.HREF_OUTSIDE_PACKAGE, hrefString); } /* Make sure file exists */ final File resolvedFile = new File(resolvedFileUri); if (!resolvedFile.exists()) { throw new AssessmentPackageDataImportException(ImportFailureReason.FILE_MISSING, hrefString); } return hrefString; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPackageFile File: qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java Repository: davemckain/qtiworks The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39367
MEDIUM
6.5
davemckain/qtiworks
checkPackageFile
qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java
1a46d6d842877ba2b824d5c269845827e2e0ccac
0
Analyze the following code function for security vulnerabilities
public int getOnNotificationPostedTrim(ManagedServiceInfo info) { return mLightTrimListeners.contains(info) ? TRIM_LIGHT : TRIM_FULL; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOnNotificationPostedTrim File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
getOnNotificationPostedTrim
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public static Map<String, String> findValidLabels(Element root, String nodeType, String attrType) { assert (root != null); assert (nodeType != null); assert (attrType != null); assert (nodeType.length() > 0); assert (attrType.length() > 0); Map<String, String> validLabels = new HashMap<String, String>(); List<String> initialLabels = getXMLLabels(root, nodeType, attrType); Iterator<String> iterator = initialLabels.iterator(); while (iterator.hasNext()) { String label = iterator.next(); if (!validLabels.containsKey(label)) { // Check if the name is invalid, in which case create // a valid version and put it in the map if (labelVHDLInvalid(label)) { String initialLabel = label; label = generateValidVHDLLabel(label); validLabels.put(initialLabel, label); } } } return validLabels; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findValidLabels File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
findValidLabels
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
@Override public boolean isUninstallBlocked(ComponentName who, String packageName) { // This function should return true if and only if the package is blocked by // setUninstallBlocked(). It should still return false for other cases of blocks, such as // when the package is a system app, or when it is an active device admin. final int userId = UserHandle.getCallingUserId(); synchronized (getLockObject()) { //TODO: This is a silly access control check. Remove. if (who != null) { final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller) || isFinancedDeviceOwner(caller)); } try { return mIPackageManager.getBlockUninstallForUser(packageName, userId); } catch (RemoteException re) { // Shouldn't happen. Slogf.e(LOG_TAG, "Failed to getBlockUninstallForUser", re); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUninstallBlocked 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
isUninstallBlocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected B encoderEnforceMaxQueuedControlFrames(int maxQueuedControlFrames) { enforceNonCodecConstraints("encoderEnforceMaxQueuedControlFrames"); this.maxQueuedControlFrames = checkPositiveOrZero(maxQueuedControlFrames, "maxQueuedControlFrames"); return self(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: encoderEnforceMaxQueuedControlFrames File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
netty
encoderEnforceMaxQueuedControlFrames
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
0
Analyze the following code function for security vulnerabilities
private boolean setCameraCompatControlState(@CameraCompatControlState int state) { if (!isCameraCompatControlEnabled()) { // Feature is disabled by config_isCameraCompatControlForStretchedIssuesEnabled. return false; } if (mCameraCompatControlState != state) { mCameraCompatControlState = state; return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCameraCompatControlState File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
setCameraCompatControlState
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public void setActivityLocusContext(ComponentName activity, LocusId locusId, IBinder appToken) { final int callingUid = Binder.getCallingUid(); final int userId = UserHandle.getCallingUserId(); if (getPackageManagerInternal().getPackageUid(activity.getPackageName(), /*flags=*/ 0, userId) != callingUid) { throw new SecurityException("Calling uid " + callingUid + " cannot set locusId" + "for package " + activity.getPackageName()); } mActivityTaskManager.setLocusId(locusId, appToken); if (mUsageStatsService != null) { mUsageStatsService.reportLocusUpdate(activity, userId, locusId, appToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActivityLocusContext 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
setActivityLocusContext
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private void parsePlayerProduction(final List<Element> elements) throws GameParseException { for (final Element current : elements) { final PlayerId player = getPlayerId(current, "player", true); final ProductionFrontier frontier = getProductionFrontier(current, "frontier", true); player.setProductionFrontier(frontier); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parsePlayerProduction File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parsePlayerProduction
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
private void syncDeCeAccountsLocked(UserAccounts accounts) { Preconditions.checkState(Thread.holdsLock(mUsers), "mUsers lock must be held"); List<Account> accountsToRemove = accounts.accountsDb.findCeAccountsNotInDe(); if (!accountsToRemove.isEmpty()) { Slog.i(TAG, accountsToRemove.size() + " accounts were previously deleted while user " + accounts.userId + " was locked. Removing accounts from CE tables"); logRecord(accounts, AccountsDb.DEBUG_ACTION_SYNC_DE_CE_ACCOUNTS, AccountsDb.TABLE_ACCOUNTS); for (Account account : accountsToRemove) { removeAccountInternal(accounts, account, Process.SYSTEM_UID); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: syncDeCeAccountsLocked File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
syncDeCeAccountsLocked
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
boolean setPhonebookAccessPermission(BluetoothDevice device, int value) { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, "Need BLUETOOTH PRIVILEGED permission"); SharedPreferences pref = getSharedPreferences(PHONEBOOK_ACCESS_PERMISSION_PREFERENCE_FILE, Context.MODE_PRIVATE); SharedPreferences.Editor editor = pref.edit(); if (value == BluetoothDevice.ACCESS_UNKNOWN) { editor.remove(device.getAddress()); } else { editor.putBoolean(device.getAddress(), value == BluetoothDevice.ACCESS_ALLOWED); } return editor.commit(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPhonebookAccessPermission File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
setPhonebookAccessPermission
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public String getCharacterEncoding() { return this.response.getCharacterEncoding(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCharacterEncoding 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
getCharacterEncoding
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
@Override public boolean isRotationFrozen() { return mPolicy.getUserRotationMode() == WindowManagerPolicy.USER_ROTATION_LOCKED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRotationFrozen 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
isRotationFrozen
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void engineInit( int opmode, Key key, AlgorithmParameterSpec engineSpec, SecureRandom random) throws InvalidAlgorithmParameterException, InvalidKeyException { // Use default parameters (including cipher key size) if none are specified if (engineSpec == null) { byte[] nonce = null; if (ivLength != 0 && opmode == Cipher.ENCRYPT_MODE) { nonce = new byte[ivLength]; random.nextBytes(nonce); } this.engineSpec = IESUtil.guessParameterSpec(engine.getCipher(), nonce); } else if (engineSpec instanceof IESParameterSpec) { this.engineSpec = (IESParameterSpec)engineSpec; } else { throw new InvalidAlgorithmParameterException("must be passed IES parameters"); } byte[] nonce = this.engineSpec.getNonce(); if (ivLength != 0 && (nonce == null || nonce.length != ivLength)) { throw new InvalidAlgorithmParameterException("NONCE in IES Parameters needs to be " + ivLength + " bytes long"); } // Parse the recipient's key if (opmode == Cipher.ENCRYPT_MODE || opmode == Cipher.WRAP_MODE) { if (key instanceof DHPublicKey) { this.key = DHUtil.generatePublicKeyParameter((PublicKey)key); } else if (key instanceof IESKey) { IESKey ieKey = (IESKey)key; this.key = DHUtil.generatePublicKeyParameter(ieKey.getPublic()); this.otherKeyParameter = DHUtil.generatePrivateKeyParameter(ieKey.getPrivate()); } else { throw new InvalidKeyException("must be passed recipient's public DH key for encryption"); } } else if (opmode == Cipher.DECRYPT_MODE || opmode == Cipher.UNWRAP_MODE) { if (key instanceof DHPrivateKey) { this.key = DHUtil.generatePrivateKeyParameter((PrivateKey)key); } else if (key instanceof IESKey) { IESKey ieKey = (IESKey)key; this.otherKeyParameter = DHUtil.generatePublicKeyParameter(ieKey.getPublic()); this.key = DHUtil.generatePrivateKeyParameter(ieKey.getPrivate()); } else { throw new InvalidKeyException("must be passed recipient's private DH key for decryption"); } } else { throw new InvalidKeyException("must be passed EC key"); } this.random = random; this.state = opmode; buffer.reset(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineInit File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineInit
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
@Override protected void onUpdateIccAvailability() { if (mUiccController == null ) { return; } UiccCardApplication newUiccApplication = getUiccCardApplication(); if (mUiccApplcation != newUiccApplication) { if (mUiccApplcation != null) { log("Removing stale icc objects."); mUiccApplcation.unregisterForReady(this); if (mIccRecords != null) { mIccRecords.unregisterForRecordsLoaded(this); } mIccRecords = null; mUiccApplcation = null; } if (newUiccApplication != null) { log("New card found"); mUiccApplcation = newUiccApplication; mIccRecords = mUiccApplcation.getIccRecords(); if (mIsSubscriptionFromRuim) { mUiccApplcation.registerForReady(this, EVENT_RUIM_READY, null); if (mIccRecords != null) { mIccRecords.registerForRecordsLoaded(this, EVENT_RUIM_RECORDS_LOADED, null); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUpdateIccAvailability 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
onUpdateIccAvailability
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
void setDropInputForAnimation(boolean isInputDroppedForAnimation) { if (mIsInputDroppedForAnimation == isInputDroppedForAnimation) { return; } mIsInputDroppedForAnimation = isInputDroppedForAnimation; updateUntrustedEmbeddingInputProtection(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDropInputForAnimation File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
setDropInputForAnimation
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static final boolean shouldShowDialogs(Configuration config) { return !(config.keyboard == Configuration.KEYBOARD_NOKEYS && config.touchscreen == Configuration.TOUCHSCREEN_NOTOUCH && config.navigation == Configuration.NAVIGATION_NONAV); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldShowDialogs File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
shouldShowDialogs
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public IssuesWithBLOBs getIssue(String id) { IssuesDao issuesWithBLOBs = extIssuesMapper.selectByPrimaryKey(id); if (issuesWithBLOBs == null) { return null; } IssuesRequest issuesRequest = new IssuesRequest(); Project project = baseProjectService.getProjectById(issuesWithBLOBs.getProjectId()); issuesRequest.setWorkspaceId(project.getWorkspaceId()); issuesRequest.setProjectId(issuesWithBLOBs.getProjectId()); issuesRequest.setUserId(issuesWithBLOBs.getCreator()); if (StringUtils.equals(issuesWithBLOBs.getPlatform(), IssuesManagePlatform.Tapd.name())) { TapdPlatform tapdPlatform = (TapdPlatform) IssueFactory.createPlatform(IssuesManagePlatform.Tapd.name(), issuesRequest); List<String> tapdUsers = tapdPlatform.getTapdUsers(issuesWithBLOBs.getProjectId(), issuesWithBLOBs.getPlatformId()); issuesWithBLOBs.setTapdUsers(tapdUsers); } if (StringUtils.equals(issuesWithBLOBs.getPlatform(), IssuesManagePlatform.Zentao.name())) { ZentaoPlatform zentaoPlatform = (ZentaoPlatform) IssueFactory.createPlatform(IssuesManagePlatform.Zentao.name(), issuesRequest); zentaoPlatform.getZentaoAssignedAndBuilds(issuesWithBLOBs); } buildCustomField(issuesWithBLOBs); return issuesWithBLOBs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIssue File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getIssue
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public static String trimToSize(String source, int length) { return trimToSize(source, length, length, " ..."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trimToSize File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
trimToSize
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
@Override public boolean removeCrossProfileWidgetProvider(ComponentName admin, String packageName) { Objects.requireNonNull(admin, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization(isProfileOwner(caller)); List<String> changedProviders = null; synchronized (getLockObject()) { ActiveAdmin activeAdmin = getProfileOwnerLocked(caller); if (activeAdmin.crossProfileWidgetProviders == null || activeAdmin.crossProfileWidgetProviders.isEmpty()) { return false; } List<String> providers = activeAdmin.crossProfileWidgetProviders; if (providers.remove(packageName)) { changedProviders = new ArrayList<>(providers); saveSettingsLocked(caller.getUserId()); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.REMOVE_CROSS_PROFILE_WIDGET_PROVIDER) .setAdmin(admin) .write(); if (changedProviders != null) { mLocalService.notifyCrossProfileProvidersChanged(caller.getUserId(), changedProviders); return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeCrossProfileWidgetProvider 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
removeCrossProfileWidgetProvider
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void translationDocumentUpdated(XWikiDocument document) { if (!document.getOriginalDocument().isNew()) { unregisterTranslationBundle(document.getOriginalDocument()); } if (!document.isNew()) { try { registerTranslationBundle(document); } catch (Exception e) { this.logger.error("Failed to register translation bundle from document [{}]", document.getDocumentReference(), e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: translationDocumentUpdated File: xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29510
HIGH
8.8
xwiki/xwiki-platform
translationDocumentUpdated
xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java
d06ff8a58480abc7f63eb1d4b8b366024d990643
0
Analyze the following code function for security vulnerabilities
@RequestMapping("save") @Csrf public String save(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, SysSite entity, String domain, Boolean wild, String roleName, String deptName, String userName, String password, HttpServletRequest request, ModelMap model) { if (ControllerUtils.verifyCustom("noright", !siteComponent.isMaster(site.getId()), model)) { return CommonConstants.TEMPLATE_ERROR; } if (null == entity.getDynamicPath()) { entity.setDynamicPath(CommonConstants.SEPARATOR); } else if (!entity.getDynamicPath().endsWith(CommonConstants.SEPARATOR)) { entity.setDynamicPath(entity.getDynamicPath() + CommonConstants.SEPARATOR); } if (null == entity.getSitePath()) { entity.setSitePath(CommonConstants.SEPARATOR); } else if (!entity.getSitePath().endsWith(CommonConstants.SEPARATOR)) { entity.setSitePath(entity.getSitePath() + CommonConstants.SEPARATOR); } if (null != entity.getId()) { entity = service.update(entity.getId(), entity, ignoreProperties); if (null != entity) { logOperateService.save(new LogOperate(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "update.site", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity))); } } else { if (ControllerUtils.verifyCustom("needAuthorizationEdition", !CmsVersion.isAuthorizationEdition(), model) || ControllerUtils.verifyCustom("unauthorizedDomain", !CmsVersion.verifyDomain(domain), model) || ControllerUtils.verifyNotEmpty("userName", userName, model) || ControllerUtils.verifyNotEmpty("password", password, model) || ControllerUtils.verifyHasExist("domain", domainService.getEntity(domain), model)) { return CommonConstants.TEMPLATE_ERROR; } service.save(entity); if (null == wild) { wild = false; } domainService.save(new SysDomain(domain, entity.getId(), wild)); SysDept dept = new SysDept(entity.getId(), deptName, 0, true, true, true); deptService.save(dept);// 初始化部门 SysRole role = new SysRole(entity.getId(), roleName, true, true); roleService.save(role);// 初始化角色 String salt = UserPasswordUtils.getSalt(); SysUser user = new SysUser(entity.getId(), userName, UserPasswordUtils.passwordEncode(password, salt), salt, true, userName, dept.getId(), true, role.getId().toString(), null, false, true, false, null, null, 0, CommonUtils.getDate()); userService.save(user);// 初始化用户 roleUserService.save(new SysRoleUser(new SysRoleUserId(role.getId(), user.getId())));// 初始化角色用户映射 logOperateService.save(new LogOperate(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "save.site", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity))); } siteComponent.clear(); if (!siteComponent.getSite(request.getServerName()).getId().equals(site.getId()) || site.getId().equals(entity.getId()) && (!site.getSitePath().equals(entity.getSitePath()) || !site.getDynamicPath().equals(entity.getDynamicPath()))) { return CommonConstants.TEMPLATE_DONEANDREFRESH; } else { return CommonConstants.TEMPLATE_DONE; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save 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
save
publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/SysSiteAdminController.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
private boolean passwordQualityInvocationOrderCheckEnabled(String packageName, int userId) { return mInjector.isChangeEnabled(ADMIN_APP_PASSWORD_COMPLEXITY, packageName, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: passwordQualityInvocationOrderCheckEnabled 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
passwordQualityInvocationOrderCheckEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private ModelAndView renameGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { String oldName = request.getParameter("groupName"); String newName = request.getParameter("newName"); if (StringUtils.hasText(oldName) && StringUtils.hasText(newName)) { m_groupRepository.renameGroup(oldName, newName); } return listGroups(request, response); }
Vulnerability Classification: - CWE: CWE-352, CWE-79 - CVE: CVE-2021-25929 - Severity: LOW - CVSS Score: 3.5 Description: NMS-13231: Backport Security Issues from Last Month Function: renameGroup File: opennms-webapp/src/main/java/org/opennms/web/controller/admin/group/GroupController.java Repository: OpenNMS/opennms Fixed Code: private ModelAndView renameGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { String oldName = request.getParameter("groupName"); String newName = request.getParameter("newName"); if (newName != null && newName.matches(".*[&<>\"`']+.*")) { throw new ServletException("Group ID must not contain any HTML markup."); } if (StringUtils.hasText(oldName) && StringUtils.hasText(newName)) { m_groupRepository.renameGroup(oldName, newName); } return listGroups(request, response); }
[ "CWE-352", "CWE-79" ]
CVE-2021-25929
LOW
3.5
OpenNMS/opennms
renameGroup
opennms-webapp/src/main/java/org/opennms/web/controller/admin/group/GroupController.java
eb08b5ed4c5548f3e941a1f0d0363ae4439fa98c
1
Analyze the following code function for security vulnerabilities
public void setListenerFilter(ComponentName cn, int userId, NotificationListenerFilter nlf) { try { sINM.setListenerFilter(cn, userId, nlf); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setListenerFilter 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
setListenerFilter
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
public org.xwiki.rest.model.jaxb.Object object(EntityReference parentReference, String className, int number) { org.xwiki.rest.model.jaxb.Object obj = new org.xwiki.rest.model.jaxb.Object(); // Add current wiki if the reference does not contains any EntityReference wikiReference = parentReference.extractReference(EntityType.WIKI); if (wikiReference == null) { obj.setWiki(this.testUtils.getCurrentWiki()); } else { obj.setWiki(wikiReference.getName()); } // Add spaces EntityReference spaceReference = parentReference.extractReference(EntityType.SPACE).removeParent(wikiReference); obj.setSpace(referenceSerializer.serialize(spaceReference)); // Add page EntityReference documentReference = parentReference.extractReference(EntityType.DOCUMENT); obj.setPageName(documentReference.getName()); // Add class reference obj.setClassName(className); // Add object number obj.setNumber(number); return obj; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: object File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
object
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public void onPreferredPaymentServiceChanged(int userId, final ComponentName service) { new Handler(Looper.getMainLooper()).post(() -> { synchronized (mLock) { if (service != null) { bindPaymentServiceLocked(userId, service); } else { unbindPaymentServiceLocked(); } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPreferredPaymentServiceChanged File: src/com/android/nfc/cardemulation/HostEmulationManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35671
MEDIUM
5.5
android
onPreferredPaymentServiceChanged
src/com/android/nfc/cardemulation/HostEmulationManager.java
745632835f3d97513a9c2a96e56e1dc06c4e4176
0
Analyze the following code function for security vulnerabilities
@Override public String getFromSQL(Select select) { String fromSelect = select.getFromSelect(); Table fromTable = select.getFromTable(); String from = getFromStatement(select); if (fromSelect != null) { String alias = getAliasForColumnSQL("dbSQL"); return from + " (" + fromSelect + ") " + alias; } else if (fromTable != null ){ String table = getTableSQL(select); return from + " " + table; } return ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFromSQL File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
getFromSQL
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
@Override public void onConfigurationChanged(Configuration newParentConfig) { if (getDisplayContent().getImeInputTarget() != this && !isImeLayeringTarget()) { super.onConfigurationChanged(newParentConfig); return; } mTempConfiguration.setTo(getConfiguration()); super.onConfigurationChanged(newParentConfig); final boolean windowConfigChanged = mTempConfiguration.windowConfiguration .diff(newParentConfig.windowConfiguration, false) != 0; // When the window configuration changed, we need to update the IME control target in // case the app may lose the IME inets control when exiting from split-screen mode, or the // IME parent may failed to attach to the app during rotating the screen. // See DisplayContent#shouldImeAttachedToApp, DisplayContent#isImeControlledByApp if (windowConfigChanged) { getDisplayContent().updateImeControlTarget(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onConfigurationChanged File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
onConfigurationChanged
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Nullable public URI getClientUrl() { return clientUrl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClientUrl File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getClientUrl
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) { try { getDefault().noteAlarmStart(ps.getTarget(), sourceUid, tag); } catch (RemoteException ex) { } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteAlarmStart File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
noteAlarmStart
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public static long getLongValue(String value, long defaultValue, String key) { long result; try { result = Long.valueOf(value).longValue(); } catch (Exception e) { if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.ERR_UNABLE_TO_PARSE_INT_2, value, key)); } result = defaultValue; } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLongValue File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
getLongValue
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private static void handle(Callable<?> task, AsyncMethodCallback resultHandler) { try { resultHandler.onComplete(task.call()); } catch (Throwable cause) { resultHandler.onError(convert(cause)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handle File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
handle
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
public void setInputSource(XMLInputSource source) throws IOException { // reset state fElementCount = 0; fElementDepth = -1; fByteStream = null; fCurrentEntityStack.removeAllElements(); fBeginLineNumber = 1; fBeginColumnNumber = 1; fBeginCharacterOffset = 0; fEndLineNumber = fBeginLineNumber; fEndColumnNumber = fBeginColumnNumber; fEndCharacterOffset = fBeginCharacterOffset; // reset encoding information fIANAEncoding = fDefaultIANAEncoding; fJavaEncoding = fIANAEncoding; // get location information String encoding = source.getEncoding(); String publicId = source.getPublicId(); String baseSystemId = source.getBaseSystemId(); String literalSystemId = source.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); // open stream Reader reader = source.getCharacterStream(); if (reader == null) { InputStream inputStream = source.getByteStream(); if (inputStream == null) { URL url = new URL(expandedSystemId); inputStream = url.openStream(); } fByteStream = new PlaybackInputStream(inputStream); String[] encodings = new String[2]; if (encoding == null) { fByteStream.detectEncoding(encodings); } else { encodings[0] = encoding; } if (encodings[0] == null) { encodings[0] = fDefaultIANAEncoding; if (fReportErrors) { fErrorReporter.reportWarning("HTML1000", null); } } if (encodings[1] == null) { encodings[1] = EncodingMap.getIANA2JavaMapping(encodings[0].toUpperCase(Locale.ENGLISH)); if (encodings[1] == null) { encodings[1] = encodings[0]; if (fReportErrors) { fErrorReporter.reportWarning("HTML1001", new Object[]{encodings[0]}); } } } fIANAEncoding = encodings[0]; fJavaEncoding = encodings[1]; /* PATCH: Asgeir Asgeirsson */ fIso8859Encoding = fIANAEncoding == null || fIANAEncoding.toUpperCase(Locale.ENGLISH).startsWith("ISO-8859") || fIANAEncoding.equalsIgnoreCase(fDefaultIANAEncoding); encoding = fIANAEncoding; reader = new InputStreamReader(fByteStream, fJavaEncoding); } fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); // set scanner and state setScanner(fContentScanner); setScannerState(STATE_START_DOCUMENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setInputSource 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
setInputSource
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public void addDataGenerator(DataGenerator<T> generator) { Objects.requireNonNull(generator, "generator cannot be null"); generators.add(generator); // Make sure data gets generated when adding data generators. reset(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addDataGenerator File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-20" ]
CVE-2021-33609
MEDIUM
4
vaadin/framework
addDataGenerator
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
0
Analyze the following code function for security vulnerabilities
@Override public synchronized String getString() throws SQLException { checkFreed(); ensureInitialized(); return data; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getString File: pgjdbc/src/main/java/org/postgresql/jdbc/PgSQLXML.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-13692
MEDIUM
6.8
pgjdbc
getString
pgjdbc/src/main/java/org/postgresql/jdbc/PgSQLXML.java
14b62aca4764d496813f55a43d050b017e01eb65
0
Analyze the following code function for security vulnerabilities
public String getFrom() { return from; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-41967 - Severity: HIGH - CVSS Score: 7.5 Description: fix: CVE-2022-41967 Dragonfly v0.3.0-SNAPSHOT fails to properly configure the DocumentBuilderFactory to prevent XML enternal entity (XXE) attacks when parsing maven-metadata.xml files provided by external Maven repositories during "SNAPSHOT" version resolution. This patches CVE-2022-41967 by disabling features which may lead to XXE. If you are currently using v0.3.0-SNAPSHOT it is STRONGLY advised to update Dragonfly to v0.3.1-SNAPSHOT just to be safe. Function: getFrom File: src/main/java/dev/hypera/dragonfly/relocation/Relocation.java Repository: HyperaDev/Dragonfly Fixed Code: public @NotNull String getFrom() { return from; }
[ "CWE-611" ]
CVE-2022-41967
HIGH
7.5
HyperaDev/Dragonfly
getFrom
src/main/java/dev/hypera/dragonfly/relocation/Relocation.java
9661375e1135127ca6cdb5712e978bec33cc06b3
1
Analyze the following code function for security vulnerabilities
@Override public List<String> getUserControlDisabledPackages(ComponentName who, String callerPackageName) { CallerIdentity caller; if (isPolicyEngineForFinanceFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); } if (isPolicyEngineForFinanceFlagEnabled()) { enforceCanQuery( MANAGE_DEVICE_POLICY_APPS_CONTROL, caller.getPackageName(), caller.getUserId()); // This retrieves the policy for the calling user only, DOs for example can't know // what's enforced globally or on another user. Set<String> packages = mDevicePolicyEngine.getResolvedPolicy( PolicyDefinition.USER_CONTROLLED_DISABLED_PACKAGES, caller.getUserId()); return packages == null ? Collections.emptyList() : packages.stream().toList(); } else { Objects.requireNonNull(who, "ComponentName is null"); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller) || isProfileOwner(caller) || isFinancedDeviceOwner(caller)); synchronized (getLockObject()) { ActiveAdmin admin = getDeviceOrProfileOwnerAdminLocked(caller.getUserId()); return admin.protectedPackages != null ? admin.protectedPackages : Collections.emptyList(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserControlDisabledPackages File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getUserControlDisabledPackages
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ProfileParameter other = (ProfileParameter) obj; return Objects.equals(name, other.name) && Objects.equals(value, other.value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileParameter.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
equals
base/common/src/main/java/com/netscape/certsrv/profile/ProfileParameter.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public int getUidForIntentSender(IIntentSender sender) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(sender.asBinder()); mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); reply.readException(); int res = reply.readInt(); data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUidForIntentSender File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getUidForIntentSender
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private void dumpActivityContainersLocked(PrintWriter pw) { pw.println("ACTIVITY MANAGER STARTER (dumpsys activity containers)"); mStackSupervisor.dumpChildrenNames(pw, " "); pw.println(" "); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpActivityContainersLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
dumpActivityContainersLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static File getRevisionFile(AbstractBuild build) { return new File(build.getRootDir(),"revision.txt"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRevisionFile 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
getRevisionFile
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Nullable public String getToken() { return token; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getToken File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getToken
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@Override public int getCurrentTtyMode(String callingPackage) { if (!canReadPhoneState(callingPackage, "getCurrentTtyMode")) { return TelecomManager.TTY_MODE_OFF; } synchronized (mLock) { return mCallsManager.getCurrentTtyMode(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentTtyMode 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
getCurrentTtyMode
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
public <T> void get(String table, Class<T> clazz, CQLWrapper filter, boolean returnCount, boolean setId, List<FacetField> facets, Handler<AsyncResult<Results<T>>> replyHandler) { get(table, clazz, new String[]{DEFAULT_JSONB_FIELD_NAME}, filter, returnCount, setId, facets, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
get
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
protected VaadinSession getExistingSession(VaadinRequest request, boolean allowSessionCreation) throws SessionExpiredException { final WrappedSession session = getWrappedSession(request, allowSessionCreation); VaadinSession vaadinSession = loadSession(session); if (vaadinSession == null) { return null; } return vaadinSession; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExistingSession File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
getExistingSession
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
@Test public void detectsAliasInQueryContainingLineBreaks() { assertThat(detectAlias("select \n u \n from \n User \nu"), is("u")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: detectsAliasInQueryContainingLineBreaks File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
detectsAliasInQueryContainingLineBreaks
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
public void setAlwaysFinish(boolean enabled) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAlwaysFinish File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setAlwaysFinish
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void onConnected(Bundle bundle) { locationRequest = LocationRequest.create(); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(1000); // Update location every second setLocationManagerStatus(AVAILABLE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onConnected File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onConnected
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ByteArray)) { return false; } ByteArray other = (ByteArray) obj; if (hashCode() != other.hashCode()) { return false; } if (!Arrays.equals(mArray, other.mArray)) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
equals
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
public String getUsername() { return userName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUsername File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
getUsername
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
@LargeTest @Test public void testOutgoingVideoCallAnsweredAsAudio() throws Exception { IdPair ids = startOutgoingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA, Process.myUserHandle(), VideoProfile.STATE_BIDIRECTIONAL); com.android.server.telecom.Call call = mTelecomSystem.getCallsManager().getCalls() .iterator().next(); mConnectionServiceFixtureA.mConnectionById.get(ids.mConnectionId).videoState = VideoProfile.STATE_AUDIO_ONLY; mConnectionServiceFixtureA.sendSetVideoState(ids.mConnectionId); mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId); assertFalse(VideoProfile.isVideo(call.getVideoStateHistory())); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21283 - Severity: MEDIUM - CVSS Score: 5.5 Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634 Fixes: 285211549 Fixes: 280797684 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15) Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Function: testOutgoingVideoCallAnsweredAsAudio File: tests/src/com/android/server/telecom/tests/VideoCallTests.java Repository: android Fixed Code: @LargeTest @Test public void testOutgoingVideoCallAnsweredAsAudio() throws Exception { IdPair ids = startOutgoingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA, Process.myUserHandle(), VideoProfile.STATE_BIDIRECTIONAL, null); com.android.server.telecom.Call call = mTelecomSystem.getCallsManager().getCalls() .iterator().next(); mConnectionServiceFixtureA.mConnectionById.get(ids.mConnectionId).videoState = VideoProfile.STATE_AUDIO_ONLY; mConnectionServiceFixtureA.sendSetVideoState(ids.mConnectionId); mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId); assertFalse(VideoProfile.isVideo(call.getVideoStateHistory())); }
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testOutgoingVideoCallAnsweredAsAudio
tests/src/com/android/server/telecom/tests/VideoCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
1
Analyze the following code function for security vulnerabilities
public void setSupportJaxbElementClass(boolean supportJaxbElementClass) { this.supportJaxbElementClass = supportJaxbElementClass; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSupportJaxbElementClass File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
setSupportJaxbElementClass
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting void handleAccept(@NonNull String ssid) { if (!isConnectionValid(ssid)) return; if (!useTrustOnFirstUse()) { mWifiConfigManager.setUserApproveNoCaCert(mCurrentTofuConfig.networkId, true); } else { if (null == mPendingRootCaCert || null == mPendingServerCert) { handleError(ssid); return; } if (!mWifiConfigManager.updateCaCertificate( mCurrentTofuConfig.networkId, mPendingRootCaCert, mPendingServerCert)) { // The user approved this network, // keep the connection regardless of the result. Log.e(TAG, "Cannot update CA cert to network " + mCurrentTofuConfig.getProfileKey() + ", CA cert = " + mPendingRootCaCert); } } mWifiConfigManager.updateNetworkSelectionStatus(mCurrentTofuConfig.networkId, WifiConfiguration.NetworkSelectionStatus.DISABLED_NONE); dismissDialogAndNotification(); clearInternalData(); if (null != mCallbacks) mCallbacks.onAccept(ssid); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21242 - Severity: CRITICAL - CVSS Score: 9.8 Description: [TOFU] Validate full cert chains before displaying dialog When a full chain including a Root CA is provided by the server, perform a full validation of the chain before displaying the TOFU dialog. If validation passes: Display a TOFU dialog and ask the user if they trust this network. Saying yes means that the Root can be installed safely for that network. They might say no - this is possible if an attacker creates a full chain they control which results in a different SHA-256 (everything else looks correct). If they say no, we stop the connection. If validation fails: Display an error message saying that the validation failed, we stop the connection and won't display the TOFU dialog. Use server certificate pinning for servers that send only a leaf or a partial chain with no Root CA. Additionally: clean up the debug logs to reduce the noise and focus only on the important details. Bug: 277824547 Test: atest InsecureEapNetworkHandler Test: Connect to various Enterprise networks Negative test: Confirm verification fails for invalid chains (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b0ee00ddf38bb677876a6cffb876e6f511e2c139) Merged-In: I224c80e2787497634d3e68760122dac5f177585a Change-Id: I224c80e2787497634d3e68760122dac5f177585a Function: handleAccept File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java Repository: android Fixed Code: @VisibleForTesting void handleAccept(@NonNull String ssid) { if (!isConnectionValid(ssid)) return; if (!useTrustOnFirstUse()) { mWifiConfigManager.setUserApproveNoCaCert(mCurrentTofuConfig.networkId, true); } else { if (null == mPendingRootCaCert || null == mPendingServerCert) { handleError(ssid); return; } if (!mWifiConfigManager.updateCaCertificate( mCurrentTofuConfig.networkId, mPendingRootCaCert, mPendingServerCert, mServerCertHash)) { // The user approved this network, // keep the connection regardless of the result. Log.e(TAG, "Cannot update CA cert to network " + mCurrentTofuConfig.getProfileKey() + ", CA cert = " + mPendingRootCaCert); } } int networkId = mCurrentTofuConfig.networkId; mWifiConfigManager.updateNetworkSelectionStatus(networkId, WifiConfiguration.NetworkSelectionStatus.DISABLED_NONE); dismissDialogAndNotification(); clearInternalData(); if (null != mCallbacks) mCallbacks.onAccept(ssid, networkId); }
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
handleAccept
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
72e903f258b5040b8f492cf18edd124b5a1ac770
1
Analyze the following code function for security vulnerabilities
public void savePolicyFile() { mHandler.removeMessages(MESSAGE_SAVE_POLICY_FILE); mHandler.sendEmptyMessage(MESSAGE_SAVE_POLICY_FILE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: savePolicyFile File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
savePolicyFile
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(token); data.writeInt(resultCode); if (resultData != null) { data.writeInt(1); resultData.writeToParcel(data, 0); } else { data.writeInt(0); } data.writeInt(finishTask ? 1 : 0); mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); reply.readException(); boolean res = reply.readInt() != 0; data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishActivity File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
finishActivity
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage @RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN) public void reportSuccessfulPasswordAttempt(int userHandle) { if (mService != null) { try { mService.reportSuccessfulPasswordAttempt(userHandle); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportSuccessfulPasswordAttempt 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
reportSuccessfulPasswordAttempt
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Test (expected = IllegalArgumentException.class) public void parseQueryMTypeWGroupByFilterMissingEquals() throws Exception { HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&m=sum:sys.cpu.0{host=wildcard(*tsort)}" + "{hostwildcard(*quirm)}"); parseQuery.invoke(rpc, tsdb, query, expressions); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseQueryMTypeWGroupByFilterMissingEquals File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
parseQueryMTypeWGroupByFilterMissingEquals
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
private void recordSecurityLogRetrievalTime() { synchronized (getLockObject()) { final long currentTime = System.currentTimeMillis(); DevicePolicyData policyData = getUserData(UserHandle.USER_SYSTEM); if (currentTime > policyData.mLastSecurityLogRetrievalTime) { policyData.mLastSecurityLogRetrievalTime = currentTime; saveSettingsLocked(UserHandle.USER_SYSTEM); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: recordSecurityLogRetrievalTime 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
recordSecurityLogRetrievalTime
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void dispatchBootCompleted() { mHandler.sendEmptyMessage(MSG_BOOT_COMPLETED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchBootCompleted File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
dispatchBootCompleted
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public static String[] translateCommandline( String toProcess ) throws Exception { return CommandLineUtils.translateCommandline( toProcess ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: translateCommandline File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
translateCommandline
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
@Override @SuppressWarnings("FinalizeDeclaration") protected void finalize() throws Throwable { super.finalize(); // Call shutdown as the user may have created the OpenSslEngine and not used it at all. shutdown(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finalize File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
finalize
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
public void setText(String text) { this.text = text; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setText File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setText
base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
protected void internalRevokePermissionsOnTopic(String role) { // This operation should be reading from zookeeper and it should be allowed without having admin privileges validateAdminAccessForTenant(namespaceName.getTenant()); validatePoliciesReadOnlyAccess(); PartitionedTopicMetadata meta = getPartitionedTopicMetadata(topicName, true, false); int numPartitions = meta.partitions; if (numPartitions > 0) { for (int i = 0; i < numPartitions; i++) { TopicName topicNamePartition = topicName.getPartition(i); revokePermissions(topicNamePartition.toString(), role); } } revokePermissions(topicName.toString(), role); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalRevokePermissionsOnTopic File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalRevokePermissionsOnTopic
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder e(String name);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: e File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
e
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private void rebuildAppWindowListLocked(final DisplayContent displayContent) { final WindowList windows = displayContent.getWindowList(); int NW = windows.size(); int i; int lastBelow = -1; int numRemoved = 0; if (mRebuildTmp.length < NW) { mRebuildTmp = new WindowState[NW+10]; } // First remove all existing app windows. i=0; while (i < NW) { WindowState w = windows.get(i); if (w.mAppToken != null) { WindowState win = windows.remove(i); win.mRebuilding = true; mRebuildTmp[numRemoved] = win; mWindowsChanged = true; if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Rebuild removing window: " + win); NW--; numRemoved++; continue; } else if (lastBelow == i-1) { if (w.mAttrs.type == TYPE_WALLPAPER) { lastBelow = i; } } i++; } // Keep whatever windows were below the app windows still below, // by skipping them. lastBelow++; i = lastBelow; // First add all of the exiting app tokens... these are no longer // in the main app list, but still have windows shown. We put them // in the back because now that the animation is over we no longer // will care about them. final ArrayList<TaskStack> stacks = displayContent.getStacks(); final int numStacks = stacks.size(); for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) { AppTokenList exitingAppTokens = stacks.get(stackNdx).mExitingAppTokens; int NT = exitingAppTokens.size(); for (int j = 0; j < NT; j++) { i = reAddAppWindowsLocked(displayContent, i, exitingAppTokens.get(j)); } } // And add in the still active app tokens in Z order. for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) { final ArrayList<Task> tasks = stacks.get(stackNdx).getTasks(); final int numTasks = tasks.size(); for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) { final AppTokenList tokens = tasks.get(taskNdx).mAppTokens; final int numTokens = tokens.size(); for (int tokenNdx = 0; tokenNdx < numTokens; ++tokenNdx) { final AppWindowToken wtoken = tokens.get(tokenNdx); if (wtoken.mIsExiting) { continue; } i = reAddAppWindowsLocked(displayContent, i, wtoken); } } } i -= lastBelow; if (i != numRemoved) { displayContent.layoutNeeded = true; Slog.w(TAG, "On display=" + displayContent.getDisplayId() + " Rebuild removed " + numRemoved + " windows but added " + i, new RuntimeException("here").fillInStackTrace()); for (i=0; i<numRemoved; i++) { WindowState ws = mRebuildTmp[i]; if (ws.mRebuilding) { StringWriter sw = new StringWriter(); PrintWriter pw = new FastPrintWriter(sw, false, 1024); ws.dump(pw, "", true); pw.flush(); Slog.w(TAG, "This window was lost: " + ws); Slog.w(TAG, sw.toString()); ws.mWinAnimator.destroySurfaceLocked(); } } Slog.w(TAG, "Current app token list:"); dumpAppTokensLocked(); Slog.w(TAG, "Final window list:"); dumpWindowsLocked(); } Arrays.fill(mRebuildTmp, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rebuildAppWindowListLocked 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
rebuildAppWindowListLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setUsername(username); return this; } } throw new RuntimeException("No HTTP basic authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUsername File: samples/client/petstore/java/okhttp-gson/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
setUsername
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void writeByte(byte b) throws TException { writeByteDirect(b); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeByte File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
writeByte
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
protected void addLocationItem(XMLAttributes attributes, int index) { fEndLineNumber = fCurrentEntity.getLineNumber(); fEndColumnNumber = fCurrentEntity.getColumnNumber(); fEndCharacterOffset = fCurrentEntity.getCharacterOffset(); LocationItem locationItem = new LocationItem(); locationItem.setValues(fBeginLineNumber, fBeginColumnNumber, fBeginCharacterOffset, fEndLineNumber, fEndColumnNumber, fEndCharacterOffset); Augmentations augs = attributes.getAugmentations(index); augs.putItem(AUGMENTATIONS, locationItem); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addLocationItem 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
addLocationItem
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@Override public void onPostDialWait(String callId, String remaining, Session.Info sessionInfo) throws RemoteException { Log.startSession(sessionInfo, "CSW.oPDW", mPackageAbbreviation); long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { logIncoming("onPostDialWait %s %s", callId, remaining); Call call = mCallIdMapper.getCall(callId); if (call != null) { call.onPostDialWait(remaining); } else { // Log.w(this, "onPostDialWait, unknown call id: %s", args.arg1); } } } catch (Throwable t) { Log.e(ConnectionServiceWrapper.this, t, ""); throw t; } finally { Binder.restoreCallingIdentity(token); Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPostDialWait File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
onPostDialWait
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
boolean getDeferHidingClient() { return mDeferHidingClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeferHidingClient File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
getDeferHidingClient
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static boolean validatePassword(String password, boolean isAdd, boolean isSae) { if (isAdd) { if (password == null) { Log.e(TAG, "validatePassword: null string"); return false; } } else { if (password == null) { // This is an update, so the psk can be null if that is not being changed. return true; } else if (password.equals(PASSWORD_MASK)) { // This is an update, so the app might have returned back the masked password, let // it thru. WifiConfigManager will handle it. return true; } } if (password.isEmpty()) { Log.e(TAG, "validatePassword failed: empty string"); return false; } if (password.startsWith("\"")) { // ASCII PSK string byte[] passwordBytes = password.getBytes(StandardCharsets.US_ASCII); int targetMinLength; if (isSae) { targetMinLength = SAE_ASCII_MIN_LEN; } else { targetMinLength = PSK_ASCII_MIN_LEN; } if (passwordBytes.length < targetMinLength) { Log.e(TAG, "validatePassword failed: ASCII string size too small: " + passwordBytes.length); return false; } if (passwordBytes.length > PSK_SAE_ASCII_MAX_LEN) { Log.e(TAG, "validatePassword failed: ASCII string size too large: " + passwordBytes.length); return false; } } else { // HEX PSK string if (password.length() != PSK_SAE_HEX_LEN) { Log.e(TAG, "validatePassword failed: hex string size mismatch: " + password.length()); return false; } } try { NativeUtil.hexOrQuotedStringToBytes(password); } catch (IllegalArgumentException e) { Log.e(TAG, "validatePassword failed: malformed string: " + password); return false; } return true; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21252 - Severity: MEDIUM - CVSS Score: 5.5 Description: Update password check for WAPI Do not allow arbitrarily large passwords. Bug: 275339978 Test: compile (cherry picked from commit 38707fb4ff1405663cc24affc95244f4cc830499) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:36deae20de1a8905e6cc72764e449b2d6e469f9e) Merged-In: I15f3aff373af56c253a50c308d886a7acf661e59 Change-Id: I15f3aff373af56c253a50c308d886a7acf661e59 Function: validatePassword File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android Fixed Code: private static boolean validatePassword(String password, boolean isAdd, boolean isSae, boolean isWapi) { if (isAdd) { if (password == null) { Log.e(TAG, "validatePassword: null string"); return false; } } else { if (password == null) { // This is an update, so the psk can be null if that is not being changed. return true; } else if (password.equals(PASSWORD_MASK)) { // This is an update, so the app might have returned back the masked password, let // it thru. WifiConfigManager will handle it. return true; } } if (password.isEmpty()) { Log.e(TAG, "validatePassword failed: empty string"); return false; } if (password.startsWith("\"")) { // ASCII PSK string byte[] passwordBytes = password.getBytes(StandardCharsets.US_ASCII); int targetMinLength; if (isSae) { targetMinLength = SAE_ASCII_MIN_LEN; } else { targetMinLength = PSK_ASCII_MIN_LEN; } if (passwordBytes.length < targetMinLength) { Log.e(TAG, "validatePassword failed: ASCII string size too small: " + passwordBytes.length); return false; } if (passwordBytes.length > PSK_SAE_ASCII_MAX_LEN) { Log.e(TAG, "validatePassword failed: ASCII string size too large: " + passwordBytes.length); return false; } } else { // HEX PSK string if (isWapi) { // Protect system against malicious actors injecting arbitrarily large passwords. if (password.length() > 100) { Log.e(TAG, "validatePassword failed: WAPI hex string too long: " + password.length()); return false; } } else if (password.length() != PSK_SAE_HEX_LEN) { Log.e(TAG, "validatePassword failed: hex string size mismatch: " + password.length()); return false; } } try { NativeUtil.hexOrQuotedStringToBytes(password); } catch (IllegalArgumentException e) { Log.e(TAG, "validatePassword failed: malformed string: " + password); return false; } return true; }
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
validatePassword
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
1
Analyze the following code function for security vulnerabilities
private JWT decode(String encodedJWT, Header header, String[] parts, Verifier verifier) { int index = encodedJWT.lastIndexOf("."); // The message comprises the first two segments of the entire JWT, the signature is the last segment. byte[] message = encodedJWT.substring(0, index).getBytes(StandardCharsets.UTF_8); // If a signature is provided and verifier must be provided. if (parts.length == 3 && verifier == null) { throw new MissingVerifierException("No Verifier has been provided for verify a signature signed using [" + header.algorithm.getName() + "]"); } // A verifier was provided but no signature exists, this is treated as an invalid signature. if (parts.length == 2 && verifier != null) { throw new InvalidJWTSignatureException(); } if (parts.length == 3) { // Verify the signature before de-serializing the payload. byte[] signature = base64Decode(parts[2].getBytes(StandardCharsets.UTF_8)); verifier.verify(header.algorithm, message, signature); } JWT jwt = Mapper.deserialize(base64Decode(parts[1].getBytes(StandardCharsets.UTF_8)), JWT.class); // Verify expiration claim if (jwt.isExpired()) { throw new JWTExpiredException(); } // Verify the notBefore claim if (jwt.isUnavailableForProcessing()) { throw new JWTUnavailableForProcessingException(); } return jwt; }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2018-1000531 - Severity: MEDIUM - CVSS Score: 5.0 Description: Fixing issue #3 and adding tests to confirm. Function: decode File: src/main/java/org/primeframework/jwt/JWTDecoder.java Repository: FusionAuth/fusionauth-jwt Fixed Code: private JWT decode(String encodedJWT, Header header, String[] parts, Verifier verifier) { // The callers of this decode will have already handled 'none' if it was deemed to be valid based upon // the provided verifiers. At this point, if we have a 'none' algorithm specified in the header, it is invalid. if (header.algorithm == Algorithm.none) { throw new MissingVerifierException("No Verifier has been provided for verify a signature signed using [" + header.algorithm.getName() + "]"); } // If a signature is provided and verifier must be provided. if (parts.length == 3 && verifier == null) { throw new MissingVerifierException("No Verifier has been provided for verify a signature signed using [" + header.algorithm.getName() + "]"); } // A verifier was provided but no signature exists, this is treated as an invalid signature. if (parts.length == 2 && verifier != null) { throw new InvalidJWTSignatureException(); } int index = encodedJWT.lastIndexOf("."); // The message comprises the first two segments of the entire JWT, the signature is the last segment. byte[] message = encodedJWT.substring(0, index).getBytes(StandardCharsets.UTF_8); if (parts.length == 3) { // Verify the signature before de-serializing the payload. byte[] signature = base64Decode(parts[2].getBytes(StandardCharsets.UTF_8)); verifier.verify(header.algorithm, message, signature); } JWT jwt = Mapper.deserialize(base64Decode(parts[1].getBytes(StandardCharsets.UTF_8)), JWT.class); // Verify expiration claim if (jwt.isExpired()) { throw new JWTExpiredException(); } // Verify the notBefore claim if (jwt.isUnavailableForProcessing()) { throw new JWTUnavailableForProcessingException(); } return jwt; }
[ "CWE-20" ]
CVE-2018-1000531
MEDIUM
5
FusionAuth/fusionauth-jwt
decode
src/main/java/org/primeframework/jwt/JWTDecoder.java
abb0d479389a2509f939452a6767dc424bb5e6ba
1
Analyze the following code function for security vulnerabilities
protected void serializeFieldsFiltered(Object bean, JsonGenerator gen, SerializerProvider provider) throws IOException, JsonGenerationException { /* note: almost verbatim copy of "serializeFields"; copied (instead of merged) * so that old method need not add check for existence of filter. */ final BeanPropertyWriter[] props; if (_filteredProps != null && provider.getActiveView() != null) { props = _filteredProps; } else { props = _props; } final PropertyFilter filter = findPropertyFilter(provider, _propertyFilterId, bean); // better also allow missing filter actually.. if (filter == null) { serializeFields(bean, gen, provider); return; } int i = 0; try { for (final int len = props.length; i < len; ++i) { BeanPropertyWriter prop = props[i]; if (prop != null) { // can have nulls in filtered list filter.serializeAsField(bean, gen, provider, prop); } } if (_anyGetterWriter != null) { _anyGetterWriter.getAndFilter(bean, gen, provider, filter); } } catch (Exception e) { String name = (i == props.length) ? "[anySetter]" : props[i].getName(); wrapAndThrow(provider, e, bean, name); } catch (StackOverflowError e) { // Minimize call depth since we are close to fail: //JsonMappingException mapE = JsonMappingException.from(gen, "Infinite recursion (StackOverflowError)", e); JsonMappingException mapE = new JsonMappingException(gen, "Infinite recursion (StackOverflowError)", e); String name = (i == props.length) ? "[anySetter]" : props[i].getName(); mapE.prependPath(new JsonMappingException.Reference(bean, name)); throw mapE; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serializeFieldsFiltered File: src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
serializeFieldsFiltered
src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public BufferedReader openBufferedReader() { if (isFileOk()) { try { return new BufferedReader(new FileReader(internal)); } catch (FileNotFoundException e) { Logme.error(e); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openBufferedReader File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
openBufferedReader
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public int maxRedirects() { return this.maxRedirects; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maxRedirects File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
maxRedirects
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
@Override public Object getField(Descriptors.FieldDescriptor field) { return extensions.getField(field); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getField File: java/core/src/main/java/com/google/protobuf/MessageReflection.java Repository: protocolbuffers/protobuf The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-3509
HIGH
7.5
protocolbuffers/protobuf
getField
java/core/src/main/java/com/google/protobuf/MessageReflection.java
a3888f53317a8018e7a439bac4abeb8f3425d5e9
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setFullName(String name) { setFullName(name, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFullName File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setFullName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
boolean isOnDeviceIdleWhitelistLocked(int uid, boolean allowExceptIdleToo) { final int appId = UserHandle.getAppId(uid); final int[] whitelist = allowExceptIdleToo ? mDeviceIdleExceptIdleWhitelist : mDeviceIdleWhitelist; return Arrays.binarySearch(whitelist, appId) >= 0 || Arrays.binarySearch(mDeviceIdleTempWhitelist, appId) >= 0 || mPendingTempWhitelist.indexOfKey(uid) >= 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOnDeviceIdleWhitelistLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
isOnDeviceIdleWhitelistLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public boolean isUpgrade() { return mIsUpgrade; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUpgrade File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
isUpgrade
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public boolean isHostAccessingProvider(Host host, Provider provider, int uid, String packageName) { // The host creates a package context to bind to remote views service in the provider. return host.id.uid == uid && provider != null && provider.id.componentName.getPackageName().equals(packageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isHostAccessingProvider 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
isHostAccessingProvider
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public int stopUser(final int userId, boolean force, final IStopUserCallback callback) { return mUserController.stopUser(userId, force, callback); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopUser File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
stopUser
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public String getX() { return "y"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getX File: src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-787" ]
CVE-2020-36518
MEDIUM
5
FasterXML/jackson-databind
getX
src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java
8238ab41d0350fb915797c89d46777b4496b74fd
0
Analyze the following code function for security vulnerabilities
public String getURL(EntityReference reference) { return getURL(reference, "view", ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getURL
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public static void safeSwingCall(@Nonnull final Runnable runnable) { if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeLater(runnable); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: safeSwingCall File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java Repository: raydac/netbeans-mmd-plugin The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000542
MEDIUM
6.8
raydac/netbeans-mmd-plugin
safeSwingCall
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
9fba652bf06e649186b8f9e612d60e9cc15097e9
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setComparator( SerializableComparator<T> comparator) { Objects.requireNonNull(comparator, "Comparator can't be null"); this.comparator = comparator; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setComparator 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
setComparator
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public void setDefaultTotalMode(SearchTotalModeEnum theDefaultTotalMode) { myDefaultTotalMode = theDefaultTotalMode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultTotalMode 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
setDefaultTotalMode
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 final void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) { // Refuse possible leaked file descriptors if (intent != null && intent.hasFileDescriptors() == true) { throw new IllegalArgumentException("File descriptors passed in Intent"); } userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, ALLOW_NON_FULL, "removeStickyBroadcast", null); synchronized(this) { if (checkCallingPermission(android.Manifest.permission.BROADCAST_STICKY) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: unbroadcastIntent() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + android.Manifest.permission.BROADCAST_STICKY; Slog.w(TAG, msg); throw new SecurityException(msg); } ArrayMap<String, ArrayList<Intent>> stickies = mStickyBroadcasts.get(userId); if (stickies != null) { ArrayList<Intent> list = stickies.get(intent.getAction()); if (list != null) { int N = list.size(); int i; for (i=0; i<N; i++) { if (intent.filterEquals(list.get(i))) { list.remove(i); break; } } if (list.size() <= 0) { stickies.remove(intent.getAction()); } } if (stickies.size() <= 0) { mStickyBroadcasts.remove(userId); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unbroadcastIntent File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
unbroadcastIntent
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
static void dumpAll(Printer printer, boolean verbose) { for (SQLiteDatabase db : getActiveDatabases()) { db.dump(printer, verbose); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpAll 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
dumpAll
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
private void notifyListeners(@NonNull final String packageName, @UserIdInt final int userId) { if (DEBUG) { Slog.d(TAG, String.format( "Shortcut changes: package=%s, user=%d", packageName, userId)); } injectPostToHandler(notifyListenerRunnable(packageName, userId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyListeners 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
notifyListeners
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeContentProvider File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
removeContentProvider
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public String parameterToString(Object param) { if (param == null) { return ""; } else if (param instanceof Date) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } b.append(String.valueOf(o)); } return b.toString(); } else { return String.valueOf(param); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToString 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
parameterToString
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
public ArrayMap<String, String> getSharedLibraries() { return mSharedLibraries; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSharedLibraries File: services/core/java/com/android/server/SystemConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
getSharedLibraries
services/core/java/com/android/server/SystemConfig.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mPm.mInstallLock") private boolean checkNoAppStorageIsConsistent(AndroidPackage oldPkg, AndroidPackage newPkg) { if (oldPkg == null) { // New install, nothing to check against. return true; } final PackageManager.Property curProp = oldPkg.getProperties().get(PackageManager.PROPERTY_NO_APP_DATA_STORAGE); final PackageManager.Property newProp = newPkg.getProperties().get(PackageManager.PROPERTY_NO_APP_DATA_STORAGE); if (curProp == null || !curProp.getBoolean()) { return newProp == null || !newProp.getBoolean(); } return newProp != null && newProp.getBoolean(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkNoAppStorageIsConsistent File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
checkNoAppStorageIsConsistent
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public static Node getNode(Node node, Pattern... nodePath) { List<Node> nodes = getNodes(node, nodePath); if (nodes != null && nodes.size() > 0) { return nodes.get(0); } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNode File: src/edu/stanford/nlp/time/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3869
MEDIUM
5
stanfordnlp/CoreNLP
getNode
src/edu/stanford/nlp/time/XMLUtils.java
5d83f1e8482ca304db8be726cad89554c88f136a
0
Analyze the following code function for security vulnerabilities
protected Object deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt, Object bean) throws IOException { return _deserializeWithExternalTypeId(p, ctxt, bean, _externalTypeIdHandler.start()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserializeWithExternalTypeId File: src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42004
HIGH
7.5
FasterXML/jackson-databind
deserializeWithExternalTypeId
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
063183589218fec19a9293ed2f17ec53ea80ba88
0
Analyze the following code function for security vulnerabilities
static PermissionInfo generatePermissionInfo( BasePermission bp, int flags) { if (bp.perm != null) { return PackageParser.generatePermissionInfo(bp.perm, flags); } PermissionInfo pi = new PermissionInfo(); pi.name = bp.name; pi.packageName = bp.sourcePackage; pi.nonLocalizedLabel = bp.name; pi.protectionLevel = bp.protectionLevel; return pi; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generatePermissionInfo File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
generatePermissionInfo
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
protected abstract boolean requestCanCreateSession(VaadinRequest request);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestCanCreateSession File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
requestCanCreateSession
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
private boolean emergencyInfoActivityPresent() { Intent intent = new Intent(ACTION_EDIT_EMERGENCY_INFO).setPackage("com.android.emergency"); List<ResolveInfo> infos = getContext().getPackageManager().queryIntentActivities(intent, 0); if (infos == null || infos.isEmpty()) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: emergencyInfoActivityPresent File: src/com/android/settings/users/UserSettings.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
emergencyInfoActivityPresent
src/com/android/settings/users/UserSettings.java
bd5d5176c74021e8cf4970f93f273ba3023c3d72
0
Analyze the following code function for security vulnerabilities
@Override protected String getLocation() { return getServerAndPort(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocation File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
getLocation
config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
void performReceiveLocked(ProcessRecord app, IIntentReceiver receiver, Intent intent, int resultCode, String data, Bundle extras, boolean ordered, boolean sticky, int sendingUser) throws RemoteException { // Send the intent to the receiver asynchronously using one-way binder calls. if (app != null) { if (app.thread != null) { // If we have an app thread, do the call through that so it is // correctly ordered with other one-way calls. try { app.thread.scheduleRegisteredReceiver(receiver, intent, resultCode, data, extras, ordered, sticky, sendingUser, app.repProcState); // TODO: Uncomment this when (b/28322359) is fixed and we aren't getting // DeadObjectException when the process isn't actually dead. //} catch (DeadObjectException ex) { // Failed to call into the process. It's dying so just let it die and move on. // throw ex; } catch (RemoteException ex) { // Failed to call into the process. It's either dying or wedged. Kill it gently. synchronized (mService) { Slog.w(TAG, "Can't deliver broadcast to " + app.processName + " (pid " + app.pid + "). Crashing it."); app.scheduleCrash("can't deliver broadcast"); } throw ex; } } else { // Application has died. Receiver doesn't exist. throw new RemoteException("app.thread must not be null"); } } else { receiver.performReceive(intent, resultCode, data, extras, ordered, sticky, sendingUser); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performReceiveLocked File: services/core/java/com/android/server/am/BroadcastQueue.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
performReceiveLocked
services/core/java/com/android/server/am/BroadcastQueue.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0