instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public void render(DriverRequest httpRequest, String src, Writer out) throws IOException { try { HtmlDocumentBuilder htmlDocumentBuilder = new HtmlDocumentBuilder(); htmlDocumentBuilder.setDoctypeExpectation(DoctypeExpectation.NO_DOCTYPE_ERRORS); Document document = htmlDocumentBuilder.parse(new InputSource(new StringReader(src))); Source source = new DOMSource(document); DOMResult result = new DOMResult(); transformer.transform(source, result); XhtmlSerializer serializer = new XhtmlSerializer(out); Dom2Sax dom2Sax = new Dom2Sax(serializer, serializer); dom2Sax.parse(result.getNode()); } catch (TransformerException e) { throw new ProcessingFailedException("Failed to transform source", e); } catch (SAXException e) { throw new ProcessingFailedException("Failed serialize transformation result", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: render File: esigate-core/src/main/java/org/esigate/xml/XsltRenderer.java Repository: esigate The code follows secure coding practices.
[ "CWE-74" ]
CVE-2018-1000854
HIGH
7.5
esigate
render
esigate-core/src/main/java/org/esigate/xml/XsltRenderer.java
8461193d2f358bcf1c3fabf82891a66786bfb540
0
Analyze the following code function for security vulnerabilities
public void readListEnd() {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readListEnd File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
readListEnd
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
@Nullable private Collection<String> retrieveSshKeys(Attributes searchResultAttributes) { Attribute attribute = searchResultAttributes.get(getUserSshKeyAttribute()); if (attribute != null) { Collection<String> sshKeys = new ArrayList<>(); try { NamingEnumeration<?> ldapValues = attribute.getAll(); while (ldapValues.hasMore()) { Object value = ldapValues.next(); if (value instanceof String) sshKeys.add((String) value); else logger.error("SSH key from ldap is not a String"); } } catch (NamingException e) { logger.error("Error retrieving SSH keys", e); } return sshKeys; } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveSshKeys File: server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-90" ]
CVE-2021-32651
MEDIUM
4.3
theonedev/onedev
retrieveSshKeys
server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
4440f0c57e440488d7e653417b2547eaae8ad19c
0
Analyze the following code function for security vulnerabilities
@Override public Bitmap screenshotApplications(IBinder appToken, int displayId, int width, int height) { if (!checkCallingPermission(Manifest.permission.READ_FRAME_BUFFER, "screenshotApplications()")) { throw new SecurityException("Requires READ_FRAME_BUFFER permission"); } return screenshotApplicationsInner(appToken, displayId, width, height, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: screenshotApplications 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
screenshotApplications
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
void handleUnlockUser(int userId) { startOwnerService(userId, "unlock-user"); if (isPermissionCheckFlagEnabled() || isPolicyEngineForFinanceFlagEnabled()) { mDevicePolicyEngine.handleUnlockUser(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleUnlockUser 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
handleUnlockUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public final int startActivity(Intent intent) { mService.enforceNotIsolatedCaller("ActivityContainer.startActivity"); final int userId = mService.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), mCurrentUser, false, ActivityManagerService.ALLOW_FULL_ONLY, "ActivityContainer", null); // TODO: Switch to user app stacks here. String mimeType = intent.getType(); final Uri data = intent.getData(); if (mimeType == null && data != null && "content".equals(data.getScheme())) { mimeType = mService.getProviderMimeType(data, userId); } checkEmbeddedAllowedInner(userId, intent, mimeType); intent.addFlags(FORCE_NEW_TASK_FLAGS); return startActivityMayWait(null, -1, null, intent, mimeType, null, null, null, null, 0, 0, null, null, null, null, false, userId, this, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivity 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
startActivity
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
private void reloadHighlightMenuKey() { mMainFragment.getArguments().putString(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, getHighlightMenuKey()); mMainFragment.reloadHighlightMenuKey(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reloadHighlightMenuKey File: src/com/android/settings/homepage/SettingsHomepageActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21256
HIGH
7.8
android
reloadHighlightMenuKey
src/com/android/settings/homepage/SettingsHomepageActivity.java
62fc1d269f5e754fc8f00b6167d79c3933b4c1f4
0
Analyze the following code function for security vulnerabilities
public MemcachedClient getMemcachedClient() { return memcachedClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMemcachedClient File: integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
getMemcachedClient
integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java
69be66141eee7abb1c47d46f0a6b74b079709f4b
0
Analyze the following code function for security vulnerabilities
public int processBlock( byte[] in, int inOff, byte[] out, int outOff) { if (WorkingKey == null) { throw new IllegalStateException("AES engine not initialised"); } if ((inOff + (32 / 2)) > in.length) { throw new DataLengthException("input buffer too short"); } if ((outOff + (32 / 2)) > out.length) { throw new OutputLengthException("output buffer too short"); } if (forEncryption) { unpackBlock(in, inOff); encryptBlock(WorkingKey); packBlock(out, outOff); } else { unpackBlock(in, inOff); decryptBlock(WorkingKey); packBlock(out, outOff); } return BLOCK_SIZE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processBlock File: core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
processBlock
core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java
413b42f4d770456508585c830cfcde95f9b0e93b
0
Analyze the following code function for security vulnerabilities
public void addView(View v) throws IOException { viewGroupMixIn.addView(v); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addView File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
addView
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public ModalDialog setEscapeKeyEnabled(final boolean escapeKeyEnabled) { this.escapeKeyEnabled = escapeKeyEnabled; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEscapeKeyEnabled File: src/main/java/org/projectforge/web/dialog/ModalDialog.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
setEscapeKeyEnabled
src/main/java/org/projectforge/web/dialog/ModalDialog.java
422de35e3c3141e418a73bfb39b430d5fd74077e
0
Analyze the following code function for security vulnerabilities
@Override public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(taskId); data.writeInt(resizeable ? 1 : 0); mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTaskResizeable File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setTaskResizeable
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private static HttpQuery fakeHttpQuery() { final HttpQuery query = mock(HttpQuery.class); final Channel chan = NettyMocks.fakeChannel(); when(query.channel()).thenReturn(chan); return query; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fakeHttpQuery File: test/tsd/TestGraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
fakeHttpQuery
test/tsd/TestGraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
@Override public void saveAdminInfo(Admin admin) { String sql = "insert into admin_table(admin_name, password) values(?,?)"; try { ps = DbUtil.getConnection().prepareStatement(sql); ps.setString(1, admin.getAdminName()); ps.setString(2, admin.getPassword()); ps.executeUpdate(); } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveAdminInfo File: src/com/bijay/onlinevotingsystem/dao/AdminDaoImpl.java Repository: bijaythapaa/OnlineVotingSystem The code follows secure coding practices.
[ "CWE-916" ]
CVE-2021-21253
MEDIUM
5
bijaythapaa/OnlineVotingSystem
saveAdminInfo
src/com/bijay/onlinevotingsystem/dao/AdminDaoImpl.java
0181cb0272857696c8eb3e44fcf6cb014ff90f09
0
Analyze the following code function for security vulnerabilities
boolean containsAnyRawData() { return !mBundle.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsAnyRawData File: src/com/android/certinstaller/CredentialHelper.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
containsAnyRawData
src/com/android/certinstaller/CredentialHelper.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("ConstantConditions") // Only called when isMultipart was true. void addPart(MultipartBody.Part part) { multipartBuilder.addPart(part); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addPart File: retrofit/src/main/java/retrofit2/RequestBuilder.java Repository: square/retrofit The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-1000850
MEDIUM
6.4
square/retrofit
addPart
retrofit/src/main/java/retrofit2/RequestBuilder.java
b9a7f6ad72073ddd40254c0058710e87a073047d
0
Analyze the following code function for security vulnerabilities
public void save(AsyncResult<SQLConnection> sqlConnection, String table, String id, Object entity, boolean returnId, boolean upsert, Handler<AsyncResult<String>> replyHandler) { save(sqlConnection, table, id, entity, returnId, upsert, /* convertEntity */ true, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
save
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public XWikiAuthService getAuthService() { synchronized (this.AUTH_SERVICE_LOCK) { if (this.authService == null) { LOGGER.info("Initializing AuthService..."); try { Class<? extends XWikiAuthService> authClass = getAuthServiceClass(); setAuthService(authClass); } catch (Exception e) { LOGGER.warn("Failed to get the configured AuthService class, fallbacking on standard authenticator", e); this.authService = new XWikiAuthServiceImpl(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Initialized AuthService {} using 'new'.", this.authService.getClass().getName()); } } } return this.authService; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthService File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-36092
HIGH
7.5
xwiki/xwiki-platform
getAuthService
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
71a6d0bb6f8ab718fcfaae0e9b8c16c2d69cd4bb
0
Analyze the following code function for security vulnerabilities
public boolean hasPreferredDatabase() { return this.config.hasOption(ClickHouseClientOption.DATABASE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasPreferredDatabase File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
hasPreferredDatabase
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
@Override public boolean checkVoldPassword(int userId) throws RemoteException { if (!mFirstCallToVold) { return false; } mFirstCallToVold = false; checkPasswordReadPermission(userId); // There's no guarantee that this will safely connect, but if it fails // we will simply show the lock screen when we shouldn't, so relatively // benign. There is an outside chance something nasty would happen if // this service restarted before vold stales out the password in this // case. The nastiness is limited to not showing the lock screen when // we should, within the first minute of decrypting the phone if this // service can't connect to vold, it restarts, and then the new instance // does successfully connect. final IMountService service = getMountService(); String password = service.getPassword(); service.clearPassword(); if (password == null) { return false; } try { if (mLockPatternUtils.isLockPatternEnabled(userId)) { if (checkPattern(password, userId).getResponseCode() == GateKeeperResponse.RESPONSE_OK) { return true; } } } catch (Exception e) { } try { if (mLockPatternUtils.isLockPasswordEnabled(userId)) { if (checkPassword(password, userId).getResponseCode() == GateKeeperResponse.RESPONSE_OK) { return true; } } } catch (Exception e) { } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkVoldPassword File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
checkVoldPassword
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
@Override public boolean getCrossProfileContactsSearchDisabled(ComponentName who) { if (!mHasFeature) { return false; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isProfileOwner(caller)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerLocked(caller); return admin.disableContactsSearch; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCrossProfileContactsSearchDisabled 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
getCrossProfileContactsSearchDisabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean fitsInLong() { if (isZero()) { return true; } if (scale < 0) { return false; } int magnitude = getMagnitude(); if (magnitude < 18) { return true; } if (magnitude > 18) { return false; } // Hard case: the magnitude is 10^18. // The largest int64 is: 9,223,372,036,854,775,807 for (int p = 0; p < precision; p++) { byte digit = getDigit(18 - p); if (digit < INT64_BCD[p]) { return true; } else if (digit > INT64_BCD[p]) { return false; } } // Exactly equal to max long plus one. return isNegative(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fitsInLong File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
fitsInLong
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
public void handleMessage(Message msg) { switch (msg.what) { case HANDLE_UPDATE: { updateAppWidgetView(msg.arg1, (RemoteViews)msg.obj); break; } case HANDLE_PROVIDER_CHANGED: { onProviderChanged(msg.arg1, (AppWidgetProviderInfo)msg.obj); break; } case HANDLE_PROVIDERS_CHANGED: { onProvidersChanged(); break; } case HANDLE_VIEW_DATA_CHANGED: { viewDataChanged(msg.arg1, msg.arg2); break; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleMessage File: core/java/android/appwidget/AppWidgetHost.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
handleMessage
core/java/android/appwidget/AppWidgetHost.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); if (mAccessibilityTextOverride != null) { info.setText(mAccessibilityTextOverride); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onInitializeAccessibilityNodeInfo File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
onInitializeAccessibilityNodeInfo
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
void setArgumentQuoteDelimiter( char argQuoteDelimiterParameter ) { this.argQuoteDelimiter = argQuoteDelimiterParameter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setArgumentQuoteDelimiter File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
setArgumentQuoteDelimiter
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
@Override public void removePermission(String name) { synchronized (mPackages) { checkPermissionTreeLP(name); BasePermission bp = mSettings.mPermissions.get(name); if (bp != null) { if (bp.type != BasePermission.TYPE_DYNAMIC) { throw new SecurityException( "Not allowed to modify non-dynamic permission " + name); } mSettings.mPermissions.remove(name); mSettings.writeLPr(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removePermission 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
removePermission
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void sendErrorResponse(IAccountManagerResponse response, int errorCode, String errorMessage) { try { response.onError(errorCode, errorMessage); } catch (RemoteException e) { // if the caller is dead then there is no one to care about remote // exceptions if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "failure while notifying response", e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendErrorResponse File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
sendErrorResponse
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private static boolean containsAlias(AppUriAuthenticationPolicy policy, String alias) { for (Map.Entry<String, Map<Uri, String>> appsToUris : policy.getAppAndUriMappings().entrySet()) { for (Map.Entry<Uri, String> urisToAliases : appsToUris.getValue().entrySet()) { if (urisToAliases.getValue().equals(alias)) { return true; } } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsAlias 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
containsAlias
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public CertInformation getCertInformation(CertPath cPath) { return certs.get(cPath); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertInformation File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getCertInformation
core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java
2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99
0
Analyze the following code function for security vulnerabilities
@Override public void disableKeyguard(IBinder token, String tag) { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires DISABLE_KEYGUARD permission"); } // If this isn't coming from the system then don't allow disabling the lockscreen // to bypass security. if (Binder.getCallingUid() != Process.SYSTEM_UID && isKeyguardSecure()) { Log.d(TAG, "current mode is SecurityMode, ignore hide keyguard"); return; } if (token == null) { throw new IllegalArgumentException("token == null"); } mKeyguardDisableHandler.sendMessage(mKeyguardDisableHandler.obtainMessage( KeyguardDisableHandler.KEYGUARD_DISABLE, new Pair<IBinder, String>(token, tag))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disableKeyguard 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
disableKeyguard
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void initPackageTracking() { if (MORE_DEBUG) Slog.v(TAG, "` tracking"); // Remember our ancestral dataset mTokenFile = new File(mBaseStateDir, "ancestral"); try { RandomAccessFile tf = new RandomAccessFile(mTokenFile, "r"); int version = tf.readInt(); if (version == CURRENT_ANCESTRAL_RECORD_VERSION) { mAncestralToken = tf.readLong(); mCurrentToken = tf.readLong(); int numPackages = tf.readInt(); if (numPackages >= 0) { mAncestralPackages = new HashSet<String>(); for (int i = 0; i < numPackages; i++) { String pkgName = tf.readUTF(); mAncestralPackages.add(pkgName); } } } tf.close(); } catch (FileNotFoundException fnf) { // Probably innocuous Slog.v(TAG, "No ancestral data"); } catch (IOException e) { Slog.w(TAG, "Unable to read token file", e); } // Keep a log of what apps we've ever backed up. Because we might have // rebooted in the middle of an operation that was removing something from // this log, we sanity-check its contents here and reconstruct it. mEverStored = new File(mBaseStateDir, "processed"); File tempProcessedFile = new File(mBaseStateDir, "processed.new"); // If we were in the middle of removing something from the ever-backed-up // file, there might be a transient "processed.new" file still present. // Ignore it -- we'll validate "processed" against the current package set. if (tempProcessedFile.exists()) { tempProcessedFile.delete(); } // If there are previous contents, parse them out then start a new // file to continue the recordkeeping. if (mEverStored.exists()) { RandomAccessFile temp = null; RandomAccessFile in = null; try { temp = new RandomAccessFile(tempProcessedFile, "rws"); in = new RandomAccessFile(mEverStored, "r"); // Loop until we hit EOF while (true) { String pkg = in.readUTF(); try { // is this package still present? mPackageManager.getPackageInfo(pkg, 0); // if we get here then yes it is; remember it mEverStoredApps.add(pkg); temp.writeUTF(pkg); if (MORE_DEBUG) Slog.v(TAG, " + " + pkg); } catch (NameNotFoundException e) { // nope, this package was uninstalled; don't include it if (MORE_DEBUG) Slog.v(TAG, " - " + pkg); } } } catch (EOFException e) { // Once we've rewritten the backup history log, atomically replace the // old one with the new one then reopen the file for continuing use. if (!tempProcessedFile.renameTo(mEverStored)) { Slog.e(TAG, "Error renaming " + tempProcessedFile + " to " + mEverStored); } } catch (IOException e) { Slog.e(TAG, "Error in processed file", e); } finally { try { if (temp != null) temp.close(); } catch (IOException e) {} try { if (in != null) in.close(); } catch (IOException e) {} } } synchronized (mQueueLock) { // Resume the full-data backup queue mFullBackupQueue = readFullBackupSchedule(); } // Register for broadcasts about package install, etc., so we can // update the provider list. IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_PACKAGE_ADDED); filter.addAction(Intent.ACTION_PACKAGE_REMOVED); filter.addAction(Intent.ACTION_PACKAGE_CHANGED); filter.addDataScheme("package"); mContext.registerReceiver(mBroadcastReceiver, filter); // Register for events related to sdcard installation. IntentFilter sdFilter = new IntentFilter(); sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE); sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE); mContext.registerReceiver(mBroadcastReceiver, sdFilter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initPackageTracking 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
initPackageTracking
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Override public int hashCode() { return Objects.hash(mMinHomeDownlinkBandwidth, mMinHomeUplinkBandwidth, mMinRoamingDownlinkBandwidth, mMinRoamingUplinkBandwidth, mExcludedSsidList, mRequiredProtoPortMap, mMaximumBssLoadValue, mPreferredRoamingPartnerList, mPolicyUpdate); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCode File: framework/java/android/net/wifi/hotspot2/pps/Policy.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21240
MEDIUM
5.5
android
hashCode
framework/java/android/net/wifi/hotspot2/pps/Policy.java
69119d1d3102e27b6473c785125696881bce9563
0
Analyze the following code function for security vulnerabilities
private PhoneSubInfoProxy getPhoneSubInfoProxy(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); try { return getPhone(phoneId).getPhoneSubInfoProxy(); } catch (NullPointerException e) { Rlog.e(TAG, "Exception is :" + e.toString() + " For subId :" + subId); e.printStackTrace(); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPhoneSubInfoProxy File: src/java/com/android/internal/telephony/PhoneSubInfoController.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-0831
MEDIUM
4.3
android
getPhoneSubInfoProxy
src/java/com/android/internal/telephony/PhoneSubInfoController.java
79eecef63f3ea99688333c19e22813f54d4a31b1
0
Analyze the following code function for security vulnerabilities
public void setNew(boolean aNew) { this.isNew = aNew; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNew File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setNew
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private void bindSnoozeAction(RemoteViews big, StandardTemplateParams p) { boolean hideSnoozeButton = mN.isForegroundService() || mN.fullScreenIntent != null || isBackgroundColorized(p) || p.mViewType != StandardTemplateParams.VIEW_TYPE_BIG; big.setBoolean(R.id.snooze_button, "setEnabled", !hideSnoozeButton); if (hideSnoozeButton) { // Only hide; NotificationContentView will show it when it adds the click listener big.setViewVisibility(R.id.snooze_button, View.GONE); } final boolean snoozeEnabled = !hideSnoozeButton && mContext.getContentResolver() != null && isSnoozeSettingEnabled(); if (snoozeEnabled) { big.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, 0); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindSnoozeAction File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
bindSnoozeAction
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public static void cursorDoubleToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getDouble(index)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cursorDoubleToContentValuesIfPresent File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
cursorDoubleToContentValuesIfPresent
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setAttachmentStore(XWikiAttachmentStoreInterface attachmentStore) { this.defaultAttachmentContentStore = attachmentStore; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAttachmentStore File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
setAttachmentStore
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException { TrustManager[] trustAllCerts = new X509TrustManager[] { new X509TrustManager() { @Override public X509Certificate[] getAcceptedIssuers() { return null; } @Override public void checkClientTrusted(X509Certificate[] certs, String authType) { } @Override public void checkServerTrusted(X509Certificate[] certs, String authType) { } } }; SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, trustAllCerts, new SecureRandom()); clientBuilder.sslContext(sslContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disableCertificateValidation File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
disableCertificateValidation
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public static void copyStream(InputStream inputStream, OutputStream outputStream) throws IOException { byte[] buf = new byte[BUFFER_SIZE]; int len; while (-1 != (len = inputStream.read(buf))) { outputStream.write(buf, 0, len); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyStream File: APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java Repository: Calsign/APDE The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36628
CRITICAL
9.8
Calsign/APDE
copyStream
APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java
c6d64cbe465348c1bfd211122d89e3117afadecf
0
Analyze the following code function for security vulnerabilities
@Test public void parseHistogramQueryMType() throws Exception { HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&m=sum:percentiles[0.98]:msg.end2end.latency"); TSQuery tsq = (TSQuery) parseQuery.invoke(rpc, tsdb, query, expressions); assertNotNull(tsq); assertEquals("1h-ago", tsq.getStart()); assertNotNull(tsq.getQueries()); TSSubQuery sub = tsq.getQueries().get(0); assertNotNull(sub); assertEquals("sum", sub.getAggregator()); assertEquals("msg.end2end.latency", sub.getMetric()); assertEquals(0.98f, sub.getPercentiles().get(0).floatValue(), 0.0001); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseHistogramQueryMType File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
parseHistogramQueryMType
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
public void switchCamera() { CameraVideoCapturer cameraVideoCapturer = (CameraVideoCapturer) videoCapturer; if (cameraVideoCapturer != null) { cameraVideoCapturer.switchCamera(new CameraVideoCapturer.CameraSwitchHandler() { @Override public void onCameraSwitchDone(boolean currentCameraIsFront) { binding.selfVideoRenderer.setMirror(currentCameraIsFront); } @Override public void onCameraSwitchError(String s) { } }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchCamera File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
switchCamera
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
public Principal authenticateSSL(Request request, Response response) throws IOException { // Retrieve the certificate chain for this client if (containerLog.isDebugEnabled()) { containerLog.debug(" Looking up certificates"); } X509Certificate[] certs = (X509Certificate[]) request.getAttribute(Globals.CERTIFICATES_ATTR); if ((certs == null) || (certs.length < 1)) { try { request.getCoyoteRequest().action(ActionCode.ACTION_REQ_SSL_CERTIFICATE, null); } catch (IllegalStateException ise) { // Request body was too large for save buffer response.sendError(HttpServletResponse.SC_UNAUTHORIZED, sm.getString("authenticator.certificates")); return null; } certs = (X509Certificate[]) request.getAttribute(Globals.CERTIFICATES_ATTR); } if ((certs == null) || (certs.length < 1)) { if (containerLog.isDebugEnabled()) { containerLog.debug(" No certificates included with this request"); } response.sendError(HttpServletResponse.SC_UNAUTHORIZED, sm.getString("authenticator.certificates")); return null; } // Authenticate the specified certificate chain Principal principal = getContext().getRealm().authenticate(certs); if (principal == null) { if (containerLog.isDebugEnabled()) { containerLog.debug(" Realm.authenticate() returned false"); } response.sendError(HttpServletResponse.SC_UNAUTHORIZED, sm.getString("authenticator.unauthorized")); return null; } return principal; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: authenticateSSL File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
authenticateSSL
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
@GetMapping("/get/ws-pj/{userId}") public Map<Object, Object> getWSAndProjectByUserId(@PathVariable String userId) { return baseUserService.getWSAndProjectByUserId(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWSAndProjectByUserId File: framework/sdk-parent/sdk/src/main/java/io/metersphere/controller/BaseUserController.java Repository: metersphere The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-38494
HIGH
7.5
metersphere
getWSAndProjectByUserId
framework/sdk-parent/sdk/src/main/java/io/metersphere/controller/BaseUserController.java
a23f75d93b666901fd148d834df9384f6f24cf28
0
Analyze the following code function for security vulnerabilities
@PostMapping(value = "/exposednextday") @Loggable @Transactional @Operation(description = "Allows the client to send the last exposed key of the infection to the backend server. The JWT must come from a previous call to /exposed") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "The exposed key has been stored in the backend"), @ApiResponse(responseCode = "400", description = "- Ivnalid base64 encoded Temporary Exposure Key" + "- TEK-date does not match delayedKeyDAte claim in Jwt" + "- TEK has negative rolling period"), @ApiResponse(responseCode = "403", description = "No delayedKeyDate claim in authentication") }) public @ResponseBody Callable<ResponseEntity<String>> addExposedSecond( @Valid @RequestBody @Parameter(description = "The last exposed key of the user") GaenSecondDay gaenSecondDay, @RequestHeader(value = "User-Agent") @Parameter(description = "App Identifier (PackageName/BundleIdentifier) + App-Version + OS (Android/iOS) + OS-Version", example = "ch.ubique.android.starsdk;1.0;iOS;13.3") String userAgent, @AuthenticationPrincipal @Parameter(description = "JWT token that can be verified by the backend server, must have been created by /v1/gaen/exposed and contain the delayedKeyDate") Object principal) { var now = Instant.now().toEpochMilli(); if (!validationUtils.isValidBase64Key(gaenSecondDay.getDelayedKey().getKeyData())) { return () -> new ResponseEntity<>("No valid base64 key", HttpStatus.BAD_REQUEST); } if (principal instanceof Jwt && !((Jwt) principal).containsClaim("delayedKeyDate")) { return () -> ResponseEntity.status(HttpStatus.FORBIDDEN).body("claim does not contain delayedKeyDate"); } if (principal instanceof Jwt) { var jwt = (Jwt) principal; var claimKeyDate = Integer.parseInt(jwt.getClaimAsString("delayedKeyDate")); if (!gaenSecondDay.getDelayedKey().getRollingStartNumber().equals(claimKeyDate)) { return () -> ResponseEntity.badRequest().body("keyDate does not match claim keyDate"); } } if (!this.validateRequest.isFakeRequest(principal, gaenSecondDay.getDelayedKey())) { if (gaenSecondDay.getDelayedKey().getRollingPeriod().equals(0)) { // currently only android seems to send 0 which can never be valid, since a non used key should not be submitted // default value according to EN is 144, so just set it to that. If we ever get 0 from iOS we should log it, since // this should not happen gaenSecondDay.getDelayedKey().setRollingPeriod(GaenKey.GaenKeyDefaultRollingPeriod); if(userAgent.toLowerCase().contains("ios")) { logger.error("Received a rolling period of 0 for an iOS User-Agent"); } } else if(gaenSecondDay.getDelayedKey().getRollingPeriod() < 0) { return () -> ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Rolling Period MUST NOT be negative."); } List<GaenKey> keys = new ArrayList<>(); keys.add(gaenSecondDay.getDelayedKey()); dataService.upsertExposees(keys); } return () -> { normalizeRequestTime(now); return ResponseEntity.ok().body("OK"); }; }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2020-26230 - Severity: LOW - CVSS Score: 2.6 Description: [MAPR] AOP aspects ordering Function: addExposedSecond File: dpppt-backend-sdk/dpppt-backend-sdk-ws/src/main/java/org/dpppt/backend/sdk/ws/controller/GaenController.java Repository: RadarCOVID/radar-covid-backend-dp3t-server Fixed Code: @PostMapping(value = "/exposednextday") @Loggable @ResponseRetention(time = "application.response.retention.time.exposednextday") @Transactional @Operation(description = "Allows the client to send the last exposed key of the infection to the backend server. The JWT must come from a previous call to /exposed") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "The exposed key has been stored in the backend"), @ApiResponse(responseCode = "400", description = "- Ivnalid base64 encoded Temporary Exposure Key" + "- TEK-date does not match delayedKeyDAte claim in Jwt" + "- TEK has negative rolling period"), @ApiResponse(responseCode = "403", description = "No delayedKeyDate claim in authentication") }) public @ResponseBody Callable<ResponseEntity<String>> addExposedSecond( @Valid @RequestBody @Parameter(description = "The last exposed key of the user") GaenSecondDay gaenSecondDay, @RequestHeader(value = "User-Agent") @Parameter(description = "App Identifier (PackageName/BundleIdentifier) + App-Version + OS (Android/iOS) + OS-Version", example = "ch.ubique.android.starsdk;1.0;iOS;13.3") String userAgent, @AuthenticationPrincipal @Parameter(description = "JWT token that can be verified by the backend server, must have been created by /v1/gaen/exposed and contain the delayedKeyDate") Object principal) { var now = Instant.now().toEpochMilli(); if (!validationUtils.isValidBase64Key(gaenSecondDay.getDelayedKey().getKeyData())) { return () -> new ResponseEntity<>("No valid base64 key", HttpStatus.BAD_REQUEST); } if (principal instanceof Jwt && !((Jwt) principal).containsClaim("delayedKeyDate")) { return () -> ResponseEntity.status(HttpStatus.FORBIDDEN).body("claim does not contain delayedKeyDate"); } if (principal instanceof Jwt) { var jwt = (Jwt) principal; var claimKeyDate = Integer.parseInt(jwt.getClaimAsString("delayedKeyDate")); if (!gaenSecondDay.getDelayedKey().getRollingStartNumber().equals(claimKeyDate)) { return () -> ResponseEntity.badRequest().body("keyDate does not match claim keyDate"); } } if (!this.validateRequest.isFakeRequest(principal, gaenSecondDay.getDelayedKey())) { if (gaenSecondDay.getDelayedKey().getRollingPeriod().equals(0)) { // currently only android seems to send 0 which can never be valid, since a non used key should not be submitted // default value according to EN is 144, so just set it to that. If we ever get 0 from iOS we should log it, since // this should not happen gaenSecondDay.getDelayedKey().setRollingPeriod(GaenKey.GaenKeyDefaultRollingPeriod); if(userAgent.toLowerCase().contains("ios")) { logger.error("Received a rolling period of 0 for an iOS User-Agent"); } } else if(gaenSecondDay.getDelayedKey().getRollingPeriod() < 0) { return () -> ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Rolling Period MUST NOT be negative."); } List<GaenKey> keys = new ArrayList<>(); keys.add(gaenSecondDay.getDelayedKey()); dataService.upsertExposees(keys); } return () -> { normalizeRequestTime(now); return ResponseEntity.ok().body("OK"); }; }
[ "CWE-200" ]
CVE-2020-26230
LOW
2.6
RadarCOVID/radar-covid-backend-dp3t-server
addExposedSecond
dpppt-backend-sdk/dpppt-backend-sdk-ws/src/main/java/org/dpppt/backend/sdk/ws/controller/GaenController.java
6d30c92cc8fcbde3ded7e9518853ef278080344d
1
Analyze the following code function for security vulnerabilities
@Override public void setDisconnectListener(DisconnectListener listener) { this.disconnectListener = listener == null ? this : listener; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDisconnectListener File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
setDisconnectListener
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
public void enableCsrf(boolean xsrfProtectionEnabled) { this.xsrfProtectionEnabled = xsrfProtectionEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enableCsrf File: fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31406
LOW
1.9
vaadin/flow
enableCsrf
fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
3fe644cab2cffa5b86316dbe71b11df1083861a9
0
Analyze the following code function for security vulnerabilities
@Override public final void extract() throws ArchiverException { validate(); execute(); runArchiveFinalizers(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extract File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java Repository: codehaus-plexus/plexus-archiver The code follows secure coding practices.
[ "CWE-22", "CWE-61" ]
CVE-2023-37460
CRITICAL
9.8
codehaus-plexus/plexus-archiver
extract
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
54759839fbdf85caf8442076f001d5fd64e0dcb2
0
Analyze the following code function for security vulnerabilities
@Override public void onExtrasChanged(Bundle extras) { Log.w(this, "FakeConference onExtrasChanged"); mExtrasLock.countDown(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onExtrasChanged File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
onExtrasChanged
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override public String getLastError() { return mLastError; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastError File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
getLastError
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
@Override public boolean removeTask(int taskId) { mAmInternal.enforceCallingPermission(REMOVE_TASKS, "removeTask()"); synchronized (mGlobalLock) { final long ident = Binder.clearCallingIdentity(); try { final Task task = mRootWindowContainer.anyTaskForId(taskId, MATCH_ATTACHED_TASK_OR_RECENT_TASKS); if (task == null) { Slog.w(TAG, "removeTask: No task remove with id=" + taskId); return false; } if (task.isLeafTask()) { mTaskSupervisor.removeTask(task, true, REMOVE_FROM_RECENTS, "remove-task"); } else { mTaskSupervisor.removeRootTask(task); } return true; } finally { Binder.restoreCallingIdentity(ident); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeTask 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
removeTask
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public IntValues getValues(String tableName, DownSampling downsampling, long startTB, long endTB, Where where, String valueCName, Function function) throws IOException { List<KeyValues> whereKeyValues = where.getKeyValues(); String op; switch (function) { case Avg: op = "avg"; break; default: op = "sum"; } List<String> ids = new ArrayList<>(20); StringBuilder whereSql = new StringBuilder(); if (whereKeyValues.size() > 0) { whereSql.append("("); for (int i = 0; i < whereKeyValues.size(); i++) { if (i != 0) { whereSql.append(" or "); } KeyValues keyValues = whereKeyValues.get(i); StringBuilder valueCollection = new StringBuilder(); List<String> values = keyValues.getValues(); for (int valueIdx = 0; valueIdx < values.size(); valueIdx++) { if (valueIdx != 0) { valueCollection.append(","); } String id = values.get(valueIdx); ids.add(id); valueCollection.append("'").append(id).append("'"); } whereSql.append(keyValues.getKey()).append(" in (").append(valueCollection).append(")"); } whereSql.append(") and "); } IntValues intValues = new IntValues(); try (Connection connection = h2Client.getConnection()) { try (ResultSet resultSet = h2Client.executeQuery( connection, "select " + Metrics.ENTITY_ID + " id, " + op + "(" + valueCName + ") value from " + tableName + " where " + whereSql + Metrics.TIME_BUCKET + ">= ? and " + Metrics.TIME_BUCKET + "<=?" + " group by " + Metrics.ENTITY_ID, startTB, endTB )) { while (resultSet.next()) { KVInt kv = new KVInt(); kv.setId(resultSet.getString("id")); kv.setValue(resultSet.getLong("value")); intValues.addKVInt(kv); } } } catch (SQLException e) { throw new IOException(e); } return intValues; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValues File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetricsQueryDAO.java Repository: apache/skywalking The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-9483
MEDIUM
5
apache/skywalking
getValues
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetricsQueryDAO.java
2b6aae3b733f9dbeae1d6eff4f1975c723e1e7d1
0
Analyze the following code function for security vulnerabilities
protected void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) { mUploadMessage = uploadMsg; Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType(acceptType); AndroidNativeUtil.getActivity().startActivityForResult(Intent.createChooser(intent, "File Browser"), FILECHOOSER_RESULTCODE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openFileChooser 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
openFileChooser
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public IBinder onBind(Intent intent) { return mBinder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onBind File: src/main/java/com/owncloud/android/files/services/FileDownloader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
onBind
src/main/java/com/owncloud/android/files/services/FileDownloader.java
27559efb79d45782e000b762860658d49e9c35e9
0
Analyze the following code function for security vulnerabilities
@Nullable NodeId getDataType() throws UaException { Object value = getValue(dataType); if (value instanceof NodeId) { return (NodeId) value; } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDataType File: opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java Repository: eclipse/milo The code follows secure coding practices.
[ "CWE-770" ]
CVE-2022-25897
HIGH
7.5
eclipse/milo
getDataType
opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java
4534381760d7d9f0bf00cbf6a8449bb0d13c6ce5
0
Analyze the following code function for security vulnerabilities
@Override public Bundle getExtras() { synchronized (mLock) { return mExtras; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExtras 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
getExtras
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
@Override public boolean canGcNow() { synchronized (mGlobalLock) { return isSleeping() || mRootWindowContainer.allResumedActivitiesIdle(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canGcNow 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
canGcNow
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void setXMLOutput(boolean isXMLOutput) { this.xmlOutput = isXMLOutput; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setXMLOutput File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setXMLOutput
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public void createOssUser(User user) { user.setCreateTime(System.currentTimeMillis()); user.setUpdateTime(System.currentTimeMillis()); user.setStatus(UserStatus.NORMAL); if (StringUtils.isBlank(user.getEmail())) { user.setEmail(user.getId() + "@metershpere.io"); } userMapper.insertSelective(user); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createOssUser File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-32699
MEDIUM
6.5
metersphere
createOssUser
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
c59e381d368990214813085a1a4877c5ef865411
0
Analyze the following code function for security vulnerabilities
protected boolean isAutoAckPingFrame() { return autoAckPingFrame; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAutoAckPingFrame File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
netty
isAutoAckPingFrame
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
0
Analyze the following code function for security vulnerabilities
public boolean isEditCommentMandatory() { return this.xwiki.isEditCommentMandatory(this.context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEditCommentMandatory 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
isEditCommentMandatory
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
@Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); Log_OC.d(TAG, "onNewIntent()"); if (intent.getBooleanExtra(FirstRunActivity.EXTRA_EXIT, false)) { super.finish(); } onlyAdd = intent.getBooleanExtra(KEY_ONLY_ADD, false) || checkIfViaSSO(intent); // Passcode PassCodeManager passCodeManager = new PassCodeManager(preferences); passCodeManager.onActivityStarted(this); Uri data = intent.getData(); if (data != null && data.toString().startsWith(getString(R.string.login_data_own_scheme))) { if (!getResources().getBoolean(R.bool.multiaccount_support) && accountManager.getAccounts().length == 1) { Toast.makeText(this, R.string.no_mutliple_accounts_allowed, Toast.LENGTH_LONG).show(); finish(); return; } else { parseAndLoginFromWebView(data.toString()); } } if (intent.getBooleanExtra(EXTRA_USE_PROVIDER_AS_WEBLOGIN, false)) { setContentView(R.layout.account_setup_webview); mLoginWebView = findViewById(R.id.login_webview); initWebViewLogin(getString(R.string.provider_registration_server), true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onNewIntent File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
onNewIntent
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
public void setIssuedBy(String issuedBy) { this.issuedBy = issuedBy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIssuedBy File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setIssuedBy
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override protected HistoryWidget createHistoryWidget() { return new BuildHistoryWidget<R>(this,builds,HISTORY_ADAPTER); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createHistoryWidget 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
createHistoryWidget
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public <T> void write(T payload) { if (payload == null) { LOG.debug("Payload was null. Skipping."); return; } String canonicalClassName = AutoValueUtils.getCanonicalName(payload.getClass()); write(canonicalClassName, payload); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: write File: graylog2-server/src/main/java/org/graylog2/cluster/ClusterConfigServiceImpl.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
write
graylog2-server/src/main/java/org/graylog2/cluster/ClusterConfigServiceImpl.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
0
Analyze the following code function for security vulnerabilities
@Override protected void reconfigureClientAuth() { if (ssl_fd == null || !as_server) { return; } // This method is called by JSSEngine's setNeedClientAuth and // setWantClientAuth to inform us of a change in value here. When // we've already configured ssl_fd and we're a server, we need to // inform NSS of this change; this usually indicates Post-Handshake // Authentication is required. try { configureClientAuth(); } catch (SSLException se) { // We cannot throw SSLException from this helper because it // is called from setNeedClientAuth and setWantClientAuth, // both of which don't disclose SSLException. throw new RuntimeException(se.getMessage(), se); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reconfigureClientAuth 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
reconfigureClientAuth
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
public String parameterToString(Object param) { if (param == null) { return ""; } else if (param instanceof Date) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } b.append(String.valueOf(o)); } return b.toString(); } else { return String.valueOf(param); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToString File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
parameterToString
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override protected List<Contentlet> getContentletsByIdentifier(String identifier) throws DotDataException, DotStateException, DotSecurityException { return getContentletsByIdentifier(identifier, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentletsByIdentifier File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getContentletsByIdentifier
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public static BufferedImage getTime01() { return getImage("time01.png"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTime01 File: src/net/sourceforge/plantuml/version/PSystemVersion.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
getTime01
src/net/sourceforge/plantuml/version/PSystemVersion.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
boolean hasUserSetupCompleted(DevicePolicyData userData) { return userData.mUserSetupComplete; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasUserSetupCompleted 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
hasUserSetupCompleted
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean impliesTypePermGlobal(Resolved resolved, User user, String[] actions, IndexNameExpressionResolver resolver, ClusterService cs) { Set<IndexPattern> ipatterns = new HashSet<ConfigModelV7.IndexPattern>(); roles.stream().forEach(p -> ipatterns.addAll(p.getIpatterns())); return ConfigModelV7.impliesTypePerm(ipatterns, resolved, user, actions, resolver, cs); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: impliesTypePermGlobal File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
impliesTypePermGlobal
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
public void removeDomChangeListener(final DomChangeListener listener) { WebAssert.notNull("listener", listener); synchronized (listeners_lock_) { if (domListeners_ != null) { domListeners_.remove(listener); domListenersList_ = null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeDomChangeListener 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
removeDomChangeListener
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@Override public void setEnabledCipherSuites(String[] cipherSuites) { checkNotNull(cipherSuites, "cipherSuites"); final StringBuilder buf = new StringBuilder(); for (String c: cipherSuites) { if (c == null) { break; } String converted = CipherSuiteConverter.toOpenSsl(c); if (converted == null) { converted = c; } if (!OpenSsl.isCipherSuiteAvailable(converted)) { throw new IllegalArgumentException("unsupported cipher suite: " + c + '(' + converted + ')'); } buf.append(converted); buf.append(':'); } if (buf.length() == 0) { throw new IllegalArgumentException("empty cipher suites"); } buf.setLength(buf.length() - 1); final String cipherSuiteSpec = buf.toString(); synchronized (this) { if (!isDestroyed()) { try { SSL.setCipherSuites(ssl, cipherSuiteSpec); } catch (Exception e) { throw new IllegalStateException("failed to enable cipher suites: " + cipherSuiteSpec, e); } } else { throw new IllegalStateException("failed to enable cipher suites: " + cipherSuiteSpec); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEnabledCipherSuites File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
setEnabledCipherSuites
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
private void updateQsExpansionEnabled() { mNotificationPanel.setQsExpansionEnabled(isDeviceProvisioned() && (mUserSetup || mUserSwitcherController == null || !mUserSwitcherController.isSimpleUserSwitcher()) && ((mDisabled2 & StatusBarManager.DISABLE2_QUICK_SETTINGS) == 0) && !mDozing && !ONLY_CORE_APPS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateQsExpansionEnabled 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
updateQsExpansionEnabled
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override protected void createDefaultClientScopesImpl(RealmModel newRealm) { ClientScopeModel roleListScope = newRealm.addClientScope(SCOPE_ROLE_LIST); roleListScope.setDescription("SAML role list"); roleListScope.setDisplayOnConsentScreen(true); roleListScope.setConsentScreenText(ROLE_LIST_CONSENT_TEXT); roleListScope.setProtocol(getId()); roleListScope.addProtocolMapper(builtins.get("role list")); newRealm.addDefaultClientScope(roleListScope, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createDefaultClientScopesImpl File: services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java Repository: keycloak The code follows secure coding practices.
[ "CWE-287" ]
CVE-2021-3827
MEDIUM
6.8
keycloak
createDefaultClientScopesImpl
services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java
44000caaf5051d7f218d1ad79573bd3d175cad0d
0
Analyze the following code function for security vulnerabilities
private int checkUidPermission(int uid, String permName) { // Not using Objects.requireNonNull() here for compatibility reasons. if (permName == null) { return PackageManager.PERMISSION_DENIED; } final CheckPermissionDelegate checkPermissionDelegate; synchronized (mLock) { checkPermissionDelegate = mCheckPermissionDelegate; } if (checkPermissionDelegate == null) { return mPermissionManagerServiceImpl.checkUidPermission(uid, permName); } return checkPermissionDelegate.checkUidPermission(uid, permName, mPermissionManagerServiceImpl::checkUidPermission); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkUidPermission File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
checkUidPermission
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
private Object getText(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); StandardEvaluationContext context = new StandardEvaluationContext(root); context.addPropertyAccessor(new MapAccessor()); return message.getValue(context, String.class); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: getText File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: private Object getText(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); SimpleEvaluationContext context = SimpleEvaluationContext .forPropertyAccessors(DataBindingPropertyAccessor.forReadOnlyAccess(), new MapAccessor()) .withRootObject(root).build(); return message.getValue(context, String.class); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getText
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
public String getUnit() { return m_unit; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUnit File: src/org/opencms/file/types/CmsResourceTypeImage.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3312
MEDIUM
4
alkacon/opencms-core
getUnit
src/org/opencms/file/types/CmsResourceTypeImage.java
92e035423aa6967822d343e54392d4291648c0ee
0
Analyze the following code function for security vulnerabilities
private V fromLong(K name, long value) { try { return valueConverter.convertLong(value); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Failed to convert long value for header '" + name + '\'', e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromLong File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
fromLong
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public void fadeKeyguardWhilePulsing() { mNotificationPanel.notifyStartFading(); mNotificationPanel.animate() .alpha(0f) .setStartDelay(0) .setDuration(FADE_KEYGUARD_DURATION_PULSING) .setInterpolator(ScrimController.KEYGUARD_FADE_OUT_INTERPOLATOR) .start(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fadeKeyguardWhilePulsing 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
fadeKeyguardWhilePulsing
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private String getGnuplotBasePath(final TSDB tsdb, final HttpQuery query) { final Map<String, List<String>> q = query.getQueryString(); q.remove("ignore"); // Super cheap caching mechanism: hash the query string. final HashMap<String, List<String>> qs = new HashMap<String, List<String>>(q); // But first remove the parameters that don't influence the output. qs.remove("png"); qs.remove("json"); qs.remove("ascii"); return tsdb.getConfig().getDirectoryName("tsd.http.cachedir") + Integer.toHexString(qs.hashCode()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGnuplotBasePath File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
getGnuplotBasePath
src/tsd/GraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
public String getSchemaSwitchCommand() { return this.dbSchemaChangeCommand; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15558 - Severity: HIGH - CVSS Score: 7.5 Description: fix sql injection Function: getSchemaSwitchCommand File: xm-commons-migration-db/src/main/java/com/icthh/xm/commons/migration/db/tenant/SchemaChangeResolver.java Repository: xm-online/xm-commons Fixed Code: @Deprecated public String getSchemaSwitchCommand() { return this.dbSchemaChangeCommand; }
[ "CWE-89" ]
CVE-2019-15558
HIGH
7.5
xm-online/xm-commons
getSchemaSwitchCommand
xm-commons-migration-db/src/main/java/com/icthh/xm/commons/migration/db/tenant/SchemaChangeResolver.java
de96e9c4339e37ab1172e3a4e16ee2b7dfe74a70
1
Analyze the following code function for security vulnerabilities
@Override public void revokeRuntimePermission(String packageName, String name, int userId) { if (!sUserManager.exists(userId)) { Log.e(TAG, "No such user:" + userId); return; } mContext.enforceCallingOrSelfPermission( android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS, "revokeRuntimePermission"); enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "revokeRuntimePermission"); final int appId; synchronized (mPackages) { final PackageParser.Package pkg = mPackages.get(packageName); if (pkg == null) { throw new IllegalArgumentException("Unknown package: " + packageName); } final BasePermission bp = mSettings.mPermissions.get(name); if (bp == null) { throw new IllegalArgumentException("Unknown permission: " + name); } enforceDeclaredAsUsedAndRuntimeOrDevelopmentPermission(pkg, bp); SettingBase sb = (SettingBase) pkg.mExtras; if (sb == null) { throw new IllegalArgumentException("Unknown package: " + packageName); } final PermissionsState permissionsState = sb.getPermissionsState(); final int flags = permissionsState.getPermissionFlags(name, userId); if ((flags & PackageManager.FLAG_PERMISSION_SYSTEM_FIXED) != 0) { throw new SecurityException("Cannot revoke system fixed permission: " + name + " for package: " + packageName); } if (bp.isDevelopment()) { // Development permissions must be handled specially, since they are not // normal runtime permissions. For now they apply to all users. if (permissionsState.revokeInstallPermission(bp) != PermissionsState.PERMISSION_OPERATION_FAILURE) { scheduleWriteSettingsLocked(); } return; } if (permissionsState.revokeRuntimePermission(bp, userId) == PermissionsState.PERMISSION_OPERATION_FAILURE) { return; } mOnPermissionChangeListeners.onPermissionsChanged(pkg.applicationInfo.uid); // Critical, after this call app should never have the permission. mSettings.writeRuntimePermissionsForUserLPr(userId, true); appId = UserHandle.getAppId(pkg.applicationInfo.uid); } killUid(appId, userId, KILL_APP_REASON_PERMISSIONS_REVOKED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revokeRuntimePermission 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
revokeRuntimePermission
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public Iterable<Map.Entry<String, String>> getAllRequestHeaders() { return request.headers(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllRequestHeaders File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
getAllRequestHeaders
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
private int updateLruProcessInternalLocked(ProcessRecord app, long now, int index, String what, Object obj, ProcessRecord srcApp) { app.lastActivityTime = now; if (app.activities.size() > 0) { // Don't want to touch dependent processes that are hosting activities. return index; } int lrui = mLruProcesses.lastIndexOf(app); if (lrui < 0) { Slog.wtf(TAG, "Adding dependent process " + app + " not on LRU list: " + what + " " + obj + " from " + srcApp); return index; } if (lrui >= index) { // Don't want to cause this to move dependent processes *back* in the // list as if they were less frequently used. return index; } if (lrui >= mLruProcessActivityStart) { // Don't want to touch dependent processes that are hosting activities. return index; } mLruProcesses.remove(lrui); if (index > 0) { index--; } if (DEBUG_LRU) Slog.d(TAG_LRU, "Moving dep from " + lrui + " to " + index + " in LRU list: " + app); mLruProcesses.add(index, app); return index; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLruProcessInternalLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
updateLruProcessInternalLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public JSON getJSON() { return json; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJSON File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getJSON
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override boolean check(WanReplicationConfig c1, WanReplicationConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getName(), c2.getName()) && isCompatible(c1.getWanConsumerConfig(), c2.getWanConsumerConfig()) && isCollectionCompatible(c1.getWanPublisherConfigs(), c2.getWanPublisherConfigs(), new WanPublisherConfigChecker()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public String getVoiceMailAlphaTag() { return getVoiceMailAlphaTagForSubscriber(getDefaultSubscription()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVoiceMailAlphaTag File: src/java/com/android/internal/telephony/PhoneSubInfoController.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-0831
MEDIUM
4.3
android
getVoiceMailAlphaTag
src/java/com/android/internal/telephony/PhoneSubInfoController.java
79eecef63f3ea99688333c19e22813f54d4a31b1
0
Analyze the following code function for security vulnerabilities
Request.Builder get() { HttpUrl url; HttpUrl.Builder urlBuilder = this.urlBuilder; if (urlBuilder != null) { url = urlBuilder.build(); } else { // No query parameters triggered builder creation, just combine the relative URL and base URL. //noinspection ConstantConditions Non-null if urlBuilder is null. url = baseUrl.resolve(relativeUrl); if (url == null) { throw new IllegalArgumentException( "Malformed URL. Base: " + baseUrl + ", Relative: " + relativeUrl); } } RequestBody body = this.body; if (body == null) { // Try to pull from one of the builders. if (formBuilder != null) { body = formBuilder.build(); } else if (multipartBuilder != null) { body = multipartBuilder.build(); } else if (hasBody) { // Body is absent, make an empty body. body = RequestBody.create(null, new byte[0]); } } MediaType contentType = this.contentType; if (contentType != null) { if (body != null) { body = new ContentTypeOverridingRequestBody(body, contentType); } else { requestBuilder.addHeader("Content-Type", contentType.toString()); } } return requestBuilder .url(url) .method(method, body); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: retrofit/src/main/java/retrofit2/RequestBuilder.java Repository: square/retrofit The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-1000850
MEDIUM
6.4
square/retrofit
get
retrofit/src/main/java/retrofit2/RequestBuilder.java
b9a7f6ad72073ddd40254c0058710e87a073047d
0
Analyze the following code function for security vulnerabilities
@Override public Object makeTransformRotation(float angle, float x, float y, float z) { return CN1Matrix4f.makeRotation(angle, x, y, z); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeTransformRotation 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
makeTransformRotation
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
protected void deleteContact() { final int position = contact_context_id; final Contact contact = (Contact) contacts.get(position); final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setNegativeButton(R.string.cancel, null); builder.setTitle(R.string.action_delete_contact); builder.setMessage(JidDialog.style(this, R.string.remove_contact_text, contact.getJid().toEscapedString())); builder.setPositiveButton(R.string.delete, (dialog, which) -> { xmppConnectionService.deleteContactOnServer(contact); filter(mSearchEditText.getText().toString()); }); builder.create().show(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteContact File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
deleteContact
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); view.setOnKeyListener(this); view.setFocusableInTouchMode(true); view.requestFocus(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onViewCreated File: src/com/android/settings/network/apn/ApnEditor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40125
HIGH
7.8
android
onViewCreated
src/com/android/settings/network/apn/ApnEditor.java
63d464c3fa5c7b9900448fef3844790756e557eb
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getPermittedInputMethods(ComponentName who, String callerPackageName, boolean calledOnParentInstance) { if (!mHasFeature) { return null; } CallerIdentity caller; if (isPolicyEngineForFinanceFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); Objects.requireNonNull(who, "ComponentName is null"); } if (!isPolicyEngineForFinanceFlagEnabled()) { if (calledOnParentInstance) { Preconditions.checkCallAuthorization( isProfileOwnerOfOrganizationOwnedDevice(caller)); } else { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); } } synchronized (getLockObject()) { if (isPolicyEngineForFinanceFlagEnabled()) { int affectedUser = calledOnParentInstance ? getProfileParentId( caller.getUserId()) : caller.getUserId(); Set<String> policy = mDevicePolicyEngine.getResolvedPolicy( PolicyDefinition.PERMITTED_INPUT_METHODS, affectedUser); return policy == null ? null : new ArrayList<>(policy); } else { ActiveAdmin admin = getParentOfAdminIfRequired( getProfileOwnerOrDeviceOwnerLocked( caller.getUserId()), calledOnParentInstance); return admin.permittedInputMethods; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermittedInputMethods 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
getPermittedInputMethods
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
boolean startConfirmationUi(int token, String action) { try { Intent confIntent = new Intent(action); confIntent.setClassName("com.android.backupconfirm", "com.android.backupconfirm.BackupRestoreConfirmation"); confIntent.putExtra(FullBackup.CONF_TOKEN_INTENT_EXTRA, token); confIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(confIntent); } catch (ActivityNotFoundException e) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startConfirmationUi 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
startConfirmationUi
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Nonnull public final JsonParser setTabSize (@Nonnegative final int nTabSize) { ValueEnforcer.isGT0 (nTabSize, "TabSize"); m_nTabSize = nTabSize; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTabSize File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
setTabSize
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
@Override public String getTagForIntentSender(IIntentSender pendingResult, String prefix) { if (!(pendingResult instanceof PendingIntentRecord)) { return null; } try { PendingIntentRecord res = (PendingIntentRecord)pendingResult; synchronized (this) { return getTagForIntentSenderLocked(res, prefix); } } catch (ClassCastException e) { } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTagForIntentSender File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
getTagForIntentSender
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasResumedActivity(int uid) { return mVisibleActivityProcessTracker.hasResumedActivity(uid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasResumedActivity 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
hasResumedActivity
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public static AsymKeyGenerationRequest fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element element = document.getDocumentElement(); return fromDOM(element); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: fromXML File: base/common/src/main/java/com/netscape/certsrv/key/AsymKeyGenerationRequest.java Repository: dogtagpki/pki Fixed Code: public static AsymKeyGenerationRequest fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element element = document.getDocumentElement(); return fromDOM(element); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromXML
base/common/src/main/java/com/netscape/certsrv/key/AsymKeyGenerationRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
private void setRoot(String webRoot) { Objects.requireNonNull(webRoot); if (!allowRootFileSystemAccess) { for (File root : File.listRoots()) { if (webRoot.startsWith(root.getAbsolutePath())) { throw new IllegalArgumentException("root cannot start with '" + root.getAbsolutePath() + "'"); } } } this.webRoot = webRoot; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRoot File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
setRoot
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
private void setPackageInstalledForSystemPackage(@NonNull AndroidPackage pkg, @NonNull int[] allUserHandles, @Nullable int[] origUserHandles, boolean writeSettings) { // writer synchronized (mPm.mLock) { PackageSetting ps = mPm.mSettings.getPackageLPr(pkg.getPackageName()); final boolean applyUserRestrictions = origUserHandles != null; if (applyUserRestrictions) { boolean installedStateChanged = false; if (DEBUG_REMOVE) { Slog.d(TAG, "Propagating install state across reinstall"); } for (int userId : allUserHandles) { final boolean installed = ArrayUtils.contains(origUserHandles, userId); if (DEBUG_REMOVE) { Slog.d(TAG, " user " + userId + " => " + installed); } if (installed != ps.getInstalled(userId)) { installedStateChanged = true; } ps.setInstalled(installed, userId); if (installed) { ps.setUninstallReason(UNINSTALL_REASON_UNKNOWN, userId); } } // Regardless of writeSettings we need to ensure that this restriction // state propagation is persisted mPm.mSettings.writeAllUsersPackageRestrictionsLPr(); if (installedStateChanged) { mPm.mSettings.writeKernelMappingLPr(ps); } } // The method below will take care of removing obsolete permissions and granting // install permissions. mPm.mPermissionManager.onPackageInstalled(pkg, Process.INVALID_UID, PermissionManagerServiceInternal.PackageInstalledParams.DEFAULT, UserHandle.USER_ALL); for (final int userId : allUserHandles) { if (applyUserRestrictions) { mPm.mSettings.writePermissionStateForUserLPr(userId, false); } } // can downgrade to reader here if (writeSettings) { mPm.writeSettingsLPrTEMP(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPackageInstalledForSystemPackage File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
setPackageInstalledForSystemPackage
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(userid); data.writeInt(orStopping ? 1 : 0); mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); reply.readException(); boolean result = reply.readInt() != 0; reply.recycle(); data.recycle(); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUserRunning File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
isUserRunning
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0