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 boolean shouldRelaunchLocked(int changes, Configuration changesConfig) { int configChanged = info.getRealConfigChanged(); boolean onlyVrUiModeChanged = onlyVrUiModeChanged(changes, changesConfig); // Override for apps targeting pre-O sdks // If a device is in VR mode, and we're transitioning into VR ui mode, add ignore ui mode // to the config change. // For O and later, apps will be required to add configChanges="uimode" to their manifest. if (info.applicationInfo.targetSdkVersion < O && requestedVrComponent != null && onlyVrUiModeChanged) { configChanged |= CONFIG_UI_MODE; } return (changes&(~configChanged)) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldRelaunchLocked 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
shouldRelaunchLocked
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@NonNull public BigPictureStyle bigLargeIcon(@Nullable Bitmap b) { return bigLargeIcon(b != null ? Icon.createWithBitmap(b) : null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bigLargeIcon File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
bigLargeIcon
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private void cleanUpActivityServices() { if (mServiceConnectionsHolder == null) { return; } // Throw away any services that have been bound by this activity. mServiceConnectionsHolder.disconnectActivityFromServices(); // This activity record is removing, make sure not to disconnect twice. mServiceConnectionsHolder = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanUpActivityServices 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
cleanUpActivityServices
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public final int startActivityFromRecents(int taskId, Bundle options) { if (checkCallingPermission(START_TASKS_FROM_RECENTS) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: startActivityFromRecents called without " + START_TASKS_FROM_RECENTS; Slog.w(TAG, msg); throw new SecurityException(msg); } return startActivityFromRecentsInner(taskId, options); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityFromRecents File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
startActivityFromRecents
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void setPowerButtonInstantlyLocks(boolean enabled, int userId) { setBoolean(LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS, enabled, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPowerButtonInstantlyLocks File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
setPowerButtonInstantlyLocks
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") int checkGrantUriPermissionLocked(int callingUid, String targetPkg, GrantUri grantUri, final int modeFlags, int lastTargetUid) { if (!Intent.isAccessUriMode(modeFlags)) { return -1; } if (targetPkg != null) { if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Checking grant " + targetPkg + " permission to " + grantUri); } final IPackageManager pm = AppGlobals.getPackageManager(); // If this is not a content: uri, we can't do anything with it. if (!ContentResolver.SCHEME_CONTENT.equals(grantUri.uri.getScheme())) { if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Can't grant URI permission for non-content URI: " + grantUri); return -1; } // Bail early if system is trying to hand out permissions directly; it // must always grant permissions on behalf of someone explicit. final int callingAppId = UserHandle.getAppId(callingUid); if ((callingAppId == SYSTEM_UID) || (callingAppId == ROOT_UID)) { if ("com.android.settings.files".equals(grantUri.uri.getAuthority())) { // Exempted authority for // 1. cropping user photos and sharing a generated license html // file in Settings app // 2. sharing a generated license html file in TvSettings app } else { Slog.w(TAG, "For security reasons, the system cannot issue a Uri permission" + " grant to " + grantUri + "; use startActivityAsCaller() instead"); return -1; } } final String authority = grantUri.uri.getAuthority(); final ProviderInfo pi = getProviderInfoLocked(authority, grantUri.sourceUserId, MATCH_DEBUG_TRIAGED_MISSING); if (pi == null) { Slog.w(TAG, "No content provider found for permission check: " + grantUri.uri.toSafeString()); return -1; } int targetUid = lastTargetUid; if (targetUid < 0 && targetPkg != null) { try { targetUid = pm.getPackageUid(targetPkg, MATCH_DEBUG_TRIAGED_MISSING, UserHandle.getUserId(callingUid)); if (targetUid < 0) { if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Can't grant URI permission no uid for: " + targetPkg); return -1; } } catch (RemoteException ex) { return -1; } } // If we're extending a persistable grant, then we always need to create // the grant data structure so that take/release APIs work if ((modeFlags & Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) != 0) { return targetUid; } if (targetUid >= 0) { // First... does the target actually need this permission? if (checkHoldingPermissionsLocked(pm, pi, grantUri, targetUid, modeFlags)) { // No need to grant the target this permission. if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Target " + targetPkg + " already has full permission to " + grantUri); return -1; } } else { // First... there is no target package, so can anyone access it? boolean allowed = pi.exported; if ((modeFlags&Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) { if (pi.readPermission != null) { allowed = false; } } if ((modeFlags&Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) { if (pi.writePermission != null) { allowed = false; } } if (pi.pathPermissions != null) { final int N = pi.pathPermissions.length; for (int i=0; i<N; i++) { if (pi.pathPermissions[i] != null && pi.pathPermissions[i].match(grantUri.uri.getPath())) { if ((modeFlags&Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) { if (pi.pathPermissions[i].getReadPermission() != null) { allowed = false; } } if ((modeFlags&Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) { if (pi.pathPermissions[i].getWritePermission() != null) { allowed = false; } } break; } } } if (allowed) { return -1; } } /* There is a special cross user grant if: * - The target is on another user. * - Apps on the current user can access the uri without any uid permissions. * In this case, we grant a uri permission, even if the ContentProvider does not normally * grant uri permissions. */ boolean specialCrossUserGrant = UserHandle.getUserId(targetUid) != grantUri.sourceUserId && checkHoldingPermissionsInternalLocked(pm, pi, grantUri, callingUid, modeFlags, false /*without considering the uid permissions*/); // Second... is the provider allowing granting of URI permissions? if (!specialCrossUserGrant) { if (!pi.grantUriPermissions) { throw new SecurityException("Provider " + pi.packageName + "/" + pi.name + " does not allow granting of Uri permissions (uri " + grantUri + ")"); } if (pi.uriPermissionPatterns != null) { final int N = pi.uriPermissionPatterns.length; boolean allowed = false; for (int i=0; i<N; i++) { if (pi.uriPermissionPatterns[i] != null && pi.uriPermissionPatterns[i].match(grantUri.uri.getPath())) { allowed = true; break; } } if (!allowed) { throw new SecurityException("Provider " + pi.packageName + "/" + pi.name + " does not allow granting of permission to path of Uri " + grantUri); } } } // Third... does the caller itself have permission to access // this uri? if (!checkHoldingPermissionsLocked(pm, pi, grantUri, callingUid, modeFlags)) { // Require they hold a strong enough Uri permission if (!checkUriPermissionLocked(grantUri, callingUid, modeFlags)) { if (android.Manifest.permission.MANAGE_DOCUMENTS.equals(pi.readPermission)) { throw new SecurityException( "UID " + callingUid + " does not have permission to " + grantUri + "; you could obtain access using ACTION_OPEN_DOCUMENT " + "or related APIs"); } else { throw new SecurityException( "UID " + callingUid + " does not have permission to " + grantUri); } } } return targetUid; }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2018-9492 - Severity: HIGH - CVSS Score: 7.2 Description: DO NOT MERGE. Persistable Uri grants still require permissions. When FLAG_GRANT_PERSISTABLE_URI_PERMISSION is requested, we still need to check permissions between the source and target packages, instead of shortcutting past them. The spirit of the original change is remains intact: if the caller requested FLAG_GRANT_PERSISTABLE_URI_PERMISSION, then we avoid returning "-1", which would prevent the grant data structure from being allocated. Bug: 111934948 Test: atest android.appsecurity.cts.AppSecurityTests Change-Id: Ief0fc922aa09fc3d9bb6a126c2ff5855347cd030 Merged-In: Ief0fc922aa09fc3d9bb6a126c2ff5855347cd030 (cherry picked from commit d6a6e7127cc341ca875d9d13cf7a864d9f20b479) Function: checkGrantUriPermissionLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android Fixed Code: @GuardedBy("this") int checkGrantUriPermissionLocked(int callingUid, String targetPkg, GrantUri grantUri, final int modeFlags, int lastTargetUid) { if (!Intent.isAccessUriMode(modeFlags)) { return -1; } if (targetPkg != null) { if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Checking grant " + targetPkg + " permission to " + grantUri); } final IPackageManager pm = AppGlobals.getPackageManager(); // If this is not a content: uri, we can't do anything with it. if (!ContentResolver.SCHEME_CONTENT.equals(grantUri.uri.getScheme())) { if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Can't grant URI permission for non-content URI: " + grantUri); return -1; } // Bail early if system is trying to hand out permissions directly; it // must always grant permissions on behalf of someone explicit. final int callingAppId = UserHandle.getAppId(callingUid); if ((callingAppId == SYSTEM_UID) || (callingAppId == ROOT_UID)) { if ("com.android.settings.files".equals(grantUri.uri.getAuthority())) { // Exempted authority for // 1. cropping user photos and sharing a generated license html // file in Settings app // 2. sharing a generated license html file in TvSettings app } else { Slog.w(TAG, "For security reasons, the system cannot issue a Uri permission" + " grant to " + grantUri + "; use startActivityAsCaller() instead"); return -1; } } final String authority = grantUri.uri.getAuthority(); final ProviderInfo pi = getProviderInfoLocked(authority, grantUri.sourceUserId, MATCH_DEBUG_TRIAGED_MISSING); if (pi == null) { Slog.w(TAG, "No content provider found for permission check: " + grantUri.uri.toSafeString()); return -1; } int targetUid = lastTargetUid; if (targetUid < 0 && targetPkg != null) { try { targetUid = pm.getPackageUid(targetPkg, MATCH_DEBUG_TRIAGED_MISSING, UserHandle.getUserId(callingUid)); if (targetUid < 0) { if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Can't grant URI permission no uid for: " + targetPkg); return -1; } } catch (RemoteException ex) { return -1; } } // Figure out the value returned when access is allowed final int allowedResult; if ((modeFlags & Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) != 0) { // If we're extending a persistable grant, then we need to return // "targetUid" so that we always create a grant data structure to // support take/release APIs allowedResult = targetUid; } else { // Otherwise, we can return "-1" to indicate that no grant data // structures need to be created allowedResult = -1; } if (targetUid >= 0) { // First... does the target actually need this permission? if (checkHoldingPermissionsLocked(pm, pi, grantUri, targetUid, modeFlags)) { // No need to grant the target this permission. if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Target " + targetPkg + " already has full permission to " + grantUri); return allowedResult; } } else { // First... there is no target package, so can anyone access it? boolean allowed = pi.exported; if ((modeFlags&Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) { if (pi.readPermission != null) { allowed = false; } } if ((modeFlags&Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) { if (pi.writePermission != null) { allowed = false; } } if (pi.pathPermissions != null) { final int N = pi.pathPermissions.length; for (int i=0; i<N; i++) { if (pi.pathPermissions[i] != null && pi.pathPermissions[i].match(grantUri.uri.getPath())) { if ((modeFlags&Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) { if (pi.pathPermissions[i].getReadPermission() != null) { allowed = false; } } if ((modeFlags&Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) { if (pi.pathPermissions[i].getWritePermission() != null) { allowed = false; } } break; } } } if (allowed) { return allowedResult; } } /* There is a special cross user grant if: * - The target is on another user. * - Apps on the current user can access the uri without any uid permissions. * In this case, we grant a uri permission, even if the ContentProvider does not normally * grant uri permissions. */ boolean specialCrossUserGrant = UserHandle.getUserId(targetUid) != grantUri.sourceUserId && checkHoldingPermissionsInternalLocked(pm, pi, grantUri, callingUid, modeFlags, false /*without considering the uid permissions*/); // Second... is the provider allowing granting of URI permissions? if (!specialCrossUserGrant) { if (!pi.grantUriPermissions) { throw new SecurityException("Provider " + pi.packageName + "/" + pi.name + " does not allow granting of Uri permissions (uri " + grantUri + ")"); } if (pi.uriPermissionPatterns != null) { final int N = pi.uriPermissionPatterns.length; boolean allowed = false; for (int i=0; i<N; i++) { if (pi.uriPermissionPatterns[i] != null && pi.uriPermissionPatterns[i].match(grantUri.uri.getPath())) { allowed = true; break; } } if (!allowed) { throw new SecurityException("Provider " + pi.packageName + "/" + pi.name + " does not allow granting of permission to path of Uri " + grantUri); } } } // Third... does the caller itself have permission to access // this uri? if (!checkHoldingPermissionsLocked(pm, pi, grantUri, callingUid, modeFlags)) { // Require they hold a strong enough Uri permission if (!checkUriPermissionLocked(grantUri, callingUid, modeFlags)) { if (android.Manifest.permission.MANAGE_DOCUMENTS.equals(pi.readPermission)) { throw new SecurityException( "UID " + callingUid + " does not have permission to " + grantUri + "; you could obtain access using ACTION_OPEN_DOCUMENT " + "or related APIs"); } else { throw new SecurityException( "UID " + callingUid + " does not have permission to " + grantUri); } } } return targetUid; }
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
checkGrantUriPermissionLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
1
Analyze the following code function for security vulnerabilities
void sendEndRestore() { if (mObserver != null) { try { mObserver.restoreFinished(mStatus); } catch (RemoteException e) { Slog.w(TAG, "Restore observer went away: endRestore"); mObserver = null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendEndRestore File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
sendEndRestore
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Override // since 2.9 public Boolean supportsUpdate(DeserializationConfig config) { // 21-Apr-2017, tatu: Bit tricky... some values, yes. So let's say "dunno" // 14-Jun-2017, tatu: Well, if merging blocked, can say no, as well. return _nonMerging ? Boolean.FALSE : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: supportsUpdate File: src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-787" ]
CVE-2020-36518
MEDIUM
5
FasterXML/jackson-databind
supportsUpdate
src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java
8238ab41d0350fb915797c89d46777b4496b74fd
0
Analyze the following code function for security vulnerabilities
private static UserFieldDTO[] getOrderedUserFieldDTO() { UserRegistrationAdminServiceStub stub; UserFieldDTO[] userFields = null; try { APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration(); String url = config.getFirstProperty(APIConstants.AUTH_MANAGER_URL); if (url == null) { handleException("API key manager URL unspecified"); } stub = new UserRegistrationAdminServiceStub(null, url + "UserRegistrationAdminService"); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); userFields = stub.readUserFieldsForUserRegistration(UserCoreConstants.DEFAULT_CARBON_DIALECT); Arrays.sort(userFields, new HostObjectUtils.RequiredUserFieldComparator()); Arrays.sort(userFields, new HostObjectUtils.UserFieldComparator()); } catch (Exception e) { log.error("Error while retrieving User registration Fields", e); } return userFields; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOrderedUserFieldDTO File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
getOrderedUserFieldDTO
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
Random current();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: current File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
current
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
protected Configuration getConfiguration() { return null; //TODO }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguration File: dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java Repository: ManyDesigns/Portofino The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-29451
MEDIUM
6.4
ManyDesigns/Portofino
getConfiguration
dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
0
Analyze the following code function for security vulnerabilities
WindowManager.LayoutParams getLayoutingAttrs(int rotation) { final WindowManager.LayoutParams[] paramsForRotation = mAttrs.paramsForRotation; if (paramsForRotation == null || paramsForRotation.length != 4 || paramsForRotation[rotation] == null) { return mAttrs; } return paramsForRotation[rotation]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLayoutingAttrs 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
getLayoutingAttrs
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public String[] getBccAddresses() { return getAddressesFromList(mBcc); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBccAddresses File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
getBccAddresses
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public static void verifyNoOtherSessionLocked(VaadinSession session) { if (isOtherSessionLocked(session)) { throw new IllegalStateException( "Can't access session while another session is locked by the same thread. This restriction is intended to help avoid deadlocks."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyNoOtherSessionLocked 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
verifyNoOtherSessionLocked
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
@Override protected DataCommunicatorState getState() { return (DataCommunicatorState) super.getState(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getState 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
getState
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
0
Analyze the following code function for security vulnerabilities
public void updateConfiguration(Configuration values) { enforceCallingPermission(android.Manifest.permission.CHANGE_CONFIGURATION, "updateConfiguration()"); synchronized(this) { if (values == null && mWindowManager != null) { // sentinel: fetch the current configuration from the window manager values = mWindowManager.computeNewConfiguration(); } if (mWindowManager != null) { mProcessList.applyDisplaySize(mWindowManager); } final long origId = Binder.clearCallingIdentity(); if (values != null) { Settings.System.clearConfiguration(values); } updateConfigurationLocked(values, null, false); Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateConfiguration File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
updateConfiguration
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@Test public void testDeserializationAsFloatEdgeCase02() throws Exception { String input = Instant.MIN.getEpochSecond() + ".0"; Instant value = MAPPER.readValue(input, Instant.class); assertEquals(value, Instant.MIN); assertEquals(Instant.MIN.getEpochSecond(), value.getEpochSecond()); assertEquals(0, value.getNano()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testDeserializationAsFloatEdgeCase02 File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testDeserializationAsFloatEdgeCase02
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
@Override public void setCurrentVolume(int volume) throws RemoteException { mCurrentVolume = volume; mHandler.post(MessageHandler.MSG_UPDATE_VOLUME); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCurrentVolume File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
setCurrentVolume
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
@Override public <T> List<T> search(String sql, int nb, int start, Object[][] whereParams, XWikiContext context) throws XWikiException { return search(sql, nb, start, whereParams, null, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: search File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
search
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public Pair<String, String> getProxyParameters(Proxy proxySpec, List<String> exclusionList) { InetSocketAddress sa = (InetSocketAddress) proxySpec.address(); String hostName = sa.getHostName(); int port = sa.getPort(); final List<String> trimmedExclList; if (exclusionList == null) { trimmedExclList = Collections.emptyList(); } else { trimmedExclList = new ArrayList<>(exclusionList.size()); for (String exclDomain : exclusionList) { trimmedExclList.add(exclDomain.trim()); } } final ProxyInfo info = ProxyInfo.buildDirectProxy(hostName, port, trimmedExclList); // The hostSpec is built assuming that there is a specified port and hostname, // but ProxyInfo.isValid() accepts 0 / empty as unspecified: also reject them. if (port == 0 || TextUtils.isEmpty(hostName) || !info.isValid()) { throw new IllegalArgumentException(); } return new Pair<>(hostName + ":" + port, TextUtils.join(",", trimmedExclList)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProxyParameters 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
getProxyParameters
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public Page<E> countColumn(String columnName) { this.countColumn = columnName; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: countColumn File: src/main/java/com/github/pagehelper/Page.java Repository: pagehelper/Mybatis-PageHelper The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-28111
HIGH
7.5
pagehelper/Mybatis-PageHelper
countColumn
src/main/java/com/github/pagehelper/Page.java
554a524af2d2b30d09505516adc412468a84d8fa
0
Analyze the following code function for security vulnerabilities
public static boolean addLegacyPasspointConfig(WifiConfiguration config) { if (sPasspointManager == null) { Log.e(TAG, "PasspointManager have not been initialized yet"); return false; } Log.d(TAG, "Installing legacy Passpoint configuration: " + config.FQDN); return sPasspointManager.addWifiConfig(config); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addLegacyPasspointConfig File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
addLegacyPasspointConfig
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
public boolean isLockTaskPermitted(String pkg) { throwIfParentInstance("isLockTaskPermitted"); if (mService != null) { try { return mService.isLockTaskPermitted(pkg); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLockTaskPermitted 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
isLockTaskPermitted
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void parseEquation(final Element input, boolean inRightOfPrevious, final XmlSerializer serializer) throws Exception { final List<Element> elements = XmlUtils.getElements(input, SM_TAG_MATH_EXPRESSION); final Element last = XmlUtils.removeLast(elements); if (last == null || last.getTextContent() == null) { return; } ExpressionProperties p = new ExpressionProperties(last); if (!p.isEqual(SM_TAG_MATH_OPERATOR, 2, ":")) { return; } final String term = FormulaBase.BaseType.EQUATION.toString().toLowerCase(Locale.ENGLISH); serializer.startTag(FormulaList.XML_NS, term); serializer.attribute(FormulaList.XML_NS, FormulaList.XML_PROP_INRIGHTOFPREVIOUS, Boolean.toString(inRightOfPrevious)); parseTerm("rightTerm", elements, serializer, false); parseTerm("leftTerm", elements, serializer, true); serializer.endTag(FormulaList.XML_NS, term); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseEquation File: app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java Repository: mkulesh/microMathematics The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000821
HIGH
7.5
mkulesh/microMathematics
parseEquation
app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
5c05ac8de16c569ff0a1816f20be235090d3dd9d
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public ContentViewClient getContentViewClient() { if (mContentViewClient == null) { // We use the Null Object pattern to avoid having to perform a null check in this class. // We create it lazily because most of the time a client will be set almost immediately // after ContentView is created. mContentViewClient = new ContentViewClient(); // We don't set the native ContentViewClient pointer here on purpose. The native // implementation doesn't mind a null delegate and using one is better than passing a // Null Object, since we cut down on the number of JNI calls. } return mContentViewClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentViewClient File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getContentViewClient
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
void stopFreezingScreenLocked(boolean force) { if (force || frozenBeforeDestroy) { frozenBeforeDestroy = false; if (getParent() == null) { return; } ProtoLog.v(WM_DEBUG_ORIENTATION, "Clear freezing of %s: visible=%b freezing=%b", token, isVisible(), isFreezingScreen()); stopFreezingScreen(true, force); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopFreezingScreenLocked 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
stopFreezingScreenLocked
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public void pushDynamicShortcut(String packageName, ShortcutInfo shortcut, @UserIdInt int userId) { verifyCaller(packageName, userId); verifyShortcutInfoPackage(packageName, shortcut); List<ShortcutInfo> changedShortcuts = new ArrayList<>(); List<ShortcutInfo> removedShortcuts = null; final ShortcutPackage ps; synchronized (mLock) { throwIfUserLockedL(userId); ps = getPackageShortcutsForPublisherLocked(packageName, userId); ps.ensureNotImmutable(shortcut.getId(), /*ignoreInvisible=*/ true); fillInDefaultActivity(Arrays.asList(shortcut)); if (!shortcut.hasRank()) { shortcut.setRank(0); } // Initialize the implicit ranks for ShortcutPackage.adjustRanks(). ps.clearAllImplicitRanks(); shortcut.setImplicitRank(0); // Validate the shortcut. fixUpIncomingShortcutInfo(shortcut, /* forUpdate= */ false); // When ranks are changing, we need to insert between ranks, so set the // "rank changed" flag. shortcut.setRankChanged(); // Push it. boolean deleted = ps.pushDynamicShortcut(shortcut, changedShortcuts); if (deleted) { if (changedShortcuts.isEmpty()) { return; // Failed to push. } removedShortcuts = Collections.singletonList(changedShortcuts.get(0)); changedShortcuts.clear(); } changedShortcuts.add(shortcut); // Lastly, adjust the ranks. ps.adjustRanks(); } packageShortcutsChanged(ps, changedShortcuts, removedShortcuts); reportShortcutUsedInternal(packageName, shortcut.getId(), userId); verifyStates(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pushDynamicShortcut 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
pushDynamicShortcut
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@GetMapping("/avatar") public String avatar(ModelMap mmap) { SysUser user = getSysUser(); mmap.put("user", userService.selectUserById(user.getUserId())); return prefix + "/avatar"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: avatar File: ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java Repository: yangzongzhuan/RuoYi The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-32065
LOW
3.5
yangzongzhuan/RuoYi
avatar
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
d8b2a9a905fb750fa60e2400238cf4750a77c5e6
0
Analyze the following code function for security vulnerabilities
public void setRowHeight(double rowHeight) { setBodyRowHeight(rowHeight); setHeaderRowHeight(rowHeight); setFooterRowHeight(rowHeight); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRowHeight 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
setRowHeight
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override protected void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { AlgorithmParameterSpec spec; if (params != null) { try { spec = params.getParameterSpec(IvParameterSpec.class); } catch (InvalidParameterSpecException e) { throw new InvalidAlgorithmParameterException( "Params must be convertible to IvParameterSpec", e); } } else { spec = null; } engineInit(opmode, key, spec, random); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineInit File: src/main/java/org/conscrypt/OpenSSLCipher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2461
HIGH
7.6
android
engineInit
src/main/java/org/conscrypt/OpenSSLCipher.java
1638945d4ed9403790962ec7abed1b7a232a9ff8
0
Analyze the following code function for security vulnerabilities
private int runInstallCreate() throws RemoteException { int userId = UserHandle.USER_ALL; String installerPackageName = null; final SessionParams params = new SessionParams(SessionParams.MODE_FULL_INSTALL); String opt; while ((opt = nextOption()) != null) { if (opt.equals("-l")) { params.installFlags |= PackageManager.INSTALL_FORWARD_LOCK; } else if (opt.equals("-r")) { params.installFlags |= PackageManager.INSTALL_REPLACE_EXISTING; } else if (opt.equals("-i")) { installerPackageName = nextArg(); if (installerPackageName == null) { throw new IllegalArgumentException("Missing installer package"); } } else if (opt.equals("-t")) { params.installFlags |= PackageManager.INSTALL_ALLOW_TEST; } else if (opt.equals("-s")) { params.installFlags |= PackageManager.INSTALL_EXTERNAL; } else if (opt.equals("-f")) { params.installFlags |= PackageManager.INSTALL_INTERNAL; } else if (opt.equals("-d")) { params.installFlags |= PackageManager.INSTALL_ALLOW_DOWNGRADE; } else if (opt.equals("-g")) { params.installFlags |= PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS; } else if (opt.equals("--originating-uri")) { params.originatingUri = Uri.parse(nextOptionData()); } else if (opt.equals("--referrer")) { params.referrerUri = Uri.parse(nextOptionData()); } else if (opt.equals("-p")) { params.mode = SessionParams.MODE_INHERIT_EXISTING; params.appPackageName = nextOptionData(); if (params.appPackageName == null) { throw new IllegalArgumentException("Missing inherit package name"); } } else if (opt.equals("-S")) { params.setSize(Long.parseLong(nextOptionData())); } else if (opt.equals("--abi")) { params.abiOverride = checkAbiArgument(nextOptionData()); } else if (opt.equals("--user")) { userId = Integer.parseInt(nextOptionData()); } else if (opt.equals("--install-location")) { params.installLocation = Integer.parseInt(nextOptionData()); } else if (opt.equals("--force-uuid")) { params.installFlags |= PackageManager.INSTALL_FORCE_VOLUME_UUID; params.volumeUuid = nextOptionData(); if ("internal".equals(params.volumeUuid)) { params.volumeUuid = null; } } else { throw new IllegalArgumentException("Unknown option " + opt); } } if (userId == UserHandle.USER_ALL) { userId = UserHandle.USER_OWNER; params.installFlags |= PackageManager.INSTALL_ALL_USERS; } final int sessionId = mInstaller.createSession(params, installerPackageName, userId); // NOTE: adb depends on parsing this string System.out.println("Success: created install session [" + sessionId + "]"); return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runInstallCreate File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runInstallCreate
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
@NonNull public Builder setCustomContentView(RemoteViews contentView) { mN.contentView = contentView; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCustomContentView File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setCustomContentView
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public String getAction() { synchronized (this) { return action; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAction File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
getAction
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
protected ID checkoutPickListValue(Field field, Cell cell) { final String val = cell.asString(); // 支持ID ID val2id = MetadataHelper.checkSpecEntityId(val, EntityHelper.PickList); if (val2id != null) { if (PickListManager.instance.getLabel(val2id) != null) { return val2id; } else { log.warn("No item of PickList found by ID {}", val2id); return null; } } else { return PickListManager.instance.findItemByLabel(val, field); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkoutPickListValue File: src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
checkoutPickListValue
src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
protected boolean csrfTokenCheck(XWikiContext context, boolean jsonAnswer) throws XWikiException { final boolean isAjaxRequest = Utils.isAjaxRequest(context); CSRFToken csrf = Utils.getComponent(CSRFToken.class); try { String token = context.getRequest().getParameter("form_token"); if (!csrf.isTokenValid(token)) { if (isAjaxRequest) { if (jsonAnswer) { Map<String, String> jsonObject = new LinkedHashMap<>(); jsonObject.put("errorType", "CSRF"); jsonObject.put("resubmissionURI", csrf.getRequestURI()); jsonObject.put("newToken", csrf.getToken()); this.answerJSON(context, HttpServletResponse.SC_FORBIDDEN, jsonObject); } else { final String csrfCheckFailedMessage = localizePlainOrKey("core.editors.csrfCheckFailed"); writeAjaxErrorResponse(HttpServletResponse.SC_FORBIDDEN, csrfCheckFailedMessage, context); } } else { sendRedirect(context.getResponse(), csrf.getResubmissionURL()); } return false; } } catch (XWikiException exception) { // too bad throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "Access denied, secret token verification failed", exception); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: csrfTokenCheck File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-23617
MEDIUM
4
xwiki/xwiki-platform
csrfTokenCheck
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
0
Analyze the following code function for security vulnerabilities
private ResolveInfo querySkipCurrentProfileIntents( List<CrossProfileIntentFilter> matchingFilters, Intent intent, String resolvedType, int flags, int sourceUserId) { if (matchingFilters != null) { int size = matchingFilters.size(); for (int i = 0; i < size; i ++) { CrossProfileIntentFilter filter = matchingFilters.get(i); if ((filter.getFlags() & PackageManager.SKIP_CURRENT_PROFILE) != 0) { // Checking if there are activities in the target user that can handle the // intent. ResolveInfo resolveInfo = checkTargetCanHandle(filter, intent, resolvedType, flags, sourceUserId); if (resolveInfo != null) { return resolveInfo; } } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: querySkipCurrentProfileIntents 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
querySkipCurrentProfileIntents
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private Handler<AsyncResult<SQLConnection>> asyncAssertTx( TestContext context, Handler<AsyncResult<SQLConnection>> resultHandler) { Async async = context.async(); return trans -> { if (trans.failed()) { setRootLevel(Level.DEBUG); context.fail(trans.cause()); } resultHandler.handle(trans); async.complete(); }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asyncAssertTx File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.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
asyncAssertTx
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public boolean onClickHandler( final View view, final PendingIntent pendingIntent, final Intent fillInIntent) { wakeUpIfDozing(SystemClock.uptimeMillis(), view); if (handleRemoteInput(view, pendingIntent, fillInIntent)) { return true; } if (DEBUG) { Log.v(TAG, "Notification click handler invoked for intent: " + pendingIntent); } logActionClick(view); // The intent we are sending is for the application, which // won't have permission to immediately start an activity after // the user switches to home. We know it is safe to do at this // point, so make sure new activity switches are now allowed. try { ActivityManager.getService().resumeAppSwitches(); } catch (RemoteException e) { } final boolean isActivity = pendingIntent.isActivity(); if (isActivity) { final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing(); final boolean afterKeyguardGone = PreviewInflater.wouldLaunchResolverActivity( mContext, pendingIntent.getIntent(), mCurrentUserId); dismissKeyguardThenExecute(new OnDismissAction() { @Override public boolean onDismiss() { try { ActivityManager.getService().resumeAppSwitches(); } catch (RemoteException e) { } boolean handled = superOnClickHandler(view, pendingIntent, fillInIntent); // close the shade if it was open if (handled) { animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */); visibilityChanged(false); mAssistManager.hideAssist(); } // Wait for activity start. return handled; } }, afterKeyguardGone); return true; } else { return superOnClickHandler(view, pendingIntent, fillInIntent); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onClickHandler File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onClickHandler
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public IBinder onBind(Intent arg0) { return mBinder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onBind File: packages/WAPPushManager/src/com/android/smspush/WapPushManager.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2014-8507
HIGH
7.5
android
onBind
packages/WAPPushManager/src/com/android/smspush/WapPushManager.java
48ed835468c6235905459e6ef7df032baf3e4df6
0
Analyze the following code function for security vulnerabilities
public Map<String, String> getMappedClaims() { return mappedClaims; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMappedClaims File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
getMappedClaims
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
private static String getAbiList(BufferedWriter writer, DataInputStream inputStream) throws IOException { // Each query starts with the argument count (1 in this case) writer.write("1"); // ... followed by a new-line. writer.newLine(); // ... followed by our only argument. writer.write("--query-abi-list"); writer.newLine(); writer.flush(); // The response is a length prefixed stream of ASCII bytes. int numBytes = inputStream.readInt(); byte[] bytes = new byte[numBytes]; inputStream.readFully(bytes); return new String(bytes, StandardCharsets.US_ASCII); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAbiList File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
getAbiList
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
public void setLockOptions(Bundle options) { this.options = options; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLockOptions File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
setLockOptions
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public void setSecurityLoggingEnabled(ComponentName admin, String packageName, boolean enabled) { if (!mHasFeature) { return; } final CallerIdentity caller = getCallerIdentity(admin, packageName); synchronized (getLockObject()) { if (isPermissionCheckFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_SECURITY_LOGGING, caller.getPackageName(), UserHandle.USER_ALL); } else { if (admin != null) { Preconditions.checkCallAuthorization( isProfileOwnerOfOrganizationOwnedDevice(caller) || isDefaultDeviceOwner(caller)); } else { // A delegate app passes a null admin component, which is expected Preconditions.checkCallAuthorization( isCallerDelegate(caller, DELEGATION_SECURITY_LOGGING)); } } if (enabled == mInjector.securityLogGetLoggingEnabledProperty()) { return; } mInjector.securityLogSetLoggingEnabledProperty(enabled); if (enabled) { mSecurityLogMonitor.start(getSecurityLoggingEnabledUser()); maybePauseDeviceWideLoggingLocked(); } else { mSecurityLogMonitor.stop(); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_SECURITY_LOGGING_ENABLED) .setAdmin(caller.getPackageName()) .setBoolean(enabled) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSecurityLoggingEnabled 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
setSecurityLoggingEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void onAnimationCancelled() throws RemoteException { super.onAnimationCancelled(); Log.d(TAG, "Occlude launch animation cancelled. Occluded state is now: " + mOccluded); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAnimationCancelled File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
onAnimationCancelled
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@Override public Repository getRepository(Project project) { Repository repository = repositoryCache.get(project.getId()); if (repository == null) { synchronized (repositoryCache) { repository = repositoryCache.get(project.getId()); if (repository == null) { try { repository = new FileRepository(project.getGitDir()); } catch (IOException e) { throw new RuntimeException(e); } repositoryCache.put(project.getId(), repository); } } } return repository; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRepository File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
getRepository
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
protected KBTemplate toUnwrappedModel(KBTemplate kbTemplate) { if (kbTemplate instanceof KBTemplateImpl) { return kbTemplate; } KBTemplateImpl kbTemplateImpl = new KBTemplateImpl(); kbTemplateImpl.setNew(kbTemplate.isNew()); kbTemplateImpl.setPrimaryKey(kbTemplate.getPrimaryKey()); kbTemplateImpl.setUuid(kbTemplate.getUuid()); kbTemplateImpl.setKbTemplateId(kbTemplate.getKbTemplateId()); kbTemplateImpl.setGroupId(kbTemplate.getGroupId()); kbTemplateImpl.setCompanyId(kbTemplate.getCompanyId()); kbTemplateImpl.setUserId(kbTemplate.getUserId()); kbTemplateImpl.setUserName(kbTemplate.getUserName()); kbTemplateImpl.setCreateDate(kbTemplate.getCreateDate()); kbTemplateImpl.setModifiedDate(kbTemplate.getModifiedDate()); kbTemplateImpl.setTitle(kbTemplate.getTitle()); kbTemplateImpl.setContent(kbTemplate.getContent()); kbTemplateImpl.setLastPublishDate(kbTemplate.getLastPublishDate()); return kbTemplateImpl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toUnwrappedModel File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
toUnwrappedModel
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
private void pushScreenCapturePolicy(int adminUserId) { // Update screen capture device-wide if disabled by the DO or COPE PO on the parent profile. ActiveAdmin admin = getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceParentLocked( UserHandle.USER_SYSTEM); if (admin != null && admin.disableScreenCapture) { setScreenCaptureDisabled(UserHandle.USER_ALL); } else { // Otherwise, update screen capture only for the calling user. admin = getProfileOwnerAdminLocked(adminUserId); if (admin != null && admin.disableScreenCapture) { setScreenCaptureDisabled(adminUserId); } else { setScreenCaptureDisabled(UserHandle.USER_NULL); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pushScreenCapturePolicy 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
pushScreenCapturePolicy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public final void forEachValue(CharSequence name, Consumer<String> action) { requireNonNull(name, "name"); requireNonNull(action, "action"); for (final Iterator<String> i = valueIterator(name); i.hasNext();) { action.accept(i.next()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forEachValue File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
forEachValue
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
public static String getDefaultSaveFilePath(final String url) { return generateFilePath(getDefaultSaveRootPath(), generateFileName(url)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultSaveFilePath File: library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
getDefaultSaveFilePath
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
public void requestReconsideration(RankingReconsideration recon) { Message m = Message.obtain(this, NotificationManagerService.MESSAGE_RECONSIDER_RANKING, recon); long delay = recon.getDelay(TimeUnit.MILLISECONDS); sendMessageDelayed(m, delay); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestReconsideration 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
requestReconsideration
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage @Nullable String getResourceTypeName(@AnyRes int resId) { synchronized (this) { ensureValidLocked(); return nativeGetResourceTypeName(mObject, resId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceTypeName File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getResourceTypeName
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public static void updateFeatureDescription(FF4j ff4j, HttpServletRequest req) { // uid final String featureId = req.getParameter(FEATID); if (featureId != null && !featureId.isEmpty()) { // https://github.com/clun/ff4j/issues/66 Feature old = ff4j.getFeatureStore().read(featureId); Feature fp = new Feature(featureId, old.isEnable()); // <-- // Description final String featureDesc = req.getParameter(DESCRIPTION); if (null != featureDesc && !featureDesc.isEmpty()) { fp.setDescription(featureDesc); } // GroupName final String groupName = req.getParameter(GROUPNAME); if (null != groupName && !groupName.isEmpty()) { fp.setGroup(groupName); } // Strategy updateFlippingStrategy(fp, req.getParameter(STRATEGY), req.getParameter(STRATEGY_INIT)); // Permissions final String permission = req.getParameter(PERMISSION); if (null != permission && PERMISSION_RESTRICTED.equals(permission)) { @SuppressWarnings("unchecked") Map<String, Object> parameters = req.getParameterMap(); Set<String> permissions = new HashSet<String>(); for (String key : parameters.keySet()) { if (key.startsWith(PREFIX_CHECKBOX)) { permissions.add(key.replace(PREFIX_CHECKBOX, "")); } } fp.setPermissions(permissions); } // Creation ff4j.getFeatureStore().update(fp); LOGGER.info(featureId + " has been updated"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateFeatureDescription File: ff4j-web/src/main/java/org/ff4j/web/embedded/ConsoleOperations.java Repository: ff4j The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
updateFeatureDescription
ff4j-web/src/main/java/org/ff4j/web/embedded/ConsoleOperations.java
991df72725f78adbc413d9b0fbb676201f1882e0
0
Analyze the following code function for security vulnerabilities
@Override public void push(final String value) { final PushCallback callback = getPushCallbackInstance(); if(callback != null) { Display.getInstance().callSerially(new Runnable() { public void run() { callback.push(value); } }); } else { NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); Intent newIntent = new Intent(this, getStubClass()); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, newIntent, PendingIntent.FLAG_CANCEL_CURRENT); Notification.Builder builder = new Notification.Builder(this) .setContentIntent(contentIntent) .setSmallIcon(android.R.drawable.stat_notify_sync) .setTicker(value) .setAutoCancel(true) .setWhen(System.currentTimeMillis()) .setContentTitle(value) .setDefaults(Notification.DEFAULT_ALL); // The following section is commented out so that builds against SDKs below 26 // won't fail. /*<SDK26> if(android.os.Build.VERSION.SDK_INT >= 21){ builder.setCategory("Notification"); } if (android.os.Build.VERSION.SDK_INT >= 26) { NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); String id = getProperty("android.NotificationChannel.id", "cn1-channel"); CharSequence name = getProperty("android.NotificationChannel.name", "Notifications"); String description = getProperty("android.NotificationChannel.description", "Remote notifications"); int importance = Integer.parseInt(getProperty("android.NotificationChannel.importance", ""+NotificationManager.IMPORTANCE_HIGH)); android.app.NotificationChannel mChannel = new android.app.NotificationChannel(id, name,importance); mChannel.setDescription(description); mChannel.enableLights(Boolean.parseBoolean(getProperty("android.NotificationChannel.enableLights", "true"))); mChannel.setLightColor(Integer.parseInt(getProperty("android.NotificationChannel.lightColor", ""+android.graphics.Color.RED))); mChannel.enableVibration(Boolean.parseBoolean(getProperty("android.NotificationChannel.enableVibration", "false"))); String vibrationPatternStr = getProperty("android.NotificationChannel.vibrationPattern", null); if (vibrationPatternStr != null) { String[] parts = vibrationPatternStr.split(","); int len = parts.length; long[] pattern = new long[len]; for (int i=0; i<len; i++) { pattern[i] = Long.parseLong(parts[i].trim()); } mChannel.setVibrationPattern(pattern); } mNotificationManager.createNotificationChannel(mChannel); System.out.println("Setting push channel to "+id); builder.setChannelId(id); } </SDK26>*/ Notification notif = builder.build(); int notifId = getNotifyId();//(int)System.currentTimeMillis(); //notif.extras.putInt("notificationId", notifId); nm.notify(notifId, notif); } }
Vulnerability Classification: - CWE: CWE-668 - CVE: CVE-2022-4903 - Severity: MEDIUM - CVSS Score: 5.1 Description: Fixed #3583 Pending Intent vulnerability Function: push File: Ports/Android/src/com/codename1/impl/android/PushNotificationService.java Repository: codenameone/CodenameOne Fixed Code: @Override public void push(final String value) { final PushCallback callback = getPushCallbackInstance(); if(callback != null) { Display.getInstance().callSerially(new Runnable() { public void run() { callback.push(value); } }); } else { NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); Intent newIntent = new Intent(this, getStubClass()); PendingIntent contentIntent = AndroidImplementation.createPendingIntent(this, 0, newIntent); Notification.Builder builder = new Notification.Builder(this) .setContentIntent(contentIntent) .setSmallIcon(android.R.drawable.stat_notify_sync) .setTicker(value) .setAutoCancel(true) .setWhen(System.currentTimeMillis()) .setContentTitle(value) .setDefaults(Notification.DEFAULT_ALL); // The following section is commented out so that builds against SDKs below 26 // won't fail. /*<SDK26> if(android.os.Build.VERSION.SDK_INT >= 21){ builder.setCategory("Notification"); } if (android.os.Build.VERSION.SDK_INT >= 26) { NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); String id = getProperty("android.NotificationChannel.id", "cn1-channel"); CharSequence name = getProperty("android.NotificationChannel.name", "Notifications"); String description = getProperty("android.NotificationChannel.description", "Remote notifications"); int importance = Integer.parseInt(getProperty("android.NotificationChannel.importance", ""+NotificationManager.IMPORTANCE_HIGH)); android.app.NotificationChannel mChannel = new android.app.NotificationChannel(id, name,importance); mChannel.setDescription(description); mChannel.enableLights(Boolean.parseBoolean(getProperty("android.NotificationChannel.enableLights", "true"))); mChannel.setLightColor(Integer.parseInt(getProperty("android.NotificationChannel.lightColor", ""+android.graphics.Color.RED))); mChannel.enableVibration(Boolean.parseBoolean(getProperty("android.NotificationChannel.enableVibration", "false"))); String vibrationPatternStr = getProperty("android.NotificationChannel.vibrationPattern", null); if (vibrationPatternStr != null) { String[] parts = vibrationPatternStr.split(","); int len = parts.length; long[] pattern = new long[len]; for (int i=0; i<len; i++) { pattern[i] = Long.parseLong(parts[i].trim()); } mChannel.setVibrationPattern(pattern); } mNotificationManager.createNotificationChannel(mChannel); System.out.println("Setting push channel to "+id); builder.setChannelId(id); } </SDK26>*/ Notification notif = builder.build(); int notifId = getNotifyId();//(int)System.currentTimeMillis(); //notif.extras.putInt("notificationId", notifId); nm.notify(notifId, notif); } }
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
push
Ports/Android/src/com/codename1/impl/android/PushNotificationService.java
dad49c9ef26a598619fc48d2697151a02987d478
1
Analyze the following code function for security vulnerabilities
private static boolean validateEnterpriseConfig(WifiConfiguration config, boolean isAdd) { if ((config.isSecurityType(WifiConfiguration.SECURITY_TYPE_EAP) || config.isSecurityType(WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE)) && !config.isEnterprise()) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT) && (!config.isEnterprise() || config.enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.TLS)) { return false; } if (config.isEnterprise()) { if (config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.PEAP || config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.TTLS) { int phase2Method = config.enterpriseConfig.getPhase2Method(); if (phase2Method == WifiEnterpriseConfig.Phase2.MSCHAP || phase2Method == WifiEnterpriseConfig.Phase2.MSCHAPV2 || phase2Method == WifiEnterpriseConfig.Phase2.PAP || phase2Method == WifiEnterpriseConfig.Phase2.GTC) { // Check the password on add only. When updating, the password may not be // available and it appears as "(Unchanged)" in Settings if ((isAdd && TextUtils.isEmpty(config.enterpriseConfig.getPassword())) || TextUtils.isEmpty(config.enterpriseConfig.getIdentity())) { Log.e(TAG, "Enterprise network without an identity or a password set"); return false; } } } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateEnterpriseConfig File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
validateEnterpriseConfig
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
0
Analyze the following code function for security vulnerabilities
public List<? extends Descriptor> getApplicableDescriptors() { return Jenkins.getInstance().getDescriptorList(clazz); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApplicableDescriptors File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getApplicableDescriptors
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public boolean hasPermissionForActivity(Intent intent, String srcPackage) { // b/270152142 if (Intent.ACTION_CHOOSER.equals(intent.getAction())) { final Bundle extras = intent.getExtras(); if (extras == null) { return true; } // If given intent is ACTION_CHOOSER, verify srcPackage has permission over EXTRA_INTENT intent = (Intent) extras.getParcelable(Intent.EXTRA_INTENT); if (intent == null) { return true; } } ResolveInfo target = mPm.resolveActivity(intent, 0); if (target == null) { // Not a valid target return false; } if (TextUtils.isEmpty(target.activityInfo.permission)) { // No permission is needed return true; } if (TextUtils.isEmpty(srcPackage)) { // The activity requires some permission but there is no source. return false; } // Source does not have sufficient permissions. if(mPm.checkPermission(target.activityInfo.permission, srcPackage) != PackageManager.PERMISSION_GRANTED) { return false; } // On M and above also check AppOpsManager for compatibility mode permissions. if (TextUtils.isEmpty(AppOpsManager.permissionToOp(target.activityInfo.permission))) { // There is no app-op for this permission, which could have been disabled. return true; } // There is no direct way to check if the app-op is allowed for a particular app. Since // app-op is only enabled for apps running in compatibility mode, simply block such apps. try { return mPm.getApplicationInfo(srcPackage, 0).targetSdkVersion >= Build.VERSION_CODES.M; } catch (NameNotFoundException e) { } return false; }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2023-40097 - Severity: HIGH - CVSS Score: 7.8 Description: Fix permission bypass in legacy shortcut Intent created for Chooser should not be allowed in legacy shortcuts since it doesn't make sense for user to tap on a shortcut in homescreen to share, the expected share flow started from ShareSheet. Bug: 295334906, 295045199 Test: manual (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b7b192bd7f24a2aa7d6881ee949657c9760c0305) Merged-In: I8d0cbccdc31bd4cb927830e5ecf841147400fdfa Change-Id: I8d0cbccdc31bd4cb927830e5ecf841147400fdfa Function: hasPermissionForActivity File: src/com/android/launcher3/util/PackageManagerHelper.java Repository: android Fixed Code: public boolean hasPermissionForActivity(Intent intent, String srcPackage) { // b/270152142 if (Intent.ACTION_CHOOSER.equals(intent.getAction())) { // Chooser shortcuts is not a valid target return false; } ResolveInfo target = mPm.resolveActivity(intent, 0); if (target == null) { // Not a valid target return false; } if (TextUtils.isEmpty(target.activityInfo.permission)) { // No permission is needed return true; } if (TextUtils.isEmpty(srcPackage)) { // The activity requires some permission but there is no source. return false; } // Source does not have sufficient permissions. if(mPm.checkPermission(target.activityInfo.permission, srcPackage) != PackageManager.PERMISSION_GRANTED) { return false; } // On M and above also check AppOpsManager for compatibility mode permissions. if (TextUtils.isEmpty(AppOpsManager.permissionToOp(target.activityInfo.permission))) { // There is no app-op for this permission, which could have been disabled. return true; } // There is no direct way to check if the app-op is allowed for a particular app. Since // app-op is only enabled for apps running in compatibility mode, simply block such apps. try { return mPm.getApplicationInfo(srcPackage, 0).targetSdkVersion >= Build.VERSION_CODES.M; } catch (NameNotFoundException e) { } return false; }
[ "CWE-20" ]
CVE-2023-40097
HIGH
7.8
android
hasPermissionForActivity
src/com/android/launcher3/util/PackageManagerHelper.java
6c9a41117d5a9365cf34e770bbb00138f6bf997e
1
Analyze the following code function for security vulnerabilities
static boolean isClockValid(long time) { return time >= 1420070400; // Thu, 01 Jan 2015 00:00:00 GMT }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isClockValid 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
isClockValid
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void setEnabled(boolean enabled) { this.enabled = enabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEnabled File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
setEnabled
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
public boolean hasEnrolledFingerprints(int userId) { if (userId != UserHandle.getCallingUserId()) { checkPermission(INTERACT_ACROSS_USERS); } return mFingerprintUtils.getFingerprintsForUser(mContext, userId).size() > 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasEnrolledFingerprints File: services/core/java/com/android/server/fingerprint/FingerprintService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
hasEnrolledFingerprints
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private int putData(byte[] data, ByteBuffer[] buffers, int offset, int length) { debug("JSSEngine: putData()"); // Handle the rather unreasonable task of moving data into the buffers. // We assume the buffer parameters have already been checked by // computeSize(...); that is, offset/length contracts hold and that // each buffer in the range is non-null. // // We also assume that data.length does not exceed the total number // of bytes the buffers can hold; this is what computeSize(...)'s // return value should ensure. This directly means that the inner // while loop won't exceed the bounds of offset+length. int buffer_index = offset; int data_index = 0; if (data == null || buffers == null) { return data_index; } for (data_index = 0; data_index < data.length;) { // Ensure we have have a buffer with capacity. while ((buffers[buffer_index] == null || buffers[buffer_index].remaining() <= 0) && (buffer_index < offset + length)) { buffer_index += 1; } if (buffer_index >= offset + length) { break; } // Compute the size of the put: it is the minimum of the space // remaining in this buffer and the bytes remaining in the data // array. int put_size = buffers[buffer_index].remaining(); if (put_size > (data.length - data_index)) { put_size = data.length - data_index; } buffers[buffer_index].put(data, data_index, put_size); data_index += put_size; } return data_index; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putData File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java Repository: dogtagpki/jss The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
putData
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
public void selectPresence(final Conversation conversation, final PresenceSelector.OnPresenceSelected listener) { final Contact contact = conversation.getContact(); if (!contact.showInRoster()) { showAddToRosterDialog(conversation.getContact()); } else { final Presences presences = contact.getPresences(); if (presences.size() == 0) { if (!contact.getOption(Contact.Options.TO) && !contact.getOption(Contact.Options.ASKING) && contact.getAccount().getStatus() == Account.State.ONLINE) { showAskForPresenceDialog(contact); } else if (!contact.getOption(Contact.Options.TO) || !contact.getOption(Contact.Options.FROM)) { PresenceSelector.warnMutualPresenceSubscription(this, conversation, listener); } else { conversation.setNextCounterpart(null); listener.onPresenceSelected(); } } else if (presences.size() == 1) { String presence = presences.toResourceArray()[0]; try { conversation.setNextCounterpart(Jid.of(contact.getJid().getLocal(), contact.getJid().getDomain(), presence)); } catch (IllegalArgumentException e) { conversation.setNextCounterpart(null); } listener.onPresenceSelected(); } else { PresenceSelector.showPresenceSelectionDialog(this, conversation, listener); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectPresence File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
selectPresence
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public Document createDocument() { return new XWikiDocument().newDocument(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createDocument File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
createDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public void sendReplyNotifications(Post parentPost, Post reply, HttpServletRequest req) { // send email notification to author of post except when the reply is by the same person if (parentPost != null && reply != null && !StringUtils.equals(parentPost.getCreatorid(), reply.getCreatorid())) { Profile replyAuthor = reply.getAuthor(); // the current user - same as utils.getAuthUser(req) Map<String, Object> model = new HashMap<String, Object>(); Map<String, String> lang = getLang(req); String name = replyAuthor.getName(); String body = Utils.markdownToHtml(reply.getBody()); String picture = Utils.formatMessage("<img src='{0}' width='25'>", escapeHtmlAttribute(avatarRepository. getLink(replyAuthor, AvatarFormat.Square25))); String postURL = CONF.serverUrl() + parentPost.getPostLink(false, false); String subject = Utils.formatMessage(lang.get("notification.reply.subject"), name, Utils.abbreviate(reply.getTitle(), 255)); model.put("subject", escapeHtml(subject)); model.put("logourl", getSmallLogoUrl()); model.put("heading", Utils.formatMessage(lang.get("notification.reply.heading"), Utils.formatMessage("<a href='{0}'>{1}</a>", postURL, escapeHtml(parentPost.getTitle())))); model.put("body", Utils.formatMessage("<h2>{0} {1}:</h2><div>{2}</div>", picture, escapeHtml(name), body)); Profile authorProfile = pc.read(parentPost.getCreatorid()); if (authorProfile != null) { User author = authorProfile.getUser(); if (author != null) { if (authorProfile.getReplyEmailsEnabled()) { parentPost.addFollower(author); } } } if (postsNeedApproval() && reply instanceof UnapprovedReply) { Report rep = new Report(); rep.setDescription("New reply awaiting approval"); rep.setSubType(Report.ReportType.OTHER); rep.setLink(parentPost.getPostLink(false, false) + "#post-" + reply.getId()); rep.setAuthorName(reply.getAuthor().getName()); rep.create(); } if (isReplyNotificationAllowed() && parentPost.hasFollowers()) { emailer.sendEmail(new ArrayList<String>(parentPost.getFollowers().values()), subject, compileEmailTemplate(model)); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendReplyNotifications File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
sendReplyNotifications
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Nullable public String getAuthToken() { return authToken; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthToken File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getAuthToken
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
List<ObjectStreamClass> getHierarchy() { List<ObjectStreamClass> result = cachedHierarchy; if (result == null) { cachedHierarchy = result = makeHierarchy(); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHierarchy File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
getHierarchy
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@HotPath(caller = HotPath.OOM_ADJUSTMENT) @Override public int getTopProcessState() { if (mRetainPowerModeAndTopProcessState) { // There is a launching app while device may be sleeping, force the top state so // the launching process can have top-app scheduling group. return ActivityManager.PROCESS_STATE_TOP; } return mTopProcessState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTopProcessState File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getTopProcessState
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public void keyguardGoingAway(boolean disableWindowAnimations, boolean keyguardGoingToNotificationShade) { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires DISABLE_KEYGUARD permission"); } if (DEBUG_KEYGUARD) Slog.d(TAG, "keyguardGoingAway: disableWinAnim=" + disableWindowAnimations + " kgToNotifShade=" + keyguardGoingToNotificationShade); synchronized (mWindowMap) { mAnimator.mKeyguardGoingAway = true; mAnimator.mKeyguardGoingAwayToNotificationShade = keyguardGoingToNotificationShade; mAnimator.mKeyguardGoingAwayDisableWindowAnimations = disableWindowAnimations; requestTraversalLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keyguardGoingAway 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
keyguardGoingAway
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public Integer getHits() { return hits; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHits File: src/main/java/cn/luischen/model/ContentDomain.java Repository: WinterChenS/my-site The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29638
MEDIUM
5.4
WinterChenS/my-site
getHits
src/main/java/cn/luischen/model/ContentDomain.java
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
0
Analyze the following code function for security vulnerabilities
public boolean isAncestorOf(DomNode node) { while (node != null) { if (node == this) { return true; } node = node.getParentNode(); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAncestorOf File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
isAncestorOf
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
SQLiteSession getThreadSession() { return mThreadSession.get(); // initialValue() throws if database closed }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getThreadSession 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
getThreadSession
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public int getCallerDisplayId() { return mCallerDisplayId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallerDisplayId File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getCallerDisplayId
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public boolean isLaunchTransitionFinished() { return mIsLaunchTransitionFinished; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLaunchTransitionFinished File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
isLaunchTransitionFinished
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void performBootTimeout() { synchronized(mWindowMap) { if (mDisplayEnabled) { return; } Slog.w(TAG, "***** BOOT TIMEOUT: forcing display enabled"); mForceDisplayEnabled = true; } performEnableScreen(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performBootTimeout 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
performBootTimeout
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public boolean scheduleBuild(int quietPeriod, Cause c) { return scheduleBuild(quietPeriod, c, new Action[0]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleBuild File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
scheduleBuild
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
void checkBarMode(int mode, int windowState, BarTransitions transitions) { final boolean powerSave = mBatteryController.isPowerSave(); final boolean anim = !mNoAnimationOnNextBarModeChange && mDeviceInteractive && windowState != WINDOW_STATE_HIDDEN && !powerSave; if (powerSave && getBarState() == StatusBarState.SHADE) { mode = MODE_WARNING; } transitions.transitionTo(mode, anim); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkBarMode File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
checkBarMode
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static String unpause(String pipelineName) { return BASE + UNPAUSE_PATH.replaceAll(":pipeline_name", pipelineName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unpause File: spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
unpause
spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
public void resetNotificationImportance() { try { sINM.unlockAllNotificationChannels(); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetNotificationImportance 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
resetNotificationImportance
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
private void parseTextFragment(Element e, boolean inRightOfPrevious, final XmlSerializer serializer) throws Exception { StringBuilder text = new StringBuilder(); for (Element en : XmlUtils.getElements(e, "p")) { if (text.length() > 0) { text.append("\n\n"); } text.append(en.getTextContent()); } // TODO: get metadata final String term = FormulaBase.BaseType.TEXT_FRAGMENT.toString().toLowerCase(Locale.ENGLISH); serializer.startTag(FormulaList.XML_NS, term); serializer.attribute(FormulaList.XML_NS, FormulaList.XML_PROP_INRIGHTOFPREVIOUS, Boolean.toString(inRightOfPrevious)); addTextTag(FormulaList.XML_PROP_TEXT, text.toString(), serializer); serializer.endTag(FormulaList.XML_NS, term); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseTextFragment File: app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java Repository: mkulesh/microMathematics The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000821
HIGH
7.5
mkulesh/microMathematics
parseTextFragment
app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
5c05ac8de16c569ff0a1816f20be235090d3dd9d
0
Analyze the following code function for security vulnerabilities
public static int getTotalWYSIWYG(Structure structure) { String typeField = Field.FieldType.WYSIWYG.toString(); return getTotals(structure,typeField); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTotalWYSIWYG File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getTotalWYSIWYG
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public static Creators collectCreators(AnnotationIntrospector intr, TypeResolutionContext tc, JavaType type, Class<?> primaryMixIn) { // Constructor also always members of resolved class, parent == resolution context return new AnnotatedCreatorCollector(intr, tc) .collect(type, primaryMixIn); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: collectCreators File: src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
collectCreators
src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private boolean hasValidRemoteInput(Action action) { if (TextUtils.isEmpty(action.title) || action.actionIntent == null) { // Weird actions return false; } RemoteInput[] remoteInputs = action.getRemoteInputs(); if (remoteInputs == null) { return false; } for (RemoteInput r : remoteInputs) { CharSequence[] choices = r.getChoices(); if (r.getAllowFreeFormInput() || (choices != null && choices.length != 0)) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasValidRemoteInput File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
hasValidRemoteInput
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
Method getMethodReadResolve() { return methodReadResolve; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMethodReadResolve File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
getMethodReadResolve
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public static HtmlForm getHtmlFormFromUiResource(ResourceFactory resourceFactory, FormService formService, HtmlFormEntryService htmlFormEntryService, String providerName, String resourcePath, Encounter encounter) throws IOException { String xml = null; // first, see if there is a specific version of the form referenced by version number if (encounter != null && encounter.getForm() != null && encounter.getForm().getVersion() != null) { String resourcePathWithVersion = resourcePath.replaceAll("\\.xml$", "") + "_v" + encounter.getForm().getVersion() + ".xml"; xml = resourceFactory.getResourceAsString(providerName, resourcePathWithVersion); // should be of the format <htmlform formUuid="..." formVersion="..." formEncounterType="...">...</htmlform> } // if not, use the bare resource path (without version number appended) to fetch the form if (xml == null) { xml = resourceFactory.getResourceAsString(providerName, resourcePath); } if (xml == null) { throw new IllegalArgumentException("No resource found at " + providerName + ":" + resourcePath); } return getHtmlFormFromResourceXml(formService, htmlFormEntryService, xml); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHtmlFormFromUiResource File: api/src/main/java/org/openmrs/module/htmlformentryui/HtmlFormUtil.java Repository: openmrs/openmrs-module-htmlformentryui The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-4284
MEDIUM
6.1
openmrs/openmrs-module-htmlformentryui
getHtmlFormFromUiResource
api/src/main/java/org/openmrs/module/htmlformentryui/HtmlFormUtil.java
811990972ea07649ae33c4b56c61c3b520895f07
0
Analyze the following code function for security vulnerabilities
void releaseSomeActivitiesLocked(ProcessRecord app, String reason) { // Examine all activities currently running in the process. TaskRecord firstTask = null; // Tasks is non-null only if two or more tasks are found. ArraySet<TaskRecord> tasks = null; if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Trying to release some activities in " + app); for (int i = 0; i < app.activities.size(); i++) { ActivityRecord r = app.activities.get(i); // First, if we find an activity that is in the process of being destroyed, // then we just aren't going to do anything for now; we want things to settle // down before we try to prune more activities. if (r.finishing || r.state == DESTROYING || r.state == DESTROYED) { if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Abort release; already destroying: " + r); return; } // Don't consider any activies that are currently not in a state where they // can be destroyed. if (r.visible || !r.stopped || !r.haveState || r.state == RESUMED || r.state == PAUSING || r.state == PAUSED || r.state == STOPPING) { if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Not releasing in-use activity: " + r); continue; } if (r.task != null) { if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Collecting release task " + r.task + " from " + r); if (firstTask == null) { firstTask = r.task; } else if (firstTask != r.task) { if (tasks == null) { tasks = new ArraySet<>(); tasks.add(firstTask); } tasks.add(r.task); } } } if (tasks == null) { if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Didn't find two or more tasks to release"); return; } // If we have activities in multiple tasks that are in a position to be destroyed, // let's iterate through the tasks and release the oldest one. final int numDisplays = mActivityDisplays.size(); for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) { final ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks; // Step through all stacks starting from behind, to hit the oldest things first. for (int stackNdx = 0; stackNdx < stacks.size(); stackNdx++) { final ActivityStack stack = stacks.get(stackNdx); // Try to release activities in this stack; if we manage to, we are done. if (stack.releaseSomeActivitiesLocked(app, tasks, reason) > 0) { return; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: releaseSomeActivitiesLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
releaseSomeActivitiesLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting int recycleTask(Task targetTask, ActivityRecord targetTaskTop, Task reusedTask, NeededUriGrants intentGrants) { // Should not recycle task which is from a different user, just adding the starting // activity to the task. if (targetTask.mUserId != mStartActivity.mUserId) { mTargetRootTask = targetTask.getRootTask(); mAddingToTask = true; return START_SUCCESS; } if (reusedTask != null) { if (targetTask.intent == null) { // This task was started because of movement of the activity based on // affinity... // Now that we are actually launching it, we can assign the base intent. targetTask.setIntent(mStartActivity); } else { final boolean taskOnHome = (mStartActivity.intent.getFlags() & FLAG_ACTIVITY_TASK_ON_HOME) != 0; if (taskOnHome) { targetTask.intent.addFlags(FLAG_ACTIVITY_TASK_ON_HOME); } else { targetTask.intent.removeFlags(FLAG_ACTIVITY_TASK_ON_HOME); } } } mRootWindowContainer.startPowerModeLaunchIfNeeded(false /* forceSend */, targetTaskTop); setTargetRootTaskIfNeeded(targetTaskTop); // When there is a reused activity and the current result is a trampoline activity, // set the reused activity as the result. if (mLastStartActivityRecord != null && (mLastStartActivityRecord.finishing || mLastStartActivityRecord.noDisplay)) { mLastStartActivityRecord = targetTaskTop; } if ((mStartFlags & START_FLAG_ONLY_IF_NEEDED) != 0) { // We don't need to start a new activity, and the client said not to do anything // if that is the case, so this is it! And for paranoia, make sure we have // correctly resumed the top activity. if (!mMovedToFront && mDoResume) { ProtoLog.d(WM_DEBUG_TASKS, "Bring to front target: %s from %s", mTargetRootTask, targetTaskTop); mTargetRootTask.moveToFront("intentActivityFound"); } resumeTargetRootTaskIfNeeded(); return START_RETURN_INTENT_TO_CALLER; } complyActivityFlags(targetTask, reusedTask != null ? reusedTask.getTopNonFinishingActivity() : null, intentGrants); if (mAddingToTask) { return START_SUCCESS; } // The reusedActivity could be finishing, for example of starting an activity with // FLAG_ACTIVITY_CLEAR_TOP flag. In that case, use the top running activity in the // task instead. targetTaskTop = targetTaskTop.finishing ? targetTask.getTopNonFinishingActivity() : targetTaskTop; // At this point we are certain we want the task moved to the front. If we need to dismiss // any other always-on-top root tasks, now is the time to do it. if (targetTaskTop.canTurnScreenOn() && mService.isDreaming()) { targetTaskTop.mTaskSupervisor.wakeUp("recycleTask#turnScreenOnFlag"); } if (mMovedToFront) { // We moved the task to front, use starting window to hide initial drawn delay. targetTaskTop.showStartingWindow(true /* taskSwitch */); } else if (mDoResume) { // Make sure the root task and its belonging display are moved to topmost. mTargetRootTask.moveToFront("intentActivityFound"); } // We didn't do anything... but it was needed (a.k.a., client don't use that intent!) // And for paranoia, make sure we have correctly resumed the top activity. resumeTargetRootTaskIfNeeded(); mLastStartActivityRecord = targetTaskTop; return mMovedToFront ? START_TASK_TO_FRONT : START_DELIVERED_TO_TOP; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: recycleTask File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
recycleTask
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
@Override public void saveXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException { saveXWikiDoc(doc, context, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveXWikiDoc File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
saveXWikiDoc
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
public Integer getResourceMetaCountHardLimit() { return myResourceMetaCountHardLimit; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceMetaCountHardLimit 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
getResourceMetaCountHardLimit
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 Rectangle getPageSize(PdfDictionary page) { PdfArray mediaBox = page.getAsArray(PdfName.MEDIABOX); return getNormalizedRectangle(mediaBox); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageSize File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getPageSize
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
private String parseCustomFieldValue(String value) { if (value.contains(",")) { value = value.replaceAll(",", ";"); } if (value.contains("\"")) { value = value.replaceAll("\"", StringUtils.EMPTY); } if (value.contains("[") || value.contains("]")) { value = value.replaceAll("]", StringUtils.EMPTY).replaceAll("\\[", StringUtils.EMPTY); } return value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseCustomFieldValue 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
parseCustomFieldValue
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public static final String getVersion() { return "V4.0.202204"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVersion File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-29784
MEDIUM
5
sanluan/PublicCMS
getVersion
publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
d8d7626cf51e4968fb384e1637a3c0c9921f33e9
0
Analyze the following code function for security vulnerabilities
@Override public boolean isShapeClipSupported(Object graphics){ return Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isShapeClipSupported File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
isShapeClipSupported
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Test public void updateGetConnectionFails1(TestContext context) { postgresClientGetConnectionFails() .update(FOO, xPojo, randomUuid(), context.asyncAssertFailure()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateGetConnectionFails1 File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.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
updateGetConnectionFails1
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public void setStateGenerator(final ValueGenerator stateGenerator) { assertNotNull("stateGenerator", stateGenerator); this.stateGenerator = stateGenerator; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStateGenerator File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
setStateGenerator
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
@Sessional @Override public Collection<Project> getPermittedProjects(Permission permission) { return query().stream() .filter(it->SecurityUtils.getSubject().isPermitted(new ProjectPermission(it, permission))) .collect(toList()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermittedProjects File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
getPermittedProjects
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
ActivityStarter setCallingFeatureId(String callingFeatureId) { mRequest.callingFeatureId = callingFeatureId; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCallingFeatureId File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
setCallingFeatureId
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
public String getSafeValue() { return makePropertiesSafe(getValue(), nameValueSpecialCharacters); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSafeValue File: varexport/src/main/java/com/indeed/util/varexport/Variable.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
getSafeValue
varexport/src/main/java/com/indeed/util/varexport/Variable.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
private static void atomicLongXmlGenerator(XmlGenerator gen, Config config) { Collection<AtomicLongConfig> configs = config.getAtomicLongConfigs().values(); for (AtomicLongConfig atomicLongConfig : configs) { MergePolicyConfig mergePolicyConfig = atomicLongConfig.getMergePolicyConfig(); gen.open("atomic-long", "name", atomicLongConfig.getName()) .node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()) .node("quorum-ref", atomicLongConfig.getQuorumName()) .close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: atomicLongXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
atomicLongXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private ParcelableConnection parcelable(ConnectionInfo c) { return new ParcelableConnection( c.request.getAccountHandle(), c.state, c.capabilities, c.properties, c.supportedAudioRoutes, c.request.getAddress(), c.addressPresentation, c.callerDisplayName, c.callerDisplayNamePresentation, c.videoProvider, c.videoState, false, /* ringback requested */ false, /* voip audio mode */ 0, /* Connect Time for conf call on this connection */ 0, /* Connect Real Time comes from conference call */ c.statusHints, c.disconnectCause, c.conferenceableConnectionIds, c.extras, c.callerNumberVerificationStatus); }
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: parcelable File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android Fixed Code: private ParcelableConnection parcelable(ConnectionInfo c) { mLatestParcelableConnection = new ParcelableConnection( c.request.getAccountHandle(), c.state, c.capabilities, c.properties, c.supportedAudioRoutes, c.request.getAddress(), c.addressPresentation, c.callerDisplayName, c.callerDisplayNamePresentation, c.videoProvider, c.videoState, false, /* ringback requested */ false, /* voip audio mode */ 0, /* Connect Time for conf call on this connection */ 0, /* Connect Real Time comes from conference call */ c.statusHints, c.disconnectCause, c.conferenceableConnectionIds, c.extras, c.callerNumberVerificationStatus); return mLatestParcelableConnection; }
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
parcelable
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
1
Analyze the following code function for security vulnerabilities
void cleanUpUserLILPw(UserManagerService userManager, int userHandle) { mDirtyUsers.remove(userHandle); mSettings.removeUserLPw(userHandle); mPendingBroadcasts.remove(userHandle); if (mInstaller != null) { // Technically, we shouldn't be doing this with the package lock // held. However, this is very rare, and there is already so much // other disk I/O going on, that we'll let it slide for now. final StorageManager storage = mContext.getSystemService(StorageManager.class); for (VolumeInfo vol : storage.getWritablePrivateVolumes()) { final String volumeUuid = vol.getFsUuid(); if (DEBUG_INSTALL) Slog.d(TAG, "Removing user data on volume " + volumeUuid); mInstaller.removeUserDataDirs(volumeUuid, userHandle); } } mUserNeedsBadging.delete(userHandle); removeUnusedPackagesLILPw(userManager, userHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanUpUserLILPw 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
cleanUpUserLILPw
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
protected void obtainRole(LdapContext searchContext, String dn, SearchResult sr) throws NamingException, LoginException { if (trace) { log.trace("rolesSearch resultDN = " + dn); } String[] attrNames = {roleAttributeID}; Attributes result = null; if (sr == null || sr.isRelative()) { result = searchContext.getAttributes(dn, attrNames); } else { result = getAttributesFromReferralEntity(sr); } if (result != null && result.size() > 0) { Attribute roles = result.get(roleAttributeID); for (int n = 0; n < roles.size(); n++) { String roleName = (String) roles.get(n); if (roleAttributeIsDN) { // Query the roleDN location for the value of roleNameAttributeID String roleDN = "\"" + roleName + "\""; loadRoleByRoleNameAttributeID(searchContext, roleDN); recurseRolesSearch(searchContext, roleName); } else { // The role attribute value is the role name addRole(roleName); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: obtainRole File: jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java Repository: wildfly-security/jboss-negotiation The code follows secure coding practices.
[ "CWE-200" ]
CVE-2015-1849
MEDIUM
4.3
wildfly-security/jboss-negotiation
obtainRole
jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java
0dc9d191b6eb1d13b8f0189c5b02ba6576f4722e
0