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
final void appDiedLocked(ProcessRecord app) { appDiedLocked(app, app.pid, app.thread); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appDiedLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
appDiedLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public T setObject(K name, Object... values) { validateName(nameValidator, false, name); int h = hashingStrategy.hashCode(name); int i = index(h); remove0(h, i, name); for (Object v: values) { if (v == null) { break; } add0(h, i, name, fromObject(name, v)); } return thisT(); }
Vulnerability Classification: - CWE: CWE-436, CWE-113 - CVE: CVE-2022-41915 - Severity: MEDIUM - CVSS Score: 6.5 Description: Merge pull request from GHSA-hh82-3pmq-7frp Motivation: The setObject methods that took arrays and iterators as arguments provided a way to bypass value validation. Modification: Add the missing value validation checks. Result: It is no longer possibel to bypass value validation in DefaultHeaders based implementations, including DefaultHttpHeaders. Function: setObject File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty Fixed Code: @Override public T setObject(K name, Object... values) { validateName(nameValidator, false, name); int h = hashingStrategy.hashCode(name); int i = index(h); remove0(h, i, name); for (Object v: values) { if (v == null) { break; } V converted = fromObject(name, v); validateValue(valueValidator, name, converted); add0(h, i, name, converted); } return thisT(); }
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
setObject
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
1
Analyze the following code function for security vulnerabilities
public int runGetMaxUsers() { System.out.println("Maximum supported users: " + UserManager.getMaxSupportedUsers()); return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runGetMaxUsers File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runGetMaxUsers
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
private void processLine(String line, Pattern success, Pattern failure) { // skip progress lines if (line.contains("\b")) { return; } // remove color escape codes for console String cleanLine = line.replaceAll("(\u001b\\[[;\\d]*m|[\b\r]+)", ""); // save output so as it can be used to alert user in browser. cumulativeOutput.append(cleanLine); boolean succeed = success.matcher(line).find(); boolean failed = failure.matcher(line).find(); // We found the success or failure pattern in stream if (succeed || failed) { if (succeed) { console(GREEN, SUCCEED_MSG); } else { console(RED, FAILED_MSG); } // save output in case of failure failedOutput = failed ? cumulativeOutput.toString() : null; // reset cumulative buffer for the next compilation cumulativeOutput = new StringBuilder(); // Notify DevModeHandler to continue doNotify(); // trigger a live-reload since webpack has recompiled the bundle // if failure, ensures the webpack error is shown in the browser if (liveReload != null) { liveReload.reload(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processLine File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
processLine
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
private static LoadingCache<RouteKey, Route[]> routeCache(final Set<Route.Definition> routes, final Config conf) { return CacheBuilder.from(conf.getString("server.routes.Cache")) .build(new CacheLoader<RouteKey, Route[]>() { @Override public Route[] load(final RouteKey key) throws Exception { return routes(routes, key.method, key.path, key.consumes, key.produces); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: routeCache File: jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
routeCache
jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
private static Stream<Arguments> testsParameters() { return Stream.of( Arguments.of(true, false), Arguments.of(false, false), Arguments.of(true, true) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testsParameters File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-94" ]
CVE-2024-21650
CRITICAL
9.8
xwiki/xwiki-platform
testsParameters
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
b290bfd573c6f7db6cc15a88dd4111d9fcad0d31
0
Analyze the following code function for security vulnerabilities
protected SignatureAlgorithm getSignatureAlgorithm() { return SignatureAlgorithm.HS512; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSignatureAlgorithm File: dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java Repository: ManyDesigns/Portofino The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-29451
MEDIUM
6.4
ManyDesigns/Portofino
getSignatureAlgorithm
dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
0
Analyze the following code function for security vulnerabilities
private boolean buildSourcesSmali(String folder, String filename) throws AndrolibException { ExtFile smaliDir = new ExtFile(mApkDir, folder); if (!smaliDir.exists()) { return false; } File dex = new File(mApkDir, APK_DIRNAME + "/" + filename); if (!mConfig.forceBuildAll) { LOGGER.info("Checking whether sources has changed..."); } if (mConfig.forceBuildAll || isModified(smaliDir, dex)) { LOGGER.info("Smaling " + folder + " folder into " + filename + "..."); //noinspection ResultOfMethodCallIgnored dex.delete(); SmaliBuilder.build(smaliDir, dex, mConfig.apiLevel > 0 ? mConfig.apiLevel : mMinSdkVersion); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildSourcesSmali File: brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
buildSourcesSmali
brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
@Test public void createsCountQueryForQueriesWithSubSelects() throws Exception { assertCountQuery("select u from User u left outer join u.roles r where r in (select r from Role)", "select count(u) from User u left outer join u.roles r where r in (select r from Role)"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createsCountQueryForQueriesWithSubSelects File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
createsCountQueryForQueriesWithSubSelects
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
private boolean enforceAcceptHandoverPermission(String packageName, int uid) { mContext.enforceCallingOrSelfPermission(Manifest.permission.ACCEPT_HANDOVER, "App requires ACCEPT_HANDOVER permission to accept handovers."); final int opCode = AppOpsManager.permissionToOpCode(Manifest.permission.ACCEPT_HANDOVER); if (opCode != AppOpsManager.OP_ACCEPT_HANDOVER || ( mAppOpsManager.checkOp(opCode, uid, packageName) != AppOpsManager.MODE_ALLOWED)) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceAcceptHandoverPermission File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
enforceAcceptHandoverPermission
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public static Path getDataFilePath(String pi, String dataFolderName, String altDataFolderName, String fileName) throws PresentationException, IndexUnreachableException { java.nio.file.Path dataFolderPath = getDataFolder(pi, dataFolderName); if (StringUtils.isNotBlank(fileName)) { dataFolderPath = dataFolderPath.resolve(fileName); } if (StringUtils.isNotBlank(altDataFolderName) && !Files.exists(dataFolderPath)) { return getDataFilePath(pi, altDataFolderName, null, fileName); } return dataFolderPath; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2020-15124 - Severity: MEDIUM - CVSS Score: 4.0 Description: Don't allow filepaths as Filename when requesting source files Function: getDataFilePath File: goobi-viewer-core/src/main/java/io/goobi/viewer/controller/DataFileTools.java Repository: intranda/goobi-viewer-core Fixed Code: public static Path getDataFilePath(String pi, String dataFolderName, String altDataFolderName, String fileName) throws PresentationException, IndexUnreachableException { //make sure fileName is a pure filename and not a path fileName = Paths.get(fileName).getFileName().toString(); java.nio.file.Path dataFolderPath = getDataFolder(pi, dataFolderName); if (StringUtils.isNotBlank(fileName)) { dataFolderPath = dataFolderPath.resolve(fileName); } if (StringUtils.isNotBlank(altDataFolderName) && !Files.exists(dataFolderPath)) { return getDataFilePath(pi, altDataFolderName, null, fileName); } return dataFolderPath; }
[ "CWE-22" ]
CVE-2020-15124
MEDIUM
4
intranda/goobi-viewer-core
getDataFilePath
goobi-viewer-core/src/main/java/io/goobi/viewer/controller/DataFileTools.java
44ceb8e2e7e888391e8a941127171d6366770df3
1
Analyze the following code function for security vulnerabilities
@Override public void notifyLockedProfile(@UserIdInt int userId) { try { if (!AppGlobals.getPackageManager().isUidPrivileged(Binder.getCallingUid())) { throw new SecurityException("Only privileged app can call notifyLockedProfile"); } } catch (RemoteException ex) { throw new SecurityException("Fail to check is caller a privileged app", ex); } synchronized (this) { if (mStackSupervisor.isUserLockedProfile(userId)) { final long ident = Binder.clearCallingIdentity(); try { final int currentUserId = mUserController.getCurrentUserIdLocked(); if (mUserController.isLockScreenDisabled(currentUserId)) { // If there is no device lock, we will show the profile's credential page. mActivityStarter.showConfirmDeviceCredential(userId); } else { // Showing launcher to avoid user entering credential twice. startHomeActivityLocked(currentUserId, "notifyLockedProfile"); } } finally { Binder.restoreCallingIdentity(ident); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyLockedProfile File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
notifyLockedProfile
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterReceiver File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
unregisterReceiver
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public void updateBlob(String columnName, @Nullable InputStream inputStream) throws SQLException { updateBlob(findColumn(columnName), inputStream); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBlob File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateBlob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override boolean check(ReplicatedMapConfig c1, ReplicatedMapConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getName(), c2.getName()) && nullSafeEqual(c1.getInMemoryFormat(), c2.getInMemoryFormat()) && nullSafeEqual(c1.getConcurrencyLevel(), c2.getConcurrencyLevel()) && nullSafeEqual(c1.isAsyncFillup(), c2.isAsyncFillup()) && nullSafeEqual(c1.isStatisticsEnabled(), c2.isStatisticsEnabled()) && nullSafeEqual(c1.getQuorumName(), c2.getQuorumName()) && ConfigCompatibilityChecker.isCompatible(c1.getMergePolicyConfig(), c2.getMergePolicyConfig()) && isCollectionCompatible(c1.getListenerConfigs(), c2.getListenerConfigs(), new ReplicatedMapListenerConfigChecker()); }
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
private void updateHideOrShowQuotedText(boolean showQuotedText) { mQuotedTextView.updateCheckedState(showQuotedText); mQuotedTextView.setUpperDividerVisible(mAttachmentsView.getAttachments().size() > 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateHideOrShowQuotedText File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
updateHideOrShowQuotedText
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private boolean insertSystemSetting(String name, String value, int requestingUserId) { if (DEBUG) { Slog.v(LOG_TAG, "insertSystemSetting(" + name + ", " + value + ", " + requestingUserId + ")"); } return mutateSystemSetting(name, value, requestingUserId, MUTATION_OPERATION_INSERT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insertSystemSetting File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
insertSystemSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
private void updateListenerHintsLocked() { final int hints = calculateHints(); if (hints == mListenerHints) return; ZenLog.traceListenerHintsChanged(mListenerHints, hints, mEffectsSuppressors.size()); mListenerHints = hints; scheduleListenerHintsChanged(hints); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateListenerHintsLocked File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
updateListenerHintsLocked
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") protected <T> T makeHttpPutRequestAndCreateCustomResponse(String uri, String body, Class<T> resultType, String user, String password, String token) { logger.debug("About to send PUT request to '{}' with payload '{}' by thread {}", uri, body, Thread.currentThread().getId()); KieServerHttpRequest request = newRequest( uri, user, password, token ).body(body).put(); KieServerHttpResponse response = request.response(); if ( response.code() == Response.Status.CREATED.getStatusCode() || response.code() == Response.Status.BAD_REQUEST.getStatusCode() ) { T serviceResponse = deserialize( response.body(), resultType ); return serviceResponse; } else { throw new IllegalStateException( "Error while sending PUT request to " + uri + " response code " + response.code() ); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeHttpPutRequestAndCreateCustomResponse File: kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java Repository: kiegroup/droolsjbpm-integration The code follows secure coding practices.
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
makeHttpPutRequestAndCreateCustomResponse
kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
0
Analyze the following code function for security vulnerabilities
@Pure @Override public boolean getBoolean(@Positive int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getBoolean columnIndex: {0}", columnIndex); byte[] value = getRawValue(columnIndex); if (value == null) { return false; } int col = columnIndex - 1; if (Oid.BOOL == fields[col].getOID()) { final byte[] v = value; return (1 == v.length) && (116 == v[0]); // 116 = 't' } if (isBinary(columnIndex)) { return BooleanTypeUtil.castToBoolean(readDoubleValue(value, fields[col].getOID(), "boolean")); } String stringValue = castNonNull(getString(columnIndex)); return BooleanTypeUtil.castToBoolean(stringValue); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBoolean File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getBoolean
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void onAttach(Activity activity) { super.onAttach(activity); Log.d(Config.LOGTAG, "ConversationFragment.onAttach()"); if (activity instanceof ConversationsActivity) { this.activity = (ConversationsActivity) activity; } else { throw new IllegalStateException("Trying to attach fragment to activity that is not the ConversationsActivity"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAttach File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onAttach
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void loadRecentTasksForUser(int userId) { synchronized (mGlobalLock) { mRecentTasks.loadUserRecentsLocked(userId); // TODO renaming the methods(?) mPackageConfigPersister.loadUserPackages(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadRecentTasksForUser 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
loadRecentTasksForUser
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public String serializeToString(Object obj, Map<String, Object> formParams, String contentType, boolean isBodyNullable) throws ApiException { try { if (contentType.startsWith("multipart/form-data")) { throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { String formString = ""; for (Entry<String, Object> param : formParams.entrySet()) { formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; } if (formString.length() == 0) { // empty string return formString; } else { return formString.substring(0, formString.length() - 1); } } else { if (isBodyNullable) { return obj == null ? "null" : json.getMapper().writeValueAsString(obj); } else { return obj == null ? "" : json.getMapper().writeValueAsString(obj); } } } catch (Exception ex) { throw new ApiException("Failed to perform serializeToString: " + ex.toString()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serializeToString File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
serializeToString
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void onUpdateUrl(String url) { // TODO: implement }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUpdateUrl File: android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
onUpdateUrl
android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
static String deriveCodePathName(String codePath) { if (codePath == null) { return null; } final File codeFile = new File(codePath); final String name = codeFile.getName(); if (codeFile.isDirectory()) { return name; } else if (name.endsWith(".apk") || name.endsWith(".tmp")) { final int lastDot = name.lastIndexOf('.'); return name.substring(0, lastDot); } else { Slog.w(TAG, "Odd, " + codePath + " doesn't look like an APK"); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deriveCodePathName 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
deriveCodePathName
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public void setChannel(String channel) { this.channel = channel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setChannel File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogUpload.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
setChannel
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogUpload.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
private static boolean isCompatible(TimedExpiryPolicyFactoryConfig c1, TimedExpiryPolicyFactoryConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getExpiryPolicyType(), c2.getExpiryPolicyType()) && isCompatible(c1.getDurationConfig(), c2.getDurationConfig()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCompatible 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
isCompatible
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
protected Message getStatusChangedMessage(Instance instance, StandardEvaluationContext context) { String activitySubtitle = evaluateExpression(context, statusActivitySubtitle); return createMessage(instance, statusChangedTitle, activitySubtitle, context); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: getStatusChangedMessage File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: protected Message getStatusChangedMessage(Instance instance, EvaluationContext context) { String activitySubtitle = evaluateExpression(context, statusActivitySubtitle); return createMessage(instance, statusChangedTitle, activitySubtitle, context); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getStatusChangedMessage
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
@Override public boolean userPromptedForPartialSigning() { return this.promptedForPartialSigning; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: userPromptedForPartialSigning File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.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
userPromptedForPartialSigning
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@Override public String getSelectStatement(Select select) { return "SELECT"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSelectStatement File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
getSelectStatement
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
private List<String> buildCriteriaClauses(String searchTerm, List<String> analysisIds, List<String> timeWindows, List<String> domains) { ArrayList<String> clauses = new ArrayList<>(); if (searchTerm != null && searchTerm.length() > 0) { clauses.add(String.format("lower(fr.covariate_name) like '%%%s%%'", searchTerm)); } if (analysisIds != null && analysisIds.size() > 0) { ArrayList<Integer> ids = new ArrayList<>(); ArrayList<String> ranges = new ArrayList<>(); analysisIds.stream().map((analysisIdExpr) -> analysisIdExpr.split(":")) .map(strArray -> Arrays.stream(strArray).map(Integer::parseInt).toArray(Integer[]::new)) .forEachOrdered((parsedIds) -> { if (parsedIds.length > 1) { ranges.add(String.format("(ar.analysis_id >= %s and ar.analysis_id <= %s)", parsedIds[0], parsedIds[1])); } else { ids.add(parsedIds[0]); } }); String idClause = ""; if (ids.size() > 0) { idClause = String.format("ar.analysis_id in (%s)", StringUtils.join(ids, ",")); } if (ranges.size() > 0) { idClause += (idClause.length() > 0 ? " OR " : "") + StringUtils.join(ranges, " OR "); } clauses.add("(" + idClause + ")"); } if (timeWindows != null && timeWindows.size() > 0) { ArrayList<String> timeWindowClauses = new ArrayList<>(); timeWindows.forEach((timeWindow) -> { timeWindowClauses.add(String.format("ar.analysis_name like '%%%s'", timeWindow)); }); clauses.add("(" + StringUtils.join(timeWindowClauses, " OR ") + ")"); } if (domains != null && domains.size() > 0) { ArrayList<String> domainClauses = new ArrayList<>(); domains.forEach((domain) -> { if (domain.toLowerCase().equals("null")) { domainClauses.add("ar.domain_id is null"); } else { domainClauses.add(String.format("lower(ar.domain_id) = lower('%s')", domain)); } }); clauses.add("(" + StringUtils.join(domainClauses, " OR ") + ")"); } return clauses; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15563 - Severity: HIGH - CVSS Score: 7.5 Description: fixes SQL injection vulnerability Function: buildCriteriaClauses File: src/main/java/org/ohdsi/webapi/service/FeatureExtractionService.java Repository: OHDSI/WebAPI Fixed Code: private List<String> buildCriteriaClauses(String searchTerm, List<String> analysisIds, List<String> timeWindows, List<String> domains) { ArrayList<String> clauses = new ArrayList<>(); if (searchTerm != null && searchTerm.length() > 0) { clauses.add(String.format("lower(fr.covariate_name) like '%%%s%%'", QuoteUtils.escapeSql(searchTerm))); } if (analysisIds != null && analysisIds.size() > 0) { ArrayList<Integer> ids = new ArrayList<>(); ArrayList<String> ranges = new ArrayList<>(); analysisIds.stream().map((analysisIdExpr) -> analysisIdExpr.split(":")) .map(strArray -> Arrays.stream(strArray).map(Integer::parseInt).toArray(Integer[]::new)) .forEachOrdered((parsedIds) -> { if (parsedIds.length > 1) { ranges.add(String.format("(ar.analysis_id >= %s and ar.analysis_id <= %s)", parsedIds[0], parsedIds[1])); } else { ids.add(parsedIds[0]); } }); String idClause = ""; if (ids.size() > 0) { idClause = String.format("ar.analysis_id in (%s)", StringUtils.join(ids, ",")); } if (ranges.size() > 0) { idClause += (idClause.length() > 0 ? " OR " : "") + StringUtils.join(ranges, " OR "); } clauses.add("(" + idClause + ")"); } if (timeWindows != null && timeWindows.size() > 0) { ArrayList<String> timeWindowClauses = new ArrayList<>(); timeWindows.forEach((timeWindow) -> { timeWindowClauses.add(String.format("ar.analysis_name like '%%%s'", QuoteUtils.escapeSql(timeWindow))); }); clauses.add("(" + StringUtils.join(timeWindowClauses, " OR ") + ")"); } if (domains != null && domains.size() > 0) { ArrayList<String> domainClauses = new ArrayList<>(); domains.forEach((domain) -> { if (domain.toLowerCase().equals("null")) { domainClauses.add("ar.domain_id is null"); } else { domainClauses.add(String.format("lower(ar.domain_id) = lower('%s')", QuoteUtils.escapeSql(domain))); } }); clauses.add("(" + StringUtils.join(domainClauses, " OR ") + ")"); } return clauses; }
[ "CWE-89" ]
CVE-2019-15563
HIGH
7.5
OHDSI/WebAPI
buildCriteriaClauses
src/main/java/org/ohdsi/webapi/service/FeatureExtractionService.java
b3944074a1976c95d500239cbbf0741917ed75ca
1
Analyze the following code function for security vulnerabilities
public long getRootSizeBytes(String root) { return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRootSizeBytes 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
getRootSizeBytes
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public ComponentName startService(IApplicationThread caller, Intent service, String resolvedType, int userId) { enforceNotIsolatedCaller("startService"); // Refuse possible leaked file descriptors if (service != null && service.hasFileDescriptors() == true) { throw new IllegalArgumentException("File descriptors passed in Intent"); } if (DEBUG_SERVICE) Slog.v(TAG, "startService: " + service + " type=" + resolvedType); synchronized(this) { final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); ComponentName res = mServices.startServiceLocked(caller, service, resolvedType, callingPid, callingUid, userId); Binder.restoreCallingIdentity(origId); return res; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startService File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
startService
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private Publisher<Object> buildCachePutPublisher( MethodInvocationContext<Object, Object> context, CacheOperation cacheOperation, List<AnnotationValue<CachePut>> putOperations) { final Flowable<?> originalFlowable = Publishers.convertPublisher(context.proceed(), Flowable.class); return originalFlowable.flatMap((Function<Object, Publisher<?>>) o -> { List<Flowable<?>> cachePuts = new ArrayList<>(); for (AnnotationValue<CachePut> putOperation : putOperations) { String[] cacheNames = cacheOperation.getCachePutNames(putOperation); if (ArrayUtils.isNotEmpty(cacheNames)) { boolean isAsync = putOperation.get(MEMBER_ASYNC, Boolean.class, false); if (isAsync) { putResultAsync(context, cacheOperation, putOperation, cacheNames, o); } else { final Flowable<Object> cachePutFlowable = Flowable.create(emitter -> { CacheKeyGenerator keyGenerator = cacheOperation.getCachePutKeyGenerator(putOperation); Object[] parameterValues = resolveParams(context, putOperation.get(MEMBER_PARAMETERS, String[].class, StringUtils.EMPTY_STRING_ARRAY)); Object key = keyGenerator.generateKey(context, parameterValues); CompletableFuture<Void> putOperationFuture = buildPutFutures(cacheNames, o, key); putOperationFuture.whenComplete((aVoid, throwable) -> { if (throwable == null) { emitter.onNext(o); emitter.onComplete(); } else { SyncCache cache = cacheManager.getCache(cacheNames[0]); if (errorHandler.handlePutError(cache, key, o, asRuntimeException(throwable))) { emitter.onError(throwable); } else { emitter.onNext(o); emitter.onComplete(); } } }); }, BackpressureStrategy.ERROR); cachePuts.add(cachePutFlowable); } } } if (!cachePuts.isEmpty()) { return Flowable.merge(cachePuts).lastOrError().toFlowable(); } else { return Flowable.just(o); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildCachePutPublisher File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
buildCachePutPublisher
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public Property<?> getProperty() { return getItem().getItemProperty(propertyId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProperty File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getProperty
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Nullable public String getApiKey() { return apiKey; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApiKey File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getApiKey
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@Override public Rect getTaskBounds(int taskId) { enforceTaskPermission("getTaskBounds()"); final long ident = Binder.clearCallingIdentity(); Rect rect = new Rect(); try { synchronized (mGlobalLock) { final Task task = mRootWindowContainer.anyTaskForId(taskId, MATCH_ATTACHED_TASK_OR_RECENT_TASKS); if (task == null) { Slog.w(TAG, "getTaskBounds: taskId=" + taskId + " not found"); return rect; } if (task.getParent() != null) { rect.set(task.getBounds()); } else if (task.mLastNonFullscreenBounds != null) { rect.set(task.mLastNonFullscreenBounds); } } } finally { Binder.restoreCallingIdentity(ident); } return rect; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTaskBounds 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
getTaskBounds
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public void removeByUuid(String uuid) { for (KBTemplate kbTemplate : findByUuid(uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(kbTemplate); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeByUuid File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
removeByUuid
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
public Intent registerReceiver(IApplicationThread caller, String packageName, IIntentReceiver receiver, IntentFilter filter, String perm, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(caller != null ? caller.asBinder() : null); data.writeString(packageName); data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); filter.writeToParcel(data, 0); data.writeString(perm); data.writeInt(userId); mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); reply.readException(); Intent intent = null; int haveIntent = reply.readInt(); if (haveIntent != 0) { intent = Intent.CREATOR.createFromParcel(reply); } reply.recycle(); data.recycle(); return intent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerReceiver File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
registerReceiver
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public String getURL(String space, String page, String action) { return getURL(space, page, action, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getURL
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public void ensureSettingsForUserLocked(int userId) { // Migrate the setting for this user if needed. migrateLegacySettingsForUserIfNeededLocked(userId); // Ensure global settings loaded if owner. if (userId == UserHandle.USER_SYSTEM) { final int globalKey = makeKey(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM); ensureSettingsStateLocked(globalKey); } // Ensure secure settings loaded. final int secureKey = makeKey(SETTINGS_TYPE_SECURE, userId); ensureSettingsStateLocked(secureKey); // Make sure the secure settings have an Android id set. SettingsState secureSettings = getSettingsLocked(SETTINGS_TYPE_SECURE, userId); ensureSecureSettingAndroidIdSetLocked(secureSettings); // Ensure system settings loaded. final int systemKey = makeKey(SETTINGS_TYPE_SYSTEM, userId); ensureSettingsStateLocked(systemKey); // Upgrade the settings to the latest version. UpgradeController upgrader = new UpgradeController(userId); upgrader.upgradeIfNeededLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ensureSettingsForUserLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
ensureSettingsForUserLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
public Form<T> withError(final ValidationError error) { if (error == null) { throw new NullPointerException("Can't reject null-values"); } final List<ValidationError> copiedErrors = new ArrayList<>(this.errors); copiedErrors.add(error); return new Form<T>( this.rootName, this.backedType, this.rawData, this.files, copiedErrors, this.value, this.groups, this.messagesApi, this.formatters, this.validatorFactory, this.config, this.lang, this.directFieldAccess); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withError File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
withError
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
private void unlockChildProfile(int profileHandle) throws RemoteException { try { doVerifyPassword(getDecryptedPasswordForTiedProfile(profileHandle), false, 0 /* no challenge */, profileHandle); } catch (UnrecoverableKeyException | InvalidKeyException | KeyStoreException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException | CertificateException | IOException e) { if (e instanceof FileNotFoundException) { Slog.i(TAG, "Child profile key not found"); } else { Slog.e(TAG, "Failed to decrypt child profile key", e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unlockChildProfile File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
unlockChildProfile
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public String getOriginalPicture() { return originalPicture; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOriginalPicture File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getOriginalPicture
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private void validate() { if (allowedThreadCount.orElse(0) < 0) throw new ConfigurationException(localized("security.configuration_invalid_negative_threads")); //$NON-NLS-1$ if (!Collections.disjoint(allowedLocalPorts, excludedLocalPorts)) throw new ConfigurationException(localized("security.configuration_invalid_port_rule_intersection")); //$NON-NLS-1$ allowedLocalPorts.forEach(ArtemisSecurityConfigurationBuilder::validatePortRange); excludedLocalPorts.forEach(ArtemisSecurityConfigurationBuilder::validatePortRange); allowLocalPortsAbove.ifPresent(value -> { validatePortRange(value); if (allowedLocalPorts.stream().anyMatch(allowed -> allowed > value)) throw new ConfigurationException(localized("security.configuration_invalid_port_allowed_in_rage")); //$NON-NLS-1$ if (excludedLocalPorts.stream().anyMatch(exclusion -> exclusion <= value)) throw new ConfigurationException(localized("security.configuration_invalid_port_exclude_outside_rage")); //$NON-NLS-1$ }); }
Vulnerability Classification: - CWE: CWE-501, CWE-653 - CVE: CVE-2024-23682 - Severity: HIGH - CVSS Score: 8.2 Description: Validate maven pom.xml if available for trusted package enforcer rules This resolves #15 as good as possible. Function: validate File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityConfigurationBuilder.java Repository: ls1intum/Ares Fixed Code: private void validate() { if (allowedThreadCount.orElse(0) < 0) throw new ConfigurationException(localized("security.configuration_invalid_negative_threads")); //$NON-NLS-1$ if (!Collections.disjoint(allowedLocalPorts, excludedLocalPorts)) throw new ConfigurationException(localized("security.configuration_invalid_port_rule_intersection")); //$NON-NLS-1$ allowedLocalPorts.forEach(ArtemisSecurityConfigurationBuilder::validatePortRange); excludedLocalPorts.forEach(ArtemisSecurityConfigurationBuilder::validatePortRange); allowLocalPortsAbove.ifPresent(value -> { validatePortRange(value); if (allowedLocalPorts.stream().anyMatch(allowed -> allowed > value)) throw new ConfigurationException(localized("security.configuration_invalid_port_allowed_in_rage")); //$NON-NLS-1$ if (excludedLocalPorts.stream().anyMatch(exclusion -> exclusion <= value)) throw new ConfigurationException(localized("security.configuration_invalid_port_exclude_outside_rage")); //$NON-NLS-1$ }); validateTrustedPackages(trustedPackages); }
[ "CWE-501", "CWE-653" ]
CVE-2024-23682
HIGH
8.2
ls1intum/Ares
validate
src/main/java/de/tum/in/test/api/security/ArtemisSecurityConfigurationBuilder.java
4c146ff85a0fa6022087fb0cffa6b8021d51101f
1
Analyze the following code function for security vulnerabilities
public String writeCookie(Cookie cookie) throws IOException { Logger.log(Logger.FULL_DEBUG, Launcher.RESOURCES, "WinstoneResponse.WritingCookie", cookie + ""); StringBuffer out = new StringBuffer(); // Set-Cookie or Set-Cookie2 if (cookie.getVersion() >= 1) out.append(OUT_COOKIE_HEADER1).append(": "); // TCK doesn't like set-cookie2 else out.append(OUT_COOKIE_HEADER1).append(": "); // name/value pair if (cookie.getVersion() == 0) out.append(cookie.getName()).append("=").append(cookie.getValue()); else { out.append(cookie.getName()).append("="); quote(cookie.getValue(), out); } if (cookie.getVersion() >= 1) { out.append("; Version=1"); if (cookie.getDomain() != null) { out.append("; Domain="); quote(cookie.getDomain(), out); } if (cookie.getSecure()) out.append("; Secure"); if (cookie.getMaxAge() >= 0) out.append("; Max-Age=").append(cookie.getMaxAge()); else out.append("; Discard"); if (cookie.getPath() != null) { out.append("; Path="); quote(cookie.getPath(), out); } } else { if (cookie.getDomain() != null) { out.append("; Domain="); out.append(cookie.getDomain()); } if (cookie.getMaxAge() > 0) { long expiryMS = System.currentTimeMillis() + (1000 * (long) cookie.getMaxAge()); String expiryDate = null; synchronized (VERSION0_DF) { expiryDate = VERSION0_DF.format(new Date(expiryMS)); } out.append("; Expires=").append(expiryDate); } else if (cookie.getMaxAge() == 0) { String expiryDate = null; synchronized (VERSION0_DF) { expiryDate = VERSION0_DF.format(new Date(5000)); } out.append("; Expires=").append(expiryDate); } if (cookie.getPath() != null) out.append("; Path=").append(cookie.getPath()); if (cookie.getSecure()) out.append("; Secure"); } return out.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeCookie File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
writeCookie
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
@Override public void setUserIsMonkey(boolean userIsMonkey) { synchronized (this) { synchronized (mPidsSelfLocked) { final int callingPid = Binder.getCallingPid(); ProcessRecord proc = mPidsSelfLocked.get(callingPid); if (proc == null) { throw new SecurityException("Unknown process: " + callingPid); } if (proc.instr == null || proc.instr.mUiAutomationConnection == null) { throw new SecurityException("Only an instrumentation process " + "with a UiAutomation can call setUserIsMonkey"); } } mUserIsMonkey = userIsMonkey; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserIsMonkey 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
setUserIsMonkey
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private static void publishOneDiagnosticInRoot(DOMDocument document, String message, DiagnosticSeverity severity, Consumer<PublishDiagnosticsParams> publishDiagnostics) { String uri = document.getDocumentURI(); DOMElement documentElement = document.getDocumentElement(); Range range = XMLPositionUtility.selectStartTag(documentElement); List<Diagnostic> diagnostics = new ArrayList<>(); diagnostics.add(new Diagnostic(range, message, severity, "XML")); publishDiagnostics.accept(new PublishDiagnosticsParams(uri, diagnostics)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: publishOneDiagnosticInRoot File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
publishOneDiagnosticInRoot
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
@Override public void run(AccountManagerFuture<Bundle> future) { boolean done = true; try { Bundle bundle = future.getResult(); //bundle.keySet(); Intent intent = (Intent) bundle.get(AccountManager.KEY_INTENT); if (intent != null) { done = false; Bundle addAccountOptions = new Bundle(); addAccountOptions.putParcelable(KEY_CALLER_IDENTITY, mPendingIntent); addAccountOptions.putBoolean(EXTRA_HAS_MULTIPLE_USERS, Utils.hasMultipleUsers(AddAccountSettings.this)); addAccountOptions.putParcelable(EXTRA_USER, mUserHandle); intent.putExtras(addAccountOptions); startActivityForResultAsUser(intent, ADD_ACCOUNT_REQUEST, mUserHandle); } else { setResult(RESULT_OK); if (mPendingIntent != null) { mPendingIntent.cancel(); mPendingIntent = null; } } if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "account added: " + bundle); } catch (OperationCanceledException e) { if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "addAccount was canceled"); } catch (IOException e) { if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "addAccount failed: " + e); } catch (AuthenticatorException e) { if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "addAccount failed: " + e); } finally { if (done) { finish(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: src/com/android/settings/accounts/AddAccountSettings.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-8609
HIGH
7.2
android
run
src/com/android/settings/accounts/AddAccountSettings.java
f5d3e74ecc2b973941d8adbe40c6b23094b5abb7
0
Analyze the following code function for security vulnerabilities
private boolean isLockScreenSecureUnchecked(int userId) { return mInjector.binderWithCleanCallingIdentity(() -> mLockPatternUtils.isSecure(userId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLockScreenSecureUnchecked 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
isLockScreenSecureUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override protected void doRefresh(LookupCachePurge cachePurge) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doRefresh File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
doRefresh
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
private static void trustedInterfacesXmlGenerator(XmlGenerator gen, Set<String> trustedInterfaces) { if (!trustedInterfaces.isEmpty()) { gen.open("trusted-interfaces"); for (String trustedInterface : trustedInterfaces) { gen.node("interface", trustedInterface); } gen.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trustedInterfacesXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-522" ]
CVE-2023-33264
MEDIUM
4.3
hazelcast
trustedInterfacesXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") default Map<String, V> subMap(String prefix, Class<V> valueType) { return subMap(prefix, Argument.of(valueType)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: subMap File: core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
subMap
core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public Iterator<String> getFileNameIterator() { return getFileNameList().iterator(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileNameIterator File: src/main/java/emissary/pickup/WorkBundle.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
getFileNameIterator
src/main/java/emissary/pickup/WorkBundle.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
private DocumentDisplayer getDocumentDisplayer() { if (this.documentDisplayer == null) { this.documentDisplayer = Utils.getComponent((Type) DocumentDisplayer.class, "configured"); } return this.documentDisplayer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocumentDisplayer 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
getDocumentDisplayer
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 updateHomepagePaddings() { if (!mIsEmbeddingActivityEnabled) { return; } if (mIsTwoPane) { int padding = getResources().getDimensionPixelSize( R.dimen.homepage_padding_horizontal_two_pane); mMainFragment.setPaddingHorizontal(padding); } else { mMainFragment.setPaddingHorizontal(0); } mMainFragment.updatePreferencePadding(mIsTwoPane); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateHomepagePaddings 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
updateHomepagePaddings
src/com/android/settings/homepage/SettingsHomepageActivity.java
62fc1d269f5e754fc8f00b6167d79c3933b4c1f4
0
Analyze the following code function for security vulnerabilities
@GET @Path("io/file-range/{size}") @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response fileRange(@PathParam("size") long size) throws IOException { File file = File.createTempFile("empty-file", ""); file.deleteOnExit(); RandomAccessFile rFile = new RandomAccessFile(file, "rw"); rFile.setLength(size); rFile.close(); return Response.ok(new FileRange(file, 0, size - 1)).build(); }
Vulnerability Classification: - CWE: CWE-378 - CVE: CVE-2023-0482 - Severity: MEDIUM - CVSS Score: 5.5 Description: [RESTEASY-3286] Use the new file utilities to create temporary files in tests. https://issues.redhat.com/browse/RESTEASY-3286 Signed-off-by: James R. Perkins <jperkins@redhat.com> Function: fileRange File: server-adapters/resteasy-undertow/src/test/java/org/jboss/resteasy/test/undertow/AsyncIOResource.java Repository: resteasy Fixed Code: @GET @Path("io/file-range/{size}") @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response fileRange(@PathParam("size") long size) throws IOException { File file = Files.createTempFile("empty-file", "").toFile(); file.deleteOnExit(); RandomAccessFile rFile = new RandomAccessFile(file, "rw"); rFile.setLength(size); rFile.close(); return Response.ok(new FileRange(file, 0, size - 1)).build(); }
[ "CWE-378" ]
CVE-2023-0482
MEDIUM
5.5
resteasy
fileRange
server-adapters/resteasy-undertow/src/test/java/org/jboss/resteasy/test/undertow/AsyncIOResource.java
807d7456f2137cde8ef7c316707211bf4e542d56
1
Analyze the following code function for security vulnerabilities
@Override public void beginParagraph(Map<String, String> parameters) { getXHTMLWikiPrinter().setStandalone(); getXHTMLWikiPrinter().printXMLStartElement("p", parameters); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: beginParagraph File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
beginParagraph
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
@Override public void onKeyEvent(KeyEvent event, int sequence) { Message message = mCaller.obtainMessageIO(DO_ON_KEY_EVENT, sequence, event); mCaller.sendMessage(message); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onKeyEvent File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
onKeyEvent
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getCustomMappingPropertyList(BaseClass bclass) { List<String> list = new ArrayList<>(); Metadata metadata; if (bclass.hasExternalCustomMapping()) { metadata = this.store.getMetadata(bclass.getName(), bclass.getCustomMapping(), null); } else { metadata = this.store.getConfigurationMetadata(); } PersistentClass mapping = metadata.getEntityBinding(bclass.getName()); if (mapping == null) { return null; } Iterator<Property> it = mapping.getPropertyIterator(); while (it.hasNext()) { Property hibprop = it.next(); String propname = hibprop.getName(); list.add(propname); } return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCustomMappingPropertyList File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
getCustomMappingPropertyList
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
public static String extractHtmlBody(String content) { Matcher startMatcher = BODY_START_PATTERN.matcher(content); Matcher endMatcher = BODY_END_PATTERN.matcher(content); int start = 0; int end = content.length(); if (startMatcher.find()) { start = startMatcher.end(); } if (endMatcher.find(start)) { end = endMatcher.start(); } return content.substring(start, end); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractHtmlBody File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
extractHtmlBody
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public final void showSafeModeOverlay() { View v = LayoutInflater.from(mContext).inflate( com.android.internal.R.layout.safe_mode, null); WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.type = WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY; lp.width = WindowManager.LayoutParams.WRAP_CONTENT; lp.height = WindowManager.LayoutParams.WRAP_CONTENT; lp.gravity = Gravity.BOTTOM | Gravity.START; lp.format = v.getBackground().getOpacity(); lp.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS; ((WindowManager)mContext.getSystemService( Context.WINDOW_SERVICE)).addView(v, lp); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showSafeModeOverlay 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
showSafeModeOverlay
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Test public void deleteByCriterionThatThrowsException(TestContext context) { Criterion criterion = new Criterion() { public String toString() { throw new RuntimeException("missing towel"); } }; createFoo(context).delete(FOO, criterion, context.asyncAssertFailure(fail -> { context.assertTrue(fail.getMessage().contains("missing towel")); })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteByCriterionThatThrowsException File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
deleteByCriterionThatThrowsException
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private void updateSettingsLI(AndroidPackage newPackage, ReconciledPackage reconciledPkg, int[] allUsers, PackageInstalledInfo res) { updateSettingsInternalLI(newPackage, reconciledPkg, allUsers, res); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSettingsLI 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
updateSettingsLI
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
@Bean public Endpoint githubEndpoint() { return Endpoints.newFixedEndpoint(endpoint); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: githubEndpoint File: echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/config/GithubConfig.java Repository: spinnaker/echo The code follows secure coding practices.
[ "CWE-532" ]
CVE-2023-39348
MEDIUM
5.3
spinnaker/echo
githubEndpoint
echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/config/GithubConfig.java
bcbc7bc89a83f79d86b5c13438c8f04e581946b2
0
Analyze the following code function for security vulnerabilities
public boolean hasUserSetupCompleted() { if (mService != null) { try { return mService.hasUserSetupCompleted(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasUserSetupCompleted File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
hasUserSetupCompleted
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private boolean hasSaverSettings() { return mOpenSaverSettings.resolveActivity(mContext.getPackageManager()) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasSaverSettings File: packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3854
MEDIUM
5
android
hasSaverSettings
packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
05e0705177d2078fa9f940ce6df723312cfab976
0
Analyze the following code function for security vulnerabilities
public String getXML() { return getXmlEncoding(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXML File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
getXML
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@POST @Path("task/{nodeId}/file") @Operation(summary = "This attaches a Task file onto a given task element", description = "This attaches a Task file onto a given task element") @ApiResponse(responseCode = "200", description = "The task node metadatas", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or parentNode not found") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response attachTaskFilePost(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @Context HttpServletRequest request) { return attachTaskFile(courseId, nodeId, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachTaskFilePost File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
attachTaskFilePost
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public boolean addBadge(Profile user, Profile.Badge b, boolean condition, boolean update) { if (user != null && condition) { String newb = StringUtils.isBlank(user.getNewbadges()) ? "" : user.getNewbadges().concat(","); newb = newb.concat(b.toString()); user.addBadge(b); user.setNewbadges(newb); if (update) { user.update(); return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBadge File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
addBadge
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public String getMetricsConfigPath() { String path = getCanonicalPath(prop.getProperty(TS_METRICS_CONFIG)); if (path == null) { path = getModelServerHome() + "/ts/configs/metrics.yaml"; } return path; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetricsConfigPath File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getMetricsConfigPath
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
private final void enqueueUidChangeLocked(UidRecord uidRec, int uid, int change) { final UidRecord.ChangeItem pendingChange; if (uidRec == null || uidRec.pendingChange == null) { if (mPendingUidChanges.size() == 0) { if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "*** Enqueueing dispatch uid changed!"); mUiHandler.obtainMessage(DISPATCH_UIDS_CHANGED_UI_MSG).sendToTarget(); } final int NA = mAvailUidChanges.size(); if (NA > 0) { pendingChange = mAvailUidChanges.remove(NA-1); if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "Retrieving available item: " + pendingChange); } else { pendingChange = new UidRecord.ChangeItem(); if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "Allocating new item: " + pendingChange); } if (uidRec != null) { uidRec.pendingChange = pendingChange; if (change == UidRecord.CHANGE_GONE && !uidRec.idle) { // If this uid is going away, and we haven't yet reported it is gone, // then do so now. change = UidRecord.CHANGE_GONE_IDLE; } } else if (uid < 0) { throw new IllegalArgumentException("No UidRecord or uid"); } pendingChange.uidRecord = uidRec; pendingChange.uid = uidRec != null ? uidRec.uid : uid; mPendingUidChanges.add(pendingChange); } else { pendingChange = uidRec.pendingChange; if (change == UidRecord.CHANGE_GONE && pendingChange.change == UidRecord.CHANGE_IDLE) { change = UidRecord.CHANGE_GONE_IDLE; } } pendingChange.change = change; pendingChange.processState = uidRec != null ? uidRec.setProcState : ActivityManager.PROCESS_STATE_NONEXISTENT; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enqueueUidChangeLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
enqueueUidChangeLocked
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public void addInstrumentationResults(IApplicationThread target, Bundle results) { int userId = UserHandle.getCallingUserId(); // Refuse possible leaked file descriptors if (results != null && results.hasFileDescriptors()) { throw new IllegalArgumentException("File descriptors passed in Intent"); } synchronized(this) { ProcessRecord app = getRecordForAppLOSP(target); if (app == null) { Slog.w(TAG, "addInstrumentationResults: no app for " + target); return; } final long origId = Binder.clearCallingIdentity(); try { addInstrumentationResultsLocked(app, results); } finally { Binder.restoreCallingIdentity(origId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addInstrumentationResults File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
addInstrumentationResults
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private String offlineToString(boolean offline) { return offline ? "1" : "0"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: offlineToString File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java Repository: keycloak The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-6563
HIGH
7.7
keycloak
offlineToString
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
11eb952e1df7cbb95b1e2c101dfd4839a2375695
0
Analyze the following code function for security vulnerabilities
@Override public void setTextContent(final String textContent) { removeAllChildren(); if (textContent != null && !textContent.isEmpty()) { appendChild(new DomText(getPage(), textContent)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTextContent 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
setTextContent
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@Override public float getAnimationScale(int which) { switch (which) { case 0: return mWindowAnimationScaleSetting; case 1: return mTransitionAnimationScaleSetting; case 2: return mAnimatorDurationScaleSetting; } return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAnimationScale 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
getAnimationScale
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void onLockSettingsReady() { synchronized (getLockObject()) { fixupAutoTimeRestrictionDuringOrganizationOwnedDeviceMigration(); } getUserData(UserHandle.USER_SYSTEM); cleanUpOldUsers(); maybeSetDefaultProfileOwnerUserRestrictions(); handleStartUser(UserHandle.USER_SYSTEM); maybeLogStart(); // Register an observer for watching for user setup complete and settings changes. mSetupContentObserver.register(); // Initialize the user setup state, to handle the upgrade case. updateUserSetupCompleteAndPaired(); List<String> packageList; synchronized (getLockObject()) { packageList = getKeepUninstalledPackagesLocked(); } if (packageList != null) { mInjector.getPackageManagerInternal().setKeepUninstalledPackages(packageList); } synchronized (getLockObject()) { ActiveAdmin deviceOwner = getDeviceOwnerAdminLocked(); if (deviceOwner != null) { // Push the force-ephemeral-users policy to the user manager. mUserManagerInternal.setForceEphemeralUsers(deviceOwner.forceEphemeralUsers); // Update user switcher message to activity manager. ActivityManagerInternal activityManagerInternal = mInjector.getActivityManagerInternal(); activityManagerInternal.setSwitchingFromSystemUserMessage( deviceOwner.startUserSessionMessage); activityManagerInternal.setSwitchingToSystemUserMessage( deviceOwner.endUserSessionMessage); } revertTransferOwnershipIfNecessaryLocked(); } updateUsbDataSignal(); // In case flag value has changed, we apply it during boot to avoid doing it concurrently // with user toggling quiet mode. setKeepProfileRunningEnabledUnchecked(isKeepProfilesRunningFlagEnabled()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLockSettingsReady 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
onLockSettingsReady
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public Notification.Builder extend(Notification.Builder builder) { Bundle bundle = new Bundle(); bundle.putInt(EXTRA_FLAGS, mFlags); bundle.putString(EXTRA_CHANNEL_ID, mChannelId); bundle.putBoolean(EXTRA_SUPPRESS_SHOW_OVER_APPS, mSuppressShowOverApps); if (mContentIntent != null) { bundle.putParcelable(EXTRA_CONTENT_INTENT, mContentIntent); } if (mDeleteIntent != null) { bundle.putParcelable(EXTRA_DELETE_INTENT, mDeleteIntent); } builder.getExtras().putBundle(EXTRA_TV_EXTENDER, bundle); return builder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extend File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
extend
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private void setDefaultShell() { //If this is windows set the shell to command.com or cmd.exe with correct arguments. if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { if ( Os.isFamily( Os.FAMILY_WIN9X ) ) { setShell( new CommandShell() ); } else { setShell( new CmdShell() ); } } else { setShell( new BourneShell() ); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultShell File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
setDefaultShell
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
@Override public void reenableKeyguard(IBinder token) { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires DISABLE_KEYGUARD permission"); } if (token == null) { throw new IllegalArgumentException("token == null"); } mKeyguardDisableHandler.sendMessage(mKeyguardDisableHandler.obtainMessage( KeyguardDisableHandler.KEYGUARD_REENABLE, token)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reenableKeyguard 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
reenableKeyguard
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public String getPackageExtensionId() { return this.packageExtensionId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageExtensionId File: xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-27480
HIGH
7.7
xwiki/xwiki-platform
getPackageExtensionId
xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
e3527b98fdd8dc8179c24dc55e662b2c55199434
0
Analyze the following code function for security vulnerabilities
public ContentProviderHolder getContentProviderExternal( String name, int userId, IBinder token) { enforceCallingPermission(android.Manifest.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY, "Do not have permission in call getContentProviderExternal()"); userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, ALLOW_FULL_ONLY, "getContentProvider", null); return getContentProviderExternalUnchecked(name, token, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentProviderExternal File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
getContentProviderExternal
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public boolean setShowBadge(String pkg, int uid, boolean showBadge) { try { sINM.setShowBadge(pkg, uid, showBadge); return true; } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShowBadge File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
setShowBadge
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
@Override public Intent getIntent() { Intent modIntent = new Intent(super.getIntent()); modIntent.putExtra(EXTRA_SHOW_FRAGMENT, getFragmentClass().getName()); String action = modIntent.getAction(); if (ACTION_SET_NEW_PASSWORD.equals(action) || ACTION_SET_NEW_PARENT_PROFILE_PASSWORD.equals(action)) { modIntent.putExtra(EXTRA_HIDE_DRAWER, true); } return modIntent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntent File: src/com/android/settings/password/ChooseLockGeneric.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
getIntent
src/com/android/settings/password/ChooseLockGeneric.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
private void rejectServiceAccount(JsonNode createRequest) { if (createRequest.has(USERNAME)) { final User user = userService.load(createRequest.get(USERNAME).asText()); if ((user != null) && user.isServiceAccount()) { throw new BadRequestException("Cannot login with service account " + user.getName()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rejectServiceAccount File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-384" ]
CVE-2024-24823
MEDIUM
4.4
Graylog2/graylog2-server
rejectServiceAccount
graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java
1596b749db86368ba476662f23a0f0c5ec2b5097
0
Analyze the following code function for security vulnerabilities
void startSetupActivityLocked() { // Only do this once per boot. if (mCheckedForSetup) { return; } // We will show this screen if the current one is a different // version than the last one shown, and we are not running in // low-level factory test mode. final ContentResolver resolver = mContext.getContentResolver(); if (mFactoryTest != FactoryTest.FACTORY_TEST_LOW_LEVEL && Settings.Global.getInt(resolver, Settings.Global.DEVICE_PROVISIONED, 0) != 0) { mCheckedForSetup = true; // See if we should be showing the platform update setup UI. Intent intent = new Intent(Intent.ACTION_UPGRADE_SETUP); List<ResolveInfo> ris = mContext.getPackageManager() .queryIntentActivities(intent, PackageManager.GET_META_DATA); // We don't allow third party apps to replace this. ResolveInfo ri = null; for (int i=0; ris != null && i<ris.size(); i++) { if ((ris.get(i).activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { ri = ris.get(i); break; } } if (ri != null) { String vers = ri.activityInfo.metaData != null ? ri.activityInfo.metaData.getString(Intent.METADATA_SETUP_VERSION) : null; if (vers == null && ri.activityInfo.applicationInfo.metaData != null) { vers = ri.activityInfo.applicationInfo.metaData.getString( Intent.METADATA_SETUP_VERSION); } String lastVers = Settings.Secure.getString( resolver, Settings.Secure.LAST_SETUP_SHOWN); if (vers != null && !vers.equals(lastVers)) { intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setComponent(new ComponentName( ri.activityInfo.packageName, ri.activityInfo.name)); mStackSupervisor.startActivityLocked(null, intent, null, ri.activityInfo, null, null, null, null, 0, 0, 0, null, 0, 0, 0, null, false, false, null, null, null); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startSetupActivityLocked 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
startSetupActivityLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@Override public void onPropertiesChanged(DeviceConfig.Properties properties) { if (properties.getKeyset().contains(NAV_BAR_HANDLE_SHOW_OVER_LOCKSCREEN)) { mShowHomeOverLockscreen = properties.getBoolean( NAV_BAR_HANDLE_SHOW_OVER_LOCKSCREEN, true /* defaultValue */); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPropertiesChanged File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
onPropertiesChanged
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public void revokeUriPermission(IApplicationThread caller, Uri uri, int mode, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(caller.asBinder()); uri.writeToParcel(data, 0); data.writeInt(mode); data.writeInt(userId); mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revokeUriPermission File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
revokeUriPermission
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public void onUsingAlternativeUi(Call activeCall, boolean isUsingAlternativeUi) { final String callId = mCallIdMapper.getCallId(activeCall); if (callId != null && isServiceValid("onUsingAlternativeUi")) { try { logOutgoing("onUsingAlternativeUi %s", isUsingAlternativeUi); mServiceInterface.onUsingAlternativeUi(callId, isUsingAlternativeUi, Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException e) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUsingAlternativeUi File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
onUsingAlternativeUi
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override public boolean canHandleVolumeKey() { if (isPlaybackTypeLocal() || mVolumeAdjustmentForRemoteGroupSessions) { return true; } MediaRouter2Manager mRouter2Manager = MediaRouter2Manager.getInstance(mContext); List<RoutingSessionInfo> sessions = mRouter2Manager.getRoutingSessions(mPackageName); boolean foundNonSystemSession = false; boolean isGroup = false; for (RoutingSessionInfo session : sessions) { if (!session.isSystemSession()) { foundNonSystemSession = true; int selectedRouteCount = session.getSelectedRoutes().size(); if (selectedRouteCount > 1) { isGroup = true; break; } } } if (!foundNonSystemSession) { Log.d(TAG, "No routing session for " + mPackageName); return false; } return !isGroup; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canHandleVolumeKey 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
canHandleVolumeKey
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
private static String getErrorHtml(boolean productionMode) { if (productionMode) { return LazyInit.PRODUCTION_MODE_TEMPLATE; } else { return readHtmlFile("RouteNotFoundError_dev.html"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getErrorHtml File: flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-20" ]
CVE-2021-31412
MEDIUM
4.3
vaadin/flow
getErrorHtml
flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java
c79a7a8dbe1a494ff99a591d2e85b1100fc0aa15
0
Analyze the following code function for security vulnerabilities
public List<ServerConfiguration> getServers() { return servers; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServers File: samples/client/petstore/java/resteasy/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
getServers
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void setOCItemDataDNsTypesExpected() { this.unsetTypeExpected(); int i = 1; this.setTypeExpected(i, TypeNames.INT); // item_data_id ++i; this.setTypeExpected(i, TypeNames.INT); // parent_dn_id ++i; this.setTypeExpected(i, TypeNames.INT); // dn_id ++i; this.setTypeExpected(i, TypeNames.STRING); // description ++i; this.setTypeExpected(i, TypeNames.STRING); // detailed_notes ++i; this.setTypeExpected(i, TypeNames.INT); // owner_id ++i; this.setTypeExpected(i, TypeNames.DATE); // date_created ++i; this.setTypeExpected(i, TypeNames.STRING); // status ++i; this.setTypeExpected(i, TypeNames.STRING); // discrepancy_note_type.name }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOCItemDataDNsTypesExpected File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
setOCItemDataDNsTypesExpected
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
int[] getAttributeResolutionStack(long themePtr, @AttrRes int defStyleAttr, @StyleRes int defStyleRes, @StyleRes int xmlStyle) { synchronized (this) { return nativeAttributeResolutionStack( mObject, themePtr, xmlStyle, defStyleAttr, defStyleRes); } }
Vulnerability Classification: - CWE: CWE-415 - CVE: CVE-2023-40103 - Severity: HIGH - CVSS Score: 7.8 Description: [res] Better native pointer tracking in Java Make sure we clear the native pointers when freeing them, so any race condition that calls into it gets a null instead of calling into already freed object Bug: 197260547 Test: build + unit tests (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7c2f195cfc8c02403d61a394213398d13584a5de) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b9ef411d0f480ee59d73601cce7fb40335a7d389) Merged-In: I817dc2f5ef24e1fafeba3ce4c1c440abe70ad3ed Change-Id: I817dc2f5ef24e1fafeba3ce4c1c440abe70ad3ed Function: getAttributeResolutionStack File: core/java/android/content/res/AssetManager.java Repository: android Fixed Code: int[] getAttributeResolutionStack(long themePtr, @AttrRes int defStyleAttr, @StyleRes int defStyleRes, @StyleRes int xmlStyle) { synchronized (this) { ensureValidLocked(); return nativeAttributeResolutionStack( mObject, themePtr, xmlStyle, defStyleAttr, defStyleRes); } }
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getAttributeResolutionStack
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
1
Analyze the following code function for security vulnerabilities
public int getNumOfOffloadedScanFilterSupported() { enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); return mAdapterProperties.getNumOfOffloadedScanFilterSupported(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNumOfOffloadedScanFilterSupported File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
getNumOfOffloadedScanFilterSupported
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public void watchRepository( String projectName, String repositoryName, Revision lastKnownRevision, String pathPattern, long timeoutMillis, AsyncMethodCallback resultHandler) { if (timeoutMillis <= 0) { rejectInvalidWatchTimeout("watchRepository", resultHandler); return; } final Repository repo = projectManager.get(projectName).repos().get(repositoryName); final CompletableFuture<com.linecorp.centraldogma.common.Revision> future = watchService.watchRepository(repo, convert(lastKnownRevision), pathPattern, timeoutMillis); handleWatchRepositoryResult(future, resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: watchRepository File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
watchRepository
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
public FileHeader nextFileHeader() { final int n = this.headers.size(); while (this.currentHeaderIndex < n) { final BaseBlock block = this.headers.get(this.currentHeaderIndex++); if (block.getHeaderType() == UnrarHeadertype.FileHeader) { return (FileHeader) block; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nextFileHeader File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2022-23596
MEDIUM
5
junrar
nextFileHeader
src/main/java/com/github/junrar/Archive.java
7b16b3d90b91445fd6af0adfed22c07413d4fab7
0
Analyze the following code function for security vulnerabilities
public void setAccessibilityTextOverride(String accessibilityOverride) { mAccessibilityTextOverride = accessibilityOverride; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAccessibilityTextOverride 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
setAccessibilityTextOverride
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
@Override protected void hangupAndPowerOff() { // hang up all active voice calls mPhone.mCT.mRingingCall.hangupIfAlive(); mPhone.mCT.mBackgroundCall.hangupIfAlive(); mPhone.mCT.mForegroundCall.hangupIfAlive(); mCi.setRadioPower(false, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hangupAndPowerOff File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
hangupAndPowerOff
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
private void clearProfilerLocked() { if (mProfileFd != null) { try { mProfileFd.close(); } catch (IOException e) { } } mProfileApp = null; mProfileProc = null; mProfileFile = null; mProfileType = 0; mAutoStopProfiler = false; mSamplingInterval = 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearProfilerLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
clearProfilerLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0