instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public void onUiModeChanged() { reloadColors(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUiModeChanged File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21245
HIGH
7.8
android
onUiModeChanged
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
a33159e8cb297b9eee6fa5c63c0e343d05fad622
0
Analyze the following code function for security vulnerabilities
public WildcardMatcher getPerms() { return WildcardMatcher.from(perms); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPerms File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
getPerms
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
private boolean containsLabelKey(XMLEvent peek) { final Attribute keyAttribute = peek.asStartElement().getAttributeByName(new QName("key")); return keyAttribute != null && keyAttribute.getValue().equals("label"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsLabelKey File: core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java Repository: neo4j/apoc The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-23926
HIGH
8.1
neo4j/apoc
containsLabelKey
core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java
3202b421b21973b2f57a43b33c88f3f6901cfd2a
0
Analyze the following code function for security vulnerabilities
final int startActivity(Intent intent, ActivityStackSupervisor.ActivityContainer container) { enforceNotIsolatedCaller("ActivityContainer.startActivity"); final int userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), mStackSupervisor.mCurrentUser, false, ActivityManagerService.ALLOW_FULL_ONLY, "ActivityContainer", null); // TODO: Switch to user app stacks here. String mimeType = intent.getType(); final Uri data = intent.getData(); if (mimeType == null && data != null && "content".equals(data.getScheme())) { mimeType = getProviderMimeType(data, userId); } container.checkEmbeddedAllowedInner(userId, intent, mimeType); intent.addFlags(FORCE_NEW_TASK_FLAGS); return mActivityStarter.startActivityMayWait(null, -1, null, intent, mimeType, null, null, null, null, 0, 0, null, null, null, null, false, userId, container, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivity 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
startActivity
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private XWikiDocument getProgrammingDocument() { XWikiContext xcontext = this.xcontextProvider.get(); XWikiDocument document = (XWikiDocument) xcontext.get(XWikiDocument.CKEY_SDOC); if (document == null) { document = xcontext.getDoc(); } return document; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProgrammingDocument File: xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authorization/xwiki-platform-security-authorization-bridge/src/main/java/org/xwiki/security/authorization/internal/DefaultContextualAuthorizationManager.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
getProgrammingDocument
xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authorization/xwiki-platform-security-authorization-bridge/src/main/java/org/xwiki/security/authorization/internal/DefaultContextualAuthorizationManager.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
public void setNearbyNotificationStreamingPolicy(@NearbyStreamingPolicy int policy) { throwIfParentInstance("setNearbyNotificationStreamingPolicy"); if (mService == null) { return; } try { mService.setNearbyNotificationStreamingPolicy(policy); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNearbyNotificationStreamingPolicy 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
setNearbyNotificationStreamingPolicy
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected String getInternalMetas(Map<String, Object> data) { String meta = ""; // set description String description = userview.getPropertyString("description"); if (description != null && !description.trim().isEmpty()) { meta += "<meta name=\"Description\" content=\"" + StringEscapeUtils.escapeHtml(description) + "\"/>\n"; } // PWA: set address bar theme color Userview uv = (Userview)data.get("userview"); String primary = getPrimaryColor(); meta += "<meta name=\"theme-color\" content=\"" + primary + "\"/>\n"; // PWA: set apple-touch-icon HttpServletRequest request = WorkflowUtil.getHttpServletRequest(); String icon = request.getContextPath() + "/images/logo_512x512.png"; UserviewSetting userviewSetting = getUserview().getSetting(); if (!userviewSetting.getPropertyString("userview_thumbnail").isEmpty()) { icon = userviewSetting.getPropertyString("userview_thumbnail"); } meta += "<link rel=\"apple-touch-icon\" href=\"" + icon + "\">\n"; // PWA: set manifest URL String appId = uv.getParamString("appId"); String userviewId = uv.getPropertyString("id"); String manifestUrl = request.getContextPath() + "/web/userview/" + appId + "/" + userviewId + "/manifest"; meta += "<link rel=\"manifest\" href=\"" + manifestUrl + "\" crossorigin=\"use-credentials\">"; return meta; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInternalMetas File: wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
getInternalMetas
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
public static List<Descriptor<Cloud>> getCloudDescriptors() { return Cloud.all(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCloudDescriptors 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
getCloudDescriptors
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
static JsonValue tryParseNumber(String value, boolean stopAtNext) throws IOException { return tryParseNumber(new StringBuilder(value), stopAtNext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tryParseNumber File: src/main/org/hjson/HjsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
tryParseNumber
src/main/org/hjson/HjsonParser.java
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
0
Analyze the following code function for security vulnerabilities
public boolean usesTemplate() { return (mN.contentView == null && mN.headsUpContentView == null && mN.bigContentView == null) || styleDisplaysCustomViewInline(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: usesTemplate File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
usesTemplate
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public Boolean upload(Path path) { return wrapRunWithOptionalDependency(() -> { try { return PodUpload.upload(client, getContext(), this, path); } catch (Exception ex) { Thread.currentThread().interrupt(); throw KubernetesClientException.launderThrowable(ex); } }, "Base64InputStream class is provided by commons-codec, TarArchiveOutputStream is provided by commons-compress"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: upload File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
upload
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
private static native long nativeAssetGetRemainingLength(long assetPtr);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeAssetGetRemainingLength 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
nativeAssetGetRemainingLength
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Override void switchUser(int userId) { super.switchUser(userId); if (showToCurrentUser()) { setPolicyVisibilityFlag(VISIBLE_FOR_USER); } else { if (DEBUG_VISIBILITY) Slog.w(TAG_WM, "user changing, hiding " + this + ", attrs=" + mAttrs.type + ", belonging to " + mOwnerUid); clearPolicyVisibilityFlag(VISIBLE_FOR_USER); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchUser 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
switchUser
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private @Nullable WifiConfiguration getInternalConfiguredNetwork( @NonNull WifiConfiguration config) { WifiConfiguration internalConfig = mConfiguredNetworks.getForCurrentUser(config.networkId); if (internalConfig != null) { return internalConfig; } internalConfig = mConfiguredNetworks.getByConfigKeyForCurrentUser( config.getProfileKey()); if (internalConfig != null) { return internalConfig; } internalConfig = getInternalConfiguredNetworkByUpgradableType(config); if (internalConfig == null) { Log.e(TAG, "Cannot find network with networkId " + config.networkId + " or configKey " + config.getProfileKey() + " or upgradable security type check"); } return internalConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInternalConfiguredNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
getInternalConfiguredNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
final void performAppGcsLocked() { final int N = mProcessesToGc.size(); if (N <= 0) { return; } if (canGcNowLocked()) { while (mProcessesToGc.size() > 0) { ProcessRecord proc = mProcessesToGc.remove(0); if (proc.curRawAdj > ProcessList.PERCEPTIBLE_APP_ADJ || proc.reportLowMemory) { if ((proc.lastRequestedGc+mConstants.GC_MIN_INTERVAL) <= SystemClock.uptimeMillis()) { // To avoid spamming the system, we will GC processes one // at a time, waiting a few seconds between each. performAppGcLocked(proc); scheduleAppGcsLocked(); return; } else { // It hasn't been long enough since we last GCed this // process... put it in the list to wait for its time. addProcessToGcListLocked(proc); break; } } } scheduleAppGcsLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performAppGcsLocked 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
performAppGcsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public SelectionHandleController getSelectionHandleControllerForTest() { return mSelectionHandleController; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSelectionHandleControllerForTest File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getSelectionHandleControllerForTest
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private boolean tryUnpackZipFile(final File importSandboxDirectory, final MultipartFile multipartFile) { /* Extract ZIP contents */ ZipEntry zipEntry = null; InputStream inputStream = null; ZipInputStream zipInputStream = null; boolean foundEntry = false; try { inputStream = ServiceUtilities.ensureInputSream(multipartFile); zipInputStream = new ZipInputStream(inputStream); while ((zipEntry = zipInputStream.getNextEntry()) != null) { foundEntry = true; final File destFile = new File(importSandboxDirectory, zipEntry.getName()); if (!zipEntry.isDirectory()) { ServiceUtilities.ensureFileCreated(destFile); final FileOutputStream destOutputStream = new FileOutputStream(destFile); try { ByteStreams.copy(zipInputStream, destOutputStream); } finally { ServiceUtilities.ensureClose(destOutputStream); } zipInputStream.closeEntry(); } } } catch (final EOFException e) { /* (Might get this if the ZIP file is truncated for some reason) */ return false; } catch (final ZipException e) { return false; } catch (final IOException e) { throw QtiWorksRuntimeException.unexpectedException(e); } finally { ServiceUtilities.ensureClose(zipInputStream, inputStream); } return foundEntry; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2022-39367 - Severity: MEDIUM - CVSS Score: 6.5 Description: vuln-fix: Zip Slip Vulnerability This fixes a Zip-Slip vulnerability. This change does one of two things. This change either 1. Inserts a guard to protect against Zip Slip. OR 2. Replaces `dir.getCanonicalPath().startsWith(parent.getCanonicalPath())`, which is vulnerable to partial path traversal attacks, with the more secure `dir.getCanonicalFile().toPath().startsWith(parent.getCanonicalFile().toPath())`. For number 2, consider `"/usr/outnot".startsWith("/usr/out")`. The check is bypassed although `/outnot` is not under the `/out` directory. It's important to understand that the terminating slash may be removed when using various `String` representations of the `File` object. For example, on Linux, `println(new File("/var"))` will print `/var`, but `println(new File("/var", "/")` will print `/var/`; however, `println(new File("/var", "/").getCanonicalPath())` will print `/var`. Weakness: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') Severity: High CVSSS: 7.4 Detection: CodeQL (https://codeql.github.com/codeql-query-help/java/java-zipslip/) & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.ZipSlip) Reported-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com> Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com> Bug-tracker: https://github.com/JLLeitschuh/security-research/issues/16 Co-authored-by: Moderne <team@moderne.io> Function: tryUnpackZipFile File: qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java Repository: davemckain/qtiworks Fixed Code: private boolean tryUnpackZipFile(final File importSandboxDirectory, final MultipartFile multipartFile) { /* Extract ZIP contents */ ZipEntry zipEntry = null; InputStream inputStream = null; ZipInputStream zipInputStream = null; boolean foundEntry = false; try { inputStream = ServiceUtilities.ensureInputSream(multipartFile); zipInputStream = new ZipInputStream(inputStream); while ((zipEntry = zipInputStream.getNextEntry()) != null) { foundEntry = true; final File destFile = new File(importSandboxDirectory, zipEntry.getName()); if (!destFile.toPath().normalize().startsWith(importSandboxDirectory.toPath().normalize())) { throw new RuntimeException("Bad zip entry"); } if (!zipEntry.isDirectory()) { ServiceUtilities.ensureFileCreated(destFile); final FileOutputStream destOutputStream = new FileOutputStream(destFile); try { ByteStreams.copy(zipInputStream, destOutputStream); } finally { ServiceUtilities.ensureClose(destOutputStream); } zipInputStream.closeEntry(); } } } catch (final EOFException e) { /* (Might get this if the ZIP file is truncated for some reason) */ return false; } catch (final ZipException e) { return false; } catch (final IOException e) { throw QtiWorksRuntimeException.unexpectedException(e); } finally { ServiceUtilities.ensureClose(zipInputStream, inputStream); } return foundEntry; }
[ "CWE-22" ]
CVE-2022-39367
MEDIUM
6.5
davemckain/qtiworks
tryUnpackZipFile
qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java
1a46d6d842877ba2b824d5c269845827e2e0ccac
1
Analyze the following code function for security vulnerabilities
public void setApiKey(@Nullable String apiKey) { this.apiKey = apiKey; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setApiKey File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setApiKey
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
public boolean isNotificationsAllowed() { return CONF.notificationEmailsAllowed(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNotificationsAllowed File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
isNotificationsAllowed
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public XmlGraphMLReader reporter(Reporter reporter) { this.reporter = reporter; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reporter File: core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java Repository: neo4j/apoc The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-23926
HIGH
8.1
neo4j/apoc
reporter
core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java
3202b421b21973b2f57a43b33c88f3f6901cfd2a
0
Analyze the following code function for security vulnerabilities
public List<String> getShellCommandLine( String[] arguments ) { List<String> commandLine = new ArrayList<String>(); if ( getShellCommand() != null ) { commandLine.add( getShellCommand() ); } if ( getShellArgs() != null ) { commandLine.addAll( getShellArgsList() ); } commandLine.addAll( getCommandLine( getExecutable(), arguments ) ); return commandLine; }
Vulnerability Classification: - CWE: CWE-78 - CVE: CVE-2017-1000487 - Severity: HIGH - CVSS Score: 7.5 Description: [PLXUTILS-161] Commandline shell injection problems Patch by Charles Duffy, applied unmodified Function: getShellCommandLine File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java Repository: codehaus-plexus/plexus-utils Fixed Code: public List<String> getShellCommandLine( String[] arguments ) { List<String> commandLine = new ArrayList<String>(); if ( getShellCommand() != null ) { commandLine.add( getShellCommand() ); } if ( getShellArgs() != null ) { commandLine.addAll( getShellArgsList() ); } commandLine.addAll( getCommandLine( getOriginalExecutable(), arguments ) ); return commandLine; }
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
getShellCommandLine
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
1
Analyze the following code function for security vulnerabilities
private void enforceCanQuery(String permission, String callerPackageName, int targetUserId) throws SecurityException { if (hasPermission(QUERY_ADMIN_POLICY, callerPackageName)) { return; } enforcePermission(permission, callerPackageName, targetUserId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceCanQuery 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
enforceCanQuery
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private boolean isPackageBlacklisted(String packageName) { var packageBlacklist = configuration.blacklistedPackages(); return packageBlacklist.stream().anyMatch(pm -> pm.matches(packageName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPackageBlacklisted File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
isPackageBlacklisted
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
ActivityStarter setResolvedType(String type) { mRequest.resolvedType = type; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResolvedType File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
setResolvedType
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
private AbstractBuild getBuildForDeprecatedMethods() { Executor e = Executor.currentExecutor(); if(e!=null) { Executable exe = e.getCurrentExecutable(); if (exe instanceof AbstractBuild) { AbstractBuild b = (AbstractBuild) exe; if(b.getProject()==this) return b; } } R lb = getLastBuild(); if(lb!=null) return lb; return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBuildForDeprecatedMethods File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getBuildForDeprecatedMethods
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
private void removeOldRosterEntries() { Log.d(TAG, "removeOldRosterEntries()"); Collection<RosterEntry> rosterEntries = mRoster.getEntries(); StringBuilder exclusion = new StringBuilder(RosterConstants.JID + " NOT IN ("); boolean first = true; for (RosterEntry rosterEntry : rosterEntries) { if (first) first = false; else exclusion.append(","); exclusion.append("'").append(rosterEntry.getUser()).append("'"); } exclusion.append(") AND "+RosterConstants.GROUP+" NOT IN ('" + RosterProvider.RosterConstants.MUCS + "');"); int count = mContentResolver.delete(RosterProvider.CONTENT_URI, exclusion.toString(), null); Log.d(TAG, "deleted " + count + " old roster entries"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeOldRosterEntries File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
removeOldRosterEntries
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public boolean deployWar(File warFile, File deployTarDir) { String context = warFile.getName(); assert context.toLowerCase().endsWith(DEPLOY_ARCH_EXT); context = context.substring(0, context.length() - DEPLOY_ARCH_EXT.length()); File failedMark = new File(deployTarDir, context + DEPLOY_FAILED_EXT); if (failedMark.exists() && failedMark.lastModified() > warFile.lastModified()) return false; // skipping deploy failed server.log("Deploying " + context); ZipFile zipFile = null; File deployDir = new File(deployTarDir, context); boolean noincremental = System.getProperty(DEF_DEPLOY_NOINCREMENTAL) != null; if (assureDir(deployDir) == false) { server.log("Can't reach deployment dir " + deployDir); return false; } Exception lastException = null; deploy: do { try { // some overhead didn't check that doesn't exist zipFile = new ZipFile(warFile); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry ze = entries.nextElement(); String en = ze.getName(); if (File.separatorChar == '/') en = en.replace('\\', File.separatorChar); File outFile = new File(deployDir, en); if (ze.isDirectory()) { outFile.mkdirs(); } else { OutputStream os = null; InputStream is = null; File parentFile = outFile.getParentFile(); if (parentFile.exists() == false) parentFile.mkdirs(); if (outFile.exists() && outFile.lastModified() >= ze.getTime()) { continue; } if (noincremental) { deleteFiles(deployDir, deployDir.list()); noincremental = false; continue deploy; } try { os = new FileOutputStream(outFile); is = zipFile.getInputStream(ze); copyStream(is, os); } catch (IOException ioe2) { server.log("Problem in extracting " + en + " " + ioe2); // TODO decide to propagate the exception up and stop deployment? lastException = ioe2; } finally { try { os.close(); } catch (Exception e2) { } try { is.close(); } catch (Exception e2) { } } outFile.setLastModified(ze.getTime()); } } } catch (ZipException ze) { server.log("Invalid .war format"); lastException = ze; } catch (IOException ioe) { server.log("Can't read " + warFile + "/ " + ioe); lastException = ioe; } finally { try { zipFile.close(); } catch (Exception e) { } zipFile = null; } } while (false); if (lastException == null) { deployDir.setLastModified(warFile.lastModified()); return true; } deployDir.setLastModified(0); return false; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2022-4594 - Severity: CRITICAL - CVSS Score: 9.8 Description: the a Path Traversal vulnerability reported by Google Function: deployWar File: 1.x/src/rogatkin/web/WarRoller.java Repository: drogatkin/TJWS2 Fixed Code: public boolean deployWar(File warFile, File deployTarDir) { String context = warFile.getName(); assert context.toLowerCase().endsWith(DEPLOY_ARCH_EXT); context = context.substring(0, context.length() - DEPLOY_ARCH_EXT.length()); File failedMark = new File(deployTarDir, context + DEPLOY_FAILED_EXT); if (failedMark.exists() && failedMark.lastModified() > warFile.lastModified()) return false; // skipping deploy failed server.log("Deploying " + context); ZipFile zipFile = null; File deployDir = new File(deployTarDir, context); boolean noincremental = System.getProperty(DEF_DEPLOY_NOINCREMENTAL) != null; if (assureDir(deployDir) == false) { server.log("Can't reach deployment dir " + deployDir); return false; } Exception lastException = null; deploy: do { try { // some overhead didn't check that doesn't exist zipFile = new ZipFile(warFile); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry ze = entries.nextElement(); String en = ze.getName(); if (File.separatorChar == '/') en = en.replace('\\', File.separatorChar); if (en.contains("../") || en.contains("/..")) throw new IOException("The file name " + en + " contains .. which can lead to a Path Traversal vulnerability"); File outFile = new File(deployDir, en); if (ze.isDirectory()) { outFile.mkdirs(); } else { OutputStream os = null; InputStream is = null; File parentFile = outFile.getParentFile(); if (parentFile.exists() == false) parentFile.mkdirs(); if (outFile.exists() && outFile.lastModified() >= ze.getTime()) { continue; } if (noincremental) { deleteFiles(deployDir, deployDir.list()); noincremental = false; continue deploy; } try { os = new FileOutputStream(outFile); is = zipFile.getInputStream(ze); copyStream(is, os); } catch (IOException ioe2) { server.log("Problem in extracting " + en + " " + ioe2); // TODO decide to propagate the exception up and stop deployment? lastException = ioe2; } finally { try { os.close(); } catch (Exception e2) { } try { is.close(); } catch (Exception e2) { } } outFile.setLastModified(ze.getTime()); } } } catch (ZipException ze) { server.log("Invalid .war format"); lastException = ze; } catch (IOException ioe) { server.log("Can't read " + warFile + "/ " + ioe); lastException = ioe; } finally { try { zipFile.close(); } catch (Exception e) { } zipFile = null; } } while (false); if (lastException == null) { deployDir.setLastModified(warFile.lastModified()); return true; } deployDir.setLastModified(0); return false; }
[ "CWE-22" ]
CVE-2022-4594
CRITICAL
9.8
drogatkin/TJWS2
deployWar
1.x/src/rogatkin/web/WarRoller.java
1bac15c496ec54efe21ad7fab4e17633778582fc
1
Analyze the following code function for security vulnerabilities
private boolean needsRedaction(Entry ent) { int userId = ent.notification.getUserId(); boolean currentUserWantsRedaction = !userAllowsPrivateNotificationsInPublic(mCurrentUserId); boolean notiUserWantsRedaction = !userAllowsPrivateNotificationsInPublic(userId); boolean redactedLockscreen = currentUserWantsRedaction || notiUserWantsRedaction; boolean notificationRequestsRedaction = ent.notification.getNotification().visibility == Notification.VISIBILITY_PRIVATE; boolean userForcesRedaction = packageHasVisibilityOverride(ent.notification.getKey()); return userForcesRedaction || notificationRequestsRedaction && redactedLockscreen; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: needsRedaction File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
needsRedaction
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void disconnect() { try { disconnect(new Presence(Presence.Type.unavailable)); } catch (NotConnectedException e) { LOGGER.log(Level.FINEST, "Connection is already disconnected", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disconnect File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
disconnect
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
protected Object[] getArgumentsForConstraint( String objectName, String field, ConstraintViolation<Object> violation) { Annotation annotation = violation.getConstraintDescriptor().getAnnotation(); if (annotation instanceof Constraints.ValidateWith) { Constraints.ValidateWith validateWithAnnotation = (Constraints.ValidateWith) annotation; if (violation.getMessage().equals(Constraints.ValidateWithValidator.defaultMessage)) { Constraints.ValidateWithValidator validateWithValidator = new Constraints.ValidateWithValidator(); validateWithValidator.initialize(validateWithAnnotation); Tuple<String, Object[]> errorMessageKey = validateWithValidator.getErrorMessageKey(); if (errorMessageKey != null && errorMessageKey._2 != null) { return errorMessageKey._2; } else { return new Object[0]; } } else { return new Object[0]; } } List<Object> arguments = new LinkedList<>(); String[] codes = new String[] {objectName + Errors.NESTED_PATH_SEPARATOR + field, field}; arguments.add(new DefaultMessageSourceResolvable(codes, field)); // Using a TreeMap for alphabetical ordering of attribute names Map<String, Object> attributesToExpose = new TreeMap<>(); violation .getConstraintDescriptor() .getAttributes() .forEach( (attributeName, attributeValue) -> { if (!internalAnnotationAttributes.contains(attributeName)) { attributesToExpose.put(attributeName, attributeValue); } }); arguments.addAll(attributesToExpose.values()); return arguments.toArray(new Object[arguments.size()]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getArgumentsForConstraint File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
getArgumentsForConstraint
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
@Override public List<Collection> findCollectionsWithSubmit(String q, Context context, Community community, String entityType, int offset, int limit) throws SQLException, SearchServiceException { List<Collection> collections = new ArrayList<>(); DiscoverQuery discoverQuery = new DiscoverQuery(); discoverQuery.setDSpaceObjectFilter(IndexableCollection.TYPE); discoverQuery.setStart(offset); discoverQuery.setMaxResults(limit); DiscoverResult resp = retrieveCollectionsWithSubmit(context, discoverQuery, entityType, community, q); for (IndexableObject solrCollections : resp.getIndexableObjects()) { Collection c = ((IndexableCollection) solrCollections).getIndexedObject(); collections.add(c); } return collections; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findCollectionsWithSubmit File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
findCollectionsWithSubmit
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
private boolean isPermanentWrongPasswordFailure(int networkId, int reasonCode) { if (reasonCode != WifiManager.ERROR_AUTH_FAILURE_WRONG_PSWD) { return false; } WifiConfiguration network = mWifiConfigManager.getConfiguredNetwork(networkId); if (network != null && network.getNetworkSelectionStatus().hasEverConnected()) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPermanentWrongPasswordFailure 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
isPermanentWrongPasswordFailure
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private boolean setIfAbsentFast(Iterable<? extends Entry<? extends CharSequence, String>> headers, Set<AsciiString> existingNames) { if (!(headers instanceof HttpHeadersBase)) { return false; } final HttpHeadersBase headersBase = (HttpHeadersBase) headers; HeaderEntry e = headersBase.head.after; while (e != headersBase.head) { final AsciiString key = e.key; final String value = e.value; assert key != null; assert value != null; if (!existingNames.contains(key)) { add0(e.hash, index(e.hash), key, value); } e = e.after; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIfAbsentFast File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
setIfAbsentFast
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public @Nullable UserHandle getLogoutUser() { // TODO(b/214336184): add CTS test try { int userId = mService.getLogoutUserId(); return userId == UserHandle.USER_NULL ? null : UserHandle.of(userId); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLogoutUser 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
getLogoutUser
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private boolean isValidVersion(String version) { return !version.equals("java-null"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidVersion File: apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SystemInfoController.java Repository: apolloconfig/apollo The code follows secure coding practices.
[ "CWE-918" ]
CVE-2019-10686
HIGH
7.5
apolloconfig/apollo
isValidVersion
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SystemInfoController.java
70d250458e1baab95415807f0de7d2af10b344ae
0
Analyze the following code function for security vulnerabilities
private boolean isManagedProfile(int userHandle) { final UserInfo user = getUserInfo(userHandle); return user != null && user.isManagedProfile(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isManagedProfile 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
isManagedProfile
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public ApplicationBasicInfo[] getAllApplicationBasicInfo(String tenantDomain, String username) throws IdentityApplicationManagementException { return getApplicationBasicInfo(tenantDomain, username, "*"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllApplicationBasicInfo File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
getAllApplicationBasicInfo
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
@Override public void logNotificationExpansion(String key, boolean userAction, boolean expanded) { mUiOffloadThread.submit(() -> { try { mBarService.onNotificationExpansionChanged(key, userAction, expanded); } catch (RemoteException e) { // Ignore. } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logNotificationExpansion File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
logNotificationExpansion
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private int processNextAffiliateChainLocked(int start) { final TaskRecord startTask = mRecentTasks.get(start); final int affiliateId = startTask.mAffiliatedTaskId; // Quick identification of isolated tasks. I.e. those not launched behind. if (startTask.taskId == affiliateId && startTask.mPrevAffiliate == null && startTask.mNextAffiliate == null) { // There is still a slim chance that there are other tasks that point to this task // and that the chain is so messed up that this task no longer points to them but // the gain of this optimization outweighs the risk. startTask.inRecents = true; return start + 1; } // Remove all tasks that are affiliated to affiliateId and put them in mTmpRecents. mTmpRecents.clear(); for (int i = mRecentTasks.size() - 1; i >= start; --i) { final TaskRecord task = mRecentTasks.get(i); if (task.mAffiliatedTaskId == affiliateId) { mRecentTasks.remove(i); mTmpRecents.add(task); } } // Sort them all by taskId. That is the order they were create in and that order will // always be correct. Collections.sort(mTmpRecents, mTaskRecordComparator); // Go through and fix up the linked list. // The first one is the end of the chain and has no next. final TaskRecord first = mTmpRecents.get(0); first.inRecents = true; if (first.mNextAffiliate != null) { Slog.w(TAG, "Link error 1 first.next=" + first.mNextAffiliate); first.setNextAffiliate(null); notifyTaskPersisterLocked(first, false); } // Everything in the middle is doubly linked from next to prev. final int tmpSize = mTmpRecents.size(); for (int i = 0; i < tmpSize - 1; ++i) { final TaskRecord next = mTmpRecents.get(i); final TaskRecord prev = mTmpRecents.get(i + 1); if (next.mPrevAffiliate != prev) { Slog.w(TAG, "Link error 2 next=" + next + " prev=" + next.mPrevAffiliate + " setting prev=" + prev); next.setPrevAffiliate(prev); notifyTaskPersisterLocked(next, false); } if (prev.mNextAffiliate != next) { Slog.w(TAG, "Link error 3 prev=" + prev + " next=" + prev.mNextAffiliate + " setting next=" + next); prev.setNextAffiliate(next); notifyTaskPersisterLocked(prev, false); } prev.inRecents = true; } // The last one is the beginning of the list and has no prev. final TaskRecord last = mTmpRecents.get(tmpSize - 1); if (last.mPrevAffiliate != null) { Slog.w(TAG, "Link error 4 last.prev=" + last.mPrevAffiliate); last.setPrevAffiliate(null); notifyTaskPersisterLocked(last, false); } // Insert the group back into mRecentTasks at start. mRecentTasks.addAll(start, mTmpRecents); // Let the caller know where we left off. return start + tmpSize; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processNextAffiliateChainLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
processNextAffiliateChainLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private Level getRootLevel() { LoggerContext loggerContext = LoggerContext.getContext(false); LoggerConfig loggerConfig = loggerContext.getConfiguration().getRootLogger(); return loggerConfig.getLevel(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRootLevel File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
getRootLevel
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public static synchronized boolean isInstalled() { return System.getSecurityManager() instanceof ArtemisSecurityManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInstalled File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
isInstalled
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
public void useSslProtocol() throws NoSuchAlgorithmException, KeyManagementException { useSslProtocol(computeDefaultTlsProtocol(SSLContext.getDefault().getSupportedSSLParameters().getProtocols())); }
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 boolean isRedirectAbsolute(XWikiContext context) { return StringUtils.equals("1", context.getWiki().Param("xwiki.redirect.absoluteurl")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRedirectAbsolute 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
isRedirectAbsolute
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public void activityPaused(IBinder token) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(token); mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: activityPaused File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
activityPaused
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private static boolean isUidSystem(int uid) { final int appid = UserHandle.getAppId(uid); return (appid == Process.SYSTEM_UID || appid == Process.PHONE_UID || uid == 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUidSystem File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
isUidSystem
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@Column(name = "ip", length = 64) public String getIp() { return this.ip; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-21333 - Severity: LOW - CVSS Score: 3.5 Description: https://github.com/sanluan/PublicCMS/issues/26 https://github.com/sanluan/PublicCMS/issues/27 Function: getIp File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogOperate.java Repository: sanluan/PublicCMS Fixed Code: @Column(name = "ip", length = 130) public String getIp() { return this.ip; }
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
getIp
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogOperate.java
b4d5956e65b14347b162424abb197a180229b3db
1
Analyze the following code function for security vulnerabilities
public Collection<SerializerConfig> getSerializerConfigs() { if (serializerConfigs == null) { serializerConfigs = new LinkedList<SerializerConfig>(); } return serializerConfigs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSerializerConfigs File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
getSerializerConfigs
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public void initializeKey(byte[] key, int offset) { // Set up the AES key. aes.setupEnc(key, offset, 256); haskey = true; // Generate the hashing key by encrypting a block of zeroes. Arrays.fill(hashKey, (byte)0); aes.encrypt(hashKey, 0, hashKey, 0); ghash.reset(hashKey, 0); // Reset the nonce. n = 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeKey File: src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
initializeKey
src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
@PermissionCheckerManager.PermissionResult private static int checkAppOpPermission(@NonNull Context context, @NonNull PermissionManagerServiceInternal permissionManagerServiceInt, @NonNull String permission, @NonNull AttributionSource attributionSource, @Nullable String message, boolean forDataDelivery, boolean fromDatasource) { final int op = AppOpsManager.permissionToOpCode(permission); if (op < 0) { Slog.wtf(LOG_TAG, "Appop permission " + permission + " with no app op defined!"); return PermissionChecker.PERMISSION_HARD_DENIED; } AttributionSource current = attributionSource; AttributionSource next = null; while (true) { final boolean skipCurrentChecks = (fromDatasource || next != null); next = current.getNext(); // If the call is from a datasource we need to vet only the chain before it. This // way we can avoid the datasource creating an attribution context for every call. if (!(fromDatasource && current.equals(attributionSource)) && next != null && !current.isTrusted(context)) { return PermissionChecker.PERMISSION_HARD_DENIED; } // The access is for oneself if this is the single receiver of data // after the data source or if this is the single attribution source // in the chain if not from a datasource. final boolean singleReceiverFromDatasource = (fromDatasource && current.equals(attributionSource) && next != null && next.getNext() == null); final boolean selfAccess = singleReceiverFromDatasource || next == null; final int opMode = performOpTransaction(context, attributionSource.getToken(), op, current, message, forDataDelivery, /*startDataDelivery*/ false, skipCurrentChecks, selfAccess, singleReceiverFromDatasource, AppOpsManager.OP_NONE, AppOpsManager.ATTRIBUTION_FLAGS_NONE, AppOpsManager.ATTRIBUTION_FLAGS_NONE, AppOpsManager.ATTRIBUTION_CHAIN_ID_NONE); switch (opMode) { case AppOpsManager.MODE_IGNORED: case AppOpsManager.MODE_ERRORED: { return PermissionChecker.PERMISSION_HARD_DENIED; } case AppOpsManager.MODE_DEFAULT: { if (!skipCurrentChecks && !checkPermission(context, permissionManagerServiceInt, permission, attributionSource.getUid(), attributionSource.getRenouncedPermissions())) { return PermissionChecker.PERMISSION_HARD_DENIED; } if (next != null && !checkPermission(context, permissionManagerServiceInt, permission, next.getUid(), next.getRenouncedPermissions())) { return PermissionChecker.PERMISSION_HARD_DENIED; } } } if (next == null || next.getNext() == null) { return PermissionChecker.PERMISSION_GRANTED; } current = next; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkAppOpPermission File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
checkAppOpPermission
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public void registerAccountListener(String[] accountTypes, String opPackageName) { int callingUid = Binder.getCallingUid(); mAppOpsManager.checkPackage(callingUid, opPackageName); int userId = UserHandle.getCallingUserId(); final long identityToken = clearCallingIdentity(); try { UserAccounts accounts = getUserAccounts(userId); registerAccountListener(accountTypes, opPackageName, accounts); } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerAccountListener 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
registerAccountListener
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public static String generateFilePath(String directory, String filename) { if (filename == null) { throw new IllegalStateException("can't generate real path, the file name is null"); } if (directory == null) { throw new IllegalStateException("can't generate real path, the directory is null"); } return formatString("%s%s%s", directory, File.separator, filename); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateFilePath File: library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
generateFilePath
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
private void playCallingSound() { stopCallingSound(); Uri ringtoneUri; if (isIncomingCallFromNotification) { ringtoneUri = NotificationUtils.INSTANCE.getCallRingtoneUri(getApplicationContext(), appPreferences); } else { ringtoneUri = Uri.parse("android.resource://" + getApplicationContext().getPackageName() + "/raw" + "/tr110_1_kap8_3_freiton1"); } mediaPlayer = new MediaPlayer(); try { mediaPlayer.setDataSource(this, ringtoneUri); mediaPlayer.setLooping(true); AudioAttributes audioAttributes = new AudioAttributes.Builder().setContentType( AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION) .build(); mediaPlayer.setAudioAttributes(audioAttributes); mediaPlayer.setOnPreparedListener(mp -> mediaPlayer.start()); mediaPlayer.prepareAsync(); } catch (IOException e) { Log.e(TAG, "Failed to play sound"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: playCallingSound File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
playCallingSound
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
public ServletOutputStream getOutputStream() throws IOException { Logger.log(Logger.FULL_DEBUG, Launcher.RESOURCES, "WinstoneResponse.GetOutputStream"); return this.outputStream; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOutputStream File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
getOutputStream
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
@Override public void init(Config.Scope config) { //PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance(); //sts.installDefaultConfiguration(); this.destinationValidator = DestinationValidator.forProtocolMap(config.getArray("knownProtocols")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java Repository: keycloak The code follows secure coding practices.
[ "CWE-287" ]
CVE-2021-3827
MEDIUM
6.8
keycloak
init
services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java
44000caaf5051d7f218d1ad79573bd3d175cad0d
0
Analyze the following code function for security vulnerabilities
protected AlgorithmParameters engineGetParameters() { if (engineParams == null) { if (paramSpec != null) { try { engineParams = helper.createAlgorithmParameters("OAEP"); engineParams.init(paramSpec); } catch (Exception e) { throw new RuntimeException(e.toString()); } } } return engineParams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineGetParameters File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineGetParameters
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
private boolean read() throws IOException { if (current=='\n') { line++; lineOffset=index; } if (peek.length()>0) { // normally peek will only hold not more than one character so this should not matter for performance current=peek.charAt(0); peek.deleteCharAt(0); } else current=reader.read(); if (current<0) return false; index++; if (capture) captureBuffer.append((char)current); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: read File: src/main/org/hjson/HjsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
read
src/main/org/hjson/HjsonParser.java
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
0
Analyze the following code function for security vulnerabilities
@Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (TextUtils.equals(action, Intent.ACTION_SCREEN_ON)) { sendMessage(CMD_SCREEN_STATE_CHANGED, 1); } else if (TextUtils.equals(action, Intent.ACTION_SCREEN_OFF)) { sendMessage(CMD_SCREEN_STATE_CHANGED, 0); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onReceive 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
onReceive
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public Grid<T> getComponent() { return (Grid<T>) super.getComponent(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComponent 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
getComponent
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
private static String toJavaCipherSuitePrefix(String protocolVersion) { final char c; if (protocolVersion == null || protocolVersion.length() == 0) { c = 0; } else { c = protocolVersion.charAt(0); } switch (c) { case 'T': return "TLS"; case 'S': return "SSL"; default: return "UNKNOWN"; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toJavaCipherSuitePrefix File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
toJavaCipherSuitePrefix
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
@Override public void revokeUriPermission(IApplicationThread caller, Uri uri, final int modeFlags, int userId) { enforceNotIsolatedCaller("revokeUriPermission"); synchronized(this) { final ProcessRecord r = getRecordForAppLocked(caller); if (r == null) { throw new SecurityException("Unable to find app for caller " + caller + " when revoking permission to uri " + uri); } if (uri == null) { Slog.w(TAG, "revokeUriPermission: null uri"); return; } if (!Intent.isAccessUriMode(modeFlags)) { return; } final String authority = uri.getAuthority(); final ProviderInfo pi = getProviderInfoLocked(authority, userId, MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE); if (pi == null) { Slog.w(TAG, "No content provider found for permission revoke: " + uri.toSafeString()); return; } revokeUriPermissionLocked(r.uid, new GrantUri(userId, uri, false), modeFlags); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revokeUriPermission 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
revokeUriPermission
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public String dialogStart() { return dialog(HTML_START, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dialogStart 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
dialogStart
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public boolean isPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets() { return myPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets 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
isPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets
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
private void stashHostRestoreUpdateLocked(Host host, int oldId, int newId) { ArrayList<RestoreUpdateRecord> r = mUpdatesByHost.get(host); if (r == null) { r = new ArrayList<>(); mUpdatesByHost.put(host, r); } else { if (alreadyStashed(r, oldId, newId)) { if (DEBUG) { Slog.i(TAG, "ID remap " + oldId + " -> " + newId + " already stashed for " + host); } return; } } r.add(new RestoreUpdateRecord(oldId, newId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stashHostRestoreUpdateLocked 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
stashHostRestoreUpdateLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@StyleRes int getParentThemeIdentifier(@StyleRes int resId) { synchronized (this) { ensureValidLocked(); // name is checked in JNI. return nativeGetParentThemeIdentifier(mObject, resId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParentThemeIdentifier 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
getParentThemeIdentifier
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Override public void checkConnect(String host, int port, Object context) { try { if (enterPublicInterface()) return; if (isConnectionAllowed(host, port)) return; throw new SecurityException(formatLocalized("security.error_network_connect_with_context", host, port)); //$NON-NLS-1$ } finally { exitPublicInterface(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkConnect File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
checkConnect
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
boolean isInstallAsUidSet() { return mUid != -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInstallAsUidSet File: src/com/android/certinstaller/CredentialHelper.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
isInstallAsUidSet
src/com/android/certinstaller/CredentialHelper.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
public void buildDependencyGraph(AbstractProject owner, DependencyGraph graph) { for (AbstractProject p : getChildProjects(owner)) graph.addDependency(new Dependency(owner, p) { @Override public boolean shouldTriggerBuild(AbstractBuild build, TaskListener listener, List<Action> actions) { return build.getResult().isBetterOrEqualTo(threshold); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildDependencyGraph File: core/src/main/java/hudson/tasks/BuildTrigger.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
buildDependencyGraph
core/src/main/java/hudson/tasks/BuildTrigger.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public StringParceledListSlice getOwnerInstalledCaCerts(@NonNull UserHandle user) { final int userId = user.getIdentifier(); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization( (isProfileOwner(caller) || isDefaultDeviceOwner(caller) || canQueryAdminPolicy( caller)) && hasFullCrossUsersPermission(caller, userId)); synchronized (getLockObject()) { return new StringParceledListSlice( new ArrayList<>(getUserData(userId).mOwnerInstalledCaCerts)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOwnerInstalledCaCerts 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
getOwnerInstalledCaCerts
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
boolean isReceivingBroadcastLocked(ProcessRecord app, ArraySet<BroadcastQueue> receivingQueues) { final ProcessReceiverRecord prr = app.mReceivers; final int numOfReceivers = prr.numberOfCurReceivers(); if (numOfReceivers > 0) { for (int i = 0; i < numOfReceivers; i++) { receivingQueues.add(prr.getCurReceiverAt(i).queue); } return true; } // It's not the current receiver, but it might be starting up to become one for (BroadcastQueue queue : mBroadcastQueues) { final BroadcastRecord r = queue.mPendingBroadcast; if (r != null && r.curApp == app) { // found it; report which queue it's in receivingQueues.add(queue); } } return !receivingQueues.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isReceivingBroadcastLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
isReceivingBroadcastLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) { if (!(sender instanceof PendingIntentRecord)) { return; } final PendingIntentRecord rec = (PendingIntentRecord)sender; final BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics(); synchronized (stats) { mBatteryStatsService.enforceCallingPermission(); int MY_UID = Binder.getCallingUid(); int uid = rec.uid == MY_UID ? Process.SYSTEM_UID : rec.uid; mBatteryStatsService.noteAlarmStart(tag, sourceUid >= 0 ? sourceUid : uid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteAlarmStart 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
noteAlarmStart
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public static String getNameWithoutExtension(String file) { checkNotNull(file); String fileName = new File(file).getName(); int dotIndex = fileName.lastIndexOf('.'); return (dotIndex == -1) ? fileName : fileName.substring(0, dotIndex); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNameWithoutExtension 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
getNameWithoutExtension
android/guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
private static int getVolumeStream(@Nullable AudioAttributes attr) { if (attr == null) { return DEFAULT_ATTRIBUTES.getVolumeControlStream(); } final int stream = attr.getVolumeControlStream(); if (stream == AudioManager.USE_DEFAULT_STREAM_TYPE) { return DEFAULT_ATTRIBUTES.getVolumeControlStream(); } return stream; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVolumeStream File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
getVolumeStream
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
public void setAlwaysOnVpnPackage(@NonNull ComponentName admin, @Nullable String vpnPackage, boolean lockdownEnabled, @Nullable Set<String> lockdownAllowlist) throws NameNotFoundException { throwIfParentInstance("setAlwaysOnVpnPackage"); if (mService != null) { try { mService.setAlwaysOnVpnPackage(admin, vpnPackage, lockdownEnabled, lockdownAllowlist == null ? null : new ArrayList<>(lockdownAllowlist)); } catch (ServiceSpecificException e) { switch (e.errorCode) { case ERROR_VPN_PACKAGE_NOT_FOUND: throw new NameNotFoundException(e.getMessage()); default: throw new RuntimeException( "Unknown error setting always-on VPN: " + e.errorCode, e); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAlwaysOnVpnPackage 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
setAlwaysOnVpnPackage
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected boolean checkKeyIntent(int authUid, Bundle bundle) { if (!checkKeyIntentParceledCorrectly(bundle)) { EventLog.writeEvent(0x534e4554, "250588548", authUid, ""); return false; } Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent == null) { return true; } // Explicitly set an empty ClipData to ensure that we don't offer to // promote any Uris contained inside for granting purposes if (intent.getClipData() == null) { intent.setClipData(ClipData.newPlainText(null, null)); } final long bid = Binder.clearCallingIdentity(); try { PackageManager pm = mContext.getPackageManager(); ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId); if (resolveInfo == null) { return false; } ActivityInfo targetActivityInfo = resolveInfo.activityInfo; int targetUid = targetActivityInfo.applicationInfo.uid; PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class); if (!isExportedSystemActivity(targetActivityInfo) && !pmi.hasSignatureCapability(targetUid, authUid, CertCapabilities.AUTH)) { String pkgName = targetActivityInfo.packageName; String activityName = targetActivityInfo.name; String tmpl = "KEY_INTENT resolved to an Activity (%s) in a package (%s) that " + "does not share a signature with the supplying authenticator (%s)."; Log.e(TAG, String.format(tmpl, activityName, pkgName, mAccountType)); return false; } return true; } finally { Binder.restoreCallingIdentity(bid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkKeyIntent 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
checkKeyIntent
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public DynamicForm withError(final String key, final String error) { return withError(key, error, new ArrayList<>()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withError File: web/play-java-forms/src/main/java/play/data/DynamicForm.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
withError
web/play-java-forms/src/main/java/play/data/DynamicForm.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage @Nullable CharSequence getResourceBagText(@StringRes int resId, int bagEntryId) { synchronized (this) { ensureValidLocked(); final TypedValue outValue = mValue; final int cookie = nativeGetResourceBagValue(mObject, resId, bagEntryId, outValue); if (cookie <= 0) { return null; } // Convert the changing configurations flags populated by native code. outValue.changingConfigurations = ActivityInfo.activityInfoConfigNativeToJava( outValue.changingConfigurations); if (outValue.type == TypedValue.TYPE_STRING) { return getPooledStringForCookie(cookie, outValue.data); } return outValue.coerceToString(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceBagText 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
getResourceBagText
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Override public boolean isExistingApplicationTemplate(String templateName, String tenantDomain) throws IdentityApplicationManagementException { return doCheckApplicationTemplateExistence(templateName, tenantDomain); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isExistingApplicationTemplate File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
isExistingApplicationTemplate
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
public boolean testConnection(DatabaseConfiguration databaseConfiguration) throws DatabaseServiceException { try { boolean connResult = false; Connection conn = getConnection(databaseConfiguration, true); if (conn != null) { connResult = true; conn.close(); } return connResult; } catch (SQLException e) { logger.error("Test connection Failed!", e); throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testConnection File: extensions/database/src/com/google/refine/extension/database/pgsql/PgSQLConnectionManager.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-41886
HIGH
7.5
OpenRefine
testConnection
extensions/database/src/com/google/refine/extension/database/pgsql/PgSQLConnectionManager.java
2de1439f5be63d9d0e89bbacbd24fa28c8c3e29d
0
Analyze the following code function for security vulnerabilities
@Override public boolean canCloseSystemDialogs(int pid, int uid) { return ActivityTaskManagerService.this.canCloseSystemDialogs(pid, uid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canCloseSystemDialogs File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
canCloseSystemDialogs
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void setHighlightValue(Map<String, Function<Object, AttributedString>> highlightValue) { this.highlightValue = highlightValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHighlightValue File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java Repository: jline/jline3 The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-50572
MEDIUM
5.5
jline/jline3
setHighlightValue
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
0
Analyze the following code function for security vulnerabilities
@Override public void startActivityForResult(Intent intent, int requestCode) { Bundle extra = intent.getExtras(); if(extra != null && extra.containsKey("WaitForResult") && !extra.getBoolean("WaitForResult")){ waitingForResult = false; }else{ waitingForResult = true; } intentResult = new Vector(); if (InPlaceEditView.isEditing()) { AndroidImplementation.stopEditing(true); } super.startActivityForResult(intent, requestCode); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityForResult File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
startActivityForResult
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
protected final Integer _parseInteger(DeserializationContext ctxt, String text) throws IOException { try { if (text.length() > 9) { long l = NumberInput.parseLong(text); if (_intOverflow(l)) { return (Integer) ctxt.handleWeirdStringValue(Integer.class, text, "Overflow: numeric value (%s) out of range of `java.lang.Integer` (%d -%d)", text, Integer.MIN_VALUE, Integer.MAX_VALUE); } return Integer.valueOf((int) l); } return NumberInput.parseInt(text); } catch (IllegalArgumentException iae) { return(Integer) ctxt.handleWeirdStringValue(Integer.class, text, "not a valid `java.lang.Integer` value"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _parseInteger File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_parseInteger
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
private void revertToNitzTime() { if (Settings.Global.getInt(mPhone.getContext().getContentResolver(), Settings.Global.AUTO_TIME, 0) == 0) { return; } if (DBG) { log("Reverting to NITZ Time: mSavedTime=" + mSavedTime + " mSavedAtTime=" + mSavedAtTime); } if (mSavedTime != 0 && mSavedAtTime != 0) { setAndBroadcastNetworkSetTime(mSavedTime + (SystemClock.elapsedRealtime() - mSavedAtTime)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revertToNitzTime 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
revertToNitzTime
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public boolean removeOnShowModeChangedListener(@NonNull OnShowModeChangedListener listener) { if (mListeners == null) { return false; } synchronized (mLock) { final int keyIndex = mListeners.indexOfKey(listener); final boolean hasKey = keyIndex >= 0; if (hasKey) { mListeners.removeAt(keyIndex); } if (hasKey && mListeners.isEmpty()) { // We just removed the last listener, so we don't need callbacks from the // service anymore. setSoftKeyboardCallbackEnabled(false); } return hasKey; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeOnShowModeChangedListener File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
removeOnShowModeChangedListener
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
public JobRequest toRestJobRequest(Request request) throws XWikiRestException { JobRequest restJobRequest = this.objectFactory.createJobRequest(); restJobRequest.setId(toRestJobId(request.getId())); restJobRequest.setInteractive(request.isInteractive()); restJobRequest.setRemote(request.isRemote()); restJobRequest.setVerbose(request.isVerbose()); restJobRequest.setStatusSerialized(request.isStatusSerialized()); restJobRequest.setStatusLogIsolated(request.isStatusLogIsolated()); for (String key : request.getPropertyNames()) { restJobRequest.getProperties().add(toRestMapEntry(key, request.getProperty(key))); } return restJobRequest; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toRestJobRequest File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-35151
HIGH
7.5
xwiki/xwiki-platform
toRestJobRequest
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
824cd742ecf5439971247da11bfe7e0ad2b10ede
0
Analyze the following code function for security vulnerabilities
public void setUser(User user) { this.user = user; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUser File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
setUser
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public void stopForegroundServicesForChannel(String pkg, int userId, String channelId) { synchronized (ActivityManagerService.this) { mServices.stopForegroundServicesForChannelLocked(pkg, userId, channelId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopForegroundServicesForChannel File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
stopForegroundServicesForChannel
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void addDenyInternal(String name) { if (name == null || name.length() == 0) { return; } long hash = TypeUtils.fnv1a_64(name); if (internalDenyHashCodes == null) { this.internalDenyHashCodes = new long[] {hash}; return; } if (Arrays.binarySearch(this.internalDenyHashCodes, hash) >= 0) { return; } long[] hashCodes = new long[this.internalDenyHashCodes.length + 1]; hashCodes[hashCodes.length - 1] = hash; System.arraycopy(this.internalDenyHashCodes, 0, hashCodes, 0, this.internalDenyHashCodes.length); Arrays.sort(hashCodes); this.internalDenyHashCodes = hashCodes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addDenyInternal 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
addDenyInternal
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
private GMSSRootCalc generateNextAuthpathAndRoot(Vector nextStack, byte[] seed, int h) { byte[] OTSseed = new byte[numLayer]; WinternitzOTSignature ots; // data structure that constructs the whole tree and stores // the initial values for treehash, Auth and retain GMSSRootCalc treeToConstruct = new GMSSRootCalc(this.heightOfTrees[h], this.K[h], this.digestProvider); treeToConstruct.initialize(nextStack); int seedForTreehashIndex = 3; int count = 0; // update the tree 2^(H) times, from the first to the last leaf for (int i = 0; i < (1 << this.heightOfTrees[h]); i++) { // initialize the seeds for the leaf generation with index 3 * 2^h if (i == seedForTreehashIndex && count < this.heightOfTrees[h] - this.K[h]) { treeToConstruct.initializeTreehashSeed(seed, count); seedForTreehashIndex *= 2; count++; } OTSseed = gmssRandom.nextSeed(seed); ots = new WinternitzOTSignature(OTSseed, digestProvider.get(), otsIndex[h]); treeToConstruct.update(ots.getPublicKey()); } if (treeToConstruct.wasFinished()) { return treeToConstruct; } System.err.println("N�chster Baum noch nicht fertig konstruiert!!!"); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateNextAuthpathAndRoot File: core/src/main/java/org/bouncycastle/pqc/crypto/gmss/GMSSKeyPairGenerator.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
generateNextAuthpathAndRoot
core/src/main/java/org/bouncycastle/pqc/crypto/gmss/GMSSKeyPairGenerator.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
private void broadcastExplicitIntentToPackage( Intent intent, String packageName, UserHandle userHandle) { int userId = userHandle.getIdentifier(); if (packageName == null) { return; } Intent packageIntent = new Intent(intent) .setPackage(packageName); List<ResolveInfo> receivers = mContext.getPackageManager().queryBroadcastReceiversAsUser( packageIntent, PackageManager.ResolveInfoFlags.of(PackageManager.GET_RECEIVERS), userId); if (receivers.isEmpty()) { Slog.i(LOG_TAG, "Found no receivers to handle intent " + intent + " in package " + packageName); return; } for (ResolveInfo receiver : receivers) { Intent componentIntent = new Intent(packageIntent) .setComponent(receiver.getComponentInfo().getComponentName()) .addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); mContext.sendBroadcastAsUser(componentIntent, userHandle); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastExplicitIntentToPackage 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
broadcastExplicitIntentToPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected void writeToHttpSession(WrappedSession wrappedSession, VaadinSession session) { wrappedSession.setAttribute(getSessionAttributeName(), session); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeToHttpSession File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
writeToHttpSession
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
@Message(id = 710, value = "Cannot inject {0} outside of a Servlet request", format = Format.MESSAGE_FORMAT) IllegalStateException cannotInjectObjectOutsideOfServletRequest(Object param1, @Cause Throwable cause);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cannotInjectObjectOutsideOfServletRequest File: impl/src/main/java/org/jboss/weld/logging/ServletLogger.java Repository: weld/core The code follows secure coding practices.
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
cannotInjectObjectOutsideOfServletRequest
impl/src/main/java/org/jboss/weld/logging/ServletLogger.java
8e413202fa1af08c09c580f444e4fd16874f9c65
0
Analyze the following code function for security vulnerabilities
@Override public HtmlTree.Converter<Spanned> createInstance() { return getSpanConverter(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createInstance File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
createInstance
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@Override public boolean resetPassword(@Nullable String password, int flags) throws RemoteException { if (!mLockPatternUtils.hasSecureLockScreen()) { Slogf.w(LOG_TAG, "Cannot reset password when the device has no lock screen"); return false; } if (password == null) password = ""; final CallerIdentity caller = getCallerIdentity(); final int userHandle = caller.getUserId(); // As of R, only privileged caller holding RESET_PASSWORD can call resetPassword() to // set password to an unsecured user. if (hasCallingPermission(permission.RESET_PASSWORD)) { final boolean result = setPasswordPrivileged(password, flags, caller); if (result) { DevicePolicyEventLogger .createEvent(DevicePolicyEnums.RESET_PASSWORD) .write(); } return result; } // If caller has PO (or DO) throw or fail silently depending on its target SDK level. if (isDefaultDeviceOwner(caller) || isProfileOwner(caller)) { synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller.getUserId()); if (getTargetSdk(admin.info.getPackageName(), userHandle) < Build.VERSION_CODES.O) { Slogf.e(LOG_TAG, "DPC can no longer call resetPassword()"); return false; } throw new SecurityException("Device admin can no longer call resetPassword()"); } } // Caller is not DO or PO, could either be unauthorized or Device Admin. synchronized (getLockObject()) { // Legacy device admin cannot call resetPassword either ActiveAdmin admin = getActiveAdminForCallerLocked( null, DeviceAdminInfo.USES_POLICY_RESET_PASSWORD, false); Preconditions.checkCallAuthorization(admin != null, "Unauthorized caller cannot call resetPassword."); if (getTargetSdk(admin.info.getPackageName(), userHandle) <= android.os.Build.VERSION_CODES.M) { Slogf.e(LOG_TAG, "Device admin can no longer call resetPassword()"); return false; } throw new SecurityException("Device admin can no longer call resetPassword()"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetPassword 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
resetPassword
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
default <KT, VT> Map<KT, VT> asMap(Class<KT> keyType, Class<VT> valueType) { Map<KT, VT> newMap = new LinkedHashMap<>(); for (Map.Entry<String, V> entry : this) { String key = entry.getKey(); Optional<KT> convertedKey = ConversionService.SHARED.convert(key, keyType); if (convertedKey.isPresent()) { Optional<VT> convertedValue = ConversionService.SHARED.convert(entry.getValue(), valueType); convertedValue.ifPresent(vt -> newMap.put(convertedKey.get(), vt)); } } return newMap; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asMap File: core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
asMap
core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public static String escapeTextAroundXMLTags(String s) { StringBuilder result = new StringBuilder(); Reader r = new StringReader(s); try { do { String text = readUntilTag(r); // System.err.println("got text: " + text); result.append(escapeXML(text)); XMLTag tag = readAndParseTag(r); // System.err.println("got tag: " + tag); if (tag == null) { break; } result.append(tag); } while (true); } catch (IOException e) { log.warn("Error reading string"); log.warn(e); } return result.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escapeTextAroundXMLTags File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-0239
HIGH
7.5
stanfordnlp/CoreNLP
escapeTextAroundXMLTags
src/edu/stanford/nlp/util/XMLUtils.java
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
0
Analyze the following code function for security vulnerabilities
@Override public Response processShutdown(ShutdownInfo info) throws Exception { stopAsync(); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processShutdown File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
processShutdown
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
void resetBackupState(File stateFileDir) { synchronized (mQueueLock) { // Wipe the "what we've ever backed up" tracking mEverStoredApps.clear(); mEverStored.delete(); mCurrentToken = 0; writeRestoreTokens(); // Remove all the state files for (File sf : stateFileDir.listFiles()) { // ... but don't touch the needs-init sentinel if (!sf.getName().equals(INIT_SENTINEL_FILE_NAME)) { sf.delete(); } } } // Enqueue a new backup of every participant synchronized (mBackupParticipants) { final int N = mBackupParticipants.size(); for (int i=0; i<N; i++) { HashSet<String> participants = mBackupParticipants.valueAt(i); if (participants != null) { for (String packageName : participants) { dataChangedImpl(packageName); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetBackupState File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
resetBackupState
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@GuardedBy("getLockObject()") private List<ActiveAdmin> getActiveAdminsForUserAndItsManagedProfilesLocked(int userHandle, Predicate<UserInfo> shouldIncludeProfileAdmins) { ArrayList<ActiveAdmin> admins = new ArrayList<>(); mInjector.binderWithCleanCallingIdentity(() -> { for (UserInfo userInfo : mUserManager.getProfiles(userHandle)) { DevicePolicyData policy = getUserDataUnchecked(userInfo.id); if (userInfo.id == userHandle) { admins.addAll(policy.mAdminList); } else if (userInfo.isManagedProfile()) { for (int i = 0; i < policy.mAdminList.size(); i++) { ActiveAdmin admin = policy.mAdminList.get(i); if (admin.hasParentActiveAdmin()) { admins.add(admin.getParentActiveAdmin()); } if (shouldIncludeProfileAdmins.test(userInfo)) { admins.add(admin); } } } else { Slogf.w(LOG_TAG, "Unknown user type: " + userInfo); } } }); return admins; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveAdminsForUserAndItsManagedProfilesLocked 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
getActiveAdminsForUserAndItsManagedProfilesLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static Activity activityFromContext(Context context) { // Only retrieve the base context if the supplied context is a ContextWrapper but not // an Activity, given that Activity is already a subclass of ContextWrapper. if (context instanceof Activity) { return ((Activity) context); } else if (context instanceof ContextWrapper) { context = ((ContextWrapper) context).getBaseContext(); return activityFromContext(context); } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: activityFromContext File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
activityFromContext
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0