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 static <T> T unmarshal(final Class<T> clazz, final Resource resource, final boolean validate) { try { return unmarshal(clazz, new InputSource(resource.getInputStream()), null, validate, false); } catch (final IOException e) { throw EXCEPTION_TRANSLATOR.translate("getting a configuration resource from spring", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unmarshal File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-0871
MEDIUM
6.1
OpenNMS/opennms
unmarshal
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
3c17231714e3d55809efc580a05734ed530f9ad4
0
Analyze the following code function for security vulnerabilities
private final void checkPasswordReadPermission(int userId) { mContext.enforceCallingOrSelfPermission(PERMISSION, "LockSettingsRead"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPasswordReadPermission File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
checkPasswordReadPermission
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
protected PersistentOfflineTopicStats internalGetBacklog(boolean authoritative) { if (topicName.isGlobal()) { validateGlobalNamespaceOwnership(namespaceName); } // Validate that namespace exists, throw 404 if it doesn't exist // note that we do not want to load the topic and hence skip authorization check try { namespaceResources().get(path(POLICIES, namespaceName.toString())); } catch (org.apache.pulsar.metadata.api.MetadataStoreException.NotFoundException e) { log.warn("[{}] Failed to get topic backlog {}: Namespace does not exist", clientAppId(), namespaceName); throw new RestException(Status.NOT_FOUND, "Namespace does not exist"); } catch (Exception e) { log.error("[{}] Failed to get topic backlog {}", clientAppId(), namespaceName, e); throw new RestException(e); } PersistentOfflineTopicStats offlineTopicStats = null; try { offlineTopicStats = pulsar().getBrokerService().getOfflineTopicStat(topicName); if (offlineTopicStats != null) { // offline topic stat has a cost - so use cached value until TTL long elapsedMs = System.currentTimeMillis() - offlineTopicStats.statGeneratedAt.getTime(); if (TimeUnit.MINUTES.convert(elapsedMs, TimeUnit.MILLISECONDS) < OFFLINE_TOPIC_STAT_TTL_MINS) { return offlineTopicStats; } } final ManagedLedgerConfig config = pulsar().getBrokerService().getManagedLedgerConfig(topicName) .get(); ManagedLedgerOfflineBacklog offlineTopicBacklog = new ManagedLedgerOfflineBacklog(config.getDigestType(), config.getPassword(), pulsar().getAdvertisedAddress(), false); offlineTopicStats = offlineTopicBacklog.estimateUnloadedTopicBacklog( (ManagedLedgerFactoryImpl) pulsar().getManagedLedgerFactory(), topicName); pulsar().getBrokerService().cacheOfflineTopicStats(topicName, offlineTopicStats); } catch (Exception exception) { throw new RestException(exception); } return offlineTopicStats; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalGetBacklog File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalGetBacklog
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public <T> void get(String table, T entity, boolean returnCount, boolean returnIdField, Handler<AsyncResult<Results<T>>> replyHandler) { boolean setId = true; if(returnIdField == false){ //if no id fields then cannot setId from external column into json object setId = false; } String pojo = null; try { pojo = pojo2json(entity); } catch (Exception e) { replyHandler.handle(Future.failedFuture(e)); return; } Class<T> clazz = (Class<T>) entity.getClass(); get(table, clazz, DEFAULT_JSONB_FIELD_NAME, WHERE + DEFAULT_JSONB_FIELD_NAME + "@>'" + pojo + "' ", returnCount, returnIdField, setId, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
get
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting @CheckForNull synchronized File getFile() { return file; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFile File: guava/src/com/google/common/io/FileBackedOutputStream.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
getFile
guava/src/com/google/common/io/FileBackedOutputStream.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
public static String createUINotFoundJSON(boolean async) { // Session Expired is technically not really the correct thing as // the session exists but the requested UI does not. Still we want // to handle it the same way on the client side. return createSessionExpiredJSON(async); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createUINotFoundJSON File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
createUINotFoundJSON
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
@Nullable protected String getDescription(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); StandardEvaluationContext context = new StandardEvaluationContext(root); context.addPropertyAccessor(new MapAccessor()); return description.getValue(context, String.class); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: getDescription File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: @Nullable protected String getDescription(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); SimpleEvaluationContext context = SimpleEvaluationContext .forPropertyAccessors(DataBindingPropertyAccessor.forReadOnlyAccess(), new MapAccessor()) .withRootObject(root).build(); return description.getValue(context, String.class); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getDescription
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
@Override public Route.OneArgHandler promise(final Deferred.Initializer0 initializer) { return req -> { return new Deferred(initializer); }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: promise File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
promise
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public String getId() { return delegate.getId(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getId File: src/main/java/org/apache/ibatis/cache/decorators/SerializedCache.java Repository: mybatis/mybatis-3 The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-26945
MEDIUM
5.1
mybatis/mybatis-3
getId
src/main/java/org/apache/ibatis/cache/decorators/SerializedCache.java
9caf480e05c389548c9889362c2cb080d728b5d8
0
Analyze the following code function for security vulnerabilities
public boolean removeSuggestionConfiguredNetwork(@NonNull WifiConfiguration suggestion) { WifiConfiguration config = getInternalConfiguredNetwork( suggestion.getProfileKey()); if (config != null && config.ephemeral && config.fromWifiNetworkSuggestion) { Log.d(TAG, "Removing suggestion network config " + config.getProfileKey()); return removeNetwork(config.networkId, suggestion.creatorUid, suggestion.creatorName); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeSuggestionConfiguredNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
removeSuggestionConfiguredNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private Flowable<MutableHttpResponse<?>> buildRoutePublisher( Class<?> declaringType, ReturnType<?> genericReturnType, boolean isReactiveReturnType, AnnotationMetadata annotationMetadata, AtomicReference<HttpRequest<?>> requestReference, Flowable<MutableHttpResponse<?>> routePublisher) { // In the case of an empty reactive type we switch handling so that // a 404 NOT_FOUND is returned routePublisher = routePublisher.switchIfEmpty(Flowable.create((emitter) -> { HttpRequest<?> httpRequest = requestReference.get(); MutableHttpResponse<?> response; Class<?> javaReturnType = genericReturnType.getType(); boolean isVoid = javaReturnType == void.class || Completable.class.isAssignableFrom(javaReturnType) || (isReactiveReturnType && genericReturnType.getFirstTypeVariable() .filter(arg -> arg.getType() == Void.class).isPresent()); if (isVoid) { // void return type with no response, nothing else to do response = forStatus(annotationMetadata); } else { // handle re-mapping of errors Optional<RouteMatch<Object>> statusRoute = Optional.empty(); // if declaringType is not null, this means its a locally marked method handler if (declaringType != null) { statusRoute = router.route(declaringType, HttpStatus.NOT_FOUND); } if (!statusRoute.isPresent()) { statusRoute = router.route(HttpStatus.NOT_FOUND); } if (statusRoute.isPresent()) { RouteMatch<?> newRoute = requestArgumentSatisfier.fulfillArgumentRequirements(statusRoute.get(), httpRequest, true); if (newRoute.isExecutable()) { try { Object result = newRoute.execute(); response = messageToResponse(newRoute, result); } catch (Throwable e) { emitter.onError(new InternalServerException("Error executing status route [" + newRoute + "]: " + e.getMessage(), e)); return; } } else { if (LOG.isWarnEnabled()) { LOG.warn("Matched status route [" + newRoute + "] not executed because one or more arguments could not be bound. Returning a default response."); } response = newNotFoundError(httpRequest); } response.setAttribute(HttpAttributes.ROUTE_MATCH, newRoute); } else { response = newNotFoundError(httpRequest); } } try { emitter.onNext(response); emitter.onComplete(); } catch (Throwable e) { emitter.onError(new InternalServerException("Error executing Error route [" + response.getStatus() + "]: " + e.getMessage(), e)); } }, BackpressureStrategy.ERROR)); return routePublisher; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildRoutePublisher File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
buildRoutePublisher
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
private void parseCategories(final List<Element> elements, final TechnologyFrontierList categories) throws GameParseException { for (final Element current : elements) { final TechnologyFrontier tf = new TechnologyFrontier(current.getAttribute("name"), data); parseCategoryTechs(getChildren("tech", current), tf); categories.addTechnologyFrontier(tf); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseCategories File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseCategories
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
private void setOauthBasePath(String basePath) { for(Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).setBasePath(basePath); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOauthBasePath File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setOauthBasePath
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting void saveTransferOwnershipBundleLocked(PersistableBundle bundle, int userId) { final File parametersFile = new File( mPathProvider.getUserSystemDirectory(userId), TRANSFER_OWNERSHIP_PARAMETERS_XML); final AtomicFile atomicFile = new AtomicFile(parametersFile); FileOutputStream stream = null; try { stream = atomicFile.startWrite(); final TypedXmlSerializer serializer = Xml.resolveSerializer(stream); serializer.startDocument(null, true); serializer.startTag(null, TAG_TRANSFER_OWNERSHIP_BUNDLE); bundle.saveToXml(serializer); serializer.endTag(null, TAG_TRANSFER_OWNERSHIP_BUNDLE); serializer.endDocument(); atomicFile.finishWrite(stream); } catch (IOException | XmlPullParserException e) { Slogf.e(LOG_TAG, "Caught exception while trying to save the " + "owner transfer parameters to file " + parametersFile, e); parametersFile.delete(); atomicFile.failWrite(stream); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveTransferOwnershipBundleLocked 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
saveTransferOwnershipBundleLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected void setPushRows(Range pushRows) { this.pushRows = pushRows; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPushRows File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-20" ]
CVE-2021-33609
MEDIUM
4
vaadin/framework
setPushRows
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
0
Analyze the following code function for security vulnerabilities
Class<?> handler(String typeName, Class<?> expectClass, int features);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handler File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
handler
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
@Override public UserHandle createAndProvisionManagedProfile( @NonNull ManagedProfileProvisioningParams provisioningParams, @NonNull String callerPackage) { Objects.requireNonNull(provisioningParams, "provisioningParams is null"); Objects.requireNonNull(callerPackage, "callerPackage is null"); final ComponentName admin = provisioningParams.getProfileAdminComponentName(); Objects.requireNonNull(admin, "admin is null"); final CallerIdentity caller = getCallerIdentity(callerPackage); Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS)); provisioningParams.logParams(callerPackage); UserInfo userInfo = null; final long identity = Binder.clearCallingIdentity(); try { final int result = checkProvisioningPreconditionSkipPermission( ACTION_PROVISION_MANAGED_PROFILE, admin.getPackageName()); if (result != STATUS_OK) { throw new ServiceSpecificException( ERROR_PRE_CONDITION_FAILED, "Provisioning preconditions failed with result: " + result); } final long startTime = SystemClock.elapsedRealtime(); onCreateAndProvisionManagedProfileStarted(provisioningParams); final Set<String> nonRequiredApps = provisioningParams.isLeaveAllSystemAppsEnabled() ? Collections.emptySet() : mOverlayPackagesProvider.getNonRequiredApps( admin, caller.getUserId(), ACTION_PROVISION_MANAGED_PROFILE); if (nonRequiredApps.isEmpty()) { Slogf.i(LOG_TAG, "No disallowed packages for the managed profile."); } else { for (String packageName : nonRequiredApps) { Slogf.i(LOG_TAG, "Disallowed package [" + packageName + "]"); } } userInfo = mUserManager.createProfileForUserEvenWhenDisallowed( provisioningParams.getProfileName(), UserManager.USER_TYPE_PROFILE_MANAGED, UserInfo.FLAG_DISABLED, caller.getUserId(), nonRequiredApps.toArray(new String[nonRequiredApps.size()])); if (userInfo == null) { throw new ServiceSpecificException( ERROR_PROFILE_CREATION_FAILED, "Error creating profile, createProfileForUserEvenWhenDisallowed " + "returned null."); } resetInteractAcrossProfilesAppOps(); logEventDuration( DevicePolicyEnums.PLATFORM_PROVISIONING_CREATE_PROFILE_MS, startTime, callerPackage); maybeInstallDevicePolicyManagementRoleHolderInUser(userInfo.id); installExistingAdminPackage(userInfo.id, admin.getPackageName()); if (!enableAdminAndSetProfileOwner( userInfo.id, caller.getUserId(), admin, provisioningParams.getOwnerName())) { throw new ServiceSpecificException( ERROR_SETTING_PROFILE_OWNER_FAILED, "Error setting profile owner."); } setUserSetupComplete(userInfo.id); startUser(userInfo.id, callerPackage); maybeMigrateAccount( userInfo.id, caller.getUserId(), provisioningParams.getAccountToMigrate(), provisioningParams.isKeepingAccountOnMigration(), callerPackage); if (provisioningParams.isOrganizationOwnedProvisioning()) { synchronized (getLockObject()) { setProfileOwnerOnOrganizationOwnedDeviceUncheckedLocked(admin, userInfo.id, true); } } onCreateAndProvisionManagedProfileCompleted(provisioningParams); sendProvisioningCompletedBroadcast( userInfo.id, ACTION_PROVISION_MANAGED_PROFILE, provisioningParams.isLeaveAllSystemAppsEnabled()); return userInfo.getUserHandle(); } catch (Exception e) { DevicePolicyEventLogger .createEvent(DevicePolicyEnums.PLATFORM_PROVISIONING_ERROR) .setStrings(callerPackage) .write(); // In case of any errors during provisioning, remove the newly created profile. if (userInfo != null) { mUserManager.removeUserEvenWhenDisallowed(userInfo.id); } throw e; } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAndProvisionManagedProfile 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
createAndProvisionManagedProfile
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Beta @Deprecated @J2ObjCIncompatible public static File createTempDir() { File baseDir = new File(System.getProperty("java.io.tmpdir")); @SuppressWarnings("GoodTime") // reading system time without TimeSource String baseName = System.currentTimeMillis() + "-"; for (int counter = 0; counter < TEMP_DIR_ATTEMPTS; counter++) { File tempDir = new File(baseDir, baseName + counter); if (tempDir.mkdir()) { return tempDir; } } throw new IllegalStateException( "Failed to create directory within " + TEMP_DIR_ATTEMPTS + " attempts (tried " + baseName + "0 to " + baseName + (TEMP_DIR_ATTEMPTS - 1) + ')'); }
Vulnerability Classification: - CWE: CWE-552 - CVE: CVE-2023-2976 - Severity: HIGH - CVSS Score: 7.1 Description: Restrict permissions when creating temporary files and directories, or fail if that's not possible. (Also, check that the provided `fileThreshold` is non-negative.) - Fixes https://github.com/google/guava/issues/2575 - Fixes https://github.com/google/guava/issues/4011 RELNOTES=Reimplemented `Files.createTempDir` and `FileBackedOutputStream` to further address [CVE-2020-8908](https://github.com/google/guava/issues/4011) and [Guava issue #2575](https://github.com/google/guava/issues/2575) (CVE forthcoming). PiperOrigin-RevId: 535359233 Function: createTempDir File: android/guava/src/com/google/common/io/Files.java Repository: google/guava Fixed Code: @Beta @Deprecated @J2ObjCIncompatible public static File createTempDir() { return TempFileCreator.INSTANCE.createTempDir(); }
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
createTempDir
android/guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
1
Analyze the following code function for security vulnerabilities
void destroySurfaceUnchecked() { mWinAnimator.destroySurfaceLocked(mTmpTransaction); mTmpTransaction.apply(); // Clear animating flags now, since the surface is now gone. (Note this is true even // if the surface is saved, to outside world the surface is still NO_SURFACE.) mAnimatingExit = false; ProtoLog.d(WM_DEBUG_ANIM, "Clear animatingExit: reason=destroySurface win=%s", this); // Clear the flag so the buffer requested for the next new surface won't be dropped by // mistaking the surface size needs to update. mReportOrientationChanged = false; if (useBLASTSync()) { immediatelyNotifyBlastSync(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroySurfaceUnchecked File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
destroySurfaceUnchecked
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private void updateContentBodyState() { this.state = (this.remainingBodyBytes > 0) ? CAState.EXPECTING_CONTENT_BODY : CAState.COMPLETE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateContentBodyState File: src/main/java/com/rabbitmq/client/impl/CommandAssembler.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
updateContentBodyState
src/main/java/com/rabbitmq/client/impl/CommandAssembler.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
void dumpBinderProxyInterfaceCounts(PrintWriter pw, String header) { final BinderProxy.InterfaceCount[] proxyCounts = BinderProxy.getSortedInterfaceCounts(50); pw.println(header); for (int i = 0; i < proxyCounts.length; i++) { pw.println(" #" + (i + 1) + ": " + proxyCounts[i]); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpBinderProxyInterfaceCounts 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
dumpBinderProxyInterfaceCounts
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private XMLEvent peek(XMLEventReader reader) throws XMLStreamException { XMLEvent peek = reader.peek(); if (peek.isCharacters() && (peek.asCharacters().isWhiteSpace())) { reader.nextEvent(); return peek(reader); } return peek; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: peek File: core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java Repository: neo4j/apoc The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-23926
HIGH
8.1
neo4j/apoc
peek
core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java
3202b421b21973b2f57a43b33c88f3f6901cfd2a
0
Analyze the following code function for security vulnerabilities
public static void uploadUpdateFile( Context context, User user, OCFile[] existingFiles, Integer behaviour, NameCollisionPolicy nameCollisionPolicy, boolean disableRetries ) { Intent intent = new Intent(context, FileUploader.class); intent.putExtra(FileUploader.KEY_USER, user); intent.putExtra(FileUploader.KEY_ACCOUNT, user.toPlatformAccount()); intent.putExtra(FileUploader.KEY_FILE, existingFiles); intent.putExtra(FileUploader.KEY_LOCAL_BEHAVIOUR, behaviour); intent.putExtra(FileUploader.KEY_NAME_COLLISION_POLICY, nameCollisionPolicy); intent.putExtra(FileUploader.KEY_DISABLE_RETRIES, disableRetries); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(intent); } else { context.startService(intent); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uploadUpdateFile File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39210
MEDIUM
5.5
nextcloud/android
uploadUpdateFile
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
public void setColumnResizeMode(ColumnResizeMode mode) { getState().columnResizeMode = mode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setColumnResizeMode File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setColumnResizeMode
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public void addToAllGroup(String fullwikiname) throws XWikiException { if (hasProgrammingRights()) { this.xwiki.setUserDefaultGroup(fullwikiname, getXWikiContext()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addToAllGroup File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
addToAllGroup
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
int getUidStateLocked(int uid) { UidRecord uidRec = mActiveUids.get(uid); return uidRec == null ? ActivityManager.PROCESS_STATE_NONEXISTENT : uidRec.curProcState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUidStateLocked 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
getUidStateLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public void removeNfcUnlockHandler(INfcUnlockHandler token) throws RemoteException { synchronized (NfcService.this) { mNfcUnlockManager.removeUnlockHandler(token.asBinder()); } applyRouting(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeNfcUnlockHandler File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
removeNfcUnlockHandler
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
protected Node composeScalarNode(String anchor, List<CommentLine> blockComments) { ScalarEvent ev = (ScalarEvent) parser.getEvent(); String tag = ev.getTag(); boolean resolved = false; Tag nodeTag; if (tag == null || tag.equals("!")) { nodeTag = resolver.resolve(NodeId.scalar, ev.getValue(), ev.getImplicit().canOmitTagInPlainScalar()); resolved = true; } else { nodeTag = new Tag(tag); } Node node = new ScalarNode(nodeTag, resolved, ev.getValue(), ev.getStartMark(), ev.getEndMark(), ev.getScalarStyle()); if (anchor != null) { node.setAnchor(anchor); anchors.put(anchor, node); } node.setBlockComments(blockComments); node.setInLineComments(inlineCommentsCollector.collectEvents().consume()); return node; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: composeScalarNode File: src/main/java/org/yaml/snakeyaml/composer/Composer.java Repository: snakeyaml The code follows secure coding practices.
[ "CWE-776" ]
CVE-2022-25857
HIGH
7.5
snakeyaml
composeScalarNode
src/main/java/org/yaml/snakeyaml/composer/Composer.java
fc300780da21f4bb92c148bc90257201220cf174
0
Analyze the following code function for security vulnerabilities
@Override public boolean getCrossProfileCallerIdDisabled(ComponentName who) { if (!mHasFeature) { return false; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isProfileOwner(caller)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerLocked(caller.getUserId()); if (admin == null) { return false; } if (admin.mManagedProfileCallerIdAccess == null) { return admin.disableCallerId; } if (admin.mManagedProfileCallerIdAccess.getPolicyType() == PackagePolicy.PACKAGE_POLICY_ALLOWLIST_AND_SYSTEM) { Slogf.w(LOG_TAG, "Denying callerId due to PACKAGE_POLICY_SYSTEM policyType"); } return admin.mManagedProfileCallerIdAccess.getPolicyType() != PackagePolicy.PACKAGE_POLICY_BLOCKLIST; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCrossProfileCallerIdDisabled File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getCrossProfileCallerIdDisabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public Intent createCancelIntent(IBinder requestId, String packageName) { return IntentFactory.createCancelUiIntent(requestId, /*shouldShowCancellationUi=*/ true, packageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createCancelIntent File: services/credentials/java/com/android/server/credentials/CredentialManagerUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40076
MEDIUM
5.5
android
createCancelIntent
services/credentials/java/com/android/server/credentials/CredentialManagerUi.java
9b68987df85b681f9362a3cadca6496796d23bbc
0
Analyze the following code function for security vulnerabilities
@Override public String getConnectionId() { List<TransportConnectionState> connectionStates = listConnectionStates(); for (TransportConnectionState cs : connectionStates) { if (cs.getInfo().getClientId() != null) { return cs.getInfo().getClientId(); } return cs.getInfo().getConnectionId().toString(); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectionId File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
getConnectionId
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
@RequiresPermissions("topic:delete_index") @GetMapping("/delete_index") @ResponseBody public Result delete_index(String id) { // ajax传过来的id,这用String接收,不用再转一次了 indexedService.deleteTopicIndex(id); return success(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete_index File: src/main/java/co/yiiu/pybbs/controller/admin/TopicAdminController.java Repository: atjiu/pybbs The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
delete_index
src/main/java/co/yiiu/pybbs/controller/admin/TopicAdminController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
0
Analyze the following code function for security vulnerabilities
public void setFilter(Filter filter) { this.filter = filter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFilter File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
setFilter
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
@Override public void doFilter(ServletRequest srequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { /* HttpServletRequest request = (HttpServletRequest) srequest; //final String realIp = request.getHeader(X_FORWARDED_FOR); //if (realIp != null) { filterChain.doFilter(new XssHttpServletRequestWrapper(request) { *//** public String getRemoteAddr() { return realIp; } public String getRemoteHost() { return realIp; } **//* }, response); return; //} */ }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2021-33561 - Severity: LOW - CVSS Score: 3.5 Description: xss robustness Function: doFilter File: sm-shop/src/main/java/com/salesmanager/shop/filter/XssFilter.java Repository: shopizer-ecommerce/shopizer Fixed Code: @Override public void doFilter(ServletRequest srequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) srequest; filterChain.doFilter(new XssHttpServletRequestWrapper(request) {}, response); }
[ "CWE-79" ]
CVE-2021-33561
LOW
3.5
shopizer-ecommerce/shopizer
doFilter
sm-shop/src/main/java/com/salesmanager/shop/filter/XssFilter.java
197f8c78c8f673b957e41ca2c823afc654c19271
1
Analyze the following code function for security vulnerabilities
private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity<?> entity) { Response response; if ("POST".equals(method)) { response = invocationBuilder.post(entity); } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else { response = invocationBuilder.method(method); } return response; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendRequest File: samples/client/petstore/java/retrofit2-play26/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
sendRequest
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
void dumpPermissionsLocked(FileDescriptor fd, PrintWriter pw, String[] args, int opti, boolean dumpAll, String dumpPackage) { boolean needSep = false; boolean printedAnything = false; pw.println("ACTIVITY MANAGER URI PERMISSIONS (dumpsys activity permissions)"); if (mGrantedUriPermissions.size() > 0) { boolean printed = false; int dumpUid = -2; if (dumpPackage != null) { try { dumpUid = mContext.getPackageManager().getPackageUid(dumpPackage, 0); } catch (NameNotFoundException e) { dumpUid = -1; } } for (int i=0; i<mGrantedUriPermissions.size(); i++) { int uid = mGrantedUriPermissions.keyAt(i); if (dumpUid >= -1 && UserHandle.getAppId(uid) != dumpUid) { continue; } final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.valueAt(i); if (!printed) { if (needSep) pw.println(); needSep = true; pw.println(" Granted Uri Permissions:"); printed = true; printedAnything = true; } pw.print(" * UID "); pw.print(uid); pw.println(" holds:"); for (UriPermission perm : perms.values()) { pw.print(" "); pw.println(perm); if (dumpAll) { perm.dump(pw, " "); } } } } if (!printedAnything) { pw.println(" (nothing)"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpPermissionsLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
dumpPermissionsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@Test public void selectParamTxException(TestContext context) { postgresClient().select(null, "SELECT 1", new JsonArray(), context.asyncAssertFailure()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectParamTxException 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
selectParamTxException
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private Stream<ProgressInfo> exportCsv(@Name("file") String fileName, String source, Object data, ExportConfig exportConfig) throws Exception { apocConfig.checkWriteAllowed(exportConfig, fileName); final String format = "csv"; ProgressInfo progressInfo = new ProgressInfo(fileName, source, format); progressInfo.batchSize = exportConfig.getBatchSize(); ProgressReporter reporter = new ProgressReporter(null, null, progressInfo); CsvFormat exporter = new CsvFormat(db); ExportFileManager cypherFileManager = FileManagerFactory .createFileManager(fileName, exportConfig.isBulkImport(), exportConfig); if (exportConfig.streamStatements()) { return ExportUtils.getProgressInfoStream(db, pools.getDefaultExecutorService(), terminationGuard, format, exportConfig, reporter, cypherFileManager, (reporterWithConsumer) -> dump(data, exportConfig, reporterWithConsumer, cypherFileManager, exporter)); } else { dump(data, exportConfig, reporter, cypherFileManager, exporter); return reporter.stream(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exportCsv File: core/src/main/java/apoc/export/csv/ExportCSV.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23532
MEDIUM
6.5
neo4j-contrib/neo4j-apoc-procedures
exportCsv
core/src/main/java/apoc/export/csv/ExportCSV.java
01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522
0
Analyze the following code function for security vulnerabilities
@Override public void run() { m_webView = new WebView(m_activity); WebSettings webSettings = m_webView.getSettings(); Log.e(TAG, "UA" + webSettings.getUserAgentString()); webSettings.setAllowFileAccess(false); webSettings.setDatabaseEnabled(true); webSettings.setDomStorageEnabled(true); webSettings.setJavaScriptEnabled(true); webSettings.setGeolocationEnabled(false); webSettings.setBuiltInZoomControls(false); webSettings.setPluginState(PluginState.ON); m_webView.getSettings().setUserAgentString(userAgent); m_webView.setWebViewClient((WebViewClient)new VPNWebViewClient()); sem.release(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: android/src/org/mozilla/firefox/vpn/qt/VPNWebView.java Repository: mozilla-mobile/mozilla-vpn-client The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-29978
HIGH
10
mozilla-mobile/mozilla-vpn-client
run
android/src/org/mozilla/firefox/vpn/qt/VPNWebView.java
c8440f464a2f5c4e7d4990152ee5850df8b23f42
0
Analyze the following code function for security vulnerabilities
public void setAdapters(XmlAdapter<?, ?>[] adapters) { this.adapters = adapters; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAdapters 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
setAdapters
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
public ModuleLocation getExpandedLocation(EnvVars env) { return new ModuleLocation(env.expand(remote), env.expand(getLocalDir()), getDepthOption(), isIgnoreExternalsOption()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExpandedLocation File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
getExpandedLocation
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
public static String getUploadStartMessage() { return FileUploader.class.getName() + UPLOAD_START_MESSAGE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUploadStartMessage File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39210
MEDIUM
5.5
nextcloud/android
getUploadStartMessage
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
public T getReply() throws ShutdownSignalException { return _blocker.uninterruptibleGetValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReply File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
getReply
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Override public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) { synchronized (this) { if (mRunningVoice != null && mRunningVoice.asBinder() == session.asBinder()) { if (keepAwake) { mVoiceWakeLock.acquire(); } else { mVoiceWakeLock.release(); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVoiceKeepAwake 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
setVoiceKeepAwake
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void updateBasePath() { if (serverIndex != null) { setBasePath(servers.get(serverIndex).URL(serverVariables)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBasePath File: samples/client/petstore/java/retrofit2-play26/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
updateBasePath
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void cleanupSSLFD() { if (!closed_fd && ssl_fd != null) { try { SSL.RemoveCallbacks(ssl_fd); PR.Close(ssl_fd); ssl_fd.close(); } catch (Exception e) { debug("Got exception trying to cleanup SSLFD: " + e.getMessage()); } finally { closed_fd = true; } } if (read_buf != null) { Buffer.Free(read_buf); read_buf = null; } if (write_buf != null) { Buffer.Free(write_buf); write_buf = null; } }
Vulnerability Classification: - CWE: CWE-401 - CVE: CVE-2021-4213 - Severity: HIGH - CVSS Score: 7.5 Description: Fix memory leak on each TLS connection Each TLS connection is leaking a bunch of data that isn't in the heap and so after 25k requests Tomcat uses about 2.5GB resident memory. There are large number of relationships that point at each other and we need to break the cycle so JSSEngineReferenceImpl's finalizer can run and clear all the native resources these point at. The lowest impact place to break the cycle was at SSLAlertEvent.engine. This relationship doesn't seem to be used anywhere. Once the cycle is broken, JSSEngineReferenceImpl can be garbage collected and the finalizer can run. Signed-off-by: Chris Kelley <ckelley@redhat.com> Function: cleanupSSLFD File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java Repository: dogtagpki/jss Fixed Code: private void cleanupSSLFD() { if (!closed_fd && ssl_fd != null) { try { SSL.RemoveCallbacks(ssl_fd); ssl_fd.close(); ssl_fd = null; } catch (Exception e) { logger.error("Got exception trying to cleanup SSLFD", e); } finally { closed_fd = true; } } if (read_buf != null) { Buffer.Free(read_buf); read_buf = null; } if (write_buf != null) { Buffer.Free(write_buf); write_buf = null; } }
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
cleanupSSLFD
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
1
Analyze the following code function for security vulnerabilities
@Override public void onBootPhase(int phase) { mService.systemReady(phase); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onBootPhase 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
onBootPhase
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public Boolean getFeatureDefault(String featureId) { int length = RECOGNIZED_FEATURES != null ? RECOGNIZED_FEATURES.length : 0; for (int i = 0; i < length; i++) { if (RECOGNIZED_FEATURES[i].equals(featureId)) { return RECOGNIZED_FEATURES_DEFAULTS[i]; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFeatureDefault File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
getFeatureDefault
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public Long getComments() { return comments; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComments File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getComments
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public String getDefaultSpace(XWikiContext context) { String defaultSpace = getXWikiPreference("defaultweb", "", context); if (StringUtils.isEmpty(defaultSpace)) { return getConfiguration().getProperty("xwiki.defaultweb", DEFAULT_HOME_SPACE); } return defaultSpace; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultSpace 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
getDefaultSpace
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@PostMapping("comments") @ApiOperation("Comments a post") @CacheLock(autoDelete = false, traceRequest = true) public BaseCommentDTO comment(@RequestBody SheetCommentParam sheetCommentParam) { return sheetCommentService.convertTo(sheetCommentService.createBy(sheetCommentParam)); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-19007 - Severity: LOW - CVSS Score: 3.5 Description: fix: #547 (#677) Function: comment File: src/main/java/run/halo/app/controller/content/api/SheetController.java Repository: halo-dev/halo Fixed Code: @PostMapping("comments") @ApiOperation("Comments a post") @CacheLock(autoDelete = false, traceRequest = true) public BaseCommentDTO comment(@RequestBody SheetCommentParam sheetCommentParam) { // Escape content sheetCommentParam.setContent(HtmlUtils.htmlEscape(sheetCommentParam.getContent(), StandardCharsets.UTF_8.displayName())); return sheetCommentService.convertTo(sheetCommentService.createBy(sheetCommentParam)); }
[ "CWE-79" ]
CVE-2020-19007
LOW
3.5
halo-dev/halo
comment
src/main/java/run/halo/app/controller/content/api/SheetController.java
d6b3d6cb5d681c7d8d64fd48de6c7c99b696bb8b
1
Analyze the following code function for security vulnerabilities
@Deprecated // since 2.12 protected final void _verifyNullForScalarCoercion(DeserializationContext ctxt, String str) throws JsonMappingException { if (!ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS)) { String strDesc = str.isEmpty() ? "empty String (\"\")" : String.format("String \"%s\"", str); _reportFailedNullCoerce(ctxt, true, MapperFeature.ALLOW_COERCION_OF_SCALARS, strDesc); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _verifyNullForScalarCoercion 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
_verifyNullForScalarCoercion
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
private int getLineStartPos(int line, int left, int right) { // Adjust the point at which to start rendering depending on the // alignment of the paragraph. Alignment align = getParagraphAlignment(line); int dir = getParagraphDirection(line); if (align == Alignment.ALIGN_LEFT) { align = (dir == DIR_LEFT_TO_RIGHT) ? Alignment.ALIGN_NORMAL : Alignment.ALIGN_OPPOSITE; } else if (align == Alignment.ALIGN_RIGHT) { align = (dir == DIR_LEFT_TO_RIGHT) ? Alignment.ALIGN_OPPOSITE : Alignment.ALIGN_NORMAL; } int x; if (align == Alignment.ALIGN_NORMAL) { if (dir == DIR_LEFT_TO_RIGHT) { x = left + getIndentAdjust(line, Alignment.ALIGN_LEFT); } else { x = right + getIndentAdjust(line, Alignment.ALIGN_RIGHT); } } else { TabStops tabStops = null; if (mSpannedText && getLineContainsTab(line)) { Spanned spanned = (Spanned) mText; int start = getLineStart(line); int spanEnd = spanned.nextSpanTransition(start, spanned.length(), TabStopSpan.class); TabStopSpan[] tabSpans = getParagraphSpans(spanned, start, spanEnd, TabStopSpan.class); if (tabSpans.length > 0) { tabStops = new TabStops(TAB_INCREMENT, tabSpans); } } int max = (int)getLineExtent(line, tabStops, false); if (align == Alignment.ALIGN_OPPOSITE) { if (dir == DIR_LEFT_TO_RIGHT) { x = right - max + getIndentAdjust(line, Alignment.ALIGN_RIGHT); } else { // max is negative here x = left - max + getIndentAdjust(line, Alignment.ALIGN_LEFT); } } else { // Alignment.ALIGN_CENTER max = max & ~1; x = (left + right - max) >> 1 + getIndentAdjust(line, Alignment.ALIGN_CENTER); } } return x; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLineStartPos File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getLineStartPos
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
private boolean isAllowComment(int articleId) { Log log = new Log().findByIdOrAlias(articleId); return (log != null && log.getBoolean("canComment")) && isAllowComment(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAllowComment File: service/src/main/java/com/zrlog/service/CommentService.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21316
MEDIUM
4.3
94fzb/zrlog
isAllowComment
service/src/main/java/com/zrlog/service/CommentService.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
@Override public void destroy() { dbWrapper.deregister(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroy File: HeatMapServer/src/com/datformers/servlet/HeatMapServlet.java Repository: ssn2013/cis450Project The code follows secure coding practices.
[ "CWE-89" ]
CVE-2015-10020
MEDIUM
5.2
ssn2013/cis450Project
destroy
HeatMapServer/src/com/datformers/servlet/HeatMapServlet.java
39b495011437a105c7670e17e071f99195b4922e
0
Analyze the following code function for security vulnerabilities
private void verifyRecaptcha(Map<String, String> parameters) throws WebApplicationException { // return if reCAPTCHA is not enabled if(!settings.isRecaptchaEnabled()) { return; } // retrieve the reCAPTCHA widget response String value = parameters.get(RECAPTCHA_PARAM_NAME); // call the service MultiValueMap<String, String> args = new LinkedMultiValueMap<>(); args.add("secret", settings.getRecaptchaSecretKey()); args.add("response", value); RestTemplate restTemplate = new RestTemplate(); try { ReCaptchaResponse response = restTemplate.postForObject( "https://www.google.com/recaptcha/api/siteverify", args, ReCaptchaResponse.class ); // was the response invalid? if (!response.success) { throw new WebApplicationException(HttpStatus.FORBIDDEN, response.displayErrorMessages()); } } catch (Exception ex) { // unknown error log.error("Error occurred after attempt to get a response during " + "CAPTCHA: " + ex.getMessage(), ex); throw new WebApplicationException(HttpStatus.INTERNAL_SERVER_ERROR, ex.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyRecaptcha File: src/main/java/com/unboundid/webapp/ssam/SSAMController.java Repository: pingidentity/ssam The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-25084
MEDIUM
4
pingidentity/ssam
verifyRecaptcha
src/main/java/com/unboundid/webapp/ssam/SSAMController.java
f64b10d63bb19ca2228b0c2d561a1a6e5a3bf251
0
Analyze the following code function for security vulnerabilities
@Override public int getCountByQuery( PotentialDuplicateQuery query ) { String queryString = "select count(*) from PotentialDuplicate pr where pr.status in (:status)"; return Optional.ofNullable( query.getTeis() ).filter( teis -> !teis.isEmpty() ).map( teis -> { Query<Long> hibernateQuery = getTypedQuery( queryString + " and ( pr.original in (:uids) or pr.duplicate in (:uids) )" ); hibernateQuery.setParameterList( "uids", teis ); setStatusParameter( query.getStatus(), hibernateQuery ); return hibernateQuery.getSingleResult().intValue(); } ).orElseGet( () -> { Query<Long> hibernateQuery = getTypedQuery( queryString ); setStatusParameter( query.getStatus(), hibernateQuery ); return hibernateQuery.getSingleResult().intValue(); } ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCountByQuery File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getCountByQuery
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
@Override public CleanResults scan(String html) throws ScanException { if (html == null) { throw new ScanException(new NullPointerException("Null html input")); } errorMessages.clear(); int maxInputSize = policy.getMaxInputSize(); if (maxInputSize < html.length()) { addError(ErrorMessageUtil.ERROR_INPUT_SIZE, new Object[]{html.length(), maxInputSize}); throw new ScanException(errorMessages.get(0)); } isNofollowAnchors = policy.isNofollowAnchors(); isNoopenerAndNoreferrerAnchors = policy.isNoopenerAndNoreferrerAnchors(); isValidateParamAsEmbed = policy.isValidateParamAsEmbed(); long startOfScan = System.currentTimeMillis(); try { CachedItem cachedItem; cachedItem = cachedItems.poll(); if (cachedItem == null){ cachedItem = new CachedItem(); } /* * We have to replace any invalid XML characters to prevent NekoHTML * from breaking when it gets passed encodings like %21. */ html = stripNonValidXMLCharacters(html, cachedItem.invalidXmlCharMatcher); /* * First thing we do is call the HTML cleaner ("NekoHTML") on it * with the appropriate options. We choose not to omit tags due to * the fallibility of our own listing in the ever changing world of * W3C. */ DOMFragmentParser parser = cachedItem.getDomFragmentParser(); try { parser.parse(new InputSource(new StringReader(html)), dom); } catch (Exception e) { throw new ScanException(e); } processChildren(dom, 0); /* * Serialize the output and then return the resulting DOM object and * its string representation. */ final String trimmedHtml = html; StringWriter out = new StringWriter(); @SuppressWarnings("deprecation") org.apache.xml.serialize.OutputFormat format = getOutputFormat(); //noinspection deprecation org.apache.xml.serialize.HTMLSerializer serializer = getHTMLSerializer(out, format); serializer.serialize(dom); /* * Get the String out of the StringWriter and rip out the XML * declaration if the Policy says we should. */ final String trimmed = trim( trimmedHtml, out.getBuffer().toString() ); Callable<String> cleanHtml = new Callable<String>() { public String call() throws Exception { return trimmed; } }; /* * Return the DOM object as well as string HTML. */ results = new CleanResults(startOfScan, cleanHtml, dom, errorMessages); cachedItems.add( cachedItem); return results; } catch (SAXException | IOException e) { throw new ScanException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scan File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-28367
MEDIUM
4.3
nahsra/antisamy
scan
src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
0199e7e194dba5e7d7197703f43ebe22401e61ae
0
Analyze the following code function for security vulnerabilities
@Override public boolean isAvailable() { try { GeoTools.getInitialContext(); return true; } catch (Exception e) { return false; } }
Vulnerability Classification: - CWE: CWE-917 - CVE: CVE-2022-24818 - Severity: HIGH - CVSS Score: 7.5 Description: [GEOT-7115] Streamline JNDI lookups Function: isAvailable File: modules/library/jdbc/src/main/java/org/geotools/data/jdbc/datasource/JNDIDataSourceFactory.java Repository: geotools Fixed Code: @Override public boolean isAvailable() { return GeoTools.isJNDIAvailable(); }
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
isAvailable
modules/library/jdbc/src/main/java/org/geotools/data/jdbc/datasource/JNDIDataSourceFactory.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
1
Analyze the following code function for security vulnerabilities
public static String unlock(String pipelineName) { return BASE + UNLOCK_PATH.replaceAll(":pipeline_name", pipelineName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unlock File: spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
unlock
spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
public void clearAndReadState() { synchronized (mAuthorities) { mAuthorities.clear(); mAccounts.clear(); mServices.clear(); mPendingOperations.clear(); mSyncStatus.clear(); mSyncHistory.clear(); readAccountInfoLocked(); readStatusLocked(); readPendingOperationsLocked(); readStatisticsLocked(); readAndDeleteLegacyAccountInfoLocked(); writeAccountInfoLocked(); writeStatusLocked(); writePendingOperationsLocked(); writeStatisticsLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearAndReadState File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
clearAndReadState
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public BaseObject getXObject(EntityReference classReference, int nb) { return getXObject( getCurrentReferenceDocumentReferenceResolver().resolve(classReference, getDocumentReference()), nb); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXObject File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getXObject
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element profileParameterElement = toDOM(document); document.appendChild(profileParameterElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: toXML File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileDataInfo.java Repository: dogtagpki/pki Fixed Code: public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element profileParameterElement = toDOM(document); document.appendChild(profileParameterElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toXML
base/common/src/main/java/com/netscape/certsrv/profile/ProfileDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
protected void sendEmail(List<Identity> tos, String subject, String body, UserRequest ureq) { File[] attachmentArray = null; if (attachments != null && !attachments.isEmpty() && allowAttachments) { attachmentArray = attachments.toArray(new File[attachments.size()]); } MailerResult result = new MailerResult(); String metaId = UUID.randomUUID().toString().replace("-", ""); for(Identity to:tos) { MailBundle bundle = new MailBundle(); bundle.setToId(to); bundle.setMetaId(metaId); bundle.setFromId(ureq.getIdentity()); bundle.setContent(subject, body, attachmentArray); result.append(mailManager.sendMessage(bundle)); } Roles roles = ureq.getUserSession().getRoles(); boolean detailedErrorOutput = roles.isAdministrator() || roles.isSystemAdmin(); MailHelper.printErrorsAndWarnings(result, getWindowControl(), detailedErrorOutput, ureq.getLocale()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendEmail File: src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
sendEmail
src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
public Set<Integer> removeNetworksForApp(ApplicationInfo app) { if (app == null || app.packageName == null) { return Collections.<Integer>emptySet(); } Log.d(TAG, "Remove all networks for app " + app); Set<Integer> removedNetworks = new ArraySet<>(); WifiConfiguration[] copiedConfigs = mConfiguredNetworks.valuesForAllUsers().toArray(new WifiConfiguration[0]); for (WifiConfiguration config : copiedConfigs) { if (app.uid != config.creatorUid || !app.packageName.equals(getCreatorPackageName(config))) { continue; } localLog("Removing network " + config.SSID + ", application \"" + app.packageName + "\" uninstalled" + " from user " + UserHandle.getUserHandleForUid(app.uid)); if (removeNetwork(config.networkId, config.creatorUid, config.creatorName)) { removedNetworks.add(config.networkId); } } return removedNetworks; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeNetworksForApp File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
removeNetworksForApp
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void setEditorErrorHandler(EditorErrorHandler editorErrorHandler) throws IllegalArgumentException { if (editorErrorHandler == null) { throw new IllegalArgumentException( "The error handler cannot be null"); } this.editorErrorHandler = editorErrorHandler; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEditorErrorHandler File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setEditorErrorHandler
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
private static boolean isMatchNoneNetworkSpecifier(WifiNetworkSpecifier specifier) { PatternMatcher ssidPatternMatcher = specifier.ssidPatternMatcher; Pair<MacAddress, MacAddress> bssidPatternMatcher = specifier.bssidPatternMatcher; if (ssidPatternMatcher.getType() != PatternMatcher.PATTERN_PREFIX && ssidPatternMatcher.getPath().equals(MATCH_EMPTY_SSID_PATTERN_PATH)) { return true; } if (bssidPatternMatcher.equals(MATCH_NONE_BSSID_PATTERN)) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMatchNoneNetworkSpecifier File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
isMatchNoneNetworkSpecifier
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
0
Analyze the following code function for security vulnerabilities
@Override public IInterface queryLocalInterface(String descriptor) { return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryLocalInterface 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
queryLocalInterface
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override public boolean convertFromTranslucent(IBinder token) { final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { return false; } final boolean translucentChanged = r.changeWindowTranslucency(true); if (translucentChanged) { r.task.stack.releaseBackgroundResources(); mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); } mWindowManager.setAppFullscreen(token, true); return translucentChanged; } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertFromTranslucent 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
convertFromTranslucent
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void afterTextChanged(Editable s) { if (hasChanged()) { mListener.afterTextChanged(s); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: afterTextChanged File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
afterTextChanged
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public ObjectOutputStream createObjectOutputStream(HierarchicalStreamWriter writer) throws IOException { return createObjectOutputStream(writer, "object-stream"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createObjectOutputStream File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
createObjectOutputStream
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public static String getParameter(HttpServletRequest request, String name) { return getParameter(request, name, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParameter File: opennms-web-api/src/main/java/org/opennms/web/api/Util.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-0869
MEDIUM
6.1
OpenNMS/opennms
getParameter
opennms-web-api/src/main/java/org/opennms/web/api/Util.java
66b4ba96a18b9952f25a350bbccc2a7e206238d1
0
Analyze the following code function for security vulnerabilities
void onWindowsVisible() { if (DEBUG_VISIBILITY) Slog.v(TAG_WM, "Reporting visible in " + token); mTaskSupervisor.stopWaitingForActivityVisible(this); if (DEBUG_SWITCH) Log.v(TAG_SWITCH, "windowsVisibleLocked(): " + this); if (!nowVisible) { nowVisible = true; lastVisibleTime = SystemClock.uptimeMillis(); mAtmService.scheduleAppGcsLocked(); // The nowVisible may be false in onAnimationFinished because the transition animation // was started by starting window but the main window hasn't drawn so the procedure // didn't schedule. Hence also check when nowVisible becomes true (drawn) to avoid the // closing activity having to wait until idle timeout to be stopped or destroyed if the // next activity won't report idle (e.g. repeated view animation). mTaskSupervisor.scheduleProcessStoppingAndFinishingActivitiesIfNeeded(); // If the activity is visible, but no windows are eligible to start input, unfreeze // to avoid permanently frozen IME insets. if (mImeInsetsFrozenUntilStartInput && getWindow( win -> WindowManager.LayoutParams.mayUseInputMethod(win.mAttrs.flags)) == null) { mImeInsetsFrozenUntilStartInput = false; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onWindowsVisible File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
onWindowsVisible
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Test public void testSerializationAsTimestamp02Nanoseconds() throws Exception { Instant date = Instant.ofEpochSecond(123456789L, 183917322); String value = MAPPER.writer() .with(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .with(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS) .writeValueAsString(date); assertEquals("The value is not correct.", "123456789.183917322", value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testSerializationAsTimestamp02Nanoseconds File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testSerializationAsTimestamp02Nanoseconds
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
@Override public void getPackageSizeInfo(final String packageName, int userHandle, final IPackageStatsObserver observer) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.GET_PACKAGE_SIZE, null); if (packageName == null) { throw new IllegalArgumentException("Attempt to get size of null packageName"); } PackageStats stats = new PackageStats(packageName, userHandle); /* * Queue up an async operation since the package measurement may take a * little while. */ Message msg = mHandler.obtainMessage(INIT_COPY); msg.obj = new MeasureParams(stats, observer); mHandler.sendMessage(msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageSizeInfo File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
getPackageSizeInfo
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public String getInverseAddressFormat(String ipAddress) { ipAddress = StringUtils.trim(ipAddress); validateIpAddress(ipAddress); LOG.debug("Preparing inverse format for IP address [{}]", ipAddress); // Detect what type of address is provided (IPv4 or IPv6) if (isIp6Address(ipAddress)) { LOG.debug("[{}] is an IPv6 address", ipAddress); /* Build reverse IPv6 address string with correct ip6.arpa suffix. * All hex nibbles from the full address should be reversed (with dots in between) * and the ip6.arpa suffix added to the end. * * For example, the reverse format for the address 2604:a880:800:10::7a1:b001 is * 1.0.0.b.1.a.7.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.8.0.0.8.8.a.4.0.6.2.ip6.arpa * See https://www.dnscheck.co/ptr-record-monitor for more info. */ // Parse the full address as an InetAddress to allow the full address bytes (16 bytes/128 bits) to be obtained. final byte[] addressBytes = InetAddresses.forString(ipAddress).getAddress(); if (addressBytes.length > 16) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "[%s] is an invalid IPv6 address", ipAddress)); } // Convert the raw address bytes to hex. final char[] resolvedHex = new char[addressBytes.length * 2]; for (int i = 0; i < addressBytes.length; i++) { final int v = addressBytes[i] & 0xFF; resolvedHex[i * 2] = HEX_CHARS_ARRAY[v >>> 4]; resolvedHex[i * 2 + 1] = HEX_CHARS_ARRAY[v & 0x0F]; } final String fullHexAddress = new String(resolvedHex).toLowerCase(Locale.ENGLISH); final String[] reversedAndSplit = new StringBuilder(fullHexAddress).reverse().toString().split(""); final String invertedAddress = Joiner.on(".").join(reversedAndSplit); LOG.debug("Inverted address [{}] built for [{}]", invertedAddress, ipAddress); return invertedAddress + IP_6_REVERSE_SUFFIX; } else { LOG.debug("[{}] is an IPv4 address", ipAddress); /* Build reverse IPv4 address string with correct in-addr.arpa suffix. * All octets should be reversed and the ip6.arpa suffix added to the end. * * For example, the reverse format for the address 10.20.30.40 is * 40.30.20.10.in-addr.arpa */ final String[] octets = ipAddress.split("\\."); final String invertedAddress = octets[3] + "." + octets[2] + "." + octets[1] + "." + octets[0] + IP_4_REVERSE_SUFFIX; LOG.debug("Inverted address [{}] built for [{}]", invertedAddress, ipAddress); return invertedAddress; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInverseAddressFormat File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
getInverseAddressFormat
graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
@Override public AsyncContext startAsync( ServletRequest servletRequest, ServletResponse servletResponse) { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startAsync File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
startAsync
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public int getReadTimeout() { return readTimeout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReadTimeout File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getReadTimeout
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
void dispatchMagnificationChanged(final @NonNull Region region, final float scale, final float centerX, final float centerY) { final ArrayMap<OnMagnificationChangedListener, Handler> entries; synchronized (mLock) { if (mListeners == null || mListeners.isEmpty()) { Slog.d(LOG_TAG, "Received magnification changed " + "callback with no listeners registered!"); setMagnificationCallbackEnabled(false); return; } // Listeners may remove themselves. Perform a shallow copy to avoid concurrent // modification. entries = new ArrayMap<>(mListeners); } for (int i = 0, count = entries.size(); i < count; i++) { final OnMagnificationChangedListener listener = entries.keyAt(i); final Handler handler = entries.valueAt(i); if (handler != null) { handler.post(new Runnable() { @Override public void run() { listener.onMagnificationChanged(MagnificationController.this, region, scale, centerX, centerY); } }); } else { // We're already on the main thread, just run the listener. listener.onMagnificationChanged(this, region, scale, centerX, centerY); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchMagnificationChanged File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
dispatchMagnificationChanged
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
public void sort(Column<T, ?> column) { sort(column, SortDirection.ASCENDING); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sort File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
sort
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public static CMSRequestInfo fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element element = document.getDocumentElement(); return fromDOM(element); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: fromXML File: base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java Repository: dogtagpki/pki Fixed Code: public static CMSRequestInfo fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element element = document.getDocumentElement(); return fromDOM(element); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromXML
base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
@GuardedBy("mLock") long getLastResetTimeLocked() { updateTimesLocked(); return mRawLastResetTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastResetTimeLocked File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40092
MEDIUM
5.5
android
getLastResetTimeLocked
services/core/java/com/android/server/pm/ShortcutService.java
a5e55363e69b3c84d3f4011c7b428edb1a25752c
0
Analyze the following code function for security vulnerabilities
@Override public String[] getSystemSharedLibraryNames() { Set<String> libSet; synchronized (mPackages) { libSet = mSharedLibraries.keySet(); int size = libSet.size(); if (size > 0) { String[] libs = new String[size]; libSet.toArray(libs); return libs; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSystemSharedLibraryNames File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
getSystemSharedLibraryNames
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public static String determineReturnLabel(String returnLabel, Patient patient, UiUtils ui) { if (org.apache.commons.lang.StringUtils.isNotBlank(returnLabel)) { return ui.message(returnLabel); } else { return ui.escapeJs(ui.format(patient)); } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2021-4284 - Severity: MEDIUM - CVSS Score: 6.1 Description: Ra 1424: escapeJs is vulnerable to XSS attacks (#51) * RA-1424: escapeJs vulnerable to XSS * RA-1424: escapeJs vulnerable to XSS Function: determineReturnLabel File: api/src/main/java/org/openmrs/module/htmlformentryui/HtmlFormUtil.java Repository: openmrs/openmrs-module-htmlformentryui Fixed Code: public static String determineReturnLabel(String returnLabel, Patient patient, UiUtils ui) { if (org.apache.commons.lang.StringUtils.isNotBlank(returnLabel)) { return ui.message(returnLabel); } else { return ui.encodeJavaScript(ui.format(patient)); } }
[ "CWE-79" ]
CVE-2021-4284
MEDIUM
6.1
openmrs/openmrs-module-htmlformentryui
determineReturnLabel
api/src/main/java/org/openmrs/module/htmlformentryui/HtmlFormUtil.java
811990972ea07649ae33c4b56c61c3b520895f07
1
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder2 instruction(String target, String data) { super.instructionImpl(target, data); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: instruction File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
instruction
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public String getSubscriberId() { return getSubscriberIdForSubscriber(getDefaultSubscription()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSubscriberId File: src/java/com/android/internal/telephony/PhoneSubInfoController.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-0831
MEDIUM
4.3
android
getSubscriberId
src/java/com/android/internal/telephony/PhoneSubInfoController.java
79eecef63f3ea99688333c19e22813f54d4a31b1
0
Analyze the following code function for security vulnerabilities
@Override public void onReceive(Context context, Intent intent) { PendingIntent pendingIntent = intent.getParcelableExtra(EXTRA_ACTION_INTENT); String actionType = intent.getStringExtra(EXTRA_ACTION_TYPE); if (DEBUG_ACTIONS) { Log.d(TAG, "Executing smart action [" + actionType + "]:" + pendingIntent.getIntent()); } ActivityOptions opts = ActivityOptions.makeBasic(); try { pendingIntent.send(context, 0, null, null, null, null, opts.toBundle()); } catch (PendingIntent.CanceledException e) { Log.e(TAG, "Pending intent canceled", e); } mScreenshotSmartActions.notifyScreenshotAction( context, intent.getStringExtra(EXTRA_ID), actionType, true, pendingIntent.getIntent()); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-35676 - Severity: HIGH - CVSS Score: 7.8 Description: [DO NOT MERGE] Update quickshare intent rather than recreating Currently, we extract the quickshare intent and re-wrap it as a new PendingIntent once we get the screenshot URI. This is insecure as it leads to executing the original with SysUI's permissions, which the app may not have. This change switches to using Intent.fillin to add the URI, keeping the original PendingIntent and original permission set. Bug: 278720336 Test: manual (to test successful quickshare), atest SaveImageInBackgroundTaskTest (to verify original pending intent unchanged) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:02938e8ccae910d96578475a19dff0a5e746b03d) Merged-In: Icad3d5f939fcfb894e2038948954bc2735dbe326 Change-Id: Icad3d5f939fcfb894e2038948954bc2735dbe326 Function: onReceive File: packages/SystemUI/src/com/android/systemui/screenshot/SmartActionsReceiver.java Repository: android Fixed Code: @Override public void onReceive(Context context, Intent intent) { PendingIntent pendingIntent = intent.getParcelableExtra(EXTRA_ACTION_INTENT, PendingIntent.class); Intent fillIn = intent.getParcelableExtra(EXTRA_ACTION_INTENT_FILLIN, Intent.class); String actionType = intent.getStringExtra(EXTRA_ACTION_TYPE); if (DEBUG_ACTIONS) { Log.d(TAG, "Executing smart action [" + actionType + "]:" + pendingIntent.getIntent()); } ActivityOptions opts = ActivityOptions.makeBasic(); try { pendingIntent.send(context, 0, fillIn, null, null, null, opts.toBundle()); } catch (PendingIntent.CanceledException e) { Log.e(TAG, "Pending intent canceled", e); } mScreenshotSmartActions.notifyScreenshotAction( context, intent.getStringExtra(EXTRA_ID), actionType, true, pendingIntent.getIntent()); }
[ "CWE-Other" ]
CVE-2023-35676
HIGH
7.8
android
onReceive
packages/SystemUI/src/com/android/systemui/screenshot/SmartActionsReceiver.java
109e58b62dc9fedcee93983678ef9d4931e72afa
1
Analyze the following code function for security vulnerabilities
@Override public void onAuthenticationError(int errMsgId, CharSequence errString) { handleFingerprintError(errMsgId, errString.toString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAuthenticationError File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onAuthenticationError
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public String renderAsHtml() { StringBuilder sb = new StringBuilder(255); sb.append("<ul>"); for (String filename:files) { sb.append("<li>") .append(currentContainerRelPath).append("/").append(StringHelper.escapeHtml(filename)) .append("</li>"); } sb.append("</ul>"); return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renderAsHtml File: src/main/java/org/olat/core/commons/modules/bc/FileSelection.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
renderAsHtml
src/main/java/org/olat/core/commons/modules/bc/FileSelection.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage public XmlResourceParser newParser() { return newParser(ID_NULL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newParser File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
newParser
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean isUsingBytes() { return usingBytes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUsingBytes File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
isUsingBytes
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
public void evaluateJavaScriptEvenIfNotYetNavigated(String script) { if (mNativeContentViewCore == 0) return; nativeEvaluateJavaScript(mNativeContentViewCore, script, null, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: evaluateJavaScriptEvenIfNotYetNavigated File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
evaluateJavaScriptEvenIfNotYetNavigated
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public void enableRssiPolling(boolean enabled) { sendMessage(CMD_ENABLE_RSSI_POLL, enabled ? 1 : 0, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enableRssiPolling 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
enableRssiPolling
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@GetMapping("/switch/source/ws/{sourceId}") public UserDTO switchWorkspace(@PathVariable(value = "sourceId") String sourceId) { baseUserService.switchUserResource("workspace", sourceId, Objects.requireNonNull(SessionUtils.getUser())); return SessionUtils.getUser(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchWorkspace File: framework/sdk-parent/sdk/src/main/java/io/metersphere/controller/BaseUserController.java Repository: metersphere The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-38494
HIGH
7.5
metersphere
switchWorkspace
framework/sdk-parent/sdk/src/main/java/io/metersphere/controller/BaseUserController.java
a23f75d93b666901fd148d834df9384f6f24cf28
0
Analyze the following code function for security vulnerabilities
private boolean buildResourcesRaw() throws AndrolibException { try { if (!new File(mApkDir, "resources.arsc").exists()) { return false; } File apkDir = new File(mApkDir, APK_DIRNAME); if (!mConfig.forceBuildAll) { LOGGER.info("Checking whether resources has changed..."); } if (mConfig.forceBuildAll || isModified(newFiles(APK_RESOURCES_FILENAMES, mApkDir), newFiles(APK_RESOURCES_FILENAMES, apkDir))) { LOGGER.info("Copying raw resources..."); mApkDir.getDirectory().copyToDir(apkDir, APK_RESOURCES_FILENAMES); } return true; } catch (DirectoryException ex) { throw new AndrolibException(ex); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildResourcesRaw File: brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
buildResourcesRaw
brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
@Override public String[] getAlias() { return new String[0]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAlias File: src/main/java/de/presti/ree6/commands/impl/mod/EmbedSender.java Repository: Ree6-Applications/Ree6 The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
getAlias
src/main/java/de/presti/ree6/commands/impl/mod/EmbedSender.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
0
Analyze the following code function for security vulnerabilities
private void populateSessionWithSAMLParameters(Request request) throws IOException { String samlRequestMessage = request.getParameter(GeneralConstants.SAML_REQUEST_KEY); String samlResponseMessage = request.getParameter(GeneralConstants.SAML_RESPONSE_KEY); boolean containsSAMLRequestMessage = isNotNull(samlRequestMessage); boolean containsSAMLResponseMessage = isNotNull(samlResponseMessage); String signature = request.getParameter(GeneralConstants.SAML_SIGNATURE_REQUEST_KEY); String sigAlg = request.getParameter(GeneralConstants.SAML_SIG_ALG_REQUEST_KEY); String relayState = request.getParameter(GeneralConstants.RELAY_STATE); Session session = request.getSessionInternal(); if (containsSAMLRequestMessage || containsSAMLResponseMessage) { logger.trace("Storing the SAMLRequest/SAMLResponse and RelayState in session"); if (isNotNull(samlRequestMessage)) { session.setNote(GeneralConstants.SAML_REQUEST_KEY, samlRequestMessage); session.setNote(JBossSAMLConstants.BINDING.get(), request.getMethod()); } if (isNotNull(samlResponseMessage)) { session.setNote(GeneralConstants.SAML_RESPONSE_KEY, samlResponseMessage); } if (isNotNull(relayState)) { session.setNote(GeneralConstants.RELAY_STATE, relayState.trim()); } if (isNotNull(signature)) { session.setNote(GeneralConstants.SAML_SIGNATURE_REQUEST_KEY, signature.trim()); } if (isNotNull(sigAlg)) { session.setNote(GeneralConstants.SAML_SIG_ALG_REQUEST_KEY, sigAlg.trim()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: populateSessionWithSAMLParameters File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
populateSessionWithSAMLParameters
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
public WearableExtender clearActions() { mActions.clear(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearActions File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
clearActions
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private boolean isValidationRunCompleted(ValidationResult validationResult) { return validationResult.getWarnings().stream() .noneMatch(check -> check.getStatus() != ValidationStatus.PASSED && VALIDATOR_RPKI_REPOSITORY_PENDING.equals(check.getKey())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidationRunCompleted File: rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java Repository: RIPE-NCC/rpki-validator-3 The code follows secure coding practices.
[ "CWE-295" ]
CVE-2020-16162
MEDIUM
5
RIPE-NCC/rpki-validator-3
isValidationRunCompleted
rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java
3cbf34fed7c0ca00574644a5b5b06f1b54a3f5dc
0
Analyze the following code function for security vulnerabilities
private Task getReusableTask() { // If a target task is specified, try to reuse that one if (mOptions != null && mOptions.getLaunchTaskId() != INVALID_TASK_ID) { Task launchTask = mRootWindowContainer.anyTaskForId(mOptions.getLaunchTaskId()); if (launchTask != null) { return launchTask; } return null; } // We may want to try to place the new activity in to an existing task. We always // do this if the target activity is singleTask or singleInstance; we will also do // this if NEW_TASK has been requested, and there is not an additional qualifier telling // us to still place it in a new task: multi task, always doc mode, or being asked to // launch this as a new task behind the current one. boolean putIntoExistingTask = ((mLaunchFlags & FLAG_ACTIVITY_NEW_TASK) != 0 && (mLaunchFlags & FLAG_ACTIVITY_MULTIPLE_TASK) == 0) || isLaunchModeOneOf(LAUNCH_SINGLE_INSTANCE, LAUNCH_SINGLE_TASK); // If bring to front is requested, and no result is requested and we have not been given // an explicit task to launch in to, and we can find a task that was started with this // same component, then instead of launching bring that one to the front. putIntoExistingTask &= mInTask == null && mStartActivity.resultTo == null; ActivityRecord intentActivity = null; if (putIntoExistingTask) { if (LAUNCH_SINGLE_INSTANCE == mLaunchMode) { // There can be one and only one instance of single instance activity in the // history, and it is always in its own unique task, so we do a special search. intentActivity = mRootWindowContainer.findActivity(mIntent, mStartActivity.info, mStartActivity.isActivityTypeHome()); } else if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) { // For the launch adjacent case we only want to put the activity in an existing // task if the activity already exists in the history. intentActivity = mRootWindowContainer.findActivity(mIntent, mStartActivity.info, !(LAUNCH_SINGLE_TASK == mLaunchMode)); } else { // Otherwise find the best task to put the activity in. intentActivity = mRootWindowContainer.findTask(mStartActivity, mPreferredTaskDisplayArea); } } if (intentActivity != null && mLaunchMode == LAUNCH_SINGLE_INSTANCE_PER_TASK && !intentActivity.getTask().getRootActivity().mActivityComponent.equals( mStartActivity.mActivityComponent)) { // The task could be selected due to same task affinity. Do not reuse the task while // starting the singleInstancePerTask activity if it is not the task root activity. intentActivity = null; } if (intentActivity != null && (mStartActivity.isActivityTypeHome() || intentActivity.isActivityTypeHome()) && intentActivity.getDisplayArea() != mPreferredTaskDisplayArea) { // Do not reuse home activity on other display areas. intentActivity = null; } return intentActivity != null ? intentActivity.getTask() : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReusableTask 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
getReusableTask
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0