instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private final void handleAppDiedLocked(ProcessRecord app, boolean restarting, boolean allowRestart) { int pid = app.pid; boolean kept = cleanUpApplicationRecordLocked(app, restarting, allowRestart, -1); if (!kept && !restarting) { removeLruProcessLocked(app); if (pid > 0) { ProcessList.remove(pid); } } if (mProfileProc == app) { clearProfilerLocked(); } // Remove this application's activities from active lists. boolean hasVisibleActivities = mStackSupervisor.handleAppDiedLocked(app); app.activities.clear(); if (app.instrumentationClass != null) { Slog.w(TAG, "Crash of app " + app.processName + " running instrumentation " + app.instrumentationClass); Bundle info = new Bundle(); info.putString("shortMsg", "Process crashed."); finishInstrumentationLocked(app, Activity.RESULT_CANCELED, info); } if (!restarting && hasVisibleActivities && !mStackSupervisor.resumeFocusedStackTopActivityLocked()) { // If there was nothing to resume, and we are not already restarting this process, but // there is a visible activity that is hosted by the process... then make sure all // visible activities are running, taking care of restarting this process. mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS); } }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3912 - Severity: HIGH - CVSS Score: 9.3 Description: DO NOT MERGE: Clean up when recycling a pid with a pending launch Fix for accidental launch of a broadcast receiver in an incorrect app instance. Bug: 30202481 Change-Id: I8ec8f19c633f3aec8da084dab5fd5b312443336f (cherry picked from commit 55eacb944122ddc0a3bb693b36fe0f07b0fe18c9) Function: handleAppDiedLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android Fixed Code: private final void handleAppDiedLocked(ProcessRecord app, boolean restarting, boolean allowRestart) { int pid = app.pid; boolean kept = cleanUpApplicationRecordLocked(app, restarting, allowRestart, -1, false /*replacingPid*/); if (!kept && !restarting) { removeLruProcessLocked(app); if (pid > 0) { ProcessList.remove(pid); } } if (mProfileProc == app) { clearProfilerLocked(); } // Remove this application's activities from active lists. boolean hasVisibleActivities = mStackSupervisor.handleAppDiedLocked(app); app.activities.clear(); if (app.instrumentationClass != null) { Slog.w(TAG, "Crash of app " + app.processName + " running instrumentation " + app.instrumentationClass); Bundle info = new Bundle(); info.putString("shortMsg", "Process crashed."); finishInstrumentationLocked(app, Activity.RESULT_CANCELED, info); } if (!restarting && hasVisibleActivities && !mStackSupervisor.resumeFocusedStackTopActivityLocked()) { // If there was nothing to resume, and we are not already restarting this process, but // there is a visible activity that is hosted by the process... then make sure all // visible activities are running, taking care of restarting this process. mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS); } }
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
handleAppDiedLocked
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
1
Analyze the following code function for security vulnerabilities
public void bind(int index, float value) { mPreparedStatement.bindDouble(index, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bind File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
bind
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
public double getHeightByRows() { return getState(false).heightByRows; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHeightByRows 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
getHeightByRows
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public void deleteMonitoredItems(ServiceRequest service) throws UaException { DeleteMonitoredItemsRequest request = (DeleteMonitoredItemsRequest) service.getRequest(); UInteger subscriptionId = request.getSubscriptionId(); Subscription subscription = subscriptions.get(subscriptionId); List<UInteger> itemsToDelete = l(request.getMonitoredItemIds()); if (subscription == null) { throw new UaException(StatusCodes.Bad_SubscriptionIdInvalid); } if (itemsToDelete.isEmpty()) { throw new UaException(StatusCodes.Bad_NothingToDo); } StatusCode[] deleteResults = new StatusCode[itemsToDelete.size()]; List<BaseMonitoredItem<?>> deletedItems = newArrayListWithCapacity(itemsToDelete.size()); synchronized (subscription) { for (int i = 0; i < itemsToDelete.size(); i++) { UInteger itemId = itemsToDelete.get(i); BaseMonitoredItem<?> item = subscription.getMonitoredItems().get(itemId); if (item == null) { deleteResults[i] = new StatusCode(StatusCodes.Bad_MonitoredItemIdInvalid); } else { deletedItems.add(item); deleteResults[i] = StatusCode.GOOD; server.getMonitoredItemCount().decrementAndGet(); } } subscription.removeMonitoredItems(deletedItems); } /* * Notify AddressSpaces of the items that have been deleted. */ byMonitoredItemType( deletedItems, dataItems -> server.getAddressSpaceManager().onDataItemsDeleted(dataItems), eventItems -> server.getAddressSpaceManager().onEventItemsDeleted(eventItems) ); /* * Build and return results. */ ResponseHeader header = service.createResponseHeader(); DeleteMonitoredItemsResponse response = new DeleteMonitoredItemsResponse( header, deleteResults, new DiagnosticInfo[0] ); service.setResponse(response); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2022-25897 - Severity: HIGH - CVSS Score: 7.5 Description: Allow max MonitoredItems per session to be configured via OpcUaServerConfigLimits Function: deleteMonitoredItems File: opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java Repository: eclipse/milo Fixed Code: public void deleteMonitoredItems(ServiceRequest service) throws UaException { DeleteMonitoredItemsRequest request = (DeleteMonitoredItemsRequest) service.getRequest(); UInteger subscriptionId = request.getSubscriptionId(); Subscription subscription = subscriptions.get(subscriptionId); List<UInteger> itemsToDelete = l(request.getMonitoredItemIds()); if (subscription == null) { throw new UaException(StatusCodes.Bad_SubscriptionIdInvalid); } if (itemsToDelete.isEmpty()) { throw new UaException(StatusCodes.Bad_NothingToDo); } StatusCode[] deleteResults = new StatusCode[itemsToDelete.size()]; List<BaseMonitoredItem<?>> deletedItems = newArrayListWithCapacity(itemsToDelete.size()); synchronized (subscription) { for (int i = 0; i < itemsToDelete.size(); i++) { UInteger itemId = itemsToDelete.get(i); BaseMonitoredItem<?> item = subscription.getMonitoredItems().get(itemId); if (item == null) { deleteResults[i] = new StatusCode(StatusCodes.Bad_MonitoredItemIdInvalid); } else { deletedItems.add(item); deleteResults[i] = StatusCode.GOOD; monitoredItemCount.decrementAndGet(); server.getMonitoredItemCount().decrementAndGet(); } } subscription.removeMonitoredItems(deletedItems); } /* * Notify AddressSpaces of the items that have been deleted. */ byMonitoredItemType( deletedItems, dataItems -> server.getAddressSpaceManager().onDataItemsDeleted(dataItems), eventItems -> server.getAddressSpaceManager().onEventItemsDeleted(eventItems) ); /* * Build and return results. */ ResponseHeader header = service.createResponseHeader(); DeleteMonitoredItemsResponse response = new DeleteMonitoredItemsResponse( header, deleteResults, new DiagnosticInfo[0] ); service.setResponse(response); }
[ "CWE-770" ]
CVE-2022-25897
HIGH
7.5
eclipse/milo
deleteMonitoredItems
opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java
4534381760d7d9f0bf00cbf6a8449bb0d13c6ce5
1
Analyze the following code function for security vulnerabilities
public void onPasspointNetworkConnected(String uniqueId) { PasspointProvider provider = mProviders.get(uniqueId); if (provider == null) { Log.e(TAG, "Passpoint network connected without provider: " + uniqueId); return; } if (!provider.getHasEverConnected()) { // First successful connection using this provider. provider.setHasEverConnected(true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPasspointNetworkConnected File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
onPasspointNetworkConnected
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private boolean removeOverrideApnUnchecked(int apnId) { if(apnId < 0) { return false; } int numDeleted = mInjector.binderWithCleanCallingIdentity( () -> mContext.getContentResolver().delete( Uri.withAppendedPath(DPC_URI, Integer.toString(apnId)), null, null)); return numDeleted > 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeOverrideApnUnchecked 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
removeOverrideApnUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setIssueHandshake(boolean issueHandshake) { this.issueHandshake = issueHandshake; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIssueHandshake File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-119" ]
CVE-2014-3488
MEDIUM
5
netty
setIssueHandshake
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2fa9400a59d0563a66908aba55c41e7285a04994
0
Analyze the following code function for security vulnerabilities
@Override public void removeAccountAsUser(IAccountManagerResponse response, Account account, boolean expectActivityLaunch, int userId) { final int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "removeAccount: " + account + ", response " + response + ", caller's uid " + callingUid + ", pid " + Binder.getCallingPid() + ", for user id " + userId); } Preconditions.checkArgument(account != null, "account cannot be null"); Preconditions.checkArgument(response != null, "response cannot be null"); // Only allow the system process to modify accounts of other users if (isCrossUser(callingUid, userId)) { throw new SecurityException( String.format( "User %s tying remove account for %s" , UserHandle.getCallingUserId(), userId)); } /* * Only the system, authenticator or profile owner should be allowed to remove accounts for * that authenticator. This will let users remove accounts (via Settings in the system) but * not arbitrary applications (like competing authenticators). */ UserHandle user = UserHandle.of(userId); if (!isAccountManagedByCaller(account.type, callingUid, user.getIdentifier()) && !isSystemUid(callingUid) && !isProfileOwner(callingUid)) { String msg = String.format( "uid %s cannot remove accounts of type: %s", callingUid, account.type); throw new SecurityException(msg); } if (!canUserModifyAccounts(userId, callingUid)) { try { response.onError(AccountManager.ERROR_CODE_USER_RESTRICTED, "User cannot modify accounts"); } catch (RemoteException re) { } return; } if (!canUserModifyAccountsForType(userId, account.type, callingUid)) { try { response.onError(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE, "User cannot modify accounts of this type (policy)."); } catch (RemoteException re) { } return; } final long identityToken = clearCallingIdentity(); UserAccounts accounts = getUserAccounts(userId); cancelNotification(getSigninRequiredNotificationId(accounts, account), user); synchronized(accounts.credentialsPermissionNotificationIds) { for (Pair<Pair<Account, String>, Integer> pair: accounts.credentialsPermissionNotificationIds.keySet()) { if (account.equals(pair.first.first)) { NotificationId id = accounts.credentialsPermissionNotificationIds.get(pair); cancelNotification(id, user); } } } final long accountId = accounts.accountsDb.findDeAccountId(account); logRecord( AccountsDb.DEBUG_ACTION_CALLED_ACCOUNT_REMOVE, AccountsDb.TABLE_ACCOUNTS, accountId, accounts, callingUid); try { new RemoveAccountSession(accounts, response, account, expectActivityLaunch).bind(); } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeAccountAsUser File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
removeAccountAsUser
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public static void retryFailedUploads( @NonNull final Context context, @NonNull final UploadsStorageManager uploadsStorageManager, @NonNull final ConnectivityService connectivityService, @NonNull final UserAccountManager accountManager, @NonNull final PowerManagementService powerManagementService ) { OCUpload[] failedUploads = uploadsStorageManager.getFailedUploads(); if(failedUploads == null || failedUploads.length == 0) { return; //nothing to do } final Connectivity connectivity = connectivityService.getConnectivity(); final boolean gotNetwork = connectivity.isConnected() && !connectivityService.isInternetWalled(); final boolean gotWifi = connectivity.isWifi(); final BatteryStatus batteryStatus = powerManagementService.getBattery(); final boolean charging = batteryStatus.isCharging() || batteryStatus.isFull(); final boolean isPowerSaving = powerManagementService.isPowerSavingEnabled(); Optional<User> uploadUser = Optional.empty(); for (OCUpload failedUpload : failedUploads) { // 1. extract failed upload owner account and cache it between loops (expensive query) if (!uploadUser.isPresent() || !uploadUser.get().nameEquals(failedUpload.getAccountName())) { uploadUser = accountManager.getUser(failedUpload.getAccountName()); } final boolean isDeleted = !new File(failedUpload.getLocalPath()).exists(); if (isDeleted) { // 2A. for deleted files, mark as permanently failed if (failedUpload.getLastResult() != UploadResult.FILE_NOT_FOUND) { failedUpload.setLastResult(UploadResult.FILE_NOT_FOUND); uploadsStorageManager.updateUpload(failedUpload); } } else if (!isPowerSaving && gotNetwork && canUploadBeRetried(failedUpload, gotWifi, charging)) { // 2B. for existing local files, try restarting it if possible retryUpload(context, uploadUser.get(), failedUpload); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retryFailedUploads File: src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
retryFailedUploads
src/main/java/com/owncloud/android/files/services/FileUploader.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
0
Analyze the following code function for security vulnerabilities
protected void internalCreateNonPartitionedTopic(boolean authoritative) { validateNonPartitionTopicName(topicName.getLocalName()); if (topicName.isGlobal()) { validateGlobalNamespaceOwnership(namespaceName); } validateTopicOwnership(topicName, authoritative); validateNamespaceOperation(topicName.getNamespaceObject(), NamespaceOperation.CREATE_TOPIC); PartitionedTopicMetadata partitionMetadata = getPartitionedTopicMetadata(topicName, authoritative, false); if (partitionMetadata.partitions > 0) { log.warn("[{}] Partitioned topic with the same name already exists {}", clientAppId(), topicName); throw new RestException(Status.CONFLICT, "This topic already exists"); } try { Optional<Topic> existedTopic = pulsar().getBrokerService().getTopicIfExists(topicName.toString()).get(); if (existedTopic.isPresent()) { log.error("[{}] Topic {} already exists", clientAppId(), topicName); throw new RestException(Status.CONFLICT, "This topic already exists"); } Topic createdTopic = getOrCreateTopic(topicName); log.info("[{}] Successfully created non-partitioned topic {}", clientAppId(), createdTopic); } catch (Exception e) { if (e instanceof RestException) { throw (RestException) e; } else { log.error("[{}] Failed to create non-partitioned topic {}", clientAppId(), topicName, e); throw new RestException(e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalCreateNonPartitionedTopic 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
internalCreateNonPartitionedTopic
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
private ConfigurationSource getConfiguration() { if (this.xwikicfg == null) { this.xwikicfg = Utils.getComponent(ConfigurationSource.class, XWikiCfgConfigurationSource.ROLEHINT); } return this.xwikicfg; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguration 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
getConfiguration
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public void onFilterComplete(int result) { Rlog.e(TAG, "Unexpected onFilterComplete call with result: " + result); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onFilterComplete File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3883
MEDIUM
4.3
android
onFilterComplete
src/java/com/android/internal/telephony/SMSDispatcher.java
b2c89e6f8962dc7aff88cb38aa3ee67d751edda9
0
Analyze the following code function for security vulnerabilities
public void useSslProtocol(String protocol, TrustManager trustManager) throws NoSuchAlgorithmException, KeyManagementException { SSLContext c = SSLContext.getInstance(protocol); c.init(null, new TrustManager[] { trustManager }, null); useSslProtocol(c); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: useSslProtocol File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
useSslProtocol
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
private ActivityRecord getCallingRecordLocked(IBinder token) { ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { return null; } return r.resultTo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallingRecordLocked 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
getCallingRecordLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void parseFrontierRules(final List<Element> elements, final ProductionFrontier frontier) throws GameParseException { for (final Element element : elements) { frontier.addRule(getProductionRule(element, "name", true)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseFrontierRules 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
parseFrontierRules
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
private void handleFirstRequest(final HttpServerExchange exchange, ServletRequestContext servletRequestContext) throws Exception { ServletRequest request = servletRequestContext.getServletRequest(); ServletResponse response = servletRequestContext.getServletResponse(); //set request attributes from the connector //generally this is only applicable if apache is sending AJP_ prefixed environment variables Map<String, String> attrs = exchange.getAttachment(HttpServerExchange.REQUEST_ATTRIBUTES); if(attrs != null) { for(Map.Entry<String, String> entry : attrs.entrySet()) { request.setAttribute(entry.getKey(), entry.getValue()); } } servletRequestContext.setRunningInsideHandler(true); try { listeners.requestInitialized(request); next.handleRequest(exchange); AsyncContextImpl asyncContextInternal = servletRequestContext.getOriginalRequest().getAsyncContextInternal(); if(asyncContextInternal != null && asyncContextInternal.isCompletedBeforeInitialRequestDone()) { asyncContextInternal.handleCompletedBeforeInitialRequestDone(); } // if(servletRequestContext.getErrorCode() > 0) { servletRequestContext.getOriginalResponse().doErrorDispatch(servletRequestContext.getErrorCode(), servletRequestContext.getErrorMessage()); } } catch (Throwable t) { servletRequestContext.setRunningInsideHandler(false); AsyncContextImpl asyncContextInternal = servletRequestContext.getOriginalRequest().getAsyncContextInternal(); if(asyncContextInternal != null && asyncContextInternal.isCompletedBeforeInitialRequestDone()) { asyncContextInternal.handleCompletedBeforeInitialRequestDone(); } if(asyncContextInternal != null) { asyncContextInternal.initialRequestFailed(); } //by default this will just log the exception boolean handled = exceptionHandler.handleThrowable(exchange, request, response, t); if(handled) { exchange.endExchange(); } else if (request.isAsyncStarted() || request.getDispatcherType() == DispatcherType.ASYNC) { exchange.unDispatch(); servletRequestContext.getOriginalRequest().getAsyncContextInternal().handleError(t); } else { if (!exchange.isResponseStarted()) { response.reset(); //reset the response exchange.setStatusCode(StatusCodes.INTERNAL_SERVER_ERROR); exchange.getResponseHeaders().clear(); String location = servletContext.getDeployment().getErrorPages().getErrorLocation(t); if (location == null) { location = servletContext.getDeployment().getErrorPages().getErrorLocation(StatusCodes.INTERNAL_SERVER_ERROR); } if (location != null) { RequestDispatcherImpl dispatcher = new RequestDispatcherImpl(location, servletContext); try { dispatcher.error(servletRequestContext, request, response, servletRequestContext.getOriginalServletPathMatch().getServletChain().getManagedServlet().getServletInfo().getName(), t); } catch (Exception e) { UndertowLogger.REQUEST_LOGGER.exceptionGeneratingErrorPage(e, location); } } else { if (servletRequestContext.displayStackTraces()) { ServletDebugPageHandler.handleRequest(exchange, servletRequestContext, t); } else { servletRequestContext.getOriginalResponse().doErrorDispatch(StatusCodes.INTERNAL_SERVER_ERROR, StatusCodes.INTERNAL_SERVER_ERROR_STRING); } } } } } finally { servletRequestContext.setRunningInsideHandler(false); listeners.requestDestroyed(request); } //if it is not dispatched and is not a mock request if (!exchange.isDispatched() && !(exchange.getConnection() instanceof MockServerConnection)) { servletRequestContext.getOriginalResponse().responseDone(); servletRequestContext.getOriginalRequest().clearAttributes(); } if(!exchange.isDispatched()) { AsyncContextImpl ctx = servletRequestContext.getOriginalRequest().getAsyncContextInternal(); if(ctx != null) { ctx.complete(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleFirstRequest File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
handleFirstRequest
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
@Override public WindowState getWinShowWhenLockedLw() { return mWinShowWhenLocked; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWinShowWhenLockedLw File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
getWinShowWhenLockedLw
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public Map<String, String> getCustomParams() { return customParams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCustomParams File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
getCustomParams
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
public boolean isAdvancedContent() { String[] matches = { "<%", "#set", "#include", "#if", "public class", "/* Advanced content */", "## Advanced content", "/* Programmatic content */", "## Programmatic content" }; String content2 = getContent().toLowerCase(); for (String match : matches) { if (content2.indexOf(match.toLowerCase()) != -1) { return true; } } if (HTML_TAG_PATTERN.matcher(content2).find()) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAdvancedContent 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
isAdvancedContent
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
@Override void onParentChanged(ConfigurationContainer rawNewParent, ConfigurationContainer rawOldParent) { final TaskFragment oldParent = (TaskFragment) rawOldParent; final TaskFragment newParent = (TaskFragment) rawNewParent; final Task oldTask = oldParent != null ? oldParent.getTask() : null; final Task newTask = newParent != null ? newParent.getTask() : null; this.task = newTask; if (shouldStartChangeTransition(newParent, oldParent)) { // Animate change transition on TaskFragment level to get the correct window crop. newParent.initializeChangeTransition(getBounds(), getSurfaceControl()); } super.onParentChanged(newParent, oldParent); if (isPersistable()) { if (oldTask != null) { mAtmService.notifyTaskPersisterLocked(oldTask, false); } if (newTask != null) { mAtmService.notifyTaskPersisterLocked(newTask, false); } } if (oldParent == null && newParent != null) { // First time we are adding the activity to the system. mVoiceInteraction = newTask.voiceSession != null; // TODO(b/36505427): Maybe this call should be moved inside // updateOverrideConfiguration() newTask.updateOverrideConfigurationFromLaunchBounds(); // When an activity is started directly into a split-screen fullscreen root task, we // need to update the initial multi-window modes so that the callbacks are scheduled // correctly when the user leaves that mode. mLastReportedMultiWindowMode = inMultiWindowMode(); mLastReportedPictureInPictureMode = inPinnedWindowingMode(); } // When the associated task is {@code null}, the {@link ActivityRecord} can no longer // access visual elements like the {@link DisplayContent}. We must remove any associations // such as animations. if (task == null) { // It is possible we have been marked as a closing app earlier. We must remove ourselves // from this list so we do not participate in any future animations. if (getDisplayContent() != null) { getDisplayContent().mClosingApps.remove(this); } } final Task rootTask = getRootTask(); updateAnimatingActivityRegistry(); if (task == mLastParentBeforePip && task != null) { // Notify the TaskFragmentOrganizer that the activity is reparented back from pip. mAtmService.mWindowOrganizerController.mTaskFragmentOrganizerController .onActivityReparentToTask(this); // Activity's reparented back from pip, clear the links once established clearLastParentBeforePip(); } updateColorTransform(); if (oldParent != null) { oldParent.cleanUpActivityReferences(this); } if (newParent != null && isState(RESUMED)) { newParent.setResumedActivity(this, "onParentChanged"); if (mStartingWindow != null && mStartingData != null && mStartingData.mAssociatedTask == null && newParent.isEmbedded()) { // The starting window should keep covering its task when the activity is // reparented to a task fragment that may not fill the task bounds. associateStartingDataWithTask(); attachStartingSurfaceToAssociatedTask(); } mImeInsetsFrozenUntilStartInput = false; } if (rootTask != null && rootTask.topRunningActivity() == this) { // make ensure the TaskOrganizer still works after re-parenting if (firstWindowDrawn) { rootTask.setHasBeenVisible(true); } } // Update the input mode if the embedded mode is changed. updateUntrustedEmbeddingInputProtection(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onParentChanged 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
onParentChanged
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@GuardedBy("getLockObject()") private List<ActiveAdmin> getActiveAdminsForAffectedUserInclPermissionBasedAdminLocked( int userHandle) { List<ActiveAdmin> list; if (isManagedProfile(userHandle)) { list = getUserDataUnchecked(userHandle).mAdminList; } list = getActiveAdminsForUserAndItsManagedProfilesInclPermissionBasedAdminLocked(userHandle, /* shouldIncludeProfileAdmins */ (user) -> false); if (getUserData(userHandle).mPermissionBasedAdmin != null) { list.add(getUserData(userHandle).mPermissionBasedAdmin); } return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveAdminsForAffectedUserInclPermissionBasedAdminLocked 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
getActiveAdminsForAffectedUserInclPermissionBasedAdminLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public static String htmlEncode(String source) { if (source == null) { return ""; } String html; StringBuilder buffer = new StringBuilder(); for (int i = 0; i < source.length(); i++) { char c = source.charAt(i); switch (c) { case '<': buffer.append("&lt;"); break; case '>': buffer.append("&gt;"); break; case '&': buffer.append("&amp;"); break; case '"': buffer.append("&quot;"); break; case 10: case 13: break; default: buffer.append(c); } } html = buffer.toString(); return html; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: htmlEncode File: common/src/main/java/com/zrlog/web/util/WebTools.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21316
MEDIUM
4.3
94fzb/zrlog
htmlEncode
common/src/main/java/com/zrlog/web/util/WebTools.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
@Override public boolean isRuntimePermission(String permission) { try { PermissionInfo info = mActivityManagerService.mContext.getPackageManager() .getPermissionInfo(permission, 0); return (info.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE) == PermissionInfo.PROTECTION_DANGEROUS; } catch (NameNotFoundException nnfe) { Slog.e(TAG, "No such permission: "+ permission, nnfe); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRuntimePermission 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
isRuntimePermission
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override protected void finalize() { if(DBG) log("finalize"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finalize File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
finalize
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public static void init(@NonNull ObservableFragment host) { host.getLifecycle().addObserver(new SearchMenuController(host)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: src/com/android/settings/search/actionbar/SearchMenuController.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
init
src/com/android/settings/search/actionbar/SearchMenuController.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
public List<String> getCommandLine( String executable, String[] arguments ) { return getRawCommandLine( executable, arguments ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCommandLine File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
getCommandLine
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
@Override public List<TxFateReport> getTxPktFates() { return mWifiNative.getTxPktFates(mInterfaceName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTxPktFates 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
getTxPktFates
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public int getSimpleViewerPreferences() { return PdfViewerPreferencesImp.getViewerPreferences(catalog).getPageLayoutAndMode(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSimpleViewerPreferences File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getSimpleViewerPreferences
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilocale, boolean resetHistory, boolean overwrite) throws XWikiException { // In order to copy the source document the user must have at least the right to view it. if (hasAccessLevel("view", getDefaultStringEntityReferenceSerializer().serialize(sourceDocumentReference))) { String targetDocStringRef = getDefaultStringEntityReferenceSerializer().serialize(targetDocumentReference); // To create the target document the user must have edit rights. If the target document exists and the user // wants to overwrite it then he needs delete right. // Note: We have to check if the target document exists before checking the delete right because delete // right is denied if not explicitly specified. if (hasAccessLevel("edit", targetDocStringRef) && (!overwrite || !exists(targetDocumentReference) || hasAccessLevel("delete", targetDocStringRef))) { // Reset creation data otherwise the required rights for page copy need to be reconsidered. return this.xwiki.copyDocument(sourceDocumentReference, targetDocumentReference, wikilocale, resetHistory, overwrite, true, getXWikiContext()); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyDocument 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
copyDocument
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
private boolean updateDisplayOverrideConfigurationLocked(Configuration values, ActivityRecord starting, boolean deferResume, int displayId, UpdateConfigurationResult result) { int changes = 0; boolean kept = true; if (mWindowManager != null) { mWindowManager.deferSurfaceLayout(); } try { if (values != null) { if (displayId == DEFAULT_DISPLAY) { // Override configuration of the default display duplicates global config, so // we're calling global config update instead for default display. It will also // apply the correct override config. changes = updateGlobalConfigurationLocked(values, false /* initLocale */, false /* persistent */, UserHandle.USER_NULL /* userId */, deferResume); } else { changes = performDisplayOverrideConfigUpdate(values, deferResume, displayId); } } kept = ensureConfigAndVisibilityAfterUpdate(starting, changes); } finally { if (mWindowManager != null) { mWindowManager.continueSurfaceLayout(); } } if (result != null) { result.changes = changes; result.activityRelaunched = !kept; } return kept; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDisplayOverrideConfigurationLocked 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
updateDisplayOverrideConfigurationLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@FrameIteratorSkip private final float invokeExact_thunkArchetype_F(Object receiver, int argPlaceholder) { return ComputedCalls.dispatchVirtual_F(jittedMethodAddress(receiver), vtableIndexArgument(receiver), receiver, argPlaceholder); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invokeExact_thunkArchetype_F File: jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java Repository: eclipse-openj9/openj9 The code follows secure coding practices.
[ "CWE-440", "CWE-250" ]
CVE-2021-41035
HIGH
7.5
eclipse-openj9/openj9
invokeExact_thunkArchetype_F
jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java
c6e0d9296ff9a3084965d83e207403de373c0bad
0
Analyze the following code function for security vulnerabilities
protected JsonDeserializer<?> _findCustomMapDeserializer(MapType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { for (Deserializers d : _factoryConfig.deserializers()) { JsonDeserializer<?> deser = d.findMapDeserializer(type, config, beanDesc, keyDeserializer, elementTypeDeserializer, elementDeserializer); if (deser != null) { return deser; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _findCustomMapDeserializer File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
_findCustomMapDeserializer
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@Bean public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() { return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(ZoneId.systemDefault().toString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jacksonObjectMapperCustomization File: console/src/main/java/com/alibaba/nacos/console/config/ConsoleConfig.java Repository: alibaba/nacos The code follows secure coding practices.
[ "CWE-290" ]
CVE-2021-29441
HIGH
7.5
alibaba/nacos
jacksonObjectMapperCustomization
console/src/main/java/com/alibaba/nacos/console/config/ConsoleConfig.java
91d16023d91ea21a5e58722c751485a0b9bbeeb3
0
Analyze the following code function for security vulnerabilities
private void sendResponse(HttpServletResponse pResp, String pContentType, String pJsonTxt) throws IOException { setContentType(pResp, pContentType); pResp.setStatus(200); setNoCacheHeaders(pResp); PrintWriter writer = pResp.getWriter(); writer.write(pJsonTxt); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendResponse File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
sendResponse
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
public void setReadyState(final String state) { readyState_ = state; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setReadyState File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
setReadyState
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@Override public boolean switchUser(ComponentName who, UserHandle userHandle) { Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SWITCH_USER); boolean switched = false; // Save previous logout user id in case of failure int logoutUserId = getLogoutUserIdUnchecked(); synchronized (getLockObject()) { long id = mInjector.binderClearCallingIdentity(); try { int userId = UserHandle.USER_SYSTEM; if (userHandle != null) { userId = userHandle.getIdentifier(); } Slogf.i(LOG_TAG, "Switching to user %d (logout user is %d)", userId, logoutUserId); setLogoutUserIdLocked(UserHandle.USER_CURRENT); switched = mInjector.getIActivityManager().switchUser(userId); if (!switched) { Slogf.w(LOG_TAG, "Failed to switch to user %d", userId); } else { Slogf.d(LOG_TAG, "Switched"); } return switched; } catch (RemoteException e) { Slogf.e(LOG_TAG, "Couldn't switch user", e); return false; } finally { mInjector.binderRestoreCallingIdentity(id); if (!switched) { setLogoutUserIdLocked(logoutUserId); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchUser 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
switchUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected boolean validateServiceKexState(KexState state) { if (KexState.DONE.equals(state)) { return true; } else if (KexState.INIT.equals(state)) { // Allow service requests that were "in flight" when we sent our own KEX_INIT. We will send back the accept // only after KEX is done. However, we will refuse a service request before the initial KEX. return initialKexDone; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateServiceKexState File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
validateServiceKexState
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
public static CertEnrollmentRequest fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element profileElement = document.getDocumentElement(); return fromDOM(profileElement); }
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/cert/CertEnrollmentRequest.java Repository: dogtagpki/pki Fixed Code: public static CertEnrollmentRequest 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 profileElement = document.getDocumentElement(); return fromDOM(profileElement); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromXML
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
public String getPublicId() { return fCurrentEntity != null ? fCurrentEntity.publicId : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPublicId 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
getPublicId
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
void deleteIssue(String id);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteIssue File: framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
deleteIssue
framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { char[] s = new char[length()]; getChars(0, length(), s, 0); return new String(s); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
toString
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
public boolean bindDeviceAdminServiceAsUser(@NonNull ComponentName admin, @NonNull Intent serviceIntent, @NonNull ServiceConnection conn, @NonNull Context.BindServiceFlags flags, @NonNull UserHandle targetUser) { throwIfParentInstance("bindDeviceAdminServiceAsUser"); // Keep this in sync with ContextImpl.bindServiceCommon. try { final IServiceConnection sd = mContext.getServiceDispatcher( conn, mContext.getMainThreadHandler(), flags.getValue()); serviceIntent.prepareToLeaveProcess(mContext); return mService.bindDeviceAdminServiceAsUser(admin, mContext.getIApplicationThread(), mContext.getActivityToken(), serviceIntent, sd, flags.getValue(), targetUser.getIdentifier()); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindDeviceAdminServiceAsUser File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
bindDeviceAdminServiceAsUser
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Test public void retrieveUsername(TestUtils testUtils) { String user = "realuser"; String userMail = "realuser@host.org"; // We need to login as superadmin to set the user email. testUtils.loginAsSuperAdmin(); testUtils.createUser(user, "realuserpwd", testUtils.getURLToNonExistentPage(), "email", userMail); testUtils.forceGuestUser(); ForgotUsernamePage forgotUsernamePage = ForgotUsernamePage.gotoPage(); forgotUsernamePage.setEmail(userMail); ForgotUsernameCompletePage forgotUsernameCompletePage = forgotUsernamePage.clickRetrieveUsername(); assertFalse(forgotUsernameCompletePage.isAccountNotFound()); assertTrue(forgotUsernameCompletePage.isUsernameRetrieved(user)); // Bypass the check that prevents to reload the current page testUtils.gotoPage(testUtils.getURLToNonExistentPage()); // test that bad mail results in no results forgotUsernamePage = ForgotUsernamePage.gotoPage(); forgotUsernamePage.setEmail("bad_mail@evil.com"); forgotUsernameCompletePage = forgotUsernamePage.clickRetrieveUsername(); assertTrue(forgotUsernameCompletePage.isAccountNotFound()); assertFalse(forgotUsernameCompletePage.isUsernameRetrieved(user)); // Bypass the check that prevents to reload the current page testUtils.gotoPage(testUtils.getURLToNonExistentPage()); // XWIKI-4920 test that the email is properly escaped forgotUsernamePage = ForgotUsernamePage.gotoPage(); forgotUsernamePage.setEmail("a' synta\\'x error"); forgotUsernameCompletePage = forgotUsernamePage.clickRetrieveUsername(); assertTrue(forgotUsernameCompletePage.isAccountNotFound()); assertFalse(forgotUsernameCompletePage.isUsernameRetrieved(user)); }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2021-32732 - Severity: MEDIUM - CVSS Score: 4.3 Description: XWIKI-18384: Improve ForgotUsername process * Ensure to send an email to users in case of forgot username request * Improve test (cherry picked from commit 21f8780680bbdea19e97c7caf63fdc1cfb2096db) Function: retrieveUsername File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/ForgotUsernameIT.java Repository: xwiki/xwiki-platform Fixed Code: @Test public void retrieveUsername(TestUtils testUtils) throws Exception { // We create three users, two of them are sharing the same email String user1Login = "realuser1"; String user1Email = "realuser@host.org"; String user2Login = "realuser2"; String user2Email = "realuser@host.org"; String user3Login = "foo"; String user3Email = "foo@host.org"; // We need to login as superadmin to set the user email. testUtils.loginAsSuperAdmin(); testUtils.createUser(user1Login, "realuserpwd", testUtils.getURLToNonExistentPage(), "email", user1Email); testUtils.createUser(user2Login, "realuserpwd", testUtils.getURLToNonExistentPage(), "email", user2Email); testUtils.createUser(user3Login, "realuserpwd", testUtils.getURLToNonExistentPage(), "email", user3Email); testUtils.forceGuestUser(); // check that when asking to retrieve username with a wrong email we don't get any information // if an user exists or not and no email is sent. ForgotUsernamePage forgotUsernamePage = ForgotUsernamePage.gotoPage(); forgotUsernamePage.setEmail("notexistant@xwiki.com"); ForgotUsernameCompletePage forgotUsernameCompletePage = forgotUsernamePage.clickRetrieveUsername(); assertTrue(forgotUsernameCompletePage.isForgotUsernameQuerySent()); // we are waiting 5 sec here just to be sure no mail is sent, maybe we could decrease the timeout value, // not sure. assertFalse(this.mail.waitForIncomingEmail(1)); // Bypass the check that prevents to reload the current page testUtils.gotoPage(testUtils.getURLToNonExistentPage()); // test getting email for a forgot username request where the email is set in one account only forgotUsernamePage = ForgotUsernamePage.gotoPage(); forgotUsernamePage.setEmail(user3Email); forgotUsernameCompletePage = forgotUsernamePage.clickRetrieveUsername(); assertTrue(forgotUsernameCompletePage.isForgotUsernameQuerySent()); assertTrue(this.mail.waitForIncomingEmail(1)); MimeMessage[] receivedEmails = this.mail.getReceivedMessages(); assertEquals(1, receivedEmails.length); MimeMessage receivedEmail = receivedEmails[0]; assertTrue(receivedEmail.getSubject().contains("Forgot username on")); String receivedMailContent = getMessageContent(receivedEmail).get("textPart"); assertTrue(receivedMailContent.contains(String.format("XWiki.%s", user3Login))); // remove mails for last test this.mail.purgeEmailFromAllMailboxes(); // Bypass the check that prevents to reload the current page testUtils.gotoPage(testUtils.getURLToNonExistentPage()); // test getting email for a forgot username request where the email is set in two accounts forgotUsernamePage = ForgotUsernamePage.gotoPage(); forgotUsernamePage.setEmail(user1Email); forgotUsernameCompletePage = forgotUsernamePage.clickRetrieveUsername(); assertTrue(forgotUsernameCompletePage.isForgotUsernameQuerySent()); assertTrue(this.mail.waitForIncomingEmail(1)); receivedEmails = this.mail.getReceivedMessages(); assertEquals(1, receivedEmails.length); receivedEmail = receivedEmails[0]; assertTrue(receivedEmail.getSubject().contains("Forgot username on")); receivedMailContent = getMessageContent(receivedEmail).get("textPart"); assertTrue(receivedMailContent.contains(String.format("XWiki.%s", user1Login))); assertTrue(receivedMailContent.contains(String.format("XWiki.%s", user2Login))); }
[ "CWE-352" ]
CVE-2021-32732
MEDIUM
4.3
xwiki/xwiki-platform
retrieveUsername
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/ForgotUsernameIT.java
f0440dfcbba705e03f7565cd88893dde57ca3fa8
1
Analyze the following code function for security vulnerabilities
public static Authentication getAuthentication() { Authentication a = SecurityContextHolder.getContext().getAuthentication(); // on Tomcat while serving the login page, this is null despite the fact // that we have filters. Looking at the stack trace, Tomcat doesn't seem to // run the request through filters when this is the login request. // see http://www.nabble.com/Matrix-authorization-problem-tp14602081p14886312.html if(a==null) a = ANONYMOUS; return a; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthentication File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getAuthentication
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
protected static boolean isDecimalNotation(final String val) { return val.indexOf('.') > -1 || val.indexOf('e') > -1 || val.indexOf('E') > -1 || "-0".equals(val); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDecimalNotation File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
isDecimalNotation
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public int getPreExpandValueSetsMaxCount() { return myPreExpandValueSetsMaxCount; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPreExpandValueSetsMaxCount File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
getPreExpandValueSetsMaxCount
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
public ObjectOutputStream createObjectOutputStream(OutputStream out, String rootNodeName) throws IOException { return createObjectOutputStream(hierarchicalStreamDriver.createWriter(out), rootNodeName); }
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
@TestApi @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @RequiresPermission(allOf = { MANAGE_DEVICE_ADMINS, INTERACT_ACROSS_USERS_FULL }) public void setActiveAdmin(@NonNull ComponentName policyReceiver, boolean refreshing, int userHandle) { if (mService != null) { try { mService.setActiveAdmin(policyReceiver, refreshing, userHandle); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActiveAdmin File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setActiveAdmin
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void destroy() { //nothing }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroy File: apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/filter/ConsumerAuthenticationFilter.java Repository: apolloconfig/apollo The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-15170
MEDIUM
6.8
apolloconfig/apollo
destroy
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/filter/ConsumerAuthenticationFilter.java
ae9ba6cfd32ed80469f162e5e3583e2477862ddf
0
Analyze the following code function for security vulnerabilities
static boolean comparePermissionInfos(PermissionInfo pi1, PermissionInfo pi2) { if (pi1.icon != pi2.icon) return false; if (pi1.logo != pi2.logo) return false; if (pi1.protectionLevel != pi2.protectionLevel) return false; if (!compareStrings(pi1.name, pi2.name)) return false; if (!compareStrings(pi1.nonLocalizedLabel, pi2.nonLocalizedLabel)) return false; // We'll take care of setting this one. if (!compareStrings(pi1.packageName, pi2.packageName)) return false; // These are not currently stored in settings. //if (!compareStrings(pi1.group, pi2.group)) return false; //if (!compareStrings(pi1.nonLocalizedDescription, pi2.nonLocalizedDescription)) return false; //if (pi1.labelRes != pi2.labelRes) return false; //if (pi1.descriptionRes != pi2.descriptionRes) return false; return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: comparePermissionInfos 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
comparePermissionInfos
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
void notifyActivityPinnedLocked() { mHandler.removeMessages(NOTIFY_ACTIVITY_PINNED_LISTENERS_MSG); mHandler.obtainMessage(NOTIFY_ACTIVITY_PINNED_LISTENERS_MSG).sendToTarget(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyActivityPinnedLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
notifyActivityPinnedLocked
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private Publisher<Object> buildCacheablePublisher( MethodInvocationContext<Object, Object> context, ReturnType returnTypeObject, CacheOperation cacheOperation, AnnotationValue<Cacheable> cacheable) { AsyncCache<?> asyncCache = cacheManager.getCache(cacheOperation.cacheableCacheName).async(); CacheKeyGenerator keyGenerator = resolveKeyGenerator(cacheOperation.defaultKeyGenerator, cacheable); Object[] params = resolveParams(context, cacheable.get(MEMBER_PARAMETERS, String[].class, StringUtils.EMPTY_STRING_ARRAY)); Object key = keyGenerator.generateKey(context, params); Argument<?> firstTypeVariable = returnTypeObject.getFirstTypeVariable().orElse(Argument.of(Object.class)); Maybe<Object> maybe = Maybe.create(emitter -> { asyncCache.get(key, firstTypeVariable).whenComplete((opt, throwable) -> { if (throwable != null) { if (errorHandler.handleLoadError(asyncCache, key, asRuntimeException(throwable))) { emitter.onError(throwable); } else { emitter.onComplete(); } emitter.onError(throwable); } else if (opt.isPresent()) { if (LOG.isDebugEnabled()) { LOG.debug("Value found in cache [" + asyncCache.getName() + "] for invocation: " + context); } emitter.onSuccess(opt.get()); } else { emitter.onComplete(); } }); }); return maybe.isEmpty().flatMapPublisher(empty -> { if (empty) { return Publishers.convertPublisher( context.proceed(), Flowable.class) .flatMap(o -> { return Single.create(emitter -> { asyncCache.put(key, o).whenComplete((aBoolean, throwable1) -> { if (throwable1 == null) { emitter.onSuccess(o); } else { if (errorHandler.handleLoadError(asyncCache, key, asRuntimeException(throwable1))) { emitter.onError(throwable1); } else { emitter.onSuccess(o); } } }); }).toFlowable(); }); } else { return maybe.toFlowable(); } }); }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2022-21700 - Severity: MEDIUM - CVSS Score: 5.0 Description: Use ConversionContext constants where possible instead of class (#2356) Changes ------- * Added ArgumentConversionContext constants in ConversionContext * Replaced Argument.of and use of argument classes with ConversionContext constants where possible * Added getFirst method in ConvertibleMultiValues that accepts ArgumentConversionContent parameter Partially addresses issue #2355 Function: buildCacheablePublisher File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core Fixed Code: private Publisher<Object> buildCacheablePublisher( MethodInvocationContext<Object, Object> context, ReturnType returnTypeObject, CacheOperation cacheOperation, AnnotationValue<Cacheable> cacheable) { AsyncCache<?> asyncCache = cacheManager.getCache(cacheOperation.cacheableCacheName).async(); CacheKeyGenerator keyGenerator = resolveKeyGenerator(cacheOperation.defaultKeyGenerator, cacheable); Object[] params = resolveParams(context, cacheable.get(MEMBER_PARAMETERS, String[].class, StringUtils.EMPTY_STRING_ARRAY)); Object key = keyGenerator.generateKey(context, params); Argument<?> firstTypeVariable = returnTypeObject.getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT); Maybe<Object> maybe = Maybe.create(emitter -> { asyncCache.get(key, firstTypeVariable).whenComplete((opt, throwable) -> { if (throwable != null) { if (errorHandler.handleLoadError(asyncCache, key, asRuntimeException(throwable))) { emitter.onError(throwable); } else { emitter.onComplete(); } emitter.onError(throwable); } else if (opt.isPresent()) { if (LOG.isDebugEnabled()) { LOG.debug("Value found in cache [" + asyncCache.getName() + "] for invocation: " + context); } emitter.onSuccess(opt.get()); } else { emitter.onComplete(); } }); }); return maybe.isEmpty().flatMapPublisher(empty -> { if (empty) { return Publishers.convertPublisher( context.proceed(), Flowable.class) .flatMap(o -> { return Single.create(emitter -> { asyncCache.put(key, o).whenComplete((aBoolean, throwable1) -> { if (throwable1 == null) { emitter.onSuccess(o); } else { if (errorHandler.handleLoadError(asyncCache, key, asRuntimeException(throwable1))) { emitter.onError(throwable1); } else { emitter.onSuccess(o); } } }); }).toFlowable(); }); } else { return maybe.toFlowable(); } }); }
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
buildCacheablePublisher
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
1
Analyze the following code function for security vulnerabilities
public static void startWebServer(Connection conn, boolean ignoreProperties) throws SQLException { WebServer webServer = new WebServer(); String[] args; if (ignoreProperties) { args = new String[] { "-webPort", "0", "-properties", "null"}; } else { args = new String[] { "-webPort", "0" }; } Server web = new Server(webServer, args); web.start(); Server server = new Server(); server.web = web; webServer.setShutdownHandler(server); String url = webServer.addSession(conn); try { Server.openBrowser(url); while (!webServer.isStopped()) { Thread.sleep(1000); } } catch (Exception e) { // ignore } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startWebServer File: h2/src/main/org/h2/tools/Server.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
startWebServer
h2/src/main/org/h2/tools/Server.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public boolean isLockTaskPermitted(String pkg) { // Check policy-exempt apps first, as it doesn't require the lock if (listPolicyExemptAppsUnchecked().contains(pkg)) { if (VERBOSE_LOG) { Slogf.v(LOG_TAG, "isLockTaskPermitted(%s): returning true for policy-exempt app", pkg); } return true; } final int userId = mInjector.userHandleGetCallingUserId(); synchronized (getLockObject()) { return getUserData(userId).mLockTaskPackages.contains(pkg); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLockTaskPermitted 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
isLockTaskPermitted
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public DirectoryEntries getSubDirectory() { return subDirectory; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSubDirectory File: common/src/main/java/com/thoughtworks/go/domain/FolderDirectoryEntry.java Repository: gocd The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-43288
LOW
3.5
gocd
getSubDirectory
common/src/main/java/com/thoughtworks/go/domain/FolderDirectoryEntry.java
f5c1d2aa9ab302a97898a6e4b16218e64fe8e9e4
0
Analyze the following code function for security vulnerabilities
@GuardedBy({"mPm.mInstallLock", "mPm.mLock"}) private AndroidPackage scanSystemPackageLI(File scanFile, int parseFlags, int scanFlags, UserHandle user) throws PackageManagerException { if (DEBUG_INSTALL) Slog.d(TAG, "Parsing: " + scanFile); Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "parsePackage"); final ParsedPackage parsedPackage; try (PackageParser2 pp = mPm.mInjector.getScanningPackageParser()) { parsedPackage = pp.parsePackage(scanFile, parseFlags, false); } finally { Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); } // Static shared libraries have synthetic package names if (parsedPackage.isStaticSharedLibrary()) { PackageManagerService.renameStaticSharedLibraryPackage(parsedPackage); } return addForInitLI(parsedPackage, parseFlags, scanFlags, user); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scanSystemPackageLI File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
scanSystemPackageLI
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public List<String> getChildren() throws XWikiException { return this.doc.getChildren(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChildren File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getChildren
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public FormValidation doCheckNumExecutors(@QueryParameter String value) { return FormValidation.validateNonNegativeInteger(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doCheckNumExecutors File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
doCheckNumExecutors
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@Override void updateAboveInsetsState(InsetsState aboveInsetsState, SparseArray<InsetsSourceProvider> localInsetsSourceProvidersFromParent, ArraySet<WindowState> insetsChangedWindows) { SparseArray<InsetsSourceProvider> mergedLocalInsetsSourceProviders = localInsetsSourceProvidersFromParent; if (mLocalInsetsSourceProviders != null && mLocalInsetsSourceProviders.size() != 0) { mergedLocalInsetsSourceProviders = createShallowCopy(mergedLocalInsetsSourceProviders); for (int i = 0; i < mLocalInsetsSourceProviders.size(); i++) { mergedLocalInsetsSourceProviders.put( mLocalInsetsSourceProviders.keyAt(i), mLocalInsetsSourceProviders.valueAt(i)); } } final SparseArray<InsetsSource> mergedLocalInsetsSourcesFromParent = toInsetsSources(mergedLocalInsetsSourceProviders); // Insets provided by the IME window can effect all the windows below it and hence it needs // to be visited in the correct order. Because of which updateAboveInsetsState() can't be // used here and instead forAllWindows() is used. forAllWindows(w -> { if (!w.mAboveInsetsState.equals(aboveInsetsState)) { w.mAboveInsetsState.set(aboveInsetsState); insetsChangedWindows.add(w); } if (!mergedLocalInsetsSourcesFromParent.contentEquals(w.mMergedLocalInsetsSources)) { w.mMergedLocalInsetsSources = createShallowCopy( mergedLocalInsetsSourcesFromParent); insetsChangedWindows.add(w); } final SparseArray<InsetsSource> providedSources = w.mProvidedInsetsSources; if (providedSources != null) { for (int i = providedSources.size() - 1; i >= 0; i--) { aboveInsetsState.addSource(providedSources.valueAt(i)); } } }, true /* traverseTopToBottom */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAboveInsetsState 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
updateAboveInsetsState
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); TextUtils.writeToParcel(msg, data, 0); data.writeInt(always ? 1 : 0); mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showBootMessage File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
showBootMessage
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public Jooby on(final String env1, final String env2, final String env3, final Runnable callback) { on(envpredicate(env1).or(envpredicate(env2)).or(envpredicate(env3)), callback); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: on 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
on
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Deprecated public List<String> getSpaceDocsName(String spaceReference) throws XWikiException { return this.xwiki.getSpaceDocsName(spaceReference, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpaceDocsName 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
getSpaceDocsName
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
protected void sendRawPdu(SmsTracker tracker) { HashMap map = tracker.getData(); byte pdu[] = (byte[]) map.get("pdu"); if (mSmsSendDisabled) { Rlog.e(TAG, "Device does not support sending sms."); tracker.onFailed(mContext, RESULT_ERROR_NO_SERVICE, 0/*errorCode*/); return; } if (pdu == null) { Rlog.e(TAG, "Empty PDU"); tracker.onFailed(mContext, RESULT_ERROR_NULL_PDU, 0/*errorCode*/); return; } // Get calling app package name via UID from Binder call PackageManager pm = mContext.getPackageManager(); String[] packageNames = pm.getPackagesForUid(Binder.getCallingUid()); if (packageNames == null || packageNames.length == 0) { // Refuse to send SMS if we can't get the calling package name. Rlog.e(TAG, "Can't get calling app package name: refusing to send SMS"); tracker.onFailed(mContext, RESULT_ERROR_GENERIC_FAILURE, 0/*errorCode*/); return; } // Get package info via packagemanager PackageInfo appInfo; try { // XXX this is lossy- apps can share a UID appInfo = pm.getPackageInfo(packageNames[0], PackageManager.GET_SIGNATURES); } catch (PackageManager.NameNotFoundException e) { Rlog.e(TAG, "Can't get calling app package info: refusing to send SMS"); tracker.onFailed(mContext, RESULT_ERROR_GENERIC_FAILURE, 0/*errorCode*/); return; } // checkDestination() returns true if the destination is not a premium short code or the // sending app is approved to send to short codes. Otherwise, a message is sent to our // handler with the SmsTracker to request user confirmation before sending. if (checkDestination(tracker)) { // check for excessive outgoing SMS usage by this app if (!mUsageMonitor.check(appInfo.packageName, SINGLE_PART_SMS)) { sendMessage(obtainMessage(EVENT_SEND_LIMIT_REACHED_CONFIRMATION, tracker)); return; } sendSms(tracker); } if (PhoneNumberUtils.isLocalEmergencyNumber(mContext, tracker.mDestAddress)) { new AsyncEmergencyContactNotifier(mContext).execute(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendRawPdu File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3883
MEDIUM
4.3
android
sendRawPdu
src/java/com/android/internal/telephony/SMSDispatcher.java
b2c89e6f8962dc7aff88cb38aa3ee67d751edda9
0
Analyze the following code function for security vulnerabilities
int getResourceArray(@ArrayRes int resId, @NonNull int[] outData) { Objects.requireNonNull(outData, "outData"); synchronized (this) { ensureValidLocked(); return nativeGetResourceArray(mObject, resId, outData); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceArray File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getResourceArray
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setOrganizationColor(@NonNull ComponentName admin, int color) { throwIfParentInstance("setOrganizationColor"); try { // always enforce alpha channel to have 100% opacity color |= 0xFF000000; mService.setOrganizationColor(admin, color); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOrganizationColor File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setOrganizationColor
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private boolean checkKeyIntentParceledCorrectly(Bundle bundle) { Parcel p = Parcel.obtain(); p.writeBundle(bundle); p.setDataPosition(0); Bundle simulateBundle = p.readBundle(); p.recycle(); Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT); if (intent != null && intent.getClass() != Intent.class) { return false; } Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent == null) { return (simulateIntent == null); } if (!intent.filterEquals(simulateIntent)) { return false; } if (intent.getSelector() != simulateIntent.getSelector()) { return false; } int prohibitedFlags = Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION; return (simulateIntent.getFlags() & prohibitedFlags) == 0; }
Vulnerability Classification: - CWE: CWE-Other, CWE-502 - CVE: CVE-2023-45777 - Severity: HIGH - CVSS Score: 7.8 Description: Stop using deprecated getParcelable method in AccountManagerService. Test: N/A Bug: 299930871 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7a24a283a360e816d2bfb2aa124c4eb2efd1be61) Merged-In: I5a55acffe2e9ef2842c383a352b0bac66c6f1a55 Change-Id: I5a55acffe2e9ef2842c383a352b0bac66c6f1a55 Function: checkKeyIntentParceledCorrectly File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android Fixed Code: private boolean checkKeyIntentParceledCorrectly(Bundle bundle) { Parcel p = Parcel.obtain(); p.writeBundle(bundle); p.setDataPosition(0); Bundle simulateBundle = p.readBundle(); p.recycle(); Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent != null && intent.getClass() != Intent.class) { return false; } Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent == null) { return (simulateIntent == null); } if (!intent.filterEquals(simulateIntent)) { return false; } if (intent.getSelector() != simulateIntent.getSelector()) { return false; } int prohibitedFlags = Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION; return (simulateIntent.getFlags() & prohibitedFlags) == 0; }
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
checkKeyIntentParceledCorrectly
services/core/java/com/android/server/accounts/AccountManagerService.java
f4644b55d36a549710ba35b6fb797ba744807da6
1
Analyze the following code function for security vulnerabilities
private void scheduleDexBuild(String filename, String smali) { try { if (mBuildError.get() != null) { return; } if (!buildSourcesRaw(filename) && !buildSourcesSmali(smali, filename)) { LOGGER.warning("Could not find sources"); } } catch (AndrolibException e) { mBuildError.compareAndSet(null, e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleDexBuild 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
scheduleDexBuild
brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
private boolean hostsPackageForUser(String pkg, int userId) { final int N = widgets.size(); for (int i = 0; i < N; i++) { Provider provider = widgets.get(i).provider; if (provider != null && provider.getUserId() == userId && provider.info != null && pkg.equals(provider.info.provider.getPackageName())) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hostsPackageForUser File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
hostsPackageForUser
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public List<PhoneAccountHandle> getAllPhoneAccountHandles() { synchronized (mLock) { try { return filterForAccountsVisibleToCaller( mPhoneAccountRegistrar.getAllPhoneAccountHandles()); } catch (Exception e) { Log.e(this, e, "getAllPhoneAccounts"); throw e; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllPhoneAccountHandles File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
getAllPhoneAccountHandles
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
public static MappedByteBuffer map(File file) throws IOException { checkNotNull(file); return map(file, MapMode.READ_ONLY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: map File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
map
android/guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
public static ThreadGroupMap sortThreadsAndGetGroupMap(ThreadInfo[] list) { ThreadGroupMap sorter = new ThreadGroupMap(); Arrays.sort(list, sorter); return sorter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sortThreadsAndGetGroupMap File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
sortThreadsAndGetGroupMap
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public void stopConversationContext(HttpServletRequest request) { deactivateConversationContext(request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopConversationContext File: impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java Repository: weld/core The code follows secure coding practices.
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
stopConversationContext
impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
8e413202fa1af08c09c580f444e4fd16874f9c65
0
Analyze the following code function for security vulnerabilities
public void setAutoTypeSupport(boolean autoTypeSupport) { this.autoTypeSupport = autoTypeSupport; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAutoTypeSupport 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
setAutoTypeSupport
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
public void broadcastPnoScanResultEvent(String iface) { sendMessage(iface, PNO_SCAN_RESULTS_EVENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastPnoScanResultEvent File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
broadcastPnoScanResultEvent
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void setQsScrimEnabled(boolean qsScrimEnabled) { boolean changed = mQsScrimEnabled != qsScrimEnabled; mQsScrimEnabled = qsScrimEnabled; if (changed) { updateQsState(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setQsScrimEnabled File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
setQsScrimEnabled
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public boolean isBackgroundRestricted(String packageName) { final int callingUid = Binder.getCallingUid(); final IPackageManager pm = AppGlobals.getPackageManager(); try { final int packageUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, UserHandle.getUserId(callingUid)); if (packageUid != callingUid) { throw new IllegalArgumentException("Uid " + callingUid + " cannot query restriction state for package " + packageName); } } catch (RemoteException exc) { // Ignore. } return isBackgroundRestrictedNoCheck(callingUid, packageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBackgroundRestricted 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
isBackgroundRestricted
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public String selectHeaderContentType(String[] contentTypes) { if (contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } return contentTypes[0]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectHeaderContentType 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
selectHeaderContentType
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
public Configuration getConfiguration() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); reply.readException(); Configuration res = Configuration.CREATOR.createFromParcel(reply); reply.recycle(); data.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguration File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getConfiguration
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public String buildLockHeaderBox() throws CmsException { StringBuffer html = new StringBuffer(512); // include resource info html.append(dialogBlockStart(null)); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_TITLE_0)); html.append(": "); html.append(getJsp().property("Title", getParamResource(), "")); html.append("<br>\n"); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_STATE_0)); html.append(": "); html.append(getState()); html.append("<br>\n"); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_PERMALINK_0)); html.append(": "); html.append(OpenCms.getLinkManager().getPermalink(getCms(), getParamResource())); html.append(dialogBlockEnd()); return html.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildLockHeaderBox File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
buildLockHeaderBox
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
protected void updateRoamingState() { // Save the roaming state before carrier config possibly overrides it. mNewSS.setDataRoamingFromRegistration(mNewSS.getDataRoaming()); ICarrierConfigLoader configLoader = (ICarrierConfigLoader) ServiceManager.getService(Context.CARRIER_CONFIG_SERVICE); if (configLoader != null) { try { PersistableBundle b = configLoader.getConfigForSubId(mPhone.getSubId()); String systemId = Integer.toString(mNewSS.getSystemId()); if (alwaysOnHomeNetwork(b)) { log("updateRoamingState: carrier config override always on home network"); setRoamingOff(); } else if (isNonRoamingInGsmNetwork(b, mNewSS.getOperatorNumeric()) || isNonRoamingInCdmaNetwork(b, systemId)) { log("updateRoamingState: carrier config override set non-roaming:" + mNewSS.getOperatorNumeric() + ", " + systemId); setRoamingOff(); } else if (isRoamingInGsmNetwork(b, mNewSS.getOperatorNumeric()) || isRoamingInCdmaNetwork(b, systemId)) { log("updateRoamingState: carrier config override set roaming:" + mNewSS.getOperatorNumeric() + ", " + systemId); setRoamingOn(); } } catch (RemoteException e) { loge("updateRoamingState: unable to access carrier config service"); } } else { log("updateRoamingState: no carrier config service available"); } if (Build.IS_DEBUGGABLE && SystemProperties.getBoolean(PROP_FORCE_ROAMING, false)) { mNewSS.setVoiceRoaming(true); mNewSS.setDataRoaming(true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateRoamingState File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
updateRoamingState
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public void doCli(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException { if (!"POST".equals(req.getMethod())) { // for GET request, serve _cli.jelly, assuming this is a browser checkPermission(READ); req.getView(this,"_cli.jelly").forward(req,rsp); return; } // do not require any permission to establish a CLI connection // the actual authentication for the connecting Channel is done by CLICommand UUID uuid = UUID.fromString(req.getHeader("Session")); rsp.setHeader("Hudson-Duplex",""); // set the header so that the client would know FullDuplexHttpChannel server; if(req.getHeader("Side").equals("download")) { duplexChannels.put(uuid,server=new FullDuplexHttpChannel(uuid, !hasPermission(ADMINISTER)) { protected void main(Channel channel) throws IOException, InterruptedException { // capture the identity given by the transport, since this can be useful for SecurityRealm.createCliAuthenticator() channel.setProperty(CLICommand.TRANSPORT_AUTHENTICATION,getAuthentication()); channel.setProperty(CliEntryPoint.class.getName(),new CliManagerImpl(channel)); } }); try { server.download(req,rsp); } finally { duplexChannels.remove(uuid); } } else { duplexChannels.get(uuid).upload(req,rsp); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doCli File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
doCli
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private void setRoamingOn() { mNewSS.setVoiceRoaming(true); mNewSS.setDataRoaming(true); mNewSS.setCdmaEriIconIndex(EriInfo.ROAMING_INDICATOR_ON); mNewSS.setCdmaEriIconMode(EriInfo.ROAMING_ICON_MODE_NORMAL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRoamingOn File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
setRoamingOn
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
@PUT @Path("survey/{nodeId}/configuration") @Operation(summary = "Attach the run-time configuration", description = "This attaches the run-time configuration onto a given survey element") @ApiResponse(responseCode = "200", description = "The test node configuration", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = SurveyConfigVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = SurveyConfigVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or task node not found") @ApiResponse(responseCode = "406", description = "The call is not applicable to survey course node") @ApiResponse(responseCode = "409", description = "The configuration is not valid") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response addSurveyConfiguration(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @QueryParam("allowCancel") @DefaultValue("false") Boolean allowCancel, @QueryParam("allowNavigation") @DefaultValue("false") Boolean allowNavigation, @QueryParam("allowSuspend") @DefaultValue("false") Boolean allowSuspend, @QueryParam("sequencePresentation") @DefaultValue(AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM) String sequencePresentation, @QueryParam("showNavigation") @DefaultValue("true") Boolean showNavigation, @QueryParam("showQuestionTitle") @DefaultValue("true") Boolean showQuestionTitle, @QueryParam("showSectionsOnly") @DefaultValue("false") Boolean showSectionsOnly, @Context HttpServletRequest request) { SurveyFullConfig config = new SurveyFullConfig(allowCancel, allowNavigation, allowSuspend, sequencePresentation, showNavigation, showQuestionTitle, showSectionsOnly); return attachNodeConfig(courseId, nodeId, config, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addSurveyConfiguration File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
addSurveyConfiguration
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_CERTIFICATES, conditional = true) public boolean setKeyPairCertificate(@Nullable ComponentName admin, @NonNull String alias, @NonNull List<Certificate> certs, boolean isUserSelectable) { throwIfParentInstance("setKeyPairCertificate"); try { final byte[] pemCert = Credentials.convertToPem(certs.get(0)); byte[] pemChain = null; if (certs.size() > 1) { pemChain = Credentials.convertToPem( certs.subList(1, certs.size()).toArray(new Certificate[0])); } return mService.setKeyPairCertificate(admin, mContext.getPackageName(), alias, pemCert, pemChain, isUserSelectable); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (CertificateException | IOException e) { Log.w(TAG, "Could not pem-encode certificate", e); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setKeyPairCertificate File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setKeyPairCertificate
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Deprecated public String getxWikiClassXML() { return getXClassXML(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getxWikiClassXML 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
getxWikiClassXML
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
ContentProviderConnection incProviderCountLocked(ProcessRecord r, final ContentProviderRecord cpr, IBinder externalProcessToken, boolean stable) { if (r != null) { for (int i=0; i<r.conProviders.size(); i++) { ContentProviderConnection conn = r.conProviders.get(i); if (conn.provider == cpr) { if (DEBUG_PROVIDER) Slog.v(TAG_PROVIDER, "Adding provider requested by " + r.processName + " from process " + cpr.info.processName + ": " + cpr.name.flattenToShortString() + " scnt=" + conn.stableCount + " uscnt=" + conn.unstableCount); if (stable) { conn.stableCount++; conn.numStableIncs++; } else { conn.unstableCount++; conn.numUnstableIncs++; } return conn; } } ContentProviderConnection conn = new ContentProviderConnection(cpr, r); if (stable) { conn.stableCount = 1; conn.numStableIncs = 1; } else { conn.unstableCount = 1; conn.numUnstableIncs = 1; } cpr.connections.add(conn); r.conProviders.add(conn); startAssociationLocked(r.uid, r.processName, cpr.uid, cpr.name, cpr.info.processName); return conn; } cpr.addExternalProcessHandleLocked(externalProcessToken); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incProviderCountLocked 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
incProviderCountLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
private static void putValueOrJsonNull(JsonObject json, String key, String value) { if (value == null) { json.put(key, Json.createNull()); } else { json.put(key, value); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putValueOrJsonNull File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
putValueOrJsonNull
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
private static boolean isMultiArch(PackageSetting ps) { return (ps.pkgFlags & ApplicationInfo.FLAG_MULTIARCH) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMultiArch 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
isMultiArch
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
final StandardTemplateParams allowTextWithProgress(boolean allowTextWithProgress) { this.mAllowTextWithProgress = allowTextWithProgress; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: allowTextWithProgress File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
allowTextWithProgress
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private void deleteTreesForInodes(List<String> inodes) throws DotDataException { DotConnect db = new DotConnect(); try { final String sInodeIds = StringUtils.join(inodes, ","); // workaround for dbs where we can't have more than one constraint // or triggers db.executeStatement("delete from tree where child in (" + sInodeIds + ") or parent in (" + sInodeIds + ")"); // workaround for dbs where we can't have more than one constraint // or triggers db.executeStatement("delete from multi_tree where child in (" + sInodeIds + ") or parent1 in (" + sInodeIds + ") or parent2 in (" + sInodeIds + ")"); } catch (SQLException e) { throw new DotDataException("Error deleting tree and multi-tree.", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteTreesForInodes File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
deleteTreesForInodes
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
private static SecurityException failedVerification(String jarName, String signatureFile) { throw new SecurityException(jarName + " failed verification of " + signatureFile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: failedVerification File: core/java/android/util/jar/StrictJarVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
failedVerification
core/java/android/util/jar/StrictJarVerifier.java
84df68840b6f2407146e722ebd95a7d8bc6e3529
0
Analyze the following code function for security vulnerabilities
public Builder withBDSState(BDSStateMap val) { bdsState = val; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withBDSState File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
withBDSState
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
public List<X509Certificate> getCertificateChain() { return mCertChain; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertificateChain File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getCertificateChain
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
private String getSecretToken() { return this.secretToken; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecretToken File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getSecretToken
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public void setAction(String action) { this.action = (action != null ? action : ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAction File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
setAction
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
private void parseFeatures(FF4jConfiguration ff4jConfig, Map<String, String> mapConf) { int idx = 0; String currentFeatureKey = FF4J_TAG + "." + FEATURES_TAG + "." + idx; while (mapConf.containsKey(currentFeatureKey + "." + FEATURE_ATT_UID)) { assertKeyNotEmpty(mapConf, currentFeatureKey + "." + FEATURE_ATT_UID); Feature f = new Feature(mapConf.get(currentFeatureKey + "." + FEATURE_ATT_UID)); // Enabled assertKeyNotEmpty(mapConf, currentFeatureKey + "." + FEATURE_ATT_ENABLE); f.setEnable(Boolean.valueOf(mapConf.get(currentFeatureKey + "." + FEATURE_ATT_ENABLE))); // Description String description = mapConf.get(currentFeatureKey + "." + FEATURE_ATT_DESC); if (null != description && !"".equals(description)) { f.setDescription(description); } // Group String groupName = mapConf.get(currentFeatureKey + "." + FEATURE_ATT_GROUP); if (null != groupName && !"".equals(groupName)) { f.setGroup(groupName); } // Permissions String strPermissions = mapConf.get(currentFeatureKey + "." + FEATURE_ATT_PERMISSIONS); if (null != strPermissions && !"".equals(strPermissions)) { f.setPermissions( Arrays.asList(strPermissions.split(",")) .stream() .map(String::trim) .collect(Collectors.toSet())); } // Custom Properties f.setCustomProperties(parseProperties(currentFeatureKey + "." + FEATURE_ATT_PROPERTIES, mapConf)); // FlipStrategy String flipStrategyClass = mapConf.get(currentFeatureKey + "." + TOGGLE_STRATEGY_TAG + "." + TOGGLE_STRATEGY_ATTCLASS); if (null != flipStrategyClass && !"".equals(flipStrategyClass)) { FlippingStrategy flipStrategy = null; try { flipStrategy = (FlippingStrategy) Class.forName(flipStrategyClass).newInstance(); } catch (Exception e) { throw new IllegalArgumentException("Cannot parse flipStrategy for feature '" + f.getUid() + "' -> check key [" + currentFeatureKey + "." + TOGGLE_STRATEGY_TAG + "." + TOGGLE_STRATEGY_ATTCLASS + "]", e); } int idxParam = 0; String currentParamKey = currentFeatureKey + "." + TOGGLE_STRATEGY_TAG + "." + TOGGLE_STRATEGY_PARAMTAG + "." + idxParam; Map<String, String> params = new HashMap<>(); while (mapConf.containsKey(currentParamKey+ "." + TOGGLE_STRATEGY_PARAMNAME)) { assertKeyNotEmpty(mapConf, currentParamKey + "." + TOGGLE_STRATEGY_PARAMNAME); assertKeyNotEmpty(mapConf, currentParamKey + "." + TOGGLE_STRATEGY_PARAMVALUE); params.put(mapConf.get(currentParamKey + "." + TOGGLE_STRATEGY_PARAMNAME), mapConf.get(currentParamKey + "." + TOGGLE_STRATEGY_PARAMVALUE)); currentParamKey = currentFeatureKey + "." + TOGGLE_STRATEGY_TAG + "." + TOGGLE_STRATEGY_PARAMTAG + "." + ++idxParam; } flipStrategy.init(f.getUid(), params); f.setFlippingStrategy(flipStrategy); } ff4jConfig.getFeatures().put(f.getUid(), f); // ff4j.features.X currentFeatureKey = FF4J_TAG + "." + FEATURES_TAG + "." + ++idx; } }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2022-44262 - Severity: CRITICAL - CVSS Score: 9.8 Description: fix: Validate FlippingStrategy in various parsers (#624) Function: parseFeatures File: ff4j-config-properties/src/main/java/org/ff4j/parser/properties/PropertiesParser.java Repository: ff4j Fixed Code: private void parseFeatures(FF4jConfiguration ff4jConfig, Map<String, String> mapConf) { int idx = 0; String currentFeatureKey = FF4J_TAG + "." + FEATURES_TAG + "." + idx; while (mapConf.containsKey(currentFeatureKey + "." + FEATURE_ATT_UID)) { assertKeyNotEmpty(mapConf, currentFeatureKey + "." + FEATURE_ATT_UID); Feature f = new Feature(mapConf.get(currentFeatureKey + "." + FEATURE_ATT_UID)); // Enabled assertKeyNotEmpty(mapConf, currentFeatureKey + "." + FEATURE_ATT_ENABLE); f.setEnable(Boolean.valueOf(mapConf.get(currentFeatureKey + "." + FEATURE_ATT_ENABLE))); // Description String description = mapConf.get(currentFeatureKey + "." + FEATURE_ATT_DESC); if (null != description && !"".equals(description)) { f.setDescription(description); } // Group String groupName = mapConf.get(currentFeatureKey + "." + FEATURE_ATT_GROUP); if (null != groupName && !"".equals(groupName)) { f.setGroup(groupName); } // Permissions String strPermissions = mapConf.get(currentFeatureKey + "." + FEATURE_ATT_PERMISSIONS); if (null != strPermissions && !"".equals(strPermissions)) { f.setPermissions( Arrays.asList(strPermissions.split(",")) .stream() .map(String::trim) .collect(Collectors.toSet())); } // Custom Properties f.setCustomProperties(parseProperties(currentFeatureKey + "." + FEATURE_ATT_PROPERTIES, mapConf)); // FlipStrategy String flipStrategyClass = mapConf.get(currentFeatureKey + "." + TOGGLE_STRATEGY_TAG + "." + TOGGLE_STRATEGY_ATTCLASS); if (null != flipStrategyClass && !"".equals(flipStrategyClass)) { FlippingStrategy flipStrategy = null; try { Class<?> typeClass = Class.forName(flipStrategyClass); if (!FlippingStrategy.class.isAssignableFrom(typeClass)) { throw new IllegalArgumentException("Cannot create flipstrategy <" + flipStrategyClass + "> invalid type"); } flipStrategy = (FlippingStrategy) typeClass.newInstance(); } catch (Exception e) { throw new IllegalArgumentException("Cannot parse flipStrategy for feature '" + f.getUid() + "' -> check key [" + currentFeatureKey + "." + TOGGLE_STRATEGY_TAG + "." + TOGGLE_STRATEGY_ATTCLASS + "]", e); } int idxParam = 0; String currentParamKey = currentFeatureKey + "." + TOGGLE_STRATEGY_TAG + "." + TOGGLE_STRATEGY_PARAMTAG + "." + idxParam; Map<String, String> params = new HashMap<>(); while (mapConf.containsKey(currentParamKey+ "." + TOGGLE_STRATEGY_PARAMNAME)) { assertKeyNotEmpty(mapConf, currentParamKey + "." + TOGGLE_STRATEGY_PARAMNAME); assertKeyNotEmpty(mapConf, currentParamKey + "." + TOGGLE_STRATEGY_PARAMVALUE); params.put(mapConf.get(currentParamKey + "." + TOGGLE_STRATEGY_PARAMNAME), mapConf.get(currentParamKey + "." + TOGGLE_STRATEGY_PARAMVALUE)); currentParamKey = currentFeatureKey + "." + TOGGLE_STRATEGY_TAG + "." + TOGGLE_STRATEGY_PARAMTAG + "." + ++idxParam; } flipStrategy.init(f.getUid(), params); f.setFlippingStrategy(flipStrategy); } ff4jConfig.getFeatures().put(f.getUid(), f); // ff4j.features.X currentFeatureKey = FF4J_TAG + "." + FEATURES_TAG + "." + ++idx; } }
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
parseFeatures
ff4j-config-properties/src/main/java/org/ff4j/parser/properties/PropertiesParser.java
991df72725f78adbc413d9b0fbb676201f1882e0
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/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
sendRequest
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
@Override public void onPreconnectionStart(List<Layer2PacketParcelable> packets) { sendMessage(CMD_START_FILS_CONNECTION, 0, 0, packets); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPreconnectionStart 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
onPreconnectionStart
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void deletePage(EntityReference reference, boolean affectChildren) { getDriver().get(getURLToDeletePage(reference, affectChildren)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deletePage File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
deletePage
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public ClusterConfig getRaw(Class<?> type) { return findClusterConfig(type.getCanonicalName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRaw File: graylog2-server/src/main/java/org/graylog2/cluster/ClusterConfigServiceImpl.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
getRaw
graylog2-server/src/main/java/org/graylog2/cluster/ClusterConfigServiceImpl.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
0