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 List<String> getId() { return this.configuration.getId(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getId File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-26471
HIGH
8.8
xwiki/xwiki-platform
getId
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java
00532d9f1404287cf3ec3a05056640d809516006
0
Analyze the following code function for security vulnerabilities
@POST @Path("/contents") @Produces(MediaType.TEXT_HTML) @Consumes(MediaType.MULTIPART_FORM_DATA) public String uploadFile(@QueryParam("f") String fileName, @Multipart("upload") Attachment attachment, @Context SecurityContext securityContext) throws IOException { if (!securityContext.isUserInRole(Authentication.ROLE_FILESYSTEM_EDITOR)) { throw new ForbiddenException("FILESYSTEM EDITOR role is required for uploading file contents."); } final java.nio.file.Path targetPath = ensureFileIsAllowed(fileName); // Write the contents a temporary file final File tempFile = File.createTempFile("upload-", targetPath.getFileName().toString()); try { tempFile.deleteOnExit(); final InputStream in = attachment.getObject(InputStream.class); Files.copy(in, tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING); // Validate it maybeValidateXml(tempFile); // Copy it to the right place Files.copy(tempFile.toPath(), targetPath, StandardCopyOption.REPLACE_EXISTING); return String.format("Successfully wrote to '%s'.", targetPath); } finally { // Delete the temporary file if (!tempFile.delete()) { LOG.warn("Failed to delete temporary file '{}' when uploading contents for '{}'.", tempFile, targetPath); } } }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-40315 - Severity: HIGH - CVSS Score: 8.0 Description: NMS-15702: Only members of ROLE_ADMIN can view/edit users.xml Function: uploadFile File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java Repository: OpenNMS/opennms Fixed Code: @POST @Path("/contents") @Produces(MediaType.TEXT_HTML) @Consumes(MediaType.MULTIPART_FORM_DATA) public String uploadFile(@QueryParam("f") String fileName, @Multipart("upload") Attachment attachment, @Context SecurityContext securityContext) throws IOException { if (!securityContext.isUserInRole(Authentication.ROLE_FILESYSTEM_EDITOR)) { throw new ForbiddenException("FILESYSTEM EDITOR role is required for uploading file contents."); } final java.nio.file.Path targetPath = ensureFileIsAllowed(fileName, securityContext); // Write the contents a temporary file final File tempFile = File.createTempFile("upload-", targetPath.getFileName().toString()); try { tempFile.deleteOnExit(); final InputStream in = attachment.getObject(InputStream.class); Files.copy(in, tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING); // Validate it maybeValidateXml(tempFile); // Copy it to the right place Files.copy(tempFile.toPath(), targetPath, StandardCopyOption.REPLACE_EXISTING); return String.format("Successfully wrote to '%s'.", targetPath); } finally { // Delete the temporary file if (!tempFile.delete()) { LOG.warn("Failed to delete temporary file '{}' when uploading contents for '{}'.", tempFile, targetPath); } } }
[ "CWE-Other" ]
CVE-2023-40315
HIGH
8
OpenNMS/opennms
uploadFile
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
201301e067329ababa3c0671ded5c4c43347d4a8
1
Analyze the following code function for security vulnerabilities
@Override public void handleSystemNavigationKey(int key) { if (SPEW) Log.d(TAG, "handleSystemNavigationKey: " + key); if (!panelsEnabled() || !mKeyguardMonitor.isDeviceInteractive() || mKeyguardMonitor.isShowing() && !mKeyguardMonitor.isOccluded()) { return; } // Panels are not available in setup if (!mUserSetup) return; if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_UP == key) { mMetricsLogger.action(MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_UP); mNotificationPanel.collapse(false /* delayed */, 1.0f /* speedUpFactor */); } else if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_DOWN == key) { mMetricsLogger.action(MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_DOWN); if (mNotificationPanel.isFullyCollapsed()) { mNotificationPanel.expand(true /* animate */); mMetricsLogger.count(NotificationPanelView.COUNTER_PANEL_OPEN, 1); } else if (!mNotificationPanel.isInSettings() && !mNotificationPanel.isExpanding()){ mNotificationPanel.flingSettings(0 /* velocity */, true /* expand */); mMetricsLogger.count(NotificationPanelView.COUNTER_PANEL_OPEN_QS, 1); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleSystemNavigationKey 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
handleSystemNavigationKey
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void switchToDefaultGestureNavBackInset(int userId, SettingsState secureSettings) { try { final IOverlayManager om = IOverlayManager.Stub.asInterface( ServiceManager.getService(Context.OVERLAY_SERVICE)); final OverlayInfo info = om.getOverlayInfo(NAV_BAR_MODE_GESTURAL_OVERLAY, userId); if (info != null && !info.isEnabled()) { final int curInset = getContext().getResources().getDimensionPixelSize( com.android.internal.R.dimen.config_backGestureInset); om.setEnabledExclusiveInCategory(NAV_BAR_MODE_GESTURAL_OVERLAY, userId); final int defInset = getContext().getResources().getDimensionPixelSize( com.android.internal.R.dimen.config_backGestureInset); final float scale = defInset == 0 ? 1.0f : ((float) curInset) / defInset; if (scale != 1.0f) { secureSettings.insertSettingLocked( Secure.BACK_GESTURE_INSET_SCALE_LEFT, Float.toString(scale), null /* tag */, false /* makeDefault */, SettingsState.SYSTEM_PACKAGE_NAME); secureSettings.insertSettingLocked( Secure.BACK_GESTURE_INSET_SCALE_RIGHT, Float.toString(scale), null /* tag */, false /* makeDefault */, SettingsState.SYSTEM_PACKAGE_NAME); if (DEBUG) { Slog.v(LOG_TAG, "Moved back sensitivity for user " + userId + " to scale " + scale); } } } } catch (SecurityException | IllegalStateException | RemoteException e) { Slog.e(LOG_TAG, "Failed to switch to default gesture nav overlay for user " + userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchToDefaultGestureNavBackInset File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
switchToDefaultGestureNavBackInset
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
@Override public Set<String> validateDatasource(DatasourceConfiguration datasourceConfiguration) { // We don't verify whether the URL is in valid format because it can contain mustache template keys, and so // look invalid at this point, but become valid after mustache rendering. So we just check if URL field has // a non-empty value. Set<String> invalids = new HashSet<>(); if (StringUtils.isEmpty(datasourceConfiguration.getUrl())) { invalids.add("Missing URL."); } final String contentTypeError = verifyContentType(datasourceConfiguration.getHeaders()); if (contentTypeError != null) { invalids.add("Invalid Content-Type: " + contentTypeError); } if (!CollectionUtils.isEmpty(datasourceConfiguration.getProperties())) { boolean isSendSessionEnabled = false; String secretKey = null; for (Property property : datasourceConfiguration.getProperties()) { if ("isSendSessionEnabled".equals(property.getKey())) { isSendSessionEnabled = "Y".equals(property.getValue()); } else if ("sessionSignatureKey".equals(property.getKey())) { secretKey = (String) property.getValue(); } } if (isSendSessionEnabled && (StringUtils.isEmpty(secretKey) || secretKey.length() < 32)) { invalids.add("Secret key is required when sending session is switched on" + ", and should be at least 32 characters long."); } } try { getSignatureKey(datasourceConfiguration); } catch (AppsmithPluginException e) { invalids.add(e.getMessage()); } if (datasourceConfiguration.getAuthentication() != null) { invalids.addAll(DatasourceValidator.validateAuthentication(datasourceConfiguration.getAuthentication())); } return invalids; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateDatasource File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-38298
HIGH
8.8
appsmithorg/appsmith
validateDatasource
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
0
Analyze the following code function for security vulnerabilities
@Override public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) { enforceNotIsolatedCaller("moveActivityTaskToBack"); synchronized(this) { final long origId = Binder.clearCallingIdentity(); try { int taskId = ActivityRecord.getTaskForActivityLocked(token, !nonRoot); if (taskId >= 0) { if ((mStackSupervisor.mLockTaskModeTask != null) && (mStackSupervisor.mLockTaskModeTask.taskId == taskId)) { mStackSupervisor.showLockTaskToast(); return false; } return ActivityRecord.getStackLocked(token).moveTaskToBackLocked(taskId); } } finally { Binder.restoreCallingIdentity(origId); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveActivityTaskToBack 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
moveActivityTaskToBack
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public static final native long getTotalMemory();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTotalMemory File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
getTotalMemory
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
public boolean isRequiresWebSocket() { if (viewManager != null && viewManager.getTopStructElement() != null && viewManager.getTopStructElement().getMetadataFields() != null) { return viewManager.getTopStructElement().getMetadataFields().containsKey(SolrConstants.ACCESSCONDITION_CONCURRENTUSE); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRequiresWebSocket File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
isRequiresWebSocket
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
@Override public void prepare(HttpServletResponse hres) { List<String> selectedFiles = selection.getFiles(); String urlEncodedLabel; if(selectedFiles.size() == 1) { String filename = selectedFiles.get(0); int lastIndexOf = filename.lastIndexOf('.'); if(lastIndexOf > 0) { filename = filename.substring(0, lastIndexOf); } urlEncodedLabel = StringHelper.urlEncodeUTF8(filename + ".zip"); } else { urlEncodedLabel = "Archive.zip"; } hres.setHeader("Content-Disposition","attachment; filename*=UTF-8''" + urlEncodedLabel); hres.setHeader("Content-Description", urlEncodedLabel); if(selectedFiles.size() == 1 && selectedFiles.get(0).toLowerCase().endsWith(".zip")) { VFSItem singleItem = currentContainer.resolve(selectedFiles.get(0)); if(singleItem instanceof VFSLeaf) { try(OutputStream out = hres.getOutputStream()) { VFSManager.copyContent((VFSLeaf)singleItem, out); } catch(IOException e) { log.error("", e); } } else { prepareZip(hres, selectedFiles); } } else { prepareZip(hres, selectedFiles); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepare File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
prepare
src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
public int getCurrentTag() { return _tagValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentTag File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
getCurrentTag
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public String getID() { return id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getID File: base/common/src/main/java/com/netscape/certsrv/account/Account.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getID
base/common/src/main/java/com/netscape/certsrv/account/Account.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public boolean pageExists(String space, String page) throws Exception { return rest().exists(new LocalDocumentReference(space, page)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pageExists File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
pageExists
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
protected void showBouncer() { mWaitingForKeyguardExit = mStatusBarKeyguardViewManager.isShowing(); mStatusBarKeyguardViewManager.dismiss(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showBouncer 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
showBouncer
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public boolean isUseProjectNamingStrategy(){ return projectNamingStrategy != DefaultProjectNamingStrategy.DEFAULT_NAMING_STRATEGY; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUseProjectNamingStrategy File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
isUseProjectNamingStrategy
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@Beta public static String simplifyPath(String pathname) { checkNotNull(pathname); if (pathname.length() == 0) { return "."; } // split the path apart Iterable<String> components = Splitter.on('/').omitEmptyStrings().split(pathname); List<String> path = new ArrayList<>(); // resolve ., .., and // for (String component : components) { switch (component) { case ".": continue; case "..": if (path.size() > 0 && !path.get(path.size() - 1).equals("..")) { path.remove(path.size() - 1); } else { path.add(".."); } break; default: path.add(component); break; } } // put it back together String result = Joiner.on('/').join(path); if (pathname.charAt(0) == '/') { result = "/" + result; } while (result.startsWith("/../")) { result = result.substring(3); } if (result.equals("/..")) { result = "/"; } else if ("".equals(result)) { result = "."; } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: simplifyPath File: guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-8908
LOW
2.1
google/guava
simplifyPath
guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
void initializeExtensions() { ExtensionDesc[] extDescs = resources.getExtensions(); List<JNLPClassLoader> loaderList = new ArrayList<>(); loaderList.add(this); if (mainClass == null) { Object obj = file.getEntryPointDesc(); if (obj instanceof ApplicationDesc) { ApplicationDesc ad = (ApplicationDesc) file.getEntryPointDesc(); mainClass = ad.getMainClass(); } else if (obj instanceof AppletDesc) { AppletDesc ad = (AppletDesc) file.getEntryPointDesc(); mainClass = ad.getMainClass(); } } //if (ext != null) { for (ExtensionDesc ext : extDescs) { try { String uniqueKey = this.getJNLPFile().getUniqueKey(); JNLPClassLoader loader = getInstance(ext.getLocation(), uniqueKey, ext.getVersion(), file.getParserSettings(), updatePolicy, mainClass, this.enableCodeBase); loaderList.add(loader); } catch (Exception ex) { LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, ex); } } //} loaders = loaderList.toArray(new JNLPClassLoader[loaderList.size()]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeExtensions File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
initializeExtensions
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@Override public void onActivityLaunched(long id, ComponentName name, int temperature) { mAppProfiler.onActivityLaunched(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onActivityLaunched 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
onActivityLaunched
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public boolean supportsAccessibilityAction(int action) { return mAccessibilityInjector.supportsAccessibilityAction(action); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: supportsAccessibilityAction 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
supportsAccessibilityAction
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public void setPermissionEnforced(String permission, boolean enforced) { // TODO: Now that we no longer change GID for storage, this should to away. mContext.enforceCallingOrSelfPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS, "setPermissionEnforced"); if (READ_EXTERNAL_STORAGE.equals(permission)) { synchronized (mPackages) { if (mSettings.mReadExternalStorageEnforced == null || mSettings.mReadExternalStorageEnforced != enforced) { mSettings.mReadExternalStorageEnforced = enforced; mSettings.writeLPr(); } } // kill any non-foreground processes so we restart them and // grant/revoke the GID. final IActivityManager am = ActivityManagerNative.getDefault(); if (am != null) { final long token = Binder.clearCallingIdentity(); try { am.killProcessesBelowForeground("setPermissionEnforcement"); } catch (RemoteException e) { } finally { Binder.restoreCallingIdentity(token); } } } else { throw new IllegalArgumentException("No selective enforcement for " + permission); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPermissionEnforced File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
setPermissionEnforced
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = "/{appId}" + REPORT_URL + ".{format:\\w+}", method = RequestMethod.POST) public final void createReport( @PathVariable final String appId, @PathVariable final String format, @RequestBody final String requestData, final HttpServletRequest createReportRequest, final HttpServletResponse createReportResponse) throws NoSuchAppException { setNoCache(createReportResponse); String ref = createAndSubmitPrintJob(appId, format, requestData, createReportRequest, createReportResponse); if (ref == null) { error(createReportResponse, "Failed to create a print job", HttpStatus.INTERNAL_SERVER_ERROR); return; } createReportResponse.setContentType("application/json; charset=utf-8"); try (PrintWriter writer = createReportResponse.getWriter()) { JSONWriter json = new JSONWriter(writer); json.object(); { json.key(JSON_PRINT_JOB_REF).value(ref); String statusURL = getBaseUrl(createReportRequest) + STATUS_URL + "/" + ref + ".json"; json.key(JSON_STATUS_LINK).value(statusURL); addDownloadLinkToJson(createReportRequest, ref, json); } json.endObject(); } catch (JSONException | IOException e) { LOGGER.warn("Error generating the JSON response", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createReport File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java Repository: mapfish/mapfish-print The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-15231
MEDIUM
4.3
mapfish/mapfish-print
createReport
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
89155f2506b9cee822e15ce60ccae390a1419d5e
0
Analyze the following code function for security vulnerabilities
@Override public void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) throws Exception { ctx.bind(localAddress, promise); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bind File: handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-34462
MEDIUM
6.5
netty
bind
handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java
535da17e45201ae4278c0479e6162bb4127d4c32
0
Analyze the following code function for security vulnerabilities
void updateSleepIfNeededLocked() { if (mSleeping && !shouldSleepLocked()) { mSleeping = false; startTimeTrackingFocusedActivityLocked(); mTopProcessState = ActivityManager.PROCESS_STATE_TOP; mStackSupervisor.comeOutOfSleepIfNeededLocked(); updateOomAdjLocked(); } else if (!mSleeping && shouldSleepLocked()) { mSleeping = true; if (mCurAppTimeTracker != null) { mCurAppTimeTracker.stop(); } mTopProcessState = ActivityManager.PROCESS_STATE_TOP_SLEEPING; mStackSupervisor.goingToSleepLocked(); updateOomAdjLocked(); // Initialize the wake times of all processes. checkExcessivePowerUsageLocked(false); mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG); Message nmsg = mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG); mHandler.sendMessageDelayed(nmsg, POWER_CHECK_DELAY); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSleepIfNeededLocked 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
updateSleepIfNeededLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public boolean isUsageStatisticsCollected() { return noUsageStatistics==null || !noUsageStatistics; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUsageStatisticsCollected File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
isUsageStatisticsCollected
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private boolean shouldReturnDocDoesNotExist(XWikiDocument doc, XWikiContext context) throws ComponentLookupException { boolean result = false; String action = context.getAction(); if (this.componentManager.hasComponent(DocExistValidator.class, action)) { result = this.componentManager.<DocExistValidator>getInstance(DocExistValidator.class, action) .docExist(doc, context); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldReturnDocDoesNotExist File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-29208
HIGH
7.5
xwiki/xwiki-platform
shouldReturnDocDoesNotExist
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
d9e947559077e947315bf700c5703dfc7dd8a8d7
0
Analyze the following code function for security vulnerabilities
@Override public void onGuildVoiceGuildDeafen(@NotNull GuildVoiceGuildDeafenEvent event) { if (event.getMember() != event.getGuild().getSelfMember()) return; if (!event.isGuildDeafened()) { event.getGuild().getSelfMember().deafen(true).queue(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onGuildVoiceGuildDeafen File: src/main/java/de/presti/ree6/events/OtherEvents.java Repository: Ree6-Applications/Ree6 The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
onGuildVoiceGuildDeafen
src/main/java/de/presti/ree6/events/OtherEvents.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
0
Analyze the following code function for security vulnerabilities
@Override protected void onLayout(boolean changed, int l, int t, int r, int b) { View locationBarView = mLocationBar.getContainerView(); if (mUrlBar == null) { mUrlBar = (UrlBar) locationBarView.findViewById(R.id.url_bar); mUrlBar.addOnLayoutChangeListener(this); } if (mNavigationButton == null) { mNavigationButton = (ImageView) locationBarView.findViewById(R.id.navigation_button); mNavigationButton.addOnLayoutChangeListener(this); } // Align the text to be pixel perfectly aligned with the text in the url bar. mTextLeft = getSuggestionTextLeftPosition(); mTextRight = getSuggestionTextRightPosition(); boolean isRTL = ApiCompatibilityUtils.isLayoutRtl(this); if (DeviceFormFactor.isTablet(getContext())) { int textWidth = isRTL ? mTextRight : (r - l - mTextLeft); final float maxRequiredWidth = mSuggestionDelegate.getMaxRequiredWidth(); final float maxMatchContentsWidth = mSuggestionDelegate.getMaxMatchContentsWidth(); float paddingStart = (textWidth > maxRequiredWidth) ? (mRequiredWidth - mMatchContentsWidth) : Math.max(textWidth - maxMatchContentsWidth, 0); ApiCompatibilityUtils.setPaddingRelative( mTextLine1, (int) paddingStart, mTextLine1.getPaddingTop(), 0, // TODO(skanuj) : Change to ApiCompatibilityUtils.getPaddingEnd(...). mTextLine1.getPaddingBottom()); } int imageWidth = mAnswerImageMaxSize; int imageSpacing = 0; if (mAnswerImage.getVisibility() == VISIBLE && imageWidth > 0) { imageSpacing = getResources().getDimensionPixelOffset( R.dimen.omnibox_suggestion_answer_image_horizontal_spacing); } if (isRTL) { mTextLine1.layout(0, t, mTextRight, b); mAnswerImage.layout(mTextRight - imageWidth , t, mTextRight, b); mTextLine2.layout(0, t, mTextRight - (imageWidth + imageSpacing), b); } else { mTextLine1.layout(mTextLeft, t, r - l, b); mAnswerImage.layout(mTextLeft, t, mTextLeft + imageWidth, b); mTextLine2.layout(mTextLeft + imageWidth + imageSpacing, t, r - l, b); } int suggestionIconPosition = getSuggestionIconLeftPosition(); if (mSuggestionIconLeft != suggestionIconPosition && mSuggestionIconLeft != Integer.MIN_VALUE) { mContentsView.postInvalidateOnAnimation(); } mSuggestionIconLeft = suggestionIconPosition; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLayout File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
onLayout
chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
public void addQueryStringEntry(StringBuilder builder, String key, Object value) { if (value != null) { if (value instanceof Iterable) { for (Object element : (Iterable<?>) value) { addQueryStringEntry(builder, key, element.toString()); builder.append('&'); } } else { addQueryStringEntry(builder, key, value.toString()); } } else { addQueryStringEntry(builder, key, (String) null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addQueryStringEntry File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
addQueryStringEntry
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
TemplateEngineTypeEnum type();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: type File: ballcat-codegen-backend/src/main/java/com/hccake/ballcat/codegen/engine/TemplateEngine.java Repository: ballcat-projects/ballcat-codegen The code follows secure coding practices.
[ "CWE-20" ]
CVE-2022-24881
HIGH
7.5
ballcat-projects/ballcat-codegen
type
ballcat-codegen-backend/src/main/java/com/hccake/ballcat/codegen/engine/TemplateEngine.java
84a7cb38daf0295b93aba21d562ec627e4eb463b
0
Analyze the following code function for security vulnerabilities
public AsyncHttpClientConfig getClientConfig() { return clientConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClientConfig File: providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/GrizzlyAsyncHttpProvider.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
getClientConfig
providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/GrizzlyAsyncHttpProvider.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public boolean isMediaNotification(NotificationData.Entry entry) { // TODO: confirm that there's a valid media key return entry.getExpandedContentView() != null && entry.getExpandedContentView() .findViewById(com.android.internal.R.id.media_actions) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMediaNotification 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
isMediaNotification
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public WindowState getWindowState() { return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWindowState 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
getWindowState
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private CallbackHandler getCallbackHandler( @UnderInitialization(WrappedFactory.class) LibPQFactory this, Properties info) throws PSQLException { // Determine the callback handler CallbackHandler cbh; String sslpasswordcallback = PGProperty.SSL_PASSWORD_CALLBACK.get(info); if (sslpasswordcallback != null) { try { cbh = (CallbackHandler) ObjectFactory.instantiate(sslpasswordcallback, info, false, null); } catch (Exception e) { throw new PSQLException( GT.tr("The password callback class provided {0} could not be instantiated.", sslpasswordcallback), PSQLState.CONNECTION_FAILURE, e); } } else { cbh = new ConsoleCallbackHandler(PGProperty.SSL_PASSWORD.get(info)); } return cbh; }
Vulnerability Classification: - CWE: CWE-665 - CVE: CVE-2022-21724 - Severity: HIGH - CVSS Score: 7.5 Description: Merge pull request from GHSA-v7wg-cpwc-24m4 This ensures arbitrary classes can't be passed instead of AuthenticationPlugin, SocketFactory, SSLSocketFactory, CallbackHandler, HostnameVerifier Function: getCallbackHandler File: pgjdbc/src/main/java/org/postgresql/ssl/LibPQFactory.java Repository: pgjdbc Fixed Code: private CallbackHandler getCallbackHandler( @UnderInitialization(WrappedFactory.class) LibPQFactory this, Properties info) throws PSQLException { // Determine the callback handler CallbackHandler cbh; String sslpasswordcallback = PGProperty.SSL_PASSWORD_CALLBACK.get(info); if (sslpasswordcallback != null) { try { cbh = ObjectFactory.instantiate(CallbackHandler.class, sslpasswordcallback, info, false, null); } catch (Exception e) { throw new PSQLException( GT.tr("The password callback class provided {0} could not be instantiated.", sslpasswordcallback), PSQLState.CONNECTION_FAILURE, e); } } else { cbh = new ConsoleCallbackHandler(PGProperty.SSL_PASSWORD.get(info)); } return cbh; }
[ "CWE-665" ]
CVE-2022-21724
HIGH
7.5
pgjdbc
getCallbackHandler
pgjdbc/src/main/java/org/postgresql/ssl/LibPQFactory.java
f4d0ed69c0b3aae8531d83d6af4c57f22312c813
1
Analyze the following code function for security vulnerabilities
@RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS) public void addOnPermissionsChangeListener( @NonNull PackageManager.OnPermissionsChangedListener listener) { synchronized (mPermissionListeners) { if (mPermissionListeners.get(listener) != null) { return; } final OnPermissionsChangeListenerDelegate delegate = new OnPermissionsChangeListenerDelegate(listener, Looper.getMainLooper()); try { mPermissionManager.addOnPermissionsChangeListener(delegate); mPermissionListeners.put(listener, delegate); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addOnPermissionsChangeListener File: core/java/android/permission/PermissionManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
addOnPermissionsChangeListener
core/java/android/permission/PermissionManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasNavigationBar() { return mPolicy.hasNavigationBar(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasNavigationBar File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
hasNavigationBar
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override public OnGoingLogicalCondition neq(T value) { Condition conditionLocal = new NotEqualCondition<T>(selector, selector.generateParameter(value)); return getOnGoingLogicalCondition(conditionLocal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: neq File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java Repository: xjodoin/torpedoquery The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2019-11343
HIGH
7.5
xjodoin/torpedoquery
neq
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
3c20b874fba9cc2a78b9ace10208de1602b56c3f
0
Analyze the following code function for security vulnerabilities
@Override public void setEnableSessionCreation(boolean b) { if (b) { throw new UnsupportedOperationException(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEnableSessionCreation 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
setEnableSessionCreation
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
default List<MediaType> accept() { return getAll(HttpHeaders.ACCEPT) .stream() .flatMap(x -> Arrays.stream(x.split(","))) .flatMap(s -> ConversionService.SHARED.convert(s, MediaType.class).map(Stream::of).orElse(Stream.empty())) .distinct() .collect(Collectors.toList()); }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2022-21700 - Severity: MEDIUM - CVSS Score: 5.0 Description: Use ConversionContext constants where possible instead of class (#2356) Changes ------- * Added ArgumentConversionContext constants in ConversionContext * Replaced Argument.of and use of argument classes with ConversionContext constants where possible * Added getFirst method in ConvertibleMultiValues that accepts ArgumentConversionContent parameter Partially addresses issue #2355 Function: accept File: http/src/main/java/io/micronaut/http/HttpHeaders.java Repository: micronaut-projects/micronaut-core Fixed Code: default List<MediaType> accept() { return getAll(HttpHeaders.ACCEPT) .stream() .flatMap(x -> Arrays.stream(x.split(","))) .flatMap(s -> ConversionService.SHARED.convert(s, MediaType.CONVERSION_CONTEXT).map(Stream::of).orElse(Stream.empty())) .distinct() .collect(Collectors.toList()); }
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
accept
http/src/main/java/io/micronaut/http/HttpHeaders.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
1
Analyze the following code function for security vulnerabilities
@Deprecated public PendingIntent getDisplayIntent() { return mDisplayIntent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisplayIntent File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getDisplayIntent
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public FormValidation doCheckIncludedRegions(@QueryParameter String value) throws IOException, ServletException { return doCheckExcludedRegions(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doCheckIncludedRegions File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
doCheckIncludedRegions
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
private void initializeStores() throws ComponentLookupException { XWikiStoreInterface mainStore = getStoreConfiguration().getXWikiStore(); // Check if we need to use the cache store.. if (getStoreConfiguration().isStoreCacheEnabled()) { XWikiCacheStoreInterface cachestore = (XWikiCacheStoreInterface) Utils.getComponent(XWikiStoreInterface.class, "cache"); cachestore.setStore(mainStore); setStore(cachestore); } else { setStore(mainStore); } setDefaultAttachmentContentStore(getStoreConfiguration().getXWikiAttachmentStore()); setVersioningStore(getStoreConfiguration().getXWikiVersioningStore()); setDefaultAttachmentArchiveStore(getStoreConfiguration().getAttachmentVersioningStore()); setRecycleBinStore(getStoreConfiguration().getXWikiRecycleBinStore()); setAttachmentRecycleBinStore(getStoreConfiguration().getAttachmentRecycleBinStore()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeStores File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
initializeStores
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object thatObject) { if (this == thatObject) { return true; } if (!(thatObject instanceof PasspointConfiguration)) { return false; } PasspointConfiguration that = (PasspointConfiguration) thatObject; return (mHomeSp == null ? that.mHomeSp == null : mHomeSp.equals(that.mHomeSp)) && (mAaaServerTrustedNames == null ? that.mAaaServerTrustedNames == null : Arrays.equals(mAaaServerTrustedNames, that.mAaaServerTrustedNames)) && (mCredential == null ? that.mCredential == null : mCredential.equals(that.mCredential)) && (mPolicy == null ? that.mPolicy == null : mPolicy.equals(that.mPolicy)) && (mSubscriptionUpdate == null ? that.mSubscriptionUpdate == null : mSubscriptionUpdate.equals(that.mSubscriptionUpdate)) && isTrustRootCertListEquals(mTrustRootCertList, that.mTrustRootCertList) && mUpdateIdentifier == that.mUpdateIdentifier && mCredentialPriority == that.mCredentialPriority && mSubscriptionCreationTimeInMillis == that.mSubscriptionCreationTimeInMillis && mSubscriptionExpirationTimeMillis == that.mSubscriptionExpirationTimeMillis && TextUtils.equals(mSubscriptionType, that.mSubscriptionType) && mUsageLimitUsageTimePeriodInMinutes == that.mUsageLimitUsageTimePeriodInMinutes && mUsageLimitStartTimeInMillis == that.mUsageLimitStartTimeInMillis && mUsageLimitDataLimit == that.mUsageLimitDataLimit && mUsageLimitTimeLimitInMinutes == that.mUsageLimitTimeLimitInMinutes && mCarrierId == that.mCarrierId && mSubscriptionId == that.mSubscriptionId && mIsOemPrivate == that.mIsOemPrivate && mIsOemPaid == that.mIsOemPaid && mIsCarrierMerged == that.mIsCarrierMerged && mIsAutojoinEnabled == that.mIsAutojoinEnabled && mIsMacRandomizationEnabled == that.mIsMacRandomizationEnabled && mIsNonPersistentMacRandomizationEnabled == that.mIsNonPersistentMacRandomizationEnabled && mMeteredOverride == that.mMeteredOverride && (mServiceFriendlyNames == null ? that.mServiceFriendlyNames == null : mServiceFriendlyNames.equals(that.mServiceFriendlyNames)) && Objects.equals(mDecoratedIdentityPrefix, that.mDecoratedIdentityPrefix) && Objects.equals(mSubscriptionGroup, that.mSubscriptionGroup); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
equals
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private boolean deleteSystemSetting(String name, int requestingUserId) { if (DEBUG) { Slog.v(LOG_TAG, "deleteSystemSetting(" + name + ", " + requestingUserId + ")"); } return mutateSystemSetting(name, null, requestingUserId, MUTATION_OPERATION_DELETE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteSystemSetting File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
deleteSystemSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
public static NativeArray jsFunction_getInlineContent(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException, APIManagementException { String apiName; String version; String providerName; String docName; String content = null; NativeArray myn = new NativeArray(0); if (args != null && isStringArray(args)) { providerName = (String) args[0]; apiName = (String) args[1]; version = (String) args[2]; docName = (String) args[3]; try { providerName = APIUtil.replaceEmailDomain(URLDecoder.decode(providerName, "UTF-8")); APIIdentifier apiId = new APIIdentifier(providerName, apiName, version); APIConsumer apiConsumer = getAPIConsumer(thisObj); content = apiConsumer.getDocumentationContent(apiId, docName); } catch (Exception e) { handleException("Error while getting Inline Document Content ", e); } if (content == null) { content = ""; } NativeObject row = new NativeObject(); row.put("providerName", row, providerName); row.put("apiName", row, apiName); row.put("apiVersion", row, version); row.put("docName", row, docName); row.put("content", row, content); myn.put(0, myn, row); } return myn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_getInlineContent File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_getInlineContent
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
protected static String getNewToken(Context context, int bitstreamId , int itemID, String reqEmail, String reqName, boolean allfiles) throws SQLException { TableRow rd = DatabaseManager.create(context, "requestitem"); rd.setColumn("token", Utils.generateHexKey()); rd.setColumn("bitstream_id", bitstreamId); rd.setColumn("item_id",itemID); rd.setColumn("allfiles", allfiles); rd.setColumn("request_email", reqEmail); rd.setColumn("request_name", reqName); rd.setColumnNull("accept_request"); rd.setColumn("request_date", new Date()); rd.setColumnNull("decision_date"); rd.setColumnNull("expires"); // don't set expiration date any more //rd.setColumn("expires", getDefaultExpirationDate()); DatabaseManager.update(context, rd); // This is a potential problem -- if we create the callback // and then crash, registration will get SNAFU-ed. // So FIRST leave some breadcrumbs if (log.isDebugEnabled()) { log.debug("Created requestitem_token " + rd.getIntColumn("requestitem_id") + " with token " + rd.getStringColumn("token") + "\""); } return rd.getStringColumn("token"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNewToken File: dspace-jspui/src/main/java/org/dspace/app/webui/util/RequestItemManager.java Repository: DSpace The code follows secure coding practices.
[ "CWE-601", "CWE-79" ]
CVE-2022-31192
MEDIUM
6.1
DSpace
getNewToken
dspace-jspui/src/main/java/org/dspace/app/webui/util/RequestItemManager.java
28eb8158210d41168a62ed5f9e044f754513bc37
0
Analyze the following code function for security vulnerabilities
public static String getUploadFinishMessage() { return FileUploader.class.getName() + UPLOAD_FINISH_MESSAGE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUploadFinishMessage File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39210
MEDIUM
5.5
nextcloud/android
getUploadFinishMessage
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
public static boolean defaultRemoveQueryParamOnRedirect() { return getBoolean(ASYNC_CLIENT + "removeQueryParamOnRedirect", true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultRemoveQueryParamOnRedirect File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7398
MEDIUM
4.3
AsyncHttpClient/async-http-client
defaultRemoveQueryParamOnRedirect
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
default void create(UUID jobId, String key, InputStream stream) throws IOException { throw new UnsupportedOperationException(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create File: portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/storage/TemporaryPerJobDataStore.java Repository: google/data-transfer-project The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-22572
LOW
2.1
google/data-transfer-project
create
portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/storage/TemporaryPerJobDataStore.java
013edb6c2d5a4e472988ea29a7cb5b1fdaf9c635
0
Analyze the following code function for security vulnerabilities
boolean ensureActivityConfiguration(int globalChanges, boolean preserveWindow) { return ensureActivityConfiguration(globalChanges, preserveWindow, false /* ignoreVisibility */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ensureActivityConfiguration File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
ensureActivityConfiguration
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public List<FederatedLoginService> getFederatedLoginServices() { return FederatedLoginService.all(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFederatedLoginServices File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getFederatedLoginServices
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private boolean isAnyPortrait(int rotation) { return rotation == mPortraitRotation || rotation == mUpsideDownRotation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAnyPortrait File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
isAnyPortrait
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@RequiresApi(Build.VERSION_CODES.S) private @WifiConfiguration.RecentFailureReason int mboAssocDisallowedReasonCodeToWifiConfigurationRecentFailureReason( @MboOceConstants.MboAssocDisallowedReasonCode int reasonCode) { switch (reasonCode) { case MboOceConstants.MBO_ASSOC_DISALLOWED_REASON_MAX_NUM_STA_ASSOCIATED: return WifiConfiguration.RECENT_FAILURE_MBO_ASSOC_DISALLOWED_MAX_NUM_STA_ASSOCIATED; case MboOceConstants.MBO_ASSOC_DISALLOWED_REASON_AIR_INTERFACE_OVERLOADED: return WifiConfiguration .RECENT_FAILURE_MBO_ASSOC_DISALLOWED_AIR_INTERFACE_OVERLOADED; case MboOceConstants.MBO_ASSOC_DISALLOWED_REASON_AUTH_SERVER_OVERLOADED: return WifiConfiguration.RECENT_FAILURE_MBO_ASSOC_DISALLOWED_AUTH_SERVER_OVERLOADED; case MboOceConstants.MBO_ASSOC_DISALLOWED_REASON_INSUFFICIENT_RSSI: return WifiConfiguration.RECENT_FAILURE_MBO_ASSOC_DISALLOWED_INSUFFICIENT_RSSI; case MboOceConstants.MBO_ASSOC_DISALLOWED_REASON_UNSPECIFIED: case MboOceConstants.MBO_ASSOC_DISALLOWED_REASON_RESERVED_0: case MboOceConstants.MBO_ASSOC_DISALLOWED_REASON_RESERVED: default: return WifiConfiguration.RECENT_FAILURE_MBO_ASSOC_DISALLOWED_UNSPECIFIED; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mboAssocDisallowedReasonCodeToWifiConfigurationRecentFailureReason 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
mboAssocDisallowedReasonCodeToWifiConfigurationRecentFailureReason
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void setActivityController(IActivityController controller, boolean imAMonkey) { enforceCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER, "setActivityController()"); synchronized (this) { mController = controller; mControllerIsAMonkey = imAMonkey; Watchdog.getInstance().setActivityController(controller); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActivityController 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
setActivityController
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public int getRotationAnimationHint() { return mRotationAnimationHint; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRotationAnimationHint File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getRotationAnimationHint
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
private JAXBContext createJaxbContextFromClasses() throws JAXBException { if (logger.isInfoEnabled()) { logger.info("Creating JAXBContext with classes to be bound [" + StringUtils.arrayToCommaDelimitedString(this.classesToBeBound) + "]"); } if (this.jaxbContextProperties != null) { return JAXBContext.newInstance(this.classesToBeBound, this.jaxbContextProperties); } else { return JAXBContext.newInstance(this.classesToBeBound); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createJaxbContextFromClasses File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
createJaxbContextFromClasses
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
private boolean isOnKeyguard() { return mStatusBar.getBarState() == StatusBarState.KEYGUARD; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOnKeyguard File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
isOnKeyguard
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void browserReload(PeerComponent browserPeer) { ((AndroidImplementation.AndroidBrowserComponent) browserPeer).reload(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: browserReload File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
browserReload
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void setFile(IReadOnlyAccess file, long length) throws IOException { totalPackedSize = 0L; totalPackedRead = 0L; close(); rof = file; try { readHeaders(length); } catch (Exception e) { logger.log(Level.WARNING, "exception in archive constructor maybe file is encrypted " + "or currupt", e); // ignore exceptions to allow exraction of working files in // corrupt archive } // Calculate size of packed data for (BaseBlock block : headers) { if (block.getHeaderType() == UnrarHeadertype.FileHeader) { totalPackedSize += ((FileHeader) block).getFullPackSize(); } } if (unrarCallback != null) { unrarCallback.volumeProgressChanged(totalPackedRead, totalPackedSize); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFile File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2018-12418
MEDIUM
4.3
junrar
setFile
src/main/java/com/github/junrar/Archive.java
ad8d0ba8e155630da8a1215cee3f253e0af45817
0
Analyze the following code function for security vulnerabilities
public String getArchive() throws XWikiException { return this.doc.getDocumentArchive(getXWikiContext()).getArchive(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getArchive File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getArchive
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
private void queueLoad(World world, BlockVector2 chunk) { world.checkLoadedChunk(BlockVector3.at(chunk.getX() << 4, 0, chunk.getZ() << 4)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queueLoad File: worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/preloader/AsyncPreloader.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
queueLoad
worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/preloader/AsyncPreloader.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
@Override public String getRequestPath() { return request.getURI().getPath(); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-44794 - Severity: CRITICAL - CVSS Score: 9.8 Description: 修复路由拦截鉴权可被绕过的问题 fix #515 Function: getRequestPath File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java Repository: dromara/Sa-Token Fixed Code: @Override public String getRequestPath() { return ApplicationInfo.cutPathPrefix(request.getPath().toString()); }
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
getRequestPath
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
954efeb73277f924f836da2a25322ea35ee1bfa3
1
Analyze the following code function for security vulnerabilities
private boolean isMonitoring(String iface) { Boolean val = mMonitoringMap.get(iface); if (val == null) { return false; } else { return val.booleanValue(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMonitoring File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
isMonitoring
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void save(String comment, boolean minorEdit) throws XWikiException { if (hasAccessLevel("edit")) { DocumentAuthors authors = this.getAuthors(); authors.setOriginalMetadataAuthor(getCurrentUserReferenceResolver().resolve(CurrentUserReference.INSTANCE)); // If the current author does not have PR don't let it set current user as author of the saved document // since it can lead to right escalation if (hasProgrammingRights() || !getConfiguration().getProperty("security.script.save.checkAuthor", true)) { saveDocument(comment, minorEdit); } else { saveAsAuthor(comment, minorEdit); } } else { java.lang.Object[] args = {getDefaultEntityReferenceSerializer().serialize(getDocumentReference())}; throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "Access denied in edit mode on document {0}", null, args); } }
Vulnerability Classification: - CWE: CWE-648 - CVE: CVE-2023-29507 - Severity: HIGH - CVSS Score: 7.2 Description: XWIKI-20380: Add missing check on document authors Function: save File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform Fixed Code: public void save(String comment, boolean minorEdit) throws XWikiException { if (hasAccessLevel("edit")) { DocumentAuthors authors = getDoc().getAuthors(); authors.setOriginalMetadataAuthor(getCurrentUserReferenceResolver().resolve(CurrentUserReference.INSTANCE)); // If the current author does not have PR don't let it set current user as author of the saved document // since it can lead to right escalation if (hasProgrammingRights() || !getConfiguration().getProperty("security.script.save.checkAuthor", true)) { saveDocument(comment, minorEdit); } else { saveAsAuthor(comment, minorEdit); } } else { java.lang.Object[] args = {getDefaultEntityReferenceSerializer().serialize(getDocumentReference())}; throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "Access denied in edit mode on document {0}", null, args); } }
[ "CWE-648" ]
CVE-2023-29507
HIGH
7.2
xwiki/xwiki-platform
save
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
905cdd7c421dbf8c565557cdc773ab1aa9028f83
1
Analyze the following code function for security vulnerabilities
public String getParamDialogtype() { return m_paramDialogtype; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParamDialogtype 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
getParamDialogtype
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public boolean hasTags(XWikiContext context) { return "1".equals(getXWikiPreference("tags", "xwiki.tags", "0", context)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasTags File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
hasTags
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public static void computeValuesFromData(@NonNull ContentValues values, boolean isForFuse) { // Worst case we have to assume no bucket details values.remove(MediaColumns.VOLUME_NAME); values.remove(MediaColumns.RELATIVE_PATH); values.remove(MediaColumns.IS_TRASHED); values.remove(MediaColumns.DATE_EXPIRES); values.remove(MediaColumns.DISPLAY_NAME); values.remove(MediaColumns.BUCKET_ID); values.remove(MediaColumns.BUCKET_DISPLAY_NAME); final String data = values.getAsString(MediaColumns.DATA); if (TextUtils.isEmpty(data)) return; final File file = new File(data); final File fileLower = new File(data.toLowerCase(Locale.ROOT)); values.put(MediaColumns.VOLUME_NAME, extractVolumeName(data)); values.put(MediaColumns.RELATIVE_PATH, extractRelativePath(data)); final String displayName = extractDisplayName(data); final Matcher matcher = FileUtils.PATTERN_EXPIRES_FILE.matcher(displayName); if (matcher.matches()) { values.put(MediaColumns.IS_PENDING, matcher.group(1).equals(FileUtils.PREFIX_PENDING) ? 1 : 0); values.put(MediaColumns.IS_TRASHED, matcher.group(1).equals(FileUtils.PREFIX_TRASHED) ? 1 : 0); values.put(MediaColumns.DATE_EXPIRES, Long.parseLong(matcher.group(2))); values.put(MediaColumns.DISPLAY_NAME, matcher.group(3)); } else { if (isForFuse) { // Allow Fuse thread to set IS_PENDING when using DATA column. // TODO(b/156867379) Unset IS_PENDING when Fuse thread doesn't explicitly specify // IS_PENDING. It can't be done now because we scan after create. Scan doesn't // explicitly specify the value of IS_PENDING. } else { values.put(MediaColumns.IS_PENDING, 0); } values.put(MediaColumns.IS_TRASHED, 0); values.putNull(MediaColumns.DATE_EXPIRES); values.put(MediaColumns.DISPLAY_NAME, displayName); } // Buckets are the parent directory final String parent = fileLower.getParent(); if (parent != null) { values.put(MediaColumns.BUCKET_ID, parent.hashCode()); // The relative path for files in the top directory is "/" if (!"/".equals(values.getAsString(MediaColumns.RELATIVE_PATH))) { values.put(MediaColumns.BUCKET_DISPLAY_NAME, file.getParentFile().getName()); } else { values.putNull(MediaColumns.BUCKET_DISPLAY_NAME); } } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2023-35670 - Severity: HIGH - CVSS Score: 7.8 Description: Canonicalize file path for insertion by legacy apps Apps with legacy external storage can try to create entries in MP for file paths in other apps external private directories by using a non-canonical path in insertion calls. Test: atest LegacyStorageHostTest#testInsertToOtherAppPrivateDirFails Bug: 276898626 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3c0f583f5dc3f4d395fa2423ab72dbd902c0c6c8) Merged-In: If4c941c8156f19459b3ec6cbaf705824ecc2ba77 Change-Id: If4c941c8156f19459b3ec6cbaf705824ecc2ba77 Function: computeValuesFromData File: src/com/android/providers/media/util/FileUtils.java Repository: android Fixed Code: public static void computeValuesFromData(@NonNull ContentValues values, boolean isForFuse) { // Worst case we have to assume no bucket details values.remove(MediaColumns.VOLUME_NAME); values.remove(MediaColumns.RELATIVE_PATH); values.remove(MediaColumns.IS_TRASHED); values.remove(MediaColumns.DATE_EXPIRES); values.remove(MediaColumns.DISPLAY_NAME); values.remove(MediaColumns.BUCKET_ID); values.remove(MediaColumns.BUCKET_DISPLAY_NAME); String data = values.getAsString(MediaColumns.DATA); if (TextUtils.isEmpty(data)) return; try { data = new File(data).getCanonicalPath(); values.put(MediaColumns.DATA, data); } catch (IOException e) { throw new IllegalArgumentException( String.format(Locale.ROOT, "Invalid file path:%s in request.", data)); } final File file = new File(data); final File fileLower = new File(data.toLowerCase(Locale.ROOT)); values.put(MediaColumns.VOLUME_NAME, extractVolumeName(data)); values.put(MediaColumns.RELATIVE_PATH, extractRelativePath(data)); final String displayName = extractDisplayName(data); final Matcher matcher = FileUtils.PATTERN_EXPIRES_FILE.matcher(displayName); if (matcher.matches()) { values.put(MediaColumns.IS_PENDING, matcher.group(1).equals(FileUtils.PREFIX_PENDING) ? 1 : 0); values.put(MediaColumns.IS_TRASHED, matcher.group(1).equals(FileUtils.PREFIX_TRASHED) ? 1 : 0); values.put(MediaColumns.DATE_EXPIRES, Long.parseLong(matcher.group(2))); values.put(MediaColumns.DISPLAY_NAME, matcher.group(3)); } else { if (isForFuse) { // Allow Fuse thread to set IS_PENDING when using DATA column. // TODO(b/156867379) Unset IS_PENDING when Fuse thread doesn't explicitly specify // IS_PENDING. It can't be done now because we scan after create. Scan doesn't // explicitly specify the value of IS_PENDING. } else { values.put(MediaColumns.IS_PENDING, 0); } values.put(MediaColumns.IS_TRASHED, 0); values.putNull(MediaColumns.DATE_EXPIRES); values.put(MediaColumns.DISPLAY_NAME, displayName); } // Buckets are the parent directory final String parent = fileLower.getParent(); if (parent != null) { values.put(MediaColumns.BUCKET_ID, parent.hashCode()); // The relative path for files in the top directory is "/" if (!"/".equals(values.getAsString(MediaColumns.RELATIVE_PATH))) { values.put(MediaColumns.BUCKET_DISPLAY_NAME, file.getParentFile().getName()); } else { values.putNull(MediaColumns.BUCKET_DISPLAY_NAME); } } }
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
computeValuesFromData
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
1
Analyze the following code function for security vulnerabilities
private String checkFilename(String path, String filename, int i) { File file = new File(path + filename); String i2 = ""; String[] tmp = null; if (!file.exists()) { return filename; } else { if (i != 0) i2 = "" + i; tmp = filename.split(i2 + "\\."); i++; filename = filename.replace(i2 + "." + tmp[tmp.length - 1], i + "." + tmp[tmp.length - 1]); return this.checkFilename(path, filename, i); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkFilename File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java Repository: jflyfox/jfinal_cms The code follows secure coding practices.
[ "CWE-74" ]
CVE-2021-37262
MEDIUM
5
jflyfox/jfinal_cms
checkFilename
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
e7fd0fe9362464c4d2bd308318eecc89a847b116
0
Analyze the following code function for security vulnerabilities
private void updateVoiceNumberField() { if (DBG) log("updateVoiceNumberField()"); mOldVmNumber = mPhone.getVoiceMailNumber(); if (TextUtils.isEmpty(mOldVmNumber)) { mSubMenuVoicemailSettings.setPhoneNumber(""); mSubMenuVoicemailSettings.setSummary(getString(R.string.voicemail_number_not_set)); } else { mSubMenuVoicemailSettings.setPhoneNumber(mOldVmNumber); mSubMenuVoicemailSettings.setSummary(BidiFormatter.getInstance().unicodeWrap( mOldVmNumber, TextDirectionHeuristics.LTR)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateVoiceNumberField File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
updateVoiceNumberField
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
@Override public Resource<?> getLocalResource(String resourceName) { String resourcePath = getSkinResourcePath(resourceName); if (resourcePath != null && getResourceURL(resourcePath) != null) { return createResource(resourcePath, resourceName); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocalResource File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/skin/AbstractResourceSkin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-29253
MEDIUM
4
xwiki/xwiki-platform
getLocalResource
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/skin/AbstractResourceSkin.java
4917c8f355717bb636d763844528b1fe0f95e8e2
0
Analyze the following code function for security vulnerabilities
private void splitHeader(AppendableCharSequence sb) { final int length = sb.length(); int nameStart; int nameEnd; int colonEnd; int valueStart; int valueEnd; nameStart = findNonWhitespace(sb, 0); for (nameEnd = nameStart; nameEnd < length; nameEnd ++) { char ch = sb.charAtUnsafe(nameEnd); if (ch == ':' || Character.isWhitespace(ch)) { break; } } for (colonEnd = nameEnd; colonEnd < length; colonEnd ++) { if (sb.charAtUnsafe(colonEnd) == ':') { colonEnd ++; break; } } name = sb.subStringUnsafe(nameStart, nameEnd); valueStart = findNonWhitespace(sb, colonEnd); if (valueStart == length) { value = EMPTY_VALUE; } else { valueEnd = findEndOfString(sb); value = sb.subStringUnsafe(valueStart, valueEnd); } }
Vulnerability Classification: - CWE: CWE-444 - CVE: CVE-2019-16869 - Severity: MEDIUM - CVSS Score: 5.0 Description: Correctly handle whitespaces in HTTP header names as defined by RFC7230#section-3.2.4 (#9585) Motivation: When parsing HTTP headers special care needs to be taken when a whitespace is detected in the header name. Modifications: - Ignore whitespace when decoding response (just like before) - Throw exception when whitespace is detected during parsing - Add unit tests Result: Fixes https://github.com/netty/netty/issues/9571 Function: splitHeader File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java Repository: netty Fixed Code: private void splitHeader(AppendableCharSequence sb) { final int length = sb.length(); int nameStart; int nameEnd; int colonEnd; int valueStart; int valueEnd; nameStart = findNonWhitespace(sb, 0); for (nameEnd = nameStart; nameEnd < length; nameEnd ++) { char ch = sb.charAtUnsafe(nameEnd); // https://tools.ietf.org/html/rfc7230#section-3.2.4 // // No whitespace is allowed between the header field-name and colon. In // the past, differences in the handling of such whitespace have led to // security vulnerabilities in request routing and response handling. A // server MUST reject any received request message that contains // whitespace between a header field-name and colon with a response code // of 400 (Bad Request). A proxy MUST remove any such whitespace from a // response message before forwarding the message downstream. if (ch == ':' || // In case of decoding a request we will just continue processing and header validation // is done in the DefaultHttpHeaders implementation. // // In the case of decoding a response we will "skip" the whitespace. (!isDecodingRequest() && Character.isWhitespace(ch))) { break; } } for (colonEnd = nameEnd; colonEnd < length; colonEnd ++) { if (sb.charAtUnsafe(colonEnd) == ':') { colonEnd ++; break; } } name = sb.subStringUnsafe(nameStart, nameEnd); valueStart = findNonWhitespace(sb, colonEnd); if (valueStart == length) { value = EMPTY_VALUE; } else { valueEnd = findEndOfString(sb); value = sb.subStringUnsafe(valueStart, valueEnd); } }
[ "CWE-444" ]
CVE-2019-16869
MEDIUM
5
netty
splitHeader
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
39cafcb05c99f2aa9fce7e6597664c9ed6a63a95
1
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Void> internalRemovePublishRate() { return getTopicPoliciesAsyncWithRetry(topicName) .thenCompose(op -> { if (!op.isPresent()) { return CompletableFuture.completedFuture(null); } op.get().setPublishRate(null); return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, op.get()); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalRemovePublishRate File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalRemovePublishRate
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@GuardedBy("getLockObject()") private void setProfileOwnerOnOrganizationOwnedDeviceUncheckedLocked( ComponentName who, int userId, boolean isProfileOwnerOnOrganizationOwnedDevice) { // Make sure that the user has a profile owner and that the specified // component is the profile owner of that user. if (!isProfileOwner(who, userId)) { throw new IllegalArgumentException(String.format( "Component %s is not a Profile Owner of user %d", who.flattenToString(), userId)); } Slogf.i(LOG_TAG, "%s %s as profile owner on organization-owned device for user %d", isProfileOwnerOnOrganizationOwnedDevice ? "Marking" : "Unmarking", who.flattenToString(), userId); // First, set restriction on removing the profile. mInjector.binderWithCleanCallingIdentity(() -> { // Clear restriction as user. final UserHandle parentUser = mUserManager.getProfileParent(UserHandle.of(userId)); if (parentUser == null) { throw new IllegalStateException(String.format("User %d is not a profile", userId)); } if (!parentUser.isSystem()) { throw new IllegalStateException( String.format("Only the profile owner of a managed profile on the" + " primary user can be granted access to device identifiers, not" + " on user %d", parentUser.getIdentifier())); } mUserManager.setUserRestriction(UserManager.DISALLOW_REMOVE_MANAGED_PROFILE, isProfileOwnerOnOrganizationOwnedDevice, parentUser); mUserManager.setUserRestriction(UserManager.DISALLOW_ADD_USER, isProfileOwnerOnOrganizationOwnedDevice, parentUser); }); // setProfileOwnerOfOrganizationOwnedDevice will trigger writing of the profile owner // data, no need to do it manually. mOwners.setProfileOwnerOfOrganizationOwnedDevice(userId, isProfileOwnerOnOrganizationOwnedDevice); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProfileOwnerOnOrganizationOwnedDeviceUncheckedLocked 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
setProfileOwnerOnOrganizationOwnedDeviceUncheckedLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
int copyApk(IMediaContainerService imcs, boolean temp) { if (DEBUG_INSTALL) Slog.d(TAG, "Moving " + move.packageName + " from " + move.fromUuid + " to " + move.toUuid); synchronized (mInstaller) { if (mInstaller.copyCompleteApp(move.fromUuid, move.toUuid, move.packageName, move.dataAppName, move.appId, move.seinfo) != 0) { return PackageManager.INSTALL_FAILED_INTERNAL_ERROR; } } codeFile = new File(Environment.getDataAppDirectory(move.toUuid), move.dataAppName); resourceFile = codeFile; if (DEBUG_INSTALL) Slog.d(TAG, "codeFile after move is " + codeFile); return PackageManager.INSTALL_SUCCEEDED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyApk File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
copyApk
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public static int translateModeAccessToPosix(int mode) { if (mode == F_OK) { // There's not an exact mapping, so we attempt a read-only open to // determine if a file exists return O_RDONLY; } else if ((mode & (R_OK | W_OK)) == (R_OK | W_OK)) { return O_RDWR; } else if ((mode & R_OK) == R_OK) { return O_RDONLY; } else if ((mode & W_OK) == W_OK) { return O_WRONLY; } else { throw new IllegalArgumentException("Bad mode: " + mode); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: translateModeAccessToPosix File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
translateModeAccessToPosix
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
public ZipOutputStream getZipOutputStream(XWikiContext context) throws IOException { return new ZipOutputStream(context.getResponse().getOutputStream()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getZipOutputStream File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getZipOutputStream
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public void onChange(boolean selfChange) { final boolean wasProvisioned = mProvisioned; final boolean isProvisioned = deviceIsProvisioned(); // latch: never unprovision mProvisioned = wasProvisioned || isProvisioned; if (MORE_DEBUG) { Slog.d(TAG, "Provisioning change: was=" + wasProvisioned + " is=" + isProvisioned + " now=" + mProvisioned); } synchronized (mQueueLock) { if (mProvisioned && !wasProvisioned && mEnabled) { // we're now good to go, so start the backup alarms if (MORE_DEBUG) Slog.d(TAG, "Now provisioned, so starting backups"); KeyValueBackupJob.schedule(mContext); scheduleNextFullBackupJob(0); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onChange 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
onChange
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public void setShouldSetAccessibilityFocusOnPageLoad(boolean on) { mShouldSetAccessibilityFocusOnPageLoad = on; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShouldSetAccessibilityFocusOnPageLoad 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
setShouldSetAccessibilityFocusOnPageLoad
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
boolean removeLike(UserReference source, EntityReference target) throws LikeException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeLike File: xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/src/main/java/org/xwiki/like/LikeManager.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-94" ]
CVE-2023-35152
HIGH
8.8
xwiki/xwiki-platform
removeLike
xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/src/main/java/org/xwiki/like/LikeManager.java
0993a7ab3c102f9ac37ffe361a83a3dc302c0e45
0
Analyze the following code function for security vulnerabilities
public Pipeline checkinRevisionsToBuild(ManualBuild build, PipelineConfig pipelineConfig, MaterialRevision... materialRevisions) { return checkinRevisionsToBuild(build, pipelineConfig, Arrays.asList(materialRevisions)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkinRevisionsToBuild File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
checkinRevisionsToBuild
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
@Override public Collection create(Context context, Community community, String handle) throws SQLException, AuthorizeException { return create(context, community, handle, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create 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
create
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
public List<Locale> getAvailableLocales() { return this.xwiki.getAvailableLocales(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAvailableLocales File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getAvailableLocales
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
@Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding("UTF-8"); if ("1".equals(request.getParameter("browse"))) { showNamespaces(request.getRequestURI(), response); } else { final String[] vars = request.getParameterValues("v"); final boolean doc = "1".equals(request.getParameter("doc")); final String fmtParam = request.getParameter("fmt"); final DisplayType displayType; if ("html".equals(fmtParam)) { displayType = DisplayType.HTML; } else if ("json".equals(fmtParam)) { displayType = DisplayType.JSON; } else { displayType = DisplayType.PLAINTEXT; } showVariables(request.getRequestURI(), response, request.getParameter("ns"), request.getParameter("tag"), doc, displayType, vars); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doGet File: varexport/src/main/java/com/indeed/util/varexport/servlet/ViewExportedVariablesServlet.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
doGet
varexport/src/main/java/com/indeed/util/varexport/servlet/ViewExportedVariablesServlet.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
public void broadcastIconDoneEvent(String iface, IconEvent iconEvent) { sendMessage(iface, RX_HS20_ANQP_ICON_EVENT, iconEvent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastIconDoneEvent File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
broadcastIconDoneEvent
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private XWikiAttachmentStoreInterface getXWikiAttachmentStoreInterface(String storeType) { if (storeType != null && !storeType.equals(XWikiHibernateAttachmentStore.HINT)) { try { return Utils.getContextComponentManager().getInstance(XWikiAttachmentStoreInterface.class, storeType); } catch (ComponentLookupException e) { LOGGER.warn("Can't find attachment content store for type [{}]", storeType, e); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXWikiAttachmentStoreInterface 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
getXWikiAttachmentStoreInterface
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
Rect getRelativeFrame() { return mWindowFrames.mRelFrame; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelativeFrame 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
getRelativeFrame
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private int regCodeToServiceState(int code) { switch (code) { case 0: case 2: // 2 is "searching" case 3: // 3 is "registration denied" case 4: // 4 is "unknown" no vaild in current baseband case 10:// same as 0, but indicates that emergency call is possible. case 12:// same as 2, but indicates that emergency call is possible. case 13:// same as 3, but indicates that emergency call is possible. case 14:// same as 4, but indicates that emergency call is possible. return ServiceState.STATE_OUT_OF_SERVICE; case 1: return ServiceState.STATE_IN_SERVICE; case 5: // in service, roam return ServiceState.STATE_IN_SERVICE; default: loge("regCodeToServiceState: unexpected service state " + code); return ServiceState.STATE_OUT_OF_SERVICE; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: regCodeToServiceState 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
regCodeToServiceState
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
private Intent newGrantCredentialsPermissionIntent(Account account, String packageName, int uid, AccountAuthenticatorResponse response, String authTokenType, boolean startInNewTask) { Intent intent = new Intent(mContext, GrantCredentialsPermissionActivity.class); if (startInNewTask) { // See FLAG_ACTIVITY_NEW_TASK docs for limitations and benefits of the flag. // Since it was set in Eclair+ we can't change it without breaking apps using // the intent from a non-Activity context. This is the default behavior. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); } intent.addCategory(getCredentialPermissionNotificationId(account, authTokenType, uid).mTag + (packageName != null ? packageName : "")); intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_ACCOUNT, account); intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_TYPE, authTokenType); intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_RESPONSE, response); intent.putExtra(GrantCredentialsPermissionActivity.EXTRAS_REQUESTING_UID, uid); return intent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newGrantCredentialsPermissionIntent 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
newGrantCredentialsPermissionIntent
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public String getMainContainerMarkupId() { return mainContainer.getMarkupId(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMainContainerMarkupId File: src/main/java/org/projectforge/web/dialog/ModalDialog.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
getMainContainerMarkupId
src/main/java/org/projectforge/web/dialog/ModalDialog.java
422de35e3c3141e418a73bfb39b430d5fd74077e
0
Analyze the following code function for security vulnerabilities
@Override public void connectionServiceFocusLost() { // Immediately response to the Telecom that it has released the call resources. // TODO(mpq): Change back to the default implementation once b/69651192 done. if (mConnSvrFocusListener != null) { mConnSvrFocusListener.onConnectionServiceReleased(ConnectionServiceWrapper.this); } BindCallback callback = new BindCallback() { @Override public void onSuccess() { try { mServiceInterface.connectionServiceFocusLost( Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException ignored) { Log.d(this, "failed to inform the focus lost event"); } } @Override public void onFailure() {} }; mBinder.bind(callback, null /* null call */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connectionServiceFocusLost File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
connectionServiceFocusLost
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private String guessMimeType(final ChannelBuffer buf) { final String mimetype = guessMimeTypeFromUri(request().getUri()); return mimetype == null ? guessMimeTypeFromContents(buf) : mimetype; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: guessMimeType File: src/tsd/HttpQuery.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
guessMimeType
src/tsd/HttpQuery.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
@Override public int setStorageEncryption(ComponentName who, boolean encrypt) { if (!mHasFeature) { return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED; } Objects.requireNonNull(who, "ComponentName is null"); final int userHandle = UserHandle.getCallingUserId(); synchronized (getLockObject()) { // Check for permissions // Only system user can set storage encryption if (userHandle != UserHandle.USER_SYSTEM) { Slogf.w(LOG_TAG, "Only owner/system user is allowed to set storage encryption. " + "User " + UserHandle.getCallingUserId() + " is not permitted."); return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED; } ActiveAdmin ap = getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_ENCRYPTED_STORAGE); // Quick exit: If the filesystem does not support encryption, we can exit early. if (!isEncryptionSupported()) { return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED; } // (1) Record the value for the admin so it's sticky if (ap.encryptionRequested != encrypt) { ap.encryptionRequested = encrypt; saveSettingsLocked(userHandle); } DevicePolicyData policy = getUserData(UserHandle.USER_SYSTEM); // (2) Compute "max" for all admins boolean newRequested = false; final int N = policy.mAdminList.size(); for (int i = 0; i < N; i++) { newRequested |= policy.mAdminList.get(i).encryptionRequested; } // Notify OS of new request setEncryptionRequested(newRequested); // Return the new global request status return newRequested ? DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE : DevicePolicyManager.ENCRYPTION_STATUS_INACTIVE; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStorageEncryption 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
setStorageEncryption
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
static public File getProjectDir(File workspaceDir, long projectID) { File dir = new File(workspaceDir, projectID + PROJECT_DIR_SUFFIX); if (!dir.exists()) { dir.mkdir(); } return dir; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProjectDir File: main/src/com/google/refine/io/FileProjectManager.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-37476
HIGH
7.8
OpenRefine
getProjectDir
main/src/com/google/refine/io/FileProjectManager.java
e9c1e65d58b47aec8cd676bd5c07d97b002f205e
0
Analyze the following code function for security vulnerabilities
protected HttpEntity<?> createRequest(InstanceEvent event, Instance instance) { Map<String, Object> body = new HashMap<>(); if (user != null) { body.put("user", user); } if (source != null) { body.put("source", source); } if (event instanceof InstanceStatusChangedEvent && !StatusInfo.STATUS_UP.equals(((InstanceStatusChangedEvent) event).getStatusInfo().getStatus())) { body.put("message", getMessage(event, instance)); body.put("alias", generateAlias(instance)); body.put("description", getDescription(event, instance)); if (actions != null) { body.put("actions", actions); } if (tags != null) { body.put("tags", tags); } if (entity != null) { body.put("entity", entity); } Map<String, Object> details = new HashMap<>(); details.put("type", "link"); details.put("href", instance.getRegistration().getHealthUrl()); details.put("text", "Instance health-endpoint"); body.put("details", details); } HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); headers.set(HttpHeaders.AUTHORIZATION, "GenieKey " + apiKey); return new HttpEntity<>(body, headers); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRequest 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
createRequest
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
boolean canLaunchDreamActivity(String packageName) { if (!mDreaming || packageName == null) { return false; } final DreamManagerInternal dreamManager = LocalServices.getService(DreamManagerInternal.class); // Verify that the package is the current active dream or doze component. The // getActiveDreamComponent() call path does not acquire the DreamManager lock and thus // is safe to use. final ComponentName activeDream = dreamManager.getActiveDreamComponent(false /* doze */); if (activeDream != null && packageName.equals(activeDream.getPackageName())) { return true; } final ComponentName activeDoze = dreamManager.getActiveDreamComponent(true /* doze */); if (activeDoze != null && packageName.equals(activeDoze.getPackageName())) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canLaunchDreamActivity 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
canLaunchDreamActivity
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder2 t(String value) { return text(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: t File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
t
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public <T> T deserialize(Response response, GenericType<T> returnType) throws ApiException { if (response == null || returnType == null) { return null; } if ("byte[]".equals(returnType.toString())) { // Handle binary response (byte array). return (T) response.readEntity(byte[].class); } else if (returnType.getRawType() == File.class) { // Handle file downloading. T file = (T) downloadFileFromResponse(response); return file; } String contentType = null; List<Object> contentTypes = response.getHeaders().get("Content-Type"); if (contentTypes != null && !contentTypes.isEmpty()) contentType = String.valueOf(contentTypes.get(0)); // read the entity stream multiple times response.bufferEntity(); return response.readEntity(returnType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserialize File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
deserialize
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void buildSQL() throws SQLException { StringBuilder sb = new StringBuilder(128); sb.append("INSERT INTO "); sb.append(mTableName); sb.append(" ("); StringBuilder sbv = new StringBuilder(128); sbv.append("VALUES ("); int i = 1; Cursor cur = null; try { cur = mDb.rawQuery("PRAGMA table_info(" + mTableName + ")", null); mColumns = new HashMap<String, Integer>(cur.getCount()); while (cur.moveToNext()) { String columnName = cur.getString(TABLE_INFO_PRAGMA_COLUMNNAME_INDEX); String defaultValue = cur.getString(TABLE_INFO_PRAGMA_DEFAULT_INDEX); mColumns.put(columnName, i); sb.append("'"); sb.append(columnName); sb.append("'"); if (defaultValue == null) { sbv.append("?"); } else { sbv.append("COALESCE(?, "); sbv.append(defaultValue); sbv.append(")"); } sb.append(i == cur.getCount() ? ") " : ", "); sbv.append(i == cur.getCount() ? ");" : ", "); ++i; } } finally { if (cur != null) cur.close(); } sb.append(sbv); mInsertSQL = sb.toString(); if (DEBUG) Log.v(TAG, "insert statement is " + mInsertSQL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildSQL File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
buildSQL
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
public void convertSyntax(String targetSyntaxId, XWikiContext context) throws XWikiException { try { convertSyntax(Syntax.valueOf(targetSyntaxId), context); } catch (Exception e) { throw new XWikiException(XWikiException.MODULE_XWIKI_RENDERING, XWikiException.ERROR_XWIKI_UNKNOWN, "Failed to convert document to syntax [" + targetSyntaxId + "]", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertSyntax 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
convertSyntax
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
@UnsupportedAppUsage public final long getNativeAsset() { return mAssetNativePtr; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNativeAsset 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
getNativeAsset
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public static long getLong(byte[] data, int index) { return PlatformDependent0.getLong(data, index); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLong File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
getLong
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
protected final boolean _isNaN(String text) { return "NaN".equals(text); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _isNaN 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
_isNaN
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0