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
public SFile getParentFile() { return new SFile(internal.getParentFile()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParentFile File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
getParentFile
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public void onStartedGoingToSleep() { mStartedGoingToSleep = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStartedGoingToSleep File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onStartedGoingToSleep
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void printRaw(String raw) { handleSpaceWhenStartElement(); // Prevent injecting {{/html}}. We escape {{/html}} as well as prefixes of {{/html}} at the end of the raw // content to avoid that raw content and plain texts can be combined to construct the full {{/html}}. This may // cause errors as we might not be using the right escaping for the context (e.g., JSON or HTML comments) but // for this reason we also escape in JSON output and HTML comments. String escapedRaw = raw.replace("{{/html}}", "{{/html}}"); StringBuilder prefix = new StringBuilder(); for (Character nextChar : List.of('{', '/', 'h', 't', 'm', 'l', '}', '}')) { prefix.append(nextChar); if (escapedRaw.endsWith(prefix.toString())) { escapedRaw = escapedRaw.substring(0, escapedRaw.length() - prefix.length()) + "{" + prefix.substring(1); break; } } super.printRaw(escapedRaw); this.elementEnded = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printRaw File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-37908
CRITICAL
9.6
xwiki/xwiki-rendering
printRaw
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
f4d5acac451dccaf276e69f0b49b72221eef5d2f
0
Analyze the following code function for security vulnerabilities
void deleteTransferOwnershipBundleLocked(int userId) { final File parametersFile = new File(mPathProvider.getUserSystemDirectory(userId), TRANSFER_OWNERSHIP_PARAMETERS_XML); parametersFile.delete(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteTransferOwnershipBundleLocked 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
deleteTransferOwnershipBundleLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public boolean previous() throws SQLException { checkScrollable(); if (onInsertRow) { throw new PSQLException(GT.tr("Can''t use relative move methods while on the insert row."), PSQLState.INVALID_CURSOR_STATE); } if (currentRow - 1 < 0) { currentRow = -1; thisRow = null; rowBuffer = null; return false; } else { currentRow--; } initRowBuffer(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: previous 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
previous
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@PUT @Path("externalpage") @Operation(summary = "Attaches an external page building block", description = "Attaches an external page building block") @ApiResponse(responseCode = "200", description = "The course 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.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response attachExternalPage(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") String parentNodeId, @QueryParam("position") Integer position, @QueryParam("shortTitle") @DefaultValue("undefined") String shortTitle, @QueryParam("longTitle") @DefaultValue("undefined") String longTitle, @QueryParam("objectives") @DefaultValue("undefined") String objectives, @QueryParam("visibilityExpertRules") String visibilityExpertRules, @QueryParam("accessExpertRules") String accessExpertRules, @QueryParam("url") String url, @Context HttpServletRequest request) { URL externalUrl = null; try { externalUrl = new URL(url); } catch (MalformedURLException e) { return Response.serverError().status(Status.CONFLICT).build(); } ExternalPageCustomConfig config = new ExternalPageCustomConfig(externalUrl); return attach(courseId, parentNodeId, "tu", position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachExternalPage 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
attachExternalPage
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
@Override boolean check(AtomicLongConfig c1, AtomicLongConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getName(), c2.getName()) && nullSafeEqual(c1.getQuorumName(), c2.getQuorumName()) && ConfigCompatibilityChecker.isCompatible(c1.getMergePolicyConfig(), c2.getMergePolicyConfig()); }
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
@POST @Path("task") @Operation(summary = "Attach Task Element on course", description = "This attaches a Task Element onto a given course. The element will be\n" + " inserted underneath the supplied parentNodeId.") @ApiResponse(responseCode = "200", description = "The course 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.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response attachTaskPost(@PathParam("courseId") Long courseId, @FormParam("parentNodeId") String parentNodeId, @FormParam("position") Integer position, @FormParam("shortTitle") @DefaultValue("undefined") String shortTitle, @FormParam("longTitle") @DefaultValue("undefined") String longTitle, @FormParam("objectives") @DefaultValue("undefined") String objectives, @FormParam("visibilityExpertRules") String visibilityExpertRules, @FormParam("accessExpertRules") String accessExpertRules, @FormParam("text") String text, @FormParam("points") Float points, @Context HttpServletRequest request) { return attachTask(courseId, parentNodeId, position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, text, points, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachTaskPost 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
attachTaskPost
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
private void migrate56(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Users.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { element.addElement("alternateEmails"); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate56 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate56
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public boolean isProviderInPackageForUid(Provider provider, int uid, String packageName) { // Packages providing the AppWidget have access to it. return provider != null && provider.id.uid == uid && provider.id.componentName.getPackageName().equals(packageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isProviderInPackageForUid File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
isProviderInPackageForUid
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Ignore("fails: unterminated quoted identifier") @Test public void updateSectionSingleQuote(TestContext context) { UpdateSection updateSection = new UpdateSection(); updateSection.addField("key").setValue("'"); createFoo(context) .update(FOO, updateSection, (Criterion) null, false, context.asyncAssertSuccess()); }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15534 - Severity: HIGH - CVSS Score: 7.5 Description: RMB-200: Single quote SQL Injection in PostgresClient.update(table, updateSection, ...) Function: updateSectionSingleQuote File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder Fixed Code: @Test public void updateSectionSingleQuote(TestContext context) { UpdateSection updateSection = new UpdateSection(); updateSection.addField("key").setValue("'"); postgresClient = createFoo(context); postgresClient.save(FOO, xPojo, context.asyncAssertSuccess(save -> { postgresClient.update(FOO, updateSection, (Criterion) null, true, context.asyncAssertSuccess(update -> { context.assertEquals(1, update.getUpdated(), "number of records updated"); postgresClient.selectSingle("SELECT jsonb->>'key' FROM " + FOO, context.asyncAssertSuccess(select -> { context.assertEquals("'", select.getString(0), "single quote"); })); })); })); }
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
updateSectionSingleQuote
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
1
Analyze the following code function for security vulnerabilities
public ServerBuilder maxNumConnections(int maxNumConnections) { this.maxNumConnections = validateMaxNumConnections(maxNumConnections); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maxNumConnections File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
maxNumConnections
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public final String getPath() { synchronized (mLock) { return mConfigurationLocked.path; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPath File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
getPath
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
@Override public void stopTextEditing() { saveTextEditingState(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopTextEditing 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
stopTextEditing
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private int adjustLaunchFlagsToDocumentMode(ActivityRecord r, boolean launchSingleInstance, boolean launchSingleTask, int launchFlags) { if ((launchFlags & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) != 0 && (launchSingleInstance || launchSingleTask)) { // We have a conflict between the Intent and the Activity manifest, manifest wins. Slog.i(TAG, "Ignoring FLAG_ACTIVITY_NEW_DOCUMENT, launchMode is " + "\"singleInstance\" or \"singleTask\""); launchFlags &= ~(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | FLAG_ACTIVITY_MULTIPLE_TASK); } else { switch (r.info.documentLaunchMode) { case ActivityInfo.DOCUMENT_LAUNCH_NONE: break; case ActivityInfo.DOCUMENT_LAUNCH_INTO_EXISTING: launchFlags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT; break; case ActivityInfo.DOCUMENT_LAUNCH_ALWAYS: launchFlags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT; break; case ActivityInfo.DOCUMENT_LAUNCH_NEVER: if (mLaunchMode == LAUNCH_SINGLE_INSTANCE_PER_TASK) { // Remove MULTIPLE_TASK flag along with NEW_DOCUMENT only if NEW_DOCUMENT // is set, otherwise we still want to keep the MULTIPLE_TASK flag (if // any) for singleInstancePerTask that the multiple tasks can be created, // or a singleInstancePerTask activity is basically the same as a // singleTask activity when documentLaunchMode set to never. if ((launchFlags & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) != 0) { launchFlags &= ~(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | FLAG_ACTIVITY_MULTIPLE_TASK); } } else { // TODO(b/184903976): Should FLAG_ACTIVITY_MULTIPLE_TASK always be // removed for document-never activity? launchFlags &= ~(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | FLAG_ACTIVITY_MULTIPLE_TASK); } break; } } return launchFlags; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: adjustLaunchFlagsToDocumentMode File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
adjustLaunchFlagsToDocumentMode
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
boolean isPendingBroadcastProcessLocked(ProcessRecord app) { return mFgBroadcastQueue.isPendingBroadcastProcessLocked(app) || mBgBroadcastQueue.isPendingBroadcastProcessLocked(app) || mBgOffloadBroadcastQueue.isPendingBroadcastProcessLocked(app) || mFgOffloadBroadcastQueue.isPendingBroadcastProcessLocked(app); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPendingBroadcastProcessLocked 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
isPendingBroadcastProcessLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public void sendResponse(Throwable error) throws IOException { BytesStreamOutput stream = new BytesStreamOutput(); try { writeResponseExceptionHeader(stream); RemoteTransportException tx = new RemoteTransportException(targetTransport.nodeName(), targetTransport.boundAddress().boundAddress(), action, error); ThrowableObjectOutputStream too = new ThrowableObjectOutputStream(stream); too.writeObject(tx); too.close(); } catch (NotSerializableException e) { stream.reset(); writeResponseExceptionHeader(stream); RemoteTransportException tx = new RemoteTransportException(targetTransport.nodeName(), targetTransport.boundAddress().boundAddress(), action, new NotSerializableTransportException(error)); ThrowableObjectOutputStream too = new ThrowableObjectOutputStream(stream); too.writeObject(tx); too.close(); } final byte[] data = stream.bytes().toBytes(); targetTransport.workers().execute(new Runnable() { @Override public void run() { targetTransport.messageReceived(data, action, sourceTransport, version, null); } }); sourceTransportServiceAdapter.onResponseSent(requestId, action, error); }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2015-5377 - Severity: HIGH - CVSS Score: 7.5 Description: Restrict Exception deserialization to Core and JDK classes when 3rd party exceptions are deserialized they might carry classes not present on the deserializing node. This causes hard exceptions and looses the exception entirely. This commit restricts the classes we support for deserialization for core and selected JDK classes to guarantee they are present on both source and target nodes Function: sendResponse File: src/main/java/org/elasticsearch/transport/local/LocalTransportChannel.java Repository: elastic/elasticsearch Fixed Code: @Override public void sendResponse(Throwable error) throws IOException { BytesStreamOutput stream = new BytesStreamOutput(); if (ThrowableObjectOutputStream.canSerialize(error) == false) { assert false : "Can not serialize exception: " + error; // make sure tests fail error = new NotSerializableTransportException(error); } try { writeResponseExceptionHeader(stream); RemoteTransportException tx = new RemoteTransportException(targetTransport.nodeName(), targetTransport.boundAddress().boundAddress(), action, error); ThrowableObjectOutputStream too = new ThrowableObjectOutputStream(stream); too.writeObject(tx); too.close(); } catch (NotSerializableException e) { stream.reset(); writeResponseExceptionHeader(stream); RemoteTransportException tx = new RemoteTransportException(targetTransport.nodeName(), targetTransport.boundAddress().boundAddress(), action, new NotSerializableTransportException(error)); ThrowableObjectOutputStream too = new ThrowableObjectOutputStream(stream); too.writeObject(tx); too.close(); } final byte[] data = stream.bytes().toBytes(); targetTransport.workers().execute(new Runnable() { @Override public void run() { targetTransport.messageReceived(data, action, sourceTransport, version, null); } }); sourceTransportServiceAdapter.onResponseSent(requestId, action, error); }
[ "CWE-74" ]
CVE-2015-5377
HIGH
7.5
elastic/elasticsearch
sendResponse
src/main/java/org/elasticsearch/transport/local/LocalTransportChannel.java
bf3052d14c874aead7da8855c5fcadf5428a43f2
1
Analyze the following code function for security vulnerabilities
@Override public Optional<CorsOriginConfiguration> convert(Object object, Class<CorsOriginConfiguration> targetType, ConversionContext context) { CorsOriginConfiguration configuration = new CorsOriginConfiguration(); if (object instanceof Map) { Map mapConfig = (Map) object; ConvertibleValues<Object> convertibleValues = new ConvertibleValuesMap<>(mapConfig); convertibleValues .get(ALLOWED_ORIGINS, Argument.listOf(String.class)) .ifPresent(configuration::setAllowedOrigins); convertibleValues .get(ALLOWED_METHODS, Argument.listOf(HttpMethod.class)) .ifPresent(configuration::setAllowedMethods); convertibleValues .get(ALLOWED_HEADERS, Argument.listOf(String.class)) .ifPresent(configuration::setAllowedHeaders); convertibleValues .get(EXPOSED_HEADERS, Argument.listOf(String.class)) .ifPresent(configuration::setExposedHeaders); convertibleValues .get(ALLOW_CREDENTIALS, Boolean.class) .ifPresent(configuration::setAllowCredentials); convertibleValues .get(MAX_AGE, Long.class) .ifPresent(configuration::setMaxAge); } return Optional.of(configuration); }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2022-21700 - Severity: MEDIUM - CVSS Score: 5.0 Description: Use ConversionContext constants where possible instead of class (#2356) Changes ------- * Added ArgumentConversionContext constants in ConversionContext * Replaced Argument.of and use of argument classes with ConversionContext constants where possible * Added getFirst method in ConvertibleMultiValues that accepts ArgumentConversionContent parameter Partially addresses issue #2355 Function: convert File: http-server/src/main/java/io/micronaut/http/server/cors/CorsOriginConverter.java Repository: micronaut-projects/micronaut-core Fixed Code: @Override public Optional<CorsOriginConfiguration> convert(Object object, Class<CorsOriginConfiguration> targetType, ConversionContext context) { CorsOriginConfiguration configuration = new CorsOriginConfiguration(); if (object instanceof Map) { Map mapConfig = (Map) object; ConvertibleValues<Object> convertibleValues = new ConvertibleValuesMap<>(mapConfig); convertibleValues .get(ALLOWED_ORIGINS, ConversionContext.LIST_OF_STRING) .ifPresent(configuration::setAllowedOrigins); convertibleValues .get(ALLOWED_METHODS, CONVERSION_CONTEXT_LIST_OF_HTTP_METHOD) .ifPresent(configuration::setAllowedMethods); convertibleValues .get(ALLOWED_HEADERS, ConversionContext.LIST_OF_STRING) .ifPresent(configuration::setAllowedHeaders); convertibleValues .get(EXPOSED_HEADERS, ConversionContext.LIST_OF_STRING) .ifPresent(configuration::setExposedHeaders); convertibleValues .get(ALLOW_CREDENTIALS, ConversionContext.BOOLEAN) .ifPresent(configuration::setAllowCredentials); convertibleValues .get(MAX_AGE, ConversionContext.LONG) .ifPresent(configuration::setMaxAge); } return Optional.of(configuration); }
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
convert
http-server/src/main/java/io/micronaut/http/server/cors/CorsOriginConverter.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
1
Analyze the following code function for security vulnerabilities
public int getBlockSize() { return BLOCK_SIZE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBlockSize File: core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
getBlockSize
core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java
413b42f4d770456508585c830cfcde95f9b0e93b
0
Analyze the following code function for security vulnerabilities
@Override public int update(Uri uri, ContentValues values, String where, String[] whereArgs) { if (DEBUG) { Slog.v(LOG_TAG, "update() for user: " + UserHandle.getCallingUserId()); } Arguments args = new Arguments(uri, where, whereArgs, false); // If a legacy table that is gone, done. if (REMOVED_LEGACY_TABLES.contains(args.table)) { return 0; } String name = values.getAsString(Settings.Secure.NAME); if (!isKeyValid(name)) { return 0; } String value = values.getAsString(Settings.Secure.VALUE); switch (args.table) { case TABLE_GLOBAL: { final int userId = UserHandle.getCallingUserId(); return updateGlobalSetting(args.name, value, userId, false) ? 1 : 0; } case TABLE_SECURE: { final int userId = UserHandle.getCallingUserId(); return updateSecureSetting(args.name, value, userId, false) ? 1 : 0; } case TABLE_SYSTEM: { final int userId = UserHandle.getCallingUserId(); return updateSystemSetting(args.name, value, userId) ? 1 : 0; } default: { throw new IllegalArgumentException("Invalid Uri path:" + uri); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: update 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
update
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
private void saveVoiceMailAndForwardingNumber( String key, VoicemailProviderSettings newSettings) { if (DBG) log("saveVoiceMailAndForwardingNumber: " + newSettings.toString()); mNewVMNumber = newSettings.getVoicemailNumber(); mNewVMNumber = (mNewVMNumber == null) ? "" : mNewVMNumber; mNewFwdSettings = newSettings.getForwardingSettings(); // Call forwarding is not suppported on CDMA. if (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) { if (DBG) log("Ignoring forwarding setting since this is CDMA phone"); mNewFwdSettings = VoicemailProviderSettings.NO_FORWARDING; } // Throw a warning if the voicemail is the same and we did not change forwarding. if (mNewVMNumber.equals(mOldVmNumber) && mNewFwdSettings == VoicemailProviderSettings.NO_FORWARDING) { showDialogIfForeground(VoicemailDialogUtil.VM_NOCHANGE_ERROR_DIALOG); return; } VoicemailProviderSettingsUtil.save(this, key, newSettings); mVMChangeCompletedSuccessfully = false; mFwdChangesRequireRollback = false; mVMOrFwdSetError = 0; if (mNewFwdSettings == VoicemailProviderSettings.NO_FORWARDING || key.equals(mPreviousVMProviderKey)) { if (DBG) log("Set voicemail number. No changes to forwarding number."); setVoicemailNumberWithCarrier(); } else { if (DBG) log("Reading current forwarding settings."); int numSettingsReasons = VoicemailProviderSettings.FORWARDING_SETTINGS_REASONS.length; mForwardingReadResults = new CallForwardInfo[numSettingsReasons]; for (int i = 0; i < mForwardingReadResults.length; i++) { mPhone.getCallForwardingOption( VoicemailProviderSettings.FORWARDING_SETTINGS_REASONS[i], CommandsInterface.SERVICE_CLASS_VOICE, mGetOptionComplete.obtainMessage(EVENT_FORWARDING_GET_COMPLETED, i, 0)); } showDialogIfForeground(VoicemailDialogUtil.VM_FWD_READING_DIALOG); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveVoiceMailAndForwardingNumber File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
saveVoiceMailAndForwardingNumber
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
public void browserExposeInJavaScript(PeerComponent browserPeer, Object o, String name) { ((AndroidImplementation.AndroidBrowserComponent) browserPeer).exposeInJavaScript(o, name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: browserExposeInJavaScript 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
browserExposeInJavaScript
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override protected void onQuitting() { mHasQuit = true; mClientModeManager.onClientModeImplQuit(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onQuitting File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onQuitting
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private static void simpleAuthenticationGenerator(XmlGenerator gen, SimpleAuthenticationConfig c) { if (c == null) { return; } XmlGenerator simpleGen = gen.open("simple"); addClusterLoginElements(simpleGen, c).nodeIfContents("role-separator", c.getRoleSeparator()); for (String username : c.getUsernames()) { simpleGen.open("user", "username", username, "password", c.getPassword(username)); for (String role : c.getRoles(username)) { simpleGen.node("role", role); } // close <user> node simpleGen.close(); } simpleGen.close(); }
Vulnerability Classification: - CWE: CWE-522 - CVE: CVE-2023-33264 - Severity: MEDIUM - CVSS Score: 4.3 Description: Extend set of masked fields in ConfigXmlGenerator Function: simpleAuthenticationGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast Fixed Code: private void simpleAuthenticationGenerator(XmlGenerator gen, SimpleAuthenticationConfig c) { if (c == null) { return; } XmlGenerator simpleGen = gen.open("simple"); addClusterLoginElements(simpleGen, c).nodeIfContents("role-separator", c.getRoleSeparator()); for (String username : c.getUsernames()) { simpleGen.open("user", "username", username, "password", getOrMaskValue(c.getPassword(username))); for (String role : c.getRoles(username)) { simpleGen.node("role", role); } // close <user> node simpleGen.close(); } simpleGen.close(); }
[ "CWE-522" ]
CVE-2023-33264
MEDIUM
4.3
hazelcast
simpleAuthenticationGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
1
Analyze the following code function for security vulnerabilities
@Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { if (devServerStartFuture.isDone()) { try { devServerStartFuture.getNow(null); } catch (CompletionException exception) { isDevServerFailedToStart.set(true); throw getCause(exception); } return false; } else { InputStream inputStream = DevModeHandlerImpl.class .getResourceAsStream("dev-mode-not-ready.html"); IOUtils.copy(inputStream, response.getOutputStream()); response.setContentType("text/html;charset=utf-8"); return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleRequest File: vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-172" ]
CVE-2021-33604
LOW
1.2
vaadin/flow
handleRequest
vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
2a801c42b406a00c44f4a85b4b4e4a4c5bf89adc
0
Analyze the following code function for security vulnerabilities
@Override public void clipRect(Object graphics, int x, int y, int width, int height) { ((AndroidGraphics) graphics).clipRect(x, y, width, height); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clipRect 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
clipRect
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void setCommandHistoryAllowed(boolean allowed) { if (allowed) { if (commandHistoryString == null) { commandHistoryString = ""; } } else { commandHistoryString = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCommandHistoryAllowed File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
setCommandHistoryAllowed
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public int finishTopCrashedActivities(WindowProcessController crashedApp, String reason) { synchronized (mGlobalLock) { return mRootWindowContainer.finishTopCrashedActivities(crashedApp, reason); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishTopCrashedActivities 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
finishTopCrashedActivities
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void updateObject(@Positive int columnIndex, @Nullable Object x, java.sql.SQLType targetSqlType, int scaleOrLength) throws SQLException { throw org.postgresql.Driver.notImplemented(this.getClass(), "updateObject"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateObject 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
updateObject
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public Builder setMaxConnectionsTotal(int maxTotalConnections) { this.maxTotalConnections = maxTotalConnections; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxConnectionsTotal File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setMaxConnectionsTotal
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
private void doAddApplicationTemplate(SpTemplate spTemplate, String tenantDomain) throws IdentityApplicationManagementException { // Add application template to database ApplicationTemplateDAO applicationTemplateDAO = ApplicationMgtSystemConfig.getInstance() .getApplicationTemplateDAO(); applicationTemplateDAO.createApplicationTemplate(spTemplate, tenantDomain); // Add application template to cache ServiceProviderTemplateCacheKey templateCacheKey = new ServiceProviderTemplateCacheKey(spTemplate.getName(), tenantDomain); ServiceProviderTemplateCache.getInstance().addToCache(templateCacheKey, spTemplate); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doAddApplicationTemplate File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
doAddApplicationTemplate
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
@Override public Object getDefaultFont() { CodenameOneTextPaint paint = new CodenameOneTextPaint(this.defaultFont); return new NativeFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM, paint); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultFont 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
getDefaultFont
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private static <A extends Annotation> A getAnnotation(final Method m, final Class<A> annotationClass) { // if we have invalid data the result is null if (m == null || annotationClass == null) { return null; } if (m.isAnnotationPresent(annotationClass)) { return m.getAnnotation(annotationClass); } // if we've already reached the Object class, return null; Class<?> c = m.getDeclaringClass(); if (c.getSuperclass() == null) { return null; } // check directly implemented interfaces for the method being checked for (Class<?> i : c.getInterfaces()) { try { Method im = i.getMethod(m.getName(), m.getParameterTypes()); return getAnnotation(im, annotationClass); } catch (final SecurityException ex) { continue; } catch (final NoSuchMethodException ex) { continue; } } try { return getAnnotation( c.getSuperclass().getMethod(m.getName(), m.getParameterTypes()), annotationClass); } catch (final SecurityException ex) { return null; } catch (final NoSuchMethodException ex) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAnnotation File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
getAnnotation
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
@Test public void upsert5(TestContext context) { String id = randomUuid(); PostgresClient postgresClient = createFoo(context); postgresClient.upsert(FOO, id, xPojo, /* convertEntity */ true, context.asyncAssertSuccess(save -> { context.assertEquals(id, save); postgresClient.getById(FOO, id, context.asyncAssertSuccess(get -> { context.assertEquals("x", get.getString("key")); postgresClient.upsert(FOO, id, singleQuotePojo, /* convertEntity */ true, context.asyncAssertSuccess(update -> { context.assertEquals(id, update); postgresClient.getById(FOO, id, context.asyncAssertSuccess(get2 -> { context.assertEquals("'", get2.getString("key")); })); })); })); })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: upsert5 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
upsert5
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public void update(String table, UpdateSection section, Criterion when, boolean returnUpdatedIdsCount, Handler<AsyncResult<UpdateResult>> replyHandler) { long start = System.nanoTime(); vertx.runOnContext(v -> { client.getConnection(res -> { if (res.succeeded()) { SQLConnection connection = res.result(); StringBuilder sb = new StringBuilder(); if (when != null) { sb.append(when.toString()); } StringBuilder returning = new StringBuilder(); if (returnUpdatedIdsCount) { returning.append(RETURNING_ID); } try { String q = UPDATE + schemaName + DOT + table + SET + DEFAULT_JSONB_FIELD_NAME + " = jsonb_set(" + DEFAULT_JSONB_FIELD_NAME + "," + section.getFieldsString() + ", '" + section.getValue() + "', false) " + sb.toString() + SPACE + returning; log.debug("update query = " + q); connection.update(q, query -> { connection.close(); if (query.failed()) { log.error(query.cause().getMessage(), query.cause()); replyHandler.handle(Future.failedFuture(query.cause())); } else { replyHandler.handle(Future.succeededFuture(query.result())); } statsTracker(UPDATE_STAT_METHOD, table, start); }); } catch (Exception e) { if(connection != null){ connection.close(); } log.error(e.getMessage(), e); replyHandler.handle(Future.failedFuture(e)); } } else { log.error(res.cause().getMessage(), res.cause()); replyHandler.handle(Future.failedFuture(res.cause())); } }); }); }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15534 - Severity: HIGH - CVSS Score: 7.5 Description: RMB-200: Single quote SQL Injection in PostgresClient.update(table, updateSection, ...) Function: update File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder Fixed Code: public void update(String table, UpdateSection section, Criterion when, boolean returnUpdatedIdsCount, Handler<AsyncResult<UpdateResult>> replyHandler) { long start = System.nanoTime(); vertx.runOnContext(v -> { client.getConnection(res -> { if (res.succeeded()) { SQLConnection connection = res.result(); try { String value = section.getValue().replace("'", "''"); String where = when == null ? "" : when.toString(); String returning = returnUpdatedIdsCount ? RETURNING_ID : ""; String q = UPDATE + schemaName + DOT + table + SET + DEFAULT_JSONB_FIELD_NAME + " = jsonb_set(" + DEFAULT_JSONB_FIELD_NAME + "," + section.getFieldsString() + ", '" + value + "', false) " + where + returning; log.debug("update query = " + q); connection.update(q, query -> { connection.close(); if (query.failed()) { log.error(query.cause().getMessage(), query.cause()); replyHandler.handle(Future.failedFuture(query.cause())); } else { replyHandler.handle(Future.succeededFuture(query.result())); } statsTracker(UPDATE_STAT_METHOD, table, start); }); } catch (Exception e) { if(connection != null){ connection.close(); } log.error(e.getMessage(), e); replyHandler.handle(Future.failedFuture(e)); } } else { log.error(res.cause().getMessage(), res.cause()); replyHandler.handle(Future.failedFuture(res.cause())); } }); }); }
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
update
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
1
Analyze the following code function for security vulnerabilities
public I_CmsDraggable getDraggable() { return m_draggable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDraggable File: src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-31544
MEDIUM
5.4
alkacon/opencms-core
getDraggable
src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java
21bfbeaf6b038e2c03bb421ce7f0933dd7a7633e
0
Analyze the following code function for security vulnerabilities
public static Configuration getConfiguration(AMWTemplateExceptionHandler templateExceptionHandler) { Configuration cfg = new Configuration(Configuration.VERSION_2_3_22); cfg.setTemplateExceptionHandler(templateExceptionHandler); cfg.setShowErrorTips(false); cfg.setLogTemplateExceptions(false); // because otherwise freemarker renders numbers by default like 1,000,000 http://freemarker.org/docs/app_faq.html#faq_number_grouping cfg.setNumberFormat("0.######"); return cfg; }
Vulnerability Classification: - CWE: CWE-917 - CVE: CVE-2023-26092 - Severity: CRITICAL - CVSS Score: 9.8 Description: prevent usage of dangerous freemarker functions Function: getConfiguration File: AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java Repository: liimaorg/liima Fixed Code: public static Configuration getConfiguration(AMWTemplateExceptionHandler templateExceptionHandler) { Configuration cfg = new Configuration(Configuration.VERSION_2_3_22); // prevents Server-Side Template Injection cfg.setNewBuiltinClassResolver(TemplateClassResolver.ALLOWS_NOTHING_RESOLVER); cfg.setAPIBuiltinEnabled(false); cfg.setTemplateExceptionHandler(templateExceptionHandler); cfg.setShowErrorTips(false); cfg.setLogTemplateExceptions(false); // because otherwise freemarker renders numbers by default like 1,000,000 http://freemarker.org/docs/app_faq.html#faq_number_grouping cfg.setNumberFormat("0.######"); return cfg; }
[ "CWE-917" ]
CVE-2023-26092
CRITICAL
9.8
liimaorg/liima
getConfiguration
AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java
78ba2e198c615dc8858e56eee3290989f0362686
1
Analyze the following code function for security vulnerabilities
@Override public String getShortDescription() { return "Load and save state of the parser cache"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getShortDescription File: src/com/facebook/buck/cli/ParserCacheCommand.java Repository: facebook/buck The code follows secure coding practices.
[ "CWE-502" ]
CVE-2018-6331
HIGH
7.5
facebook/buck
getShortDescription
src/com/facebook/buck/cli/ParserCacheCommand.java
8c5500981812564877bd122c0f8fab48d3528ddf
0
Analyze the following code function for security vulnerabilities
@Override public void reduceImageSizes(Context context) { super.reduceImageSizes(context); if (mVerificationIcon != null) { int rightIconSize = context.getResources().getDimensionPixelSize( ActivityManager.isLowRamDeviceStatic() ? R.dimen.notification_right_icon_size_low_ram : R.dimen.notification_right_icon_size); mVerificationIcon.scaleDownIfNecessary(rightIconSize, rightIconSize); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reduceImageSizes File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
reduceImageSizes
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override protected void pin2AuthenticationSucceed() { if (mAddContact) { addContact(); } else { updateContact(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pin2AuthenticationSucceed File: src/com/android/phone/settings/fdn/EditFdnContactScreen.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
pin2AuthenticationSucceed
src/com/android/phone/settings/fdn/EditFdnContactScreen.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
private BodyPart getPart(Multipart messageContent, String mimeType) throws Exception { for (int i = 0; i < messageContent.getCount(); i++) { BodyPart part = messageContent.getBodyPart(i); if (part.isMimeType(mimeType)) { return part; } if (part.isMimeType("multipart/related") || part.isMimeType("multipart/alternative") || part.isMimeType("multipart/mixed")) { BodyPart out = getPart((Multipart) part.getContent(), mimeType); if (out != null) { return out; } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPart File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/ResetPasswordIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-200" ]
CVE-2021-32731
MEDIUM
5
xwiki/xwiki-platform
getPart
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/ResetPasswordIT.java
0cf716250b3645a5974c80d8336dcdf885749dff
0
Analyze the following code function for security vulnerabilities
public abstract short get(String name, short defaultValue) throws IOException, IllegalArgumentException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
get
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public void setAllowFocus(boolean allowFocus) { mAllowFocus = allowFocus; if (mFirstDrawComplete) { setFocusable(allowFocus); setFocusableInTouchMode(allowFocus); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowFocus 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
setAllowFocus
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
private static Document createPatternXMLDoc(List<SsurgeonPattern> patterns) { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document domDoc = db.newDocument(); Element rootElt = domDoc.createElement(SsurgeonPattern.ELT_LIST_TAG); domDoc.appendChild(rootElt); int ordinal = 1; for (SsurgeonPattern pattern : patterns) { Element patElt = domDoc.createElement(SsurgeonPattern.SSURGEON_ELEM_TAG); patElt.setAttribute(SsurgeonPattern.ORDINAL_ATTR, String.valueOf(ordinal)); Element semgrexElt = domDoc.createElement(SsurgeonPattern.SEMGREX_ELEM_TAG); semgrexElt.appendChild(domDoc.createTextNode(pattern.getSemgrexPattern().pattern())); patElt.appendChild(semgrexElt); Element uidElem = domDoc.createElement(SsurgeonPattern.UID_ELEM_TAG); uidElem.appendChild(domDoc.createTextNode(pattern.getUID())); patElt.appendChild(uidElem); Element notesElem = domDoc.createElement(SsurgeonPattern.NOTES_ELEM_TAG); notesElem.appendChild(domDoc.createTextNode(pattern.getNotes())); patElt.appendChild(notesElem); SemanticGraph semgrexGraph = pattern.getSemgrexGraph(); if (semgrexGraph != null) { Element patNode = domDoc.createElement(SsurgeonPattern.SEMGREX_GRAPH_ELEM_TAG); patNode.appendChild(domDoc.createTextNode(semgrexGraph.toCompactString())); } Element editList = domDoc.createElement(SsurgeonPattern.EDIT_LIST_ELEM_TAG); patElt.appendChild(editList); int editOrdinal = 1; for (SsurgeonEdit edit : pattern.getEditScript()) { Element editElem = domDoc.createElement(SsurgeonPattern.EDIT_ELEM_TAG); editElem.setAttribute(SsurgeonPattern.ORDINAL_ATTR, String.valueOf(editOrdinal)); editElem.appendChild(domDoc.createTextNode(edit.toEditString())); editList.appendChild(editElem); editOrdinal++; } rootElt.appendChild(patElt); ordinal++; } return domDoc; } catch (Exception e) { log.error(Ssurgeon.class.getName(), "createPatternXML"); log.error(e); return null; } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2021-3878 - Severity: HIGH - CVSS Score: 7.5 Description: Missed a couple possibly unsafe XMLUtils Function: createPatternXMLDoc File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP Fixed Code: private static Document createPatternXMLDoc(List<SsurgeonPattern> patterns) { try { DocumentBuilderFactory dbf = XMLUtils.safeDocumentBuilderFactory(); DocumentBuilder db = dbf.newDocumentBuilder(); Document domDoc = db.newDocument(); Element rootElt = domDoc.createElement(SsurgeonPattern.ELT_LIST_TAG); domDoc.appendChild(rootElt); int ordinal = 1; for (SsurgeonPattern pattern : patterns) { Element patElt = domDoc.createElement(SsurgeonPattern.SSURGEON_ELEM_TAG); patElt.setAttribute(SsurgeonPattern.ORDINAL_ATTR, String.valueOf(ordinal)); Element semgrexElt = domDoc.createElement(SsurgeonPattern.SEMGREX_ELEM_TAG); semgrexElt.appendChild(domDoc.createTextNode(pattern.getSemgrexPattern().pattern())); patElt.appendChild(semgrexElt); Element uidElem = domDoc.createElement(SsurgeonPattern.UID_ELEM_TAG); uidElem.appendChild(domDoc.createTextNode(pattern.getUID())); patElt.appendChild(uidElem); Element notesElem = domDoc.createElement(SsurgeonPattern.NOTES_ELEM_TAG); notesElem.appendChild(domDoc.createTextNode(pattern.getNotes())); patElt.appendChild(notesElem); SemanticGraph semgrexGraph = pattern.getSemgrexGraph(); if (semgrexGraph != null) { Element patNode = domDoc.createElement(SsurgeonPattern.SEMGREX_GRAPH_ELEM_TAG); patNode.appendChild(domDoc.createTextNode(semgrexGraph.toCompactString())); } Element editList = domDoc.createElement(SsurgeonPattern.EDIT_LIST_ELEM_TAG); patElt.appendChild(editList); int editOrdinal = 1; for (SsurgeonEdit edit : pattern.getEditScript()) { Element editElem = domDoc.createElement(SsurgeonPattern.EDIT_ELEM_TAG); editElem.setAttribute(SsurgeonPattern.ORDINAL_ATTR, String.valueOf(editOrdinal)); editElem.appendChild(domDoc.createTextNode(edit.toEditString())); editList.appendChild(editElem); editOrdinal++; } rootElt.appendChild(patElt); ordinal++; } return domDoc; } catch (Exception e) { log.error(Ssurgeon.class.getName(), "createPatternXML"); log.error(e); return null; } }
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
createPatternXMLDoc
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
1
Analyze the following code function for security vulnerabilities
private void logRecord(UserAccounts accounts, String action, String tableName) { logRecord(action, tableName, -1, accounts); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logRecord File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
logRecord
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public int addAttachments() throws XWikiException { return addAttachments(null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAttachments File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
addAttachments
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setPassword(password); return this; } } throw new RuntimeException("No HTTP basic authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPassword File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setPassword
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public String getURL(String action, String queryString) { return this.doc.getURL(action, queryString, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
void registerObserver() { synchronized (mLock) { mEnforceBroadcastReceiverRestrictions = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_SDK_SANDBOX, ENFORCE_BROADCAST_RECEIVER_RESTRICTIONS, false); DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SDK_SANDBOX, mContext.getMainExecutor(), this); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerObserver 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
registerObserver
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting @GuardedBy("this") void incrementProcStateSeqAndNotifyAppsLocked() { if (mWaitForNetworkTimeoutMs <= 0) { return; } // Used for identifying which uids need to block for network. ArrayList<Integer> blockingUids = null; for (int i = mActiveUids.size() - 1; i >= 0; --i) { final UidRecord uidRec = mActiveUids.valueAt(i); // If the network is not restricted for uid, then nothing to do here. if (!mInjector.isNetworkRestrictedForUid(uidRec.uid)) { continue; } if (!UserHandle.isApp(uidRec.uid) || !uidRec.hasInternetPermission) { continue; } // If process state is not changed, then there's nothing to do. if (uidRec.setProcState == uidRec.curProcState) { continue; } final int blockState = getBlockStateForUid(uidRec); // No need to inform the app when the blockState is NETWORK_STATE_NO_CHANGE as // there's nothing the app needs to do in this scenario. if (blockState == NETWORK_STATE_NO_CHANGE) { continue; } synchronized (uidRec.networkStateLock) { uidRec.curProcStateSeq = ++mProcStateSeqCounter; if (blockState == NETWORK_STATE_BLOCK) { if (blockingUids == null) { blockingUids = new ArrayList<>(); } blockingUids.add(uidRec.uid); } else { if (DEBUG_NETWORK) { Slog.d(TAG_NETWORK, "uid going to background, notifying all blocking" + " threads for uid: " + uidRec); } if (uidRec.waitingForNetwork) { uidRec.networkStateLock.notifyAll(); } } } } // There are no uids that need to block, so nothing more to do. if (blockingUids == null) { return; } for (int i = mLruProcesses.size() - 1; i >= 0; --i) { final ProcessRecord app = mLruProcesses.get(i); if (!blockingUids.contains(app.uid)) { continue; } if (!app.killedByAm && app.thread != null) { final UidRecord uidRec = mActiveUids.get(app.uid); try { if (DEBUG_NETWORK) { Slog.d(TAG_NETWORK, "Informing app thread that it needs to block: " + uidRec); } app.thread.setNetworkBlockSeq(uidRec.curProcStateSeq); } catch (RemoteException ignored) { } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incrementProcStateSeqAndNotifyAppsLocked 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
incrementProcStateSeqAndNotifyAppsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void maybeSetDefaultRestrictionsForAdminLocked( int userId, ActiveAdmin admin, Set<String> defaultRestrictions) { if (defaultRestrictions.equals(admin.defaultEnabledRestrictionsAlreadySet)) { return; // The same set of default restrictions has been already applied. } Slogf.i(LOG_TAG, "New user restrictions need to be set by default for user " + userId); if (VERBOSE_LOG) { Slogf.d(LOG_TAG, "Default enabled restrictions: " + defaultRestrictions + ". Restrictions already enabled: " + admin.defaultEnabledRestrictionsAlreadySet); } final Set<String> restrictionsToSet = new ArraySet<>(defaultRestrictions); restrictionsToSet.removeAll(admin.defaultEnabledRestrictionsAlreadySet); if (!restrictionsToSet.isEmpty()) { for (final String restriction : restrictionsToSet) { admin.ensureUserRestrictions().putBoolean(restriction, true); } admin.defaultEnabledRestrictionsAlreadySet.addAll(restrictionsToSet); Slogf.i(LOG_TAG, "Enabled the following restrictions by default: " + restrictionsToSet); saveUserRestrictionsLocked(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeSetDefaultRestrictionsForAdminLocked 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
maybeSetDefaultRestrictionsForAdminLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getTranslationList(XWikiDocument doc, XWikiContext context) throws XWikiException { try { return getTranslationList(doc.getDocumentReference()); } catch (QueryException e) { throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_HIBERNATE_SEARCH, "Failed to retrieve the list of translations for [{0}]", e, new Object[] {doc.getDocumentReference()}); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTranslationList 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
getTranslationList
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 int getOffloadedScanResultStorage() { enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); return mAdapterProperties.getOffloadedScanResultStorage(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOffloadedScanResultStorage 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
getOffloadedScanResultStorage
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
Intent getIntent() { return mRequest.intent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntent File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
getIntent
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
@Override public void setDialing(String callId, Session.Info sessionInfo) { Log.startSession(sessionInfo, LogUtils.Sessions.CSW_SET_DIALING, mPackageAbbreviation); long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { logIncoming("setDialing %s", callId); Call call = mCallIdMapper.getCall(callId); if (call != null) { mCallsManager.markCallAsDialing(call); } else { // Log.w(this, "setDialing, unknown call id: %s", msg.obj); } } } catch (Throwable t) { Log.e(ConnectionServiceWrapper.this, t, ""); throw t; } finally { Binder.restoreCallingIdentity(token); Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDialing 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
setDialing
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private static @AttributionFlags int resolveAttributionFlags( @NonNull AttributionSource attributionChain, @NonNull AttributionSource current, boolean fromDatasource, boolean startDataDelivery, boolean selfAccess, boolean isTrusted, boolean flagsForProxy) { if (current == null || !startDataDelivery) { return AppOpsManager.ATTRIBUTION_FLAGS_NONE; } int trustedFlag = isTrusted ? AppOpsManager.ATTRIBUTION_FLAG_TRUSTED : AppOpsManager.ATTRIBUTION_FLAGS_NONE; if (flagsForProxy) { if (selfAccess) { return trustedFlag | AppOpsManager.ATTRIBUTION_FLAG_ACCESSOR; } else if (!fromDatasource && current.equals(attributionChain)) { return trustedFlag | AppOpsManager.ATTRIBUTION_FLAG_ACCESSOR; } } else { if (selfAccess) { return trustedFlag | AppOpsManager.ATTRIBUTION_FLAG_RECEIVER; } else if (fromDatasource && current.equals(attributionChain.getNext())) { return trustedFlag | AppOpsManager.ATTRIBUTION_FLAG_ACCESSOR; } else if (current.getNext() == null) { return trustedFlag | AppOpsManager.ATTRIBUTION_FLAG_RECEIVER; } } if (fromDatasource && current.equals(attributionChain)) { return AppOpsManager.ATTRIBUTION_FLAGS_NONE; } return trustedFlag | AppOpsManager.ATTRIBUTION_FLAG_INTERMEDIARY; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveAttributionFlags File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
resolveAttributionFlags
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public void onClick(View v) { if (v.getTag() instanceof UserPreference) { int userId = ((UserPreference) v.getTag()).getUserId(); switch (v.getId()) { case UserPreference.DELETE_ID: final EnforcedAdmin removeDisallowedAdmin = RestrictedLockUtils.checkIfRestrictionEnforced(getContext(), UserManager.DISALLOW_REMOVE_USER, UserHandle.myUserId()); if (removeDisallowedAdmin != null) { RestrictedLockUtils.sendShowAdminSupportDetailsIntent(getContext(), removeDisallowedAdmin); } else { onRemoveUserClicked(userId); } break; case UserPreference.SETTINGS_ID: onManageUserClicked(userId, false); break; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onClick File: src/com/android/settings/users/UserSettings.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
onClick
src/com/android/settings/users/UserSettings.java
bd5d5176c74021e8cf4970f93f273ba3023c3d72
0
Analyze the following code function for security vulnerabilities
@Override public boolean isNegative() { return (flags & NEGATIVE_FLAG) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNegative File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
isNegative
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
public int getBadgeIconType() { return mBadgeIcon; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBadgeIconType File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getBadgeIconType
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName) { ByteArrayDataSource dataSource = new ByteArrayDataSource(mimeType, data, offset, length); return addMtomAttachment(new DataHandler(dataSource), elementNamespace, elementLocalName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addMtomAttachment File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
addMtomAttachment
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
void teardown() { killRemoteCacheManager(hotrodClient); killServers(hotrod); killRestServer(rest); killMemcachedClient(memcachedClient); killMemcachedServer(memcached); killCacheManagers(cacheManager); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: teardown File: integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
teardown
integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java
69be66141eee7abb1c47d46f0a6b74b079709f4b
0
Analyze the following code function for security vulnerabilities
private static void entryListenerConfigXmlGenerator(XmlGenerator gen, List<EntryListenerConfig> entryListenerConfigs) { if (!entryListenerConfigs.isEmpty()) { gen.open("entry-listeners"); for (EntryListenerConfig lc : entryListenerConfigs) { gen.node("entry-listener", classNameOrImplClass(lc.getClassName(), lc.getImplementation()), "include-value", lc.isIncludeValue(), "local", lc.isLocal()); } gen.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: entryListenerConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
entryListenerConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@LargeTest @Test public void testTelecomManagerAcceptRingingVideoCallAsAudio() throws Exception { IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA); assertEquals(Call.STATE_RINGING, mInCallServiceFixtureX.getCall(ids.mCallId).getState()); assertEquals(Call.STATE_RINGING, mInCallServiceFixtureY.getCall(ids.mCallId).getState()); // Use TelecomManager API to answer the ringing call. TelecomManager telecomManager = (TelecomManager) mComponentContextFixture.getTestDouble() .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); telecomManager.acceptRingingCall(VideoProfile.STATE_AUDIO_ONLY); waitForHandlerAction(mTelecomSystem.getCallsManager() .getConnectionServiceFocusManager().getHandler(), TEST_TIMEOUT); // The generic answer method on the ConnectionService is used to answer audio-only calls. verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .answer(eq(ids.mConnectionId), any()); mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId); mInCallServiceFixtureX.mInCallAdapter.disconnectCall(ids.mCallId); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21283 - Severity: MEDIUM - CVSS Score: 5.5 Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634 Fixes: 285211549 Fixes: 280797684 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15) Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Function: testTelecomManagerAcceptRingingVideoCallAsAudio File: tests/src/com/android/server/telecom/tests/BasicCallTests.java Repository: android Fixed Code: @LargeTest @Test public void testTelecomManagerAcceptRingingVideoCallAsAudio() throws Exception { IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA, null); assertEquals(Call.STATE_RINGING, mInCallServiceFixtureX.getCall(ids.mCallId).getState()); assertEquals(Call.STATE_RINGING, mInCallServiceFixtureY.getCall(ids.mCallId).getState()); // Use TelecomManager API to answer the ringing call. TelecomManager telecomManager = (TelecomManager) mComponentContextFixture.getTestDouble() .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); telecomManager.acceptRingingCall(VideoProfile.STATE_AUDIO_ONLY); waitForHandlerAction(mTelecomSystem.getCallsManager() .getConnectionServiceFocusManager().getHandler(), TEST_TIMEOUT); // The generic answer method on the ConnectionService is used to answer audio-only calls. verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .answer(eq(ids.mConnectionId), any()); mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId); mInCallServiceFixtureX.mInCallAdapter.disconnectCall(ids.mCallId); }
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testTelecomManagerAcceptRingingVideoCallAsAudio
tests/src/com/android/server/telecom/tests/BasicCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
1
Analyze the following code function for security vulnerabilities
@Override public boolean switchUser(final int targetUserId) { enforceShellRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES, targetUserId); UserInfo currentUserInfo; UserInfo targetUserInfo; synchronized (this) { int currentUserId = mUserController.getCurrentUserIdLocked(); currentUserInfo = mUserController.getUserInfo(currentUserId); targetUserInfo = mUserController.getUserInfo(targetUserId); if (targetUserInfo == null) { Slog.w(TAG, "No user info for user #" + targetUserId); return false; } if (!targetUserInfo.supportsSwitchTo()) { Slog.w(TAG, "Cannot switch to User #" + targetUserId + ": not supported"); return false; } if (targetUserInfo.isManagedProfile()) { Slog.w(TAG, "Cannot switch to User #" + targetUserId + ": not a full user"); return false; } mUserController.setTargetUserIdLocked(targetUserId); } Pair<UserInfo, UserInfo> userNames = new Pair<>(currentUserInfo, targetUserInfo); mUiHandler.removeMessages(START_USER_SWITCH_UI_MSG); mUiHandler.sendMessage(mUiHandler.obtainMessage(START_USER_SWITCH_UI_MSG, userNames)); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchUser 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
switchUser
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public boolean isCommonCriteriaModeEnabled(@Nullable ComponentName admin) { throwIfParentInstance("isCommonCriteriaModeEnabled"); if (mService != null) { try { return mService.isCommonCriteriaModeEnabled(admin); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCommonCriteriaModeEnabled 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
isCommonCriteriaModeEnabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public long getBootTimeTempAllowListDuration() { // Do not lock ActivityManagerService.this here, this API is called by // PackageManagerService. return mConstants.mBootTimeTempAllowlistDuration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBootTimeTempAllowListDuration 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
getBootTimeTempAllowListDuration
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public <T> T deserialize(Response response, GenericType<T> returnType) throws ApiException { if (response == null || returnType == null) { return null; } if ("byte[]".equals(returnType.toString())) { // Handle binary response (byte array). return (T) response.readEntity(byte[].class); } else if (returnType.getRawType() == File.class) { // Handle file downloading. T file = (T) downloadFileFromResponse(response); return file; } String contentType = null; List<Object> contentTypes = response.getHeaders().get("Content-Type"); if (contentTypes != null && !contentTypes.isEmpty()) contentType = String.valueOf(contentTypes.get(0)); // read the entity stream multiple times response.bufferEntity(); return response.readEntity(returnType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserialize File: samples/client/petstore/java/jersey2-java8-localdatetime/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
deserialize
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public boolean isGroupedWithParent() { return mGroupedWithParent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isGroupedWithParent File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
isGroupedWithParent
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
JNLPClassLoader[] getLoaders() { return loaders; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLoaders 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
getLoaders
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
public void setObjectInputFilter(ObjectInputStream ois, String filterPattern) { try { Object objectFilter = createFilterMethod.invoke(ois, filterPattern); setObjectInputFilterMethod.invoke(ois, objectFilter); } catch (IllegalAccessException | InvocationTargetException e) { LOG.warn("Could not set ObjectFilter: " + e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setObjectInputFilter File: common/src/main/java/org/keycloak/common/util/DelegatingSerializationFilter.java Repository: keycloak The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-1714
MEDIUM
6.5
keycloak
setObjectInputFilter
common/src/main/java/org/keycloak/common/util/DelegatingSerializationFilter.java
d962a42f561acf3cb9b0734ae56cfbb4a696bdf4
0
Analyze the following code function for security vulnerabilities
private boolean isPasswordLimitingAdminTargetingP(CallerIdentity caller) { if (!caller.hasAdminComponent()) { return false; } synchronized (getLockObject()) { return getActiveAdminWithPolicyForUidLocked( caller.getComponentName(), DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD, caller.getUid()) != null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPasswordLimitingAdminTargetingP 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
isPasswordLimitingAdminTargetingP
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public String getAttachmentURL(AttachmentReference attachmentReference, String queryString, XWikiContext context) { return getAttachmentURL(attachmentReference, "download", queryString, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachmentURL File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getAttachmentURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private void buildPackageFileMap(final File importSandboxDirectory, final Set<String> packageQtiFileBuilder, final Set<String> packageSafeFileBuilder, final List<ContentPackageResource> qtiResources) throws AssessmentPackageDataImportException { for (final ContentPackageResource qtiResource : qtiResources) { final List<URI> fileHrefs = qtiResource.getFileHrefs(); boolean isFirst = true; for (final URI fileHref : fileHrefs) { final String fileHrefString = checkPackageFile(importSandboxDirectory, fileHref); if (isFirst) { packageQtiFileBuilder.add(fileHrefString); } else { packageSafeFileBuilder.add(fileHrefString); } isFirst = false; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildPackageFileMap File: qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java Repository: davemckain/qtiworks The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39367
MEDIUM
6.5
davemckain/qtiworks
buildPackageFileMap
qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java
1a46d6d842877ba2b824d5c269845827e2e0ccac
0
Analyze the following code function for security vulnerabilities
boolean stopSipService(SipManager sipManager) { try { sipManager.close(mProfile.getUriString()); return true; } catch (Exception e) { log("stopSipService, stop failed for profile: " + mProfile.getUriString() + ", exception: " + e); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopSipService File: sip/src/com/android/services/telephony/sip/SipAccountRegistry.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
stopSipService
sip/src/com/android/services/telephony/sip/SipAccountRegistry.java
a294ae5342410431a568126183efe86261668b5d
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(START_TASKS_FROM_RECENTS) @SystemApi public void setLaunchTaskId(int taskId) { mLaunchTaskId = taskId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLaunchTaskId File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
setLaunchTaskId
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
private Stream<NodeFeature> getInitializedFeatures() { if (features == null) { return Stream.empty(); } else if (features instanceof NodeFeature) { return Stream.of((NodeFeature) features); } else { return Stream.of((NodeFeature[]) features).filter(Objects::nonNull); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInitializedFeatures File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getInitializedFeatures
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
protected CoercionAction _checkIntToFloatCoercion(JsonParser p, DeserializationContext ctxt, Class<?> rawTargetType) throws IOException { final CoercionAction act = ctxt.findCoercionAction(LogicalType.Float, rawTargetType, CoercionInputShape.Integer); if (act == CoercionAction.Fail) { return _checkCoercionFail(ctxt, act, rawTargetType, p.getNumberValue(), "Integer value (" + p.getText() + ")"); } return act; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _checkIntToFloatCoercion File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_checkIntToFloatCoercion
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
private String getTargetLanguage(List<Element> elements, final String key) { ArrayList<String> textLanguages = null; for (Element en : elements) { if (key.equals(en.getTagName()) && en.getAttribute("lang") != null) { if (textLanguages == null) { textLanguages = new ArrayList<>(); } textLanguages.add(en.getAttribute("lang")); } } if (textLanguages != null) { if (textLanguages.contains(prefLanguage)) { return prefLanguage; } else if (textLanguages.contains(defLanguage)) { return defLanguage; } else if (textLanguages.contains("eng")) { return "eng"; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTargetLanguage File: app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java Repository: mkulesh/microMathematics The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000821
HIGH
7.5
mkulesh/microMathematics
getTargetLanguage
app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
5c05ac8de16c569ff0a1816f20be235090d3dd9d
0
Analyze the following code function for security vulnerabilities
private void sendStatic(RoutingContext context, String path) { String file = null; if (!includeHidden) { file = getFile(path, context); int idx = file.lastIndexOf('/'); String name = file.substring(idx + 1); if (name.length() > 0 && name.charAt(0) == '.') { // skip context.next(); return; } } // Look in cache CacheEntry entry; if (cachingEnabled) { entry = propsCache().get(path); if (entry != null) { HttpServerRequest request = context.request(); if ((filesReadOnly || !entry.isOutOfDate()) && entry.shouldUseCached(request)) { context.response().setStatusCode(NOT_MODIFIED.code()).end(); return; } } } if (file == null) { file = getFile(path, context); } final String sfile = file; // verify if the file exists isFileExisting(context, sfile, exists -> { if (exists.failed()) { context.fail(exists.cause()); return; } // file does not exist, continue... if (!exists.result()) { context.next(); return; } // Need to read the props from the filesystem getFileProps(context, sfile, res -> { if (res.succeeded()) { FileProps fprops = res.result(); if (fprops == null) { // File does not exist context.next(); } else if (fprops.isDirectory()) { sendDirectory(context, path, sfile); } else { propsCache().put(path, new CacheEntry(fprops, System.currentTimeMillis())); sendFile(context, sfile, fprops); } } else { context.fail(res.cause()); } }); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendStatic File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
sendStatic
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
public int stopUser(int userid, IStopUserCallback callback) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopUser File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
stopUser
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private static String chooseFilename(String url, String hint, String contentDisposition, String contentLocation) { String filename = null; // First, try to use the hint from the application, if there's one if (filename == null && hint != null && !hint.endsWith("/")) { if (Constants.LOGVV) { Log.v(Constants.TAG, "getting filename from hint"); } int index = hint.lastIndexOf('/') + 1; if (index > 0) { filename = hint.substring(index); } else { filename = hint; } } // If we couldn't do anything with the hint, move toward the content disposition if (filename == null && contentDisposition != null) { filename = parseContentDisposition(contentDisposition); if (filename != null) { if (Constants.LOGVV) { Log.v(Constants.TAG, "getting filename from content-disposition"); } int index = filename.lastIndexOf('/') + 1; if (index > 0) { filename = filename.substring(index); } } } // If we still have nothing at this point, try the content location if (filename == null && contentLocation != null) { String decodedContentLocation = Uri.decode(contentLocation); if (decodedContentLocation != null && !decodedContentLocation.endsWith("/") && decodedContentLocation.indexOf('?') < 0) { if (Constants.LOGVV) { Log.v(Constants.TAG, "getting filename from content-location"); } int index = decodedContentLocation.lastIndexOf('/') + 1; if (index > 0) { filename = decodedContentLocation.substring(index); } else { filename = decodedContentLocation; } } } // If all the other http-related approaches failed, use the plain uri if (filename == null) { String decodedUrl = Uri.decode(url); if (decodedUrl != null && !decodedUrl.endsWith("/") && decodedUrl.indexOf('?') < 0) { int index = decodedUrl.lastIndexOf('/') + 1; if (index > 0) { if (Constants.LOGVV) { Log.v(Constants.TAG, "getting filename from uri"); } filename = decodedUrl.substring(index); } } } // Finally, if couldn't get filename from URI, get a generic filename if (filename == null) { if (Constants.LOGVV) { Log.v(Constants.TAG, "using default filename"); } filename = Constants.DEFAULT_DL_FILENAME; } // The VFAT file system is assumed as target for downloads. // Replace invalid characters according to the specifications of VFAT. filename = FileUtils.buildValidFatFilename(filename); return filename; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: chooseFilename File: src/com/android/providers/downloads/Helpers.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
chooseFilename
src/com/android/providers/downloads/Helpers.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
public List<Object> get(final String key) { return propertyValues.get(key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: stroom-core-server/src/main/java/stroom/importexport/server/Config.java Repository: gchq/stroom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000651
HIGH
7.5
gchq/stroom
get
stroom-core-server/src/main/java/stroom/importexport/server/Config.java
ba30ffd415bd7d32ee40ba4b04035267ce80b499
0
Analyze the following code function for security vulnerabilities
public void sendSetConnectionProperties(String id) throws Exception { for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.setConnectionProperties(id, mConnectionById.get(id).properties, null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendSetConnectionProperties File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
sendSetConnectionProperties
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private boolean hasValueInA11yButtonTargets(SettingsState secureSettings) { final Setting a11yButtonTargetsSettings = secureSettings.getSettingLocked(Secure.ACCESSIBILITY_BUTTON_TARGETS); return !a11yButtonTargetsSettings.isNull() && !TextUtils.isEmpty(a11yButtonTargetsSettings.getValue()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasValueInA11yButtonTargets File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
hasValueInA11yButtonTargets
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public void initPlaceCover(SysSite site, CmsPlace entity) { entity.setCover(getUrl(site, true, entity.getCover())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initPlaceCover File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
initPlaceCover
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
public boolean isMine(Post showPost, Profile authUser) { // author can edit, mods can edit & ppl with rep > 100 can edit return showPost != null && authUser != null ? authUser.getId().equals(showPost.getCreatorid()) : false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMine 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
isMine
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
void startProfilesLocked() { if (DEBUG_MU) Slog.i(TAG_MU, "startProfilesLocked"); List<UserInfo> profiles = getUserManagerLocked().getProfiles( mCurrentUserId, false /* enabledOnly */); List<UserInfo> toStart = new ArrayList<UserInfo>(profiles.size()); for (UserInfo user : profiles) { if ((user.flags & UserInfo.FLAG_INITIALIZED) == UserInfo.FLAG_INITIALIZED && user.id != mCurrentUserId) { toStart.add(user); } } final int n = toStart.size(); int i = 0; for (; i < n && i < (MAX_RUNNING_USERS - 1); ++i) { startUserInBackground(toStart.get(i).id); } if (i < n) { Slog.w(TAG_MU, "More profiles than MAX_RUNNING_USERS"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startProfilesLocked 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
startProfilesLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@SystemApi @RequiresPermission(android.Manifest.permission.TRIGGER_LOST_MODE) public void sendLostModeLocationUpdate(@NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) { throwIfParentInstance("sendLostModeLocationUpdate"); if (mService == null) { executeCallback(AndroidFuture.completedFuture(false), executor, callback); return; } try { final AndroidFuture<Boolean> future = new AndroidFuture<>(); mService.sendLostModeLocationUpdate(future); executeCallback(future, executor, callback); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendLostModeLocationUpdate 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
sendLostModeLocationUpdate
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public boolean isNotificationSuppressed() { return (mFlags & FLAG_SUPPRESS_NOTIFICATION) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNotificationSuppressed File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
isNotificationSuppressed
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public AppointmentRequestStatus getStatus() { return status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatus File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4727
MEDIUM
6.1
openmrs/openmrs-module-appointmentscheduling
getStatus
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
public HttpRequest queryString(final String queryString, final boolean decode) { this.query = HttpUtil.parseQuery(queryString, decode); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryString File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
queryString
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
public void init(FilterConfig filterConfig) throws ServletException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: core/src/main/java/jenkins/security/ApiTokenFilter.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-287" ]
CVE-2014-2062
MEDIUM
6.5
jenkinsci/jenkins
init
core/src/main/java/jenkins/security/ApiTokenFilter.java
5548b5220cfd496831b5721124189ff18fbb12a3
0
Analyze the following code function for security vulnerabilities
private static Predicate<Provider> startsWith(final String param) { return new Predicate<Provider>() { @Override public boolean test(Provider provider) { String identifier = provider.getIdentifier(); String lowerCaseParam = param.toLowerCase(); if(identifier.toLowerCase().startsWith(lowerCaseParam)) return true; if(provider.getPerson() != null) { PersonName name = provider.getPerson().getPersonName(); if (name != null) { if (name.getGivenName().toLowerCase().startsWith(lowerCaseParam) || name.getFamilyName().toLowerCase().startsWith(lowerCaseParam) || name.getMiddleName().toLowerCase().startsWith(lowerCaseParam)) return true; } } //Check the provider name (From provider table) String[] names = provider.getName().split(" "); for(String n:names) { if (n.toLowerCase().startsWith(lowerCaseParam)) return true; } return false; } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startsWith File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
startsWith
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
private void vibrateForCameraGesture() { // Make sure to pass -1 for repeat so VibratorService doesn't stop us when going to sleep. mVibrator.vibrate(mCameraLaunchGestureVibePattern, -1 /* repeat */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: vibrateForCameraGesture File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
vibrateForCameraGesture
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void notifyDownloadStart(DownloadFileOperation download) { /// create status notification with a progress bar mLastPercent = 0; mNotificationBuilder = NotificationUtils.newNotificationBuilder(this); mNotificationBuilder .setSmallIcon(R.drawable.notification_icon) .setTicker(getString(R.string.downloader_download_in_progress_ticker)) .setContentTitle(getString(R.string.downloader_download_in_progress_ticker)) .setOngoing(true) .setProgress(100, 0, download.getSize() < 0) .setContentText( String.format(getString(R.string.downloader_download_in_progress_content), 0, new File(download.getSavePath()).getName()) ); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { mNotificationBuilder.setChannelId(NotificationUtils.NOTIFICATION_CHANNEL_DOWNLOAD); } /// includes a pending intent in the notification showing the details view of the file Intent showDetailsIntent = null; if (PreviewImageFragment.canBePreviewed(download.getFile())) { showDetailsIntent = new Intent(this, PreviewImageActivity.class); } else { showDetailsIntent = new Intent(this, FileDisplayActivity.class); } showDetailsIntent.putExtra(FileActivity.EXTRA_FILE, download.getFile()); showDetailsIntent.putExtra(FileActivity.EXTRA_USER, download.getAccount()); showDetailsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); mNotificationBuilder.setContentIntent(PendingIntent.getActivity(this, (int) System.currentTimeMillis(), showDetailsIntent, 0)); if (mNotificationManager == null) { mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); } if (mNotificationManager != null) { mNotificationManager.notify(R.string.downloader_download_in_progress_ticker, mNotificationBuilder.build()); } }
Vulnerability Classification: - CWE: CWE-732 - CVE: CVE-2022-24886 - Severity: LOW - CVSS Score: 2.1 Description: Make PendingIntents immutable Good practice for security Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com> Function: notifyDownloadStart File: src/main/java/com/owncloud/android/files/services/FileDownloader.java Repository: nextcloud/android Fixed Code: private void notifyDownloadStart(DownloadFileOperation download) { /// create status notification with a progress bar mLastPercent = 0; mNotificationBuilder = NotificationUtils.newNotificationBuilder(this); mNotificationBuilder .setSmallIcon(R.drawable.notification_icon) .setTicker(getString(R.string.downloader_download_in_progress_ticker)) .setContentTitle(getString(R.string.downloader_download_in_progress_ticker)) .setOngoing(true) .setProgress(100, 0, download.getSize() < 0) .setContentText( String.format(getString(R.string.downloader_download_in_progress_content), 0, new File(download.getSavePath()).getName()) ); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { mNotificationBuilder.setChannelId(NotificationUtils.NOTIFICATION_CHANNEL_DOWNLOAD); } /// includes a pending intent in the notification showing the details view of the file Intent showDetailsIntent = null; if (PreviewImageFragment.canBePreviewed(download.getFile())) { showDetailsIntent = new Intent(this, PreviewImageActivity.class); } else { showDetailsIntent = new Intent(this, FileDisplayActivity.class); } showDetailsIntent.putExtra(FileActivity.EXTRA_FILE, download.getFile()); showDetailsIntent.putExtra(FileActivity.EXTRA_USER, download.getAccount()); showDetailsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); mNotificationBuilder.setContentIntent(PendingIntent.getActivity(this, (int) System.currentTimeMillis(), showDetailsIntent, PendingIntent.FLAG_IMMUTABLE)); if (mNotificationManager == null) { mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); } if (mNotificationManager != null) { mNotificationManager.notify(R.string.downloader_download_in_progress_ticker, mNotificationBuilder.build()); } }
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
notifyDownloadStart
src/main/java/com/owncloud/android/files/services/FileDownloader.java
27559efb79d45782e000b762860658d49e9c35e9
1
Analyze the following code function for security vulnerabilities
private void removeClosedUIs(final VaadinSession session) { List<UI> uis = new ArrayList<>(session.getUIs()); for (final UI ui : uis) { if (ui.isClosing()) { ui.accessSynchronously(() -> { getLogger().log(Level.FINER, "Removing closed UI {0}", ui.getUIId()); session.removeUI(ui); }); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeClosedUIs File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
removeClosedUIs
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
public Builder setUseProxySelector(boolean useProxySelector) { this.useProxySelector = useProxySelector; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUseProxySelector File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setUseProxySelector
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@Override public void connectionClosedOnError(Exception e) { if (e instanceof XMPPException.StreamErrorException) { dropSmState(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connectionClosedOnError File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
connectionClosedOnError
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
@Override public void listFiles(String projectName, String repositoryName, Revision revision, String pathPattern, AsyncMethodCallback resultHandler) { handle(projectManager.get(projectName).repos().get(repositoryName) .find(convert(revision), pathPattern, FIND_ALL_WITHOUT_CONTENT) .thenApply(entries -> { final List<Entry> ret = new ArrayList<>(entries.size()); entries.forEach((path, entry) -> ret.add( new Entry(path, convert(entry.type())))); return ret; }), resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listFiles 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
listFiles
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
public ProfileInput getInputByName(String name) { for (ProfileInput input : inputs) { if (input.getName().equals(name)) return input; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInputByName File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getInputByName
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0