instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private boolean addWifiConfig(WifiConfiguration wifiConfig) { if (wifiConfig == null) { return false; } // Convert to PasspointConfiguration PasspointConfiguration passpointConfig = PasspointProvider.convertFromWifiConfig(wifiConfig); if (passpointConfig == null) { return false; } // Setup aliases for enterprise certificates and key. WifiEnterpriseConfig enterpriseConfig = wifiConfig.enterpriseConfig; String caCertificateAliasSuffix = enterpriseConfig.getCaCertificateAlias(); String clientCertAndKeyAliasSuffix = enterpriseConfig.getClientCertificateAlias(); if (passpointConfig.getCredential().getUserCredential() != null && TextUtils.isEmpty(caCertificateAliasSuffix)) { Log.e(TAG, "Missing CA Certificate for user credential"); return false; } if (passpointConfig.getCredential().getCertCredential() != null) { if (TextUtils.isEmpty(caCertificateAliasSuffix)) { Log.e(TAG, "Missing CA certificate for Certificate credential"); return false; } if (TextUtils.isEmpty(clientCertAndKeyAliasSuffix)) { Log.e(TAG, "Missing client certificate and key for certificate credential"); return false; } } // Note that for legacy configuration, the alias for client private key is the same as the // alias for the client certificate. PasspointProvider provider = new PasspointProvider(passpointConfig, mKeyStore, mWifiCarrierInfoManager, mProviderIndex++, wifiConfig.creatorUid, null, false, Arrays.asList(enterpriseConfig.getCaCertificateAlias()), enterpriseConfig.getClientCertificateAlias(), null, false, false, mClock); provider.enableVerboseLogging(mVerboseLoggingEnabled); mProviders.put(passpointConfig.getUniqueId(), provider); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addWifiConfig File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
addWifiConfig
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
@NonNull PermissionControllerManager getPermissionControllerManager( @NonNull UserHandle user) { if (user.equals(mContext.getUser())) { return mContext.getSystemService(PermissionControllerManager.class); } else { try { return mContext.createPackageContextAsUser(mContext.getPackageName(), 0, user).getSystemService(PermissionControllerManager.class); } catch (NameNotFoundException notPossible) { // not possible throw new IllegalStateException(notPossible); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermissionControllerManager 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
getPermissionControllerManager
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private byte[] getBytes(Proxy proxy, SecurityAuthentication authentication, Map<String, Object> headers) { if (isUrlOk() == false) return null; final Future<byte[]> result = EXE.submit(requestWithGetAndResponse(internal, proxy, authentication, headers)); try { return result.get(SecurityUtils.getSecurityProfile().getTimeout(), TimeUnit.MILLISECONDS); } catch (Exception e) { System.err.println("SURL response issue to " + internal.getHost() + " " + e); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBytes File: src/net/sourceforge/plantuml/security/SURL.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
getBytes
src/net/sourceforge/plantuml/security/SURL.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public static XMLEvent peek(XMLEventReader xmlEventReader) throws ParsingException { try { return xmlEventReader.peek(); } catch (XMLStreamException e) { throw logger.parserException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: peek File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java Repository: keycloak The code follows secure coding practices.
[ "CWE-200" ]
CVE-2017-2582
MEDIUM
4
keycloak
peek
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
0cb5ba0f6e83162d221681f47b470c3042eef237
0
Analyze the following code function for security vulnerabilities
private void doRequest(String method, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { int serviceId = 0; String proxyPath = ""; String queryString = ""; try { if (request.getQueryString() != null) { queryString = "?" + request.getQueryString(); } if (request.getPathInfo() != null) // /{serviceId}/* { String[] pathParts = request.getPathInfo().split("/"); if (pathParts.length > 1) { serviceId = Integer.parseInt(pathParts[1]); } if (pathParts.length > 2) { proxyPath = String.join("/", Arrays.copyOfRange(pathParts, 2, pathParts.length)); } if (serviceId < 0 || serviceId > supportedServices.length) { serviceId = 0; } } } catch (Exception e) { // Ignore and use 0 serviceId = 0; } String exportUrl = System.getenv(supportedServices[serviceId]); if (exportUrl == null || exportUrl.isEmpty() || (!exportUrl.startsWith("http://") && !exportUrl.startsWith("https://"))) { throw new Exception(supportedServices[serviceId] + " not set or invalid"); } else if (!exportUrl.endsWith("/")) // There are other non-trivial cases, admins should configure these URLs carefully { exportUrl += "/"; } URL url = new URL(exportUrl + proxyPath + queryString); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod(method); //Copy request headers to export server Enumeration<String> headerNames = request.getHeaderNames(); while (headerNames.hasMoreElements()) { String headerName = headerNames.nextElement(); Enumeration<String> headers = request.getHeaders(headerName); while (headers.hasMoreElements()) { String headerValue = headers.nextElement(); con.addRequestProperty(headerName, headerValue); } } if ("POST".equals(method)) { // Send post request con.setDoOutput(true); OutputStream params = con.getOutputStream(); Utils.copy(request.getInputStream(), params); params.flush(); params.close(); } int responseCode = con.getResponseCode(); //Copy response code response.setStatus(responseCode); //Copy response headers Map<String, List<String>> map = con.getHeaderFields(); for (Map.Entry<String, List<String>> entry : map.entrySet()) { String key = entry.getKey(); if (key != null) { for (String val : entry.getValue()) { response.addHeader(entry.getKey(), val); } } } //Copy response OutputStream out = response.getOutputStream(); //Error if (responseCode >= 400) { Utils.copy(con.getErrorStream(), out); } else //Success { Utils.copy(con.getInputStream(), out); } out.flush(); out.close(); } catch (Exception e) { response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR); e.printStackTrace(); } }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-3398 - Severity: HIGH - CVSS Score: 7.5 Description: 18.1.3 release Function: doRequest File: src/main/java/com/mxgraph/online/ExportProxyServlet.java Repository: jgraph/drawio Fixed Code: private void doRequest(String method, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { int serviceId = 0; String proxyPath = ""; String queryString = ""; try { if (request.getQueryString() != null) { queryString = "?" + request.getQueryString(); } if (request.getPathInfo() != null) // /{serviceId}/* { String[] pathParts = request.getPathInfo().split("/"); if (pathParts.length > 1) { serviceId = Integer.parseInt(pathParts[1]); } if (pathParts.length > 2) { proxyPath = String.join("/", Arrays.copyOfRange(pathParts, 2, pathParts.length)); } if (serviceId < 0 || serviceId > supportedServices.length) { serviceId = 0; } } } catch (Exception e) { // Ignore and use 0 serviceId = 0; } String exportUrl = System.getenv(supportedServices[serviceId]); if (exportUrl == null || exportUrl.isEmpty() || (!exportUrl.startsWith("http://") && !exportUrl.startsWith("https://"))) { throw new Exception(supportedServices[serviceId] + " not set or invalid"); } else if (!exportUrl.endsWith("/")) // There are other non-trivial cases, admins should configure these URLs carefully { exportUrl += "/"; } URL url = new URL(exportUrl + proxyPath + queryString); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod(method); //Copy request headers to export server Enumeration<String> headerNames = request.getHeaderNames(); while (headerNames.hasMoreElements()) { String headerName = headerNames.nextElement(); Enumeration<String> headers = request.getHeaders(headerName); while (headers.hasMoreElements()) { String headerValue = headers.nextElement(); con.addRequestProperty(headerName, headerValue); } } if ("POST".equals(method)) { // Send post request con.setDoOutput(true); OutputStream params = con.getOutputStream(); Utils.copyRestricted(request.getInputStream(), params, MAX_FETCH_SIZE); params.flush(); params.close(); } int responseCode = con.getResponseCode(); //Copy response code response.setStatus(responseCode); //Copy response headers Map<String, List<String>> map = con.getHeaderFields(); for (Map.Entry<String, List<String>> entry : map.entrySet()) { String key = entry.getKey(); if (key != null) { for (String val : entry.getValue()) { response.addHeader(entry.getKey(), val); } } } //Copy response OutputStream out = response.getOutputStream(); //Error if (responseCode >= 400) { Utils.copy(con.getErrorStream(), out); } else //Success { Utils.copy(con.getInputStream(), out); } out.flush(); out.close(); } catch (Exception e) { response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR); e.printStackTrace(); } }
[ "CWE-400" ]
CVE-2023-3398
HIGH
7.5
jgraph/drawio
doRequest
src/main/java/com/mxgraph/online/ExportProxyServlet.java
064729fec4262f9373d9fdcafda0be47cd18dd50
1
Analyze the following code function for security vulnerabilities
@TestApi public boolean isCurrentInputMethodSetByOwner() { try { return mService.isCurrentInputMethodSetByOwner(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCurrentInputMethodSetByOwner File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
isCurrentInputMethodSetByOwner
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@CheckResult public boolean isPermissionRevokedByPolicy(@NonNull String packageName, @NonNull String permissionName) { try { return mPermissionManager.isPermissionRevokedByPolicy(packageName, permissionName, mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPermissionRevokedByPolicy File: core/java/android/permission/PermissionManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
isPermissionRevokedByPolicy
core/java/android/permission/PermissionManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
protected void setLockscreenUser(int newUserId) { mLockscreenWallpaper.setCurrentUser(newUserId); mScrimController.setCurrentUser(newUserId); updateMediaMetaData(true, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLockscreenUser 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
setLockscreenUser
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage public final int getAssetInt() { throw new UnsupportedOperationException(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAssetInt 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
getAssetInt
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private void incrementCountForActivity(ArrayMap<ComponentName, Integer> counts, ComponentName cn, int increment) { Integer oldValue = counts.get(cn); if (oldValue == null) { oldValue = 0; } counts.put(cn, oldValue + increment); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incrementCountForActivity File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
incrementCountForActivity
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
void toShortString(StringBuilder sb) { sb.append(pid); sb.append(':'); sb.append(processName); sb.append('/'); if (info.uid < Process.FIRST_APPLICATION_UID) { sb.append(uid); } else { sb.append('u'); sb.append(userId); int appId = UserHandle.getAppId(info.uid); if (appId >= Process.FIRST_APPLICATION_UID) { sb.append('a'); sb.append(appId - Process.FIRST_APPLICATION_UID); } else { sb.append('s'); sb.append(appId); } if (uid != info.uid) { sb.append('i'); sb.append(UserHandle.getAppId(uid) - Process.FIRST_ISOLATED_UID); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toShortString File: services/core/java/com/android/server/am/ProcessRecord.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
toShortString
services/core/java/com/android/server/am/ProcessRecord.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public void setInterceptorBroadcaster(IInterceptorBroadcaster theInterceptorBroadcaster) { myInterceptorBroadcaster = theInterceptorBroadcaster; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setInterceptorBroadcaster File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setInterceptorBroadcaster
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
0
Analyze the following code function for security vulnerabilities
protected abstract void shutdown();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shutdown File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
shutdown
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
private Route.Filter filter(final Class<? extends Route.Filter> filter) { requireNonNull(filter, "Filter is required."); return (req, rsp, chain) -> req.require(filter).handle(req, rsp, chain); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filter File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
filter
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public void setBinaryExtensionEnabled(boolean value) { _binaryExtensionEnabled = value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBinaryExtensionEnabled File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
setBinaryExtensionEnabled
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
private void forceStopPackageLocked(final String packageName, int uid, String reason) { forceStopPackageLocked(packageName, UserHandle.getAppId(uid), false, false, true, false, false, UserHandle.getUserId(uid), reason); Intent intent = new Intent(Intent.ACTION_PACKAGE_RESTARTED, Uri.fromParts("package", packageName, null)); if (!mProcessesReady) { intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); } intent.putExtra(Intent.EXTRA_UID, uid); intent.putExtra(Intent.EXTRA_USER_HANDLE, UserHandle.getUserId(uid)); broadcastIntentLocked(null, null, intent, null, null, 0, null, null, null, AppOpsManager.OP_NONE, null, false, false, MY_PID, Process.SYSTEM_UID, UserHandle.getUserId(uid)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceStopPackageLocked 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
forceStopPackageLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public int getIdInt() { return id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIdInt File: src/main/java/object/Variant.java Repository: nickzren/alsdb The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15021
MEDIUM
5.2
nickzren/alsdb
getIdInt
src/main/java/object/Variant.java
cbc79a68145e845f951113d184b4de207c341599
0
Analyze the following code function for security vulnerabilities
private void setWidthAndHeight(ActivityImpl activity, Map<String, Object> activityInfo) { activityInfo.put("width", activity.getWidth()); activityInfo.put("height", activity.getHeight()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWidthAndHeight File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java Repository: thinkgem/jeesite The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34601
CRITICAL
9.8
thinkgem/jeesite
setWidthAndHeight
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
0
Analyze the following code function for security vulnerabilities
private void incLine(int nbLines) { lineNumber_ += nbLines; columnNumber_ = 1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incLine File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
incLine
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public Element toDOM(Document document) { Element infoElement = document.createElement("CMSRequestInfo"); toDOM(document, infoElement); return infoElement; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toDOM File: base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toDOM
base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
void continueUserSwitch(UserStartedState uss, int oldUserId, int newUserId) { completeSwitchAndInitalize(uss, newUserId, false, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: continueUserSwitch 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
continueUserSwitch
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private boolean isStomp() { URI uri = connector.getUri(); return uri != null && uri.getScheme() != null && uri.getScheme().indexOf("stomp") != -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isStomp File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
isStomp
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
@Override public void close() throws IOException { cipherInputStream.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: close File: src/main/java/net/lingala/zip4j/io/inputstream/DecompressedInputStream.java Repository: srikanth-lingala/zip4j The code follows secure coding practices.
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
close
src/main/java/net/lingala/zip4j/io/inputstream/DecompressedInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
0
Analyze the following code function for security vulnerabilities
void setWallpaperAnimLayerAdjustmentLocked(int adj) { if (DEBUG_LAYERS || DEBUG_WALLPAPER) Slog.v(TAG, "Setting wallpaper layer adj to " + adj); mWallpaperAnimLayerAdjustment = adj; for (int curTokenNdx = mWallpaperTokens.size() - 1; curTokenNdx >= 0; curTokenNdx--) { WindowList windows = mWallpaperTokens.get(curTokenNdx).windows; for (int wallpaperNdx = windows.size() - 1; wallpaperNdx >= 0; wallpaperNdx--) { WindowState wallpaper = windows.get(wallpaperNdx); wallpaper.mWinAnimator.mAnimLayer = wallpaper.mLayer + adj; if (DEBUG_LAYERS || DEBUG_WALLPAPER) Slog.v(TAG, "setWallpaper win " + wallpaper + " anim layer: " + wallpaper.mWinAnimator.mAnimLayer); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWallpaperAnimLayerAdjustmentLocked 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
setWallpaperAnimLayerAdjustmentLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override public void forceUpdateUserSetupComplete(@UserIdInt int userId) { Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS)); boolean isUserCompleted = mInjector.settingsSecureGetIntForUser( Settings.Secure.USER_SETUP_COMPLETE, 0, userId) != 0; DevicePolicyData policy = getUserData(userId); policy.mUserSetupComplete = isUserCompleted; mStateCache.setDeviceProvisioned(isUserCompleted); synchronized (getLockObject()) { saveSettingsLocked(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceUpdateUserSetupComplete 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
forceUpdateUserSetupComplete
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void initConnection() throws IOException { boolean isFirstInitialization = packetReader == null || packetWriter == null; compressionHandler = null; // Set the reader and writer instance variables initReaderAndWriter(); if (isFirstInitialization) { packetWriter = new PacketWriter(); packetReader = new PacketReader(); // If debugging is enabled, we should start the thread that will listen for // all packets and then log them. if (config.isDebuggerEnabled()) { addAsyncStanzaListener(debugger.getReaderListener(), null); if (debugger.getWriterListener() != null) { addPacketSendingListener(debugger.getWriterListener(), null); } } } // Start the packet writer. This will open an XMPP stream to the server packetWriter.init(); // Start the packet reader. The startup() method will block until we // get an opening stream packet back from server packetReader.init(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initConnection File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
initConnection
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
private void getUniqueLinkedEntityReferences(XDOM dom, EntityType entityType, Set<EntityReference> references) { Set<EntityReference> uniqueLinkedEntityReferences = getLinkParser().getUniqueLinkedEntityReferences(dom, entityType, getDocumentReference()); references.addAll(uniqueLinkedEntityReferences); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUniqueLinkedEntityReferences 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
getUniqueLinkedEntityReferences
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
@Override public HttpHeaders add(CharSequence name, Iterable<?> values) { headers.addObject(name, values); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: add File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-43797
MEDIUM
4.3
netty
add
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
07aa6b5938a8b6ed7a6586e066400e2643897323
0
Analyze the following code function for security vulnerabilities
@Override public boolean needsAuth(Map<String, Object> context) { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: needsAuth File: store/src/java/com/zimbra/cs/service/account/AutoCompleteGal.java Repository: Zimbra/zm-mailbox The code follows secure coding practices.
[ "CWE-862" ]
CVE-2020-10194
MEDIUM
4
Zimbra/zm-mailbox
needsAuth
store/src/java/com/zimbra/cs/service/account/AutoCompleteGal.java
1df440e0efa624d1772a05fb6d397d9beb4bda1e
0
Analyze the following code function for security vulnerabilities
private boolean canModifyNetwork(WifiConfiguration config, int uid, @Nullable String packageName) { // Passpoint configurations are generated and managed by PasspointManager. They can be // added by either PasspointNetworkNominator (for auto connection) or Settings app // (for manual connection), and need to be removed once the connection is completed. // Since it is "owned" by us, so always allow us to modify them. if (config.isPasspoint() && uid == Process.WIFI_UID) { return true; } // EAP-SIM/AKA/AKA' network needs framework to update the anonymous identity provided // by authenticator back to the WifiConfiguration object. // Since it is "owned" by us, so always allow us to modify them. if (config.enterpriseConfig != null && uid == Process.WIFI_UID && config.enterpriseConfig.isAuthenticationSimBased()) { return true; } // TODO: ideally package should not be null here (and hence we wouldn't need the // isDeviceOwner(uid) method), but it would require changing many methods to pass the // package name around (for example, all methods called by // WifiServiceImpl.triggerConnectAndReturnStatus(netId, callingUid) final boolean isOrganizationOwnedDeviceAdmin = mWifiPermissionsUtil.isOrganizationOwnedDeviceAdmin(uid, packageName); // If |uid| corresponds to the device owner or the profile owner of an organization owned // device, allow all modifications. if (isOrganizationOwnedDeviceAdmin) { return true; } final boolean isCreator = (config.creatorUid == uid); // WiFi config lockdown related logic. At this point we know uid is NOT a Device Owner // or a Profile Owner of an organization owned device. final boolean isConfigEligibleForLockdown = mWifiPermissionsUtil.isOrganizationOwnedDeviceAdmin(config.creatorUid, config.creatorName); if (!isConfigEligibleForLockdown) { // App that created the network or settings app (i.e user) has permission to // modify the network. return isCreator || mWifiPermissionsUtil.checkNetworkSettingsPermission(uid) || mWifiPermissionsUtil.checkNetworkSetupWizardPermission(uid); } final ContentResolver resolver = mContext.getContentResolver(); final boolean isLockdownFeatureEnabled = Settings.Global.getInt(resolver, Settings.Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN, 0) != 0; return !isLockdownFeatureEnabled // If not locked down, settings app (i.e user) has permission to modify the network. && (mWifiPermissionsUtil.checkNetworkSettingsPermission(uid) || mWifiPermissionsUtil.checkNetworkSetupWizardPermission(uid)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canModifyNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
canModifyNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void removeDatatransferProgressListener( OnDatatransferProgressListener listener, OCUpload ocUpload ) { if (ocUpload == null || listener == null) { return; } String targetKey = buildRemoteName(ocUpload.getAccountName(), ocUpload.getRemotePath()); if (mBoundListeners.get(targetKey) == listener) { mBoundListeners.remove(targetKey); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeDatatransferProgressListener 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
removeDatatransferProgressListener
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
public void backupNow() { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "backupNow"); if (mPowerManager.isPowerSaveMode()) { if (DEBUG) Slog.v(TAG, "Not running backup while in battery save mode"); KeyValueBackupJob.schedule(mContext); // try again in several hours } else { if (DEBUG) Slog.v(TAG, "Scheduling immediate backup pass"); synchronized (mQueueLock) { // Fire the intent that kicks off the whole shebang... try { mRunBackupIntent.send(); } catch (PendingIntent.CanceledException e) { // should never happen Slog.e(TAG, "run-backup intent cancelled!"); } // ...and cancel any pending scheduled job, because we've just superseded it KeyValueBackupJob.cancel(mContext); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: backupNow 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
backupNow
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Deprecated public int getCustomSizePreset() { return mCustomSizePreset; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCustomSizePreset File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getCustomSizePreset
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private int checkProvisioningPreconditionSkipPermission(String action, String packageName) { if (!mHasFeature) { logMissingFeatureAction("Cannot check provisioning for action " + action); return STATUS_DEVICE_ADMIN_NOT_SUPPORTED; } if (!isProvisioningAllowed()) { return STATUS_PROVISIONING_NOT_ALLOWED_FOR_NON_DEVELOPER_USERS; } final int code = checkProvisioningPreConditionSkipPermissionNoLog(action, packageName); if (code != STATUS_OK) { Slogf.d(LOG_TAG, "checkProvisioningPreCondition(" + action + ", " + packageName + ") failed: " + computeProvisioningErrorString(code, mInjector.userHandleGetCallingUserId())); } return code; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkProvisioningPreconditionSkipPermission 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
checkProvisioningPreconditionSkipPermission
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void setHeader(String arg0, String arg1) { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHeader File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
setHeader
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public int getStatus() { return status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatus File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
getStatus
src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
@POST @Path("externalpage/{nodeId}") @Operation(summary = "Update an external page building block", description = "Update an external page building block") @ApiResponse(responseCode = "200", description = "The course node metadatas", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or parentNode not found") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response updateExternalPage(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @FormParam("shortTitle") @DefaultValue("undefined") String shortTitle, @FormParam("longTitle") @DefaultValue("undefined") String longTitle, @FormParam("objectives") @DefaultValue("undefined") String objectives, @FormParam("visibilityExpertRules") String visibilityExpertRules, @FormParam("accessExpertRules") String accessExpertRules, @FormParam("url") String url, @Context HttpServletRequest request) { URL externalUrl = null; if(url != null) { try { externalUrl = new URL(url); } catch (MalformedURLException e) { return Response.serverError().status(Status.CONFLICT).build(); } } ExternalPageCustomConfig config = new ExternalPageCustomConfig(externalUrl); return update(courseId, nodeId, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateExternalPage File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
updateExternalPage
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public static CertDataInfo fromDOM(Element infoElement) { CertDataInfo info = new CertDataInfo(); String id = infoElement.getAttribute("id"); info.setID(StringUtils.isEmpty(id) ? null : new CertId(id)); NodeList subjectDNList = infoElement.getElementsByTagName("SubjectDN"); if (subjectDNList.getLength() > 0) { String value = subjectDNList.item(0).getTextContent(); info.setSubjectDN(value); } NodeList issuerDNList = infoElement.getElementsByTagName("IssuerDN"); if (issuerDNList.getLength() > 0) { String value = issuerDNList.item(0).getTextContent(); info.setIssuerDN(value); } NodeList statusList = infoElement.getElementsByTagName("Status"); if (statusList.getLength() > 0) { String value = statusList.item(0).getTextContent(); info.setStatus(value); } NodeList typeList = infoElement.getElementsByTagName("Type"); if (typeList.getLength() > 0) { String value = typeList.item(0).getTextContent(); info.setType(value); } NodeList versionList = infoElement.getElementsByTagName("Version"); if (versionList.getLength() > 0) { String value = versionList.item(0).getTextContent(); info.setVersion(Integer.parseInt(value)); } NodeList keyAlgorithmOIDList = infoElement.getElementsByTagName("KeyAlgorithmOID"); if (keyAlgorithmOIDList.getLength() > 0) { String value = keyAlgorithmOIDList.item(0).getTextContent(); info.setKeyAlgorithmOID(value); } NodeList keyLengthList = infoElement.getElementsByTagName("KeyLength"); if (keyLengthList.getLength() > 0) { String value = keyLengthList.item(0).getTextContent(); info.setKeyLength(Integer.parseInt(value)); } NodeList notValidBeforeList = infoElement.getElementsByTagName("NotValidBefore"); if (notValidBeforeList.getLength() > 0) { String value = notValidBeforeList.item(0).getTextContent(); info.setNotValidBefore(new Date(Long.parseLong(value))); } NodeList notValidAfterList = infoElement.getElementsByTagName("NotValidAfter"); if (notValidAfterList.getLength() > 0) { String value = notValidAfterList.item(0).getTextContent(); info.setNotValidAfter(new Date(Long.parseLong(value))); } NodeList issuedOnList = infoElement.getElementsByTagName("IssuedOn"); if (issuedOnList.getLength() > 0) { String value = issuedOnList.item(0).getTextContent(); info.setIssuedOn(new Date(Long.parseLong(value))); } NodeList issuedByList = infoElement.getElementsByTagName("IssuedBy"); if (issuedByList.getLength() > 0) { String value = issuedByList.item(0).getTextContent(); info.setIssuedBy(value); } NodeList revokedOnList = infoElement.getElementsByTagName("RevokedOn"); if (revokedOnList.getLength() > 0) { String value = revokedOnList.item(0).getTextContent(); info.setRevokedOn(new Date(Long.parseLong(value))); } NodeList revokedByList = infoElement.getElementsByTagName("RevokedBy"); if (revokedByList.getLength() > 0) { String value = revokedByList.item(0).getTextContent(); info.setRevokedBy(value); } return info; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void copyDir(String source, File target) throws Exception { //Let's wrap the code to a runnable inner class to avoid NoClassDef on Option classes. try { new Runnable() { public void run() { File destination = target; if (!destination.isDirectory() && !destination.mkdirs()) { throw KubernetesClientException.launderThrowable(new IOException("Failed to create directory: " + destination)); } try ( InputStream is = readTar(source); org.apache.commons.compress.archivers.tar.TarArchiveInputStream tis = new org.apache.commons.compress.archivers.tar.TarArchiveInputStream(is)) { for (org.apache.commons.compress.archivers.ArchiveEntry entry = tis.getNextTarEntry(); entry != null; entry = tis.getNextEntry()) { if (tis.canReadEntryData(entry)) { File f = new File(destination, entry.getName()); if (entry.isDirectory()) { if (!f.isDirectory() && !f.mkdirs()) { throw new IOException("Failed to create directory: " + f); } } else { File parent = f.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { throw new IOException("Failed to create directory: " + f); } try (OutputStream fs = new FileOutputStream(f)) { System.out.println("Writing: " + f.getCanonicalPath()); BlockingInputStreamPumper pumper = new BlockingInputStreamPumper(tis, new Callback<byte[]>() { @Override public void call(byte[] input) { try { fs.write(input); } catch (IOException e) { throw KubernetesClientException.launderThrowable(e); } } }, () -> { try { fs.close(); } catch (IOException e) { throw KubernetesClientException.launderThrowable(e); } }); pumper.run(); } } } } } catch (Exception e) { throw KubernetesClientException.launderThrowable(e); } } }.run(); } catch (NoClassDefFoundError e) { throw new KubernetesClientException("TarArchiveInputStream class is provided by commons-codec, an optional dependency. To use the read/copy functionality you must explicitly add this dependency to the classpath."); } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-20218 - Severity: MEDIUM - CVSS Score: 5.8 Description: fix: CVE-2021-20218 vulnerable to a path traversal Function: copyDir File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client Fixed Code: private void copyDir(String source, File target) throws Exception { //Let's wrap the code to a runnable inner class to avoid NoClassDef on Option classes. try { new Runnable() { public void run() { File destination = target; if (!destination.isDirectory() && !destination.mkdirs()) { throw KubernetesClientException.launderThrowable(new IOException("Failed to create directory: " + destination)); } try ( InputStream is = readTar(source); org.apache.commons.compress.archivers.tar.TarArchiveInputStream tis = new org.apache.commons.compress.archivers.tar.TarArchiveInputStream(is)) { for (org.apache.commons.compress.archivers.ArchiveEntry entry = tis.getNextTarEntry(); entry != null; entry = tis.getNextEntry()) { if (tis.canReadEntryData(entry)) { final String normalizedEntryName = FilenameUtils.normalize(entry.getName()); if (normalizedEntryName == null){ throw new IOException("Tar entry '" + entry.getName() + "' has an invalid name"); } File f = new File(destination, normalizedEntryName); if (entry.isDirectory()) { if (!f.isDirectory() && !f.mkdirs()) { throw new IOException("Failed to create directory: " + f); } } else { File parent = f.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { throw new IOException("Failed to create directory: " + f); } try (OutputStream fs = new FileOutputStream(f)) { System.out.println("Writing: " + f.getCanonicalPath()); BlockingInputStreamPumper pumper = new BlockingInputStreamPumper(tis, new Callback<byte[]>() { @Override public void call(byte[] input) { try { fs.write(input); } catch (IOException e) { throw KubernetesClientException.launderThrowable(e); } } }, () -> { try { fs.close(); } catch (IOException e) { throw KubernetesClientException.launderThrowable(e); } }); pumper.run(); } } } } } catch (Exception e) { throw KubernetesClientException.launderThrowable(e); } } }.run(); } catch (NoClassDefFoundError e) { throw new KubernetesClientException("TarArchiveInputStream class is provided by commons-codec, an optional dependency. To use the read/copy functionality you must explicitly add this dependency to the classpath."); } }
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
copyDir
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
1
Analyze the following code function for security vulnerabilities
public void setLinkName(String linkName) { this.linkName = linkName; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-7171 - Severity: LOW - CVSS Score: 3.3 Description: fix(novel-admin): 友情链接URL格式校验 Function: setLinkName File: novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java Repository: 201206030/novel-plus Fixed Code: public void setLinkName(String linkName) { this.linkName = linkName; }
[ "CWE-79" ]
CVE-2023-7171
LOW
3.3
201206030/novel-plus
setLinkName
novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java
d6093d8182362422370d7eaf6c53afde9ee45215
1
Analyze the following code function for security vulnerabilities
public void fromXML(String xml) throws XWikiException { fromXML(xml, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromXML 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
fromXML
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
protected SecureRandom initSecureRandom(boolean needed, SecureRandom provided) { return !needed ? null : (provided != null) ? provided : new SecureRandom(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initSecureRandom File: core/src/main/java/org/bouncycastle/crypto/signers/DSASigner.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000341
MEDIUM
4.3
bcgit/bc-java
initSecureRandom
core/src/main/java/org/bouncycastle/crypto/signers/DSASigner.java
acaac81f96fec91ab45bd0412beaf9c3acd8defa
0
Analyze the following code function for security vulnerabilities
void shutdown() { done = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shutdown File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
shutdown
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
Builder setLaunchedFromUid(int uid) { mLaunchedFromUid = uid; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLaunchedFromUid 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
setLaunchedFromUid
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void resetCaCertificate() { mCaCert = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetCaCertificate File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
resetCaCertificate
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
private void initializeContainerView(InternalAccessDelegate internalDispatcher) { TraceEvent.begin(); mContainerViewInternals = internalDispatcher; mContainerView.setWillNotDraw(false); mContainerView.setClickable(true); mRenderCoordinates.reset(); initPopupZoomer(mContext); mImeAdapter = createImeAdapter(mContext); TraceEvent.end(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeContainerView 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
initializeContainerView
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public RemoteViews createHeadsUpContentView() { return createHeadsUpContentView(false /* useIncreasedHeight */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createHeadsUpContentView File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
createHeadsUpContentView
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private void cleanUnversionedFilesInAllSubmodules() { List<String> args = submoduleForEachRecursive(asList("git", "clean", gitCleanArgs())); runOrBomb(gitWd().withArgs(args)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanUnversionedFilesInAllSubmodules File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
cleanUnversionedFilesInAllSubmodules
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
@Override public SaReactorFilter setBeforeAuth(SaFilterAuthStrategy beforeAuth) { this.beforeAuth = beforeAuth; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBeforeAuth File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
setBeforeAuth
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
@Override public Iterable<File> children(File file) { return fileTreeChildren(file); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: children 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
children
guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
void setShowingLocked(boolean showing) { setShowingLocked(showing, false /* forceCallbacks */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShowingLocked File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
setShowingLocked
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
protected void engineSetMode( String mode) throws NoSuchAlgorithmException { String md = Strings.toUpperCase(mode); if (md.equals("NONE") || md.equals("ECB")) { return; } if (md.equals("1")) { privateKeyOnly = true; publicKeyOnly = false; return; } else if (md.equals("2")) { privateKeyOnly = false; publicKeyOnly = true; return; } throw new NoSuchAlgorithmException("can't support mode " + mode); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineSetMode File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineSetMode
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
private void crashApplication(ProcessRecord r, ApplicationErrorReport.CrashInfo crashInfo) { long timeMillis = System.currentTimeMillis(); String shortMsg = crashInfo.exceptionClassName; String longMsg = crashInfo.exceptionMessage; String stackTrace = crashInfo.stackTrace; if (shortMsg != null && longMsg != null) { longMsg = shortMsg + ": " + longMsg; } else if (shortMsg != null) { longMsg = shortMsg; } AppErrorResult result = new AppErrorResult(); synchronized (this) { if (mController != null) { try { String name = r != null ? r.processName : null; int pid = r != null ? r.pid : Binder.getCallingPid(); int uid = r != null ? r.info.uid : Binder.getCallingUid(); if (!mController.appCrashed(name, pid, shortMsg, longMsg, timeMillis, crashInfo.stackTrace)) { if ("1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0")) && "Native crash".equals(crashInfo.exceptionClassName)) { Slog.w(TAG, "Skip killing native crashed app " + name + "(" + pid + ") during testing"); } else { Slog.w(TAG, "Force-killing crashed app " + name + " at watcher's request"); if (r != null) { r.kill("crash", true); } else { // Huh. Process.killProcess(pid); killProcessGroup(uid, pid); } } return; } } catch (RemoteException e) { mController = null; Watchdog.getInstance().setActivityController(null); } } final long origId = Binder.clearCallingIdentity(); // If this process is running instrumentation, finish it. if (r != null && r.instrumentationClass != null) { Slog.w(TAG, "Error in app " + r.processName + " running instrumentation " + r.instrumentationClass + ":"); if (shortMsg != null) Slog.w(TAG, " " + shortMsg); if (longMsg != null) Slog.w(TAG, " " + longMsg); Bundle info = new Bundle(); info.putString("shortMsg", shortMsg); info.putString("longMsg", longMsg); finishInstrumentationLocked(r, Activity.RESULT_CANCELED, info); Binder.restoreCallingIdentity(origId); return; } // Log crash in battery stats. if (r != null) { mBatteryStatsService.noteProcessCrash(r.processName, r.uid); } // If we can't identify the process or it's already exceeded its crash quota, // quit right away without showing a crash dialog. if (r == null || !makeAppCrashingLocked(r, shortMsg, longMsg, stackTrace)) { Binder.restoreCallingIdentity(origId); return; } Message msg = Message.obtain(); msg.what = SHOW_ERROR_MSG; HashMap data = new HashMap(); data.put("result", result); data.put("app", r); msg.obj = data; mUiHandler.sendMessage(msg); Binder.restoreCallingIdentity(origId); } int res = result.get(); Intent appErrorIntent = null; synchronized (this) { if (r != null && !r.isolated) { // XXX Can't keep track of crash time for isolated processes, // since they don't have a persistent identity. mProcessCrashTimes.put(r.info.processName, r.uid, SystemClock.uptimeMillis()); } if (res == AppErrorDialog.FORCE_QUIT_AND_REPORT) { appErrorIntent = createAppErrorIntentLocked(r, timeMillis, crashInfo); } } if (appErrorIntent != null) { try { mContext.startActivityAsUser(appErrorIntent, new UserHandle(r.userId)); } catch (ActivityNotFoundException e) { Slog.w(TAG, "bug report receiver dissappeared", e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: crashApplication 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
crashApplication
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public JSONObject getFolder() { JSONObject array = null; File dir = new File(getRealFilePath()); File file = null; if (!dir.isDirectory()) { this.error(sprintf(lang("DIRECTORY_NOT_EXIST"), this.get.get("path"))); } else { if (!dir.canRead()) { this.error(sprintf(lang("UNABLE_TO_OPEN_DIRECTORY"), this.get.get("path"))); } else { array = new JSONObject(); String[] files = dir.list(); JSONObject data = null; JSONObject props = null; for (int i = 0; i < files.length; i++) { data = new JSONObject(); props = new JSONObject(); file = new File(getRealFilePath() + files[i]); if (file.isDirectory() && !contains(getConfig("unallowed_dirs"), files[i])) { try { props.put("Date Created", (String) null); props.put("Date Modified", (String) null); props.put("Height", (String) null); props.put("Width", (String) null); props.put("Size", (String) null); data.put("Path", this.get.get("path") + files[i] + "/"); data.put("Filename", files[i]); data.put("File Type", "dir"); data.put("Preview", getConfig("icons-path") + getConfig("icons-directory")); // TODO 文件权限 data.put("Protected", 0); data.put("Error", ""); data.put("Code", 0); data.put("Properties", props); array.put(this.get.get("path") + files[i] + "/", data); } catch (JSONException e) { this.error("JSONObject error"); } } else if (!contains(getConfig("unallowed_files"), files[i])) { this.item = new HashMap<String, Object>(); this.item.put("properties", this.properties); this.getFileInfo(getFilePath() + files[i]); if (this.params.get("type") == null || (this.params.get("type") != null && (!this.params.get("type").equals("Image") || this.params .get("type").equals("Image") && contains(getConfig("images"), (String) this.item.get("filetype"))))) { try { data.put("Path", this.get.get("path") + files[i]); data.put("Filename", this.item.get("filename")); data.put("File Type", this.item.get("filetype")); // TODO 文件权限 data.put("Protected", 0); data.put("Preview", this.item.get("preview")); data.put("Properties", this.item.get("properties")); data.put("Error", ""); data.put("Code", 0); array.put(this.get.get("path") + files[i], data); } catch (JSONException e) { this.error("JSONObject error"); } } } } } } return array; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFolder 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
getFolder
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
e7fd0fe9362464c4d2bd308318eecc89a847b116
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public BaseObject updateObjectFromRequest(String className, XWikiContext context) throws XWikiException { return updateObjectFromRequest(className, "", context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateObjectFromRequest 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-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
updateObjectFromRequest
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
private void handleTrustCircleClick() { mLockscreenGestureLogger.write(MetricsEvent.ACTION_LS_LOCK, 0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */); mIndicationController.showTransientIndication( R.string.keyguard_indication_trust_disabled); mLockPatternUtils.requireCredentialEntry(KeyguardUpdateMonitor.getCurrentUser()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleTrustCircleClick File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
handleTrustCircleClick
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static void removeLoginCookies(Response response) { response.deleteCookie(Cookie.SESSION_COOKIE_NAME); response.deleteCookie(Cookie.EMAIL_COOKIE_NAME); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeLoginCookies File: src/gribbit/auth/User.java Repository: lukehutch/gribbit The code follows secure coding practices.
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
removeLoginCookies
src/gribbit/auth/User.java
620418df247aebda3dd4be1dda10fe229ea505dd
0
Analyze the following code function for security vulnerabilities
public void setPolicySets(Map<String, List<ProfilePolicy>> policySets) { this.policySets = policySets; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPolicySets File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setPolicySets
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof SetiLocation)) { return false; } SetiLocation that = (SetiLocation)obj; return _userId.equals(that._userId) && _setiChannel.equals(that._setiChannel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
equals
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
private boolean connectToService() { if (DEBUG_SD_INSTALL) Log.i(TAG, "Trying to bind to" + " DefaultContainerService"); Intent service = new Intent().setComponent(DEFAULT_CONTAINER_COMPONENT); Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); if (mContext.bindServiceAsUser(service, mDefContainerConn, Context.BIND_AUTO_CREATE, UserHandle.OWNER)) { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); mBound = true; return true; } Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connectToService 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
connectToService
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") protected Set<String> getPulledResources(XWikiContext context) { initializeRequestListIfNeeded(context); return (Set<String>) context.get(this.contextKey); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPulledResources File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
getPulledResources
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
void updateCurrentContainerView() { ViewGroup oldContainerView = mCurrentContainerView; mCurrentContainerView = mContainerView; for (Entry<View, Position> entry : mAnchorViews.entrySet()) { View anchorView = entry.getKey(); Position position = entry.getValue(); oldContainerView.removeView(anchorView); mCurrentContainerView.addView(anchorView); if (position != null) { doSetAnchorViewPosition(anchorView, position.mX, position.mY, position.mWidth, position.mHeight); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateCurrentContainerView 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
updateCurrentContainerView
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
@Pure public java.sql.@Nullable Date getDate(String columnName) throws SQLException { return getDate(findColumn(columnName), null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDate File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getDate
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public int copySpaceBetweenWikis(String space, String sourceWiki, String targetWiki, String locale, boolean clean) throws XWikiException { if (hasProgrammingRights()) { return this.xwiki.copySpaceBetweenWikis(space, sourceWiki, targetWiki, locale, clean, getXWikiContext()); } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copySpaceBetweenWikis 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
copySpaceBetweenWikis
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
static void logWarn(final HttpQuery query, final String msg) { LOG.warn(query.channel().toString() + ' ' + msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logWarn File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
logWarn
src/tsd/GraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
public @NonNull List<byte[]> getInstalledCaCerts(@Nullable ComponentName admin) { final List<byte[]> certs = new ArrayList<byte[]>(); throwIfParentInstance("getInstalledCaCerts"); if (mService != null) { try { mService.enforceCanManageCaCerts(admin, mContext.getPackageName()); final TrustedCertificateStore certStore = new TrustedCertificateStore(); for (String alias : certStore.userAliases()) { try { certs.add(certStore.getCertificate(alias).getEncoded()); } catch (CertificateException ce) { Log.w(TAG, "Could not encode certificate: " + alias, ce); } } } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } return certs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstalledCaCerts File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getInstalledCaCerts
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public IoWriteFuture writePacket(Buffer buffer, long timeout, TimeUnit unit) throws IOException { long timeoutMillis = unit.toMillis(timeout); IoWriteFuture writeFuture; try { long start = System.currentTimeMillis(); writeFuture = kexHandler.writePacket(buffer, timeout, unit); long elapsed = System.currentTimeMillis() - start; if (elapsed >= timeoutMillis) { // We just barely made it. Give it a tiny grace period. timeoutMillis = 1; } else { timeoutMillis -= elapsed; } } catch (InterruptedIOException e) { // Already timed out PendingWriteFuture timedOut = new PendingWriteFuture(this, buffer); Throwable t = new TimeoutException("Timeout writing packet: " + timeout + " " + unit); t.initCause(e); if (log.isDebugEnabled()) { log.debug("writePacket({}): {}", AbstractSession.this, t.getMessage()); } timedOut.setValue(t); return timedOut; } if (writeFuture.isDone()) { // No need to schedule anything. return writeFuture; } @SuppressWarnings("unchecked") DefaultSshFuture<IoWriteFuture> future = (DefaultSshFuture<IoWriteFuture>) writeFuture; FactoryManager factoryManager = getFactoryManager(); ScheduledExecutorService executor = factoryManager.getScheduledExecutorService(); ScheduledFuture<?> sched = executor.schedule(() -> { Throwable t = new TimeoutException("Timeout writing packet: " + timeout + " " + unit); if (log.isDebugEnabled()) { log.debug("writePacket({}): {}", AbstractSession.this, t.getMessage()); } future.setValue(t); }, timeoutMillis, TimeUnit.MILLISECONDS); future.addListener(f -> sched.cancel(false)); return writeFuture; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writePacket File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
writePacket
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("deprecation") protected void _closeInput() throws IOException { if (_inputStream != null) { if (_ioContext.isResourceManaged() || isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) { _inputStream.close(); } _inputStream = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _closeInput 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
_closeInput
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterProcessObserver File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
unregisterProcessObserver
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override // NotificationData.Environment public boolean isDeviceProvisioned() { return mDeviceProvisionedController.isDeviceProvisioned(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDeviceProvisioned 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
isDeviceProvisioned
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void clearPending() { if (postponedActivityResult.clear()) { Log.e(Config.LOGTAG, "cleared pending intent with unhandled result left"); } if (pendingScrollState.clear()) { Log.e(Config.LOGTAG, "cleared scroll state"); } if (pendingTakePhotoUri.clear()) { Log.e(Config.LOGTAG, "cleared pending photo uri"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearPending File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
clearPending
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public String getCertTypeSSLClient() { return certTypeSSLClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertTypeSSLClient File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getCertTypeSSLClient
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public void cleanupZipTemp() { System.out.println("Deleting temporary zip directory: " + tempWorkDir); deleteDirectory(new File(tempWorkDir)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanupZipTemp File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
cleanupZipTemp
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
private PendingIntent createBackgroundPendingIntent() { return createBackgroundPendingIntent(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createBackgroundPendingIntent File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
createBackgroundPendingIntent
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void save(String comment) throws XWikiException { save(comment, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save 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
save
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public void setUpdateIdentifier(int updateIdentifier) { mUpdateIdentifier = updateIdentifier; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUpdateIdentifier 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
setUpdateIdentifier
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
public int getStorageEncryptionStatus() { throwIfParentInstance("getStorageEncryptionStatus"); return getStorageEncryptionStatus(myUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStorageEncryptionStatus File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getStorageEncryptionStatus
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void unregisterPongListener() { mAlarmManager.cancel(mPingAlarmPendIntent); mAlarmManager.cancel(mPongTimeoutAlarmPendIntent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterPongListener File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
unregisterPongListener
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
@Override public void setOrganizationColor(@NonNull ComponentName who, int color) { if (!mHasFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallingUser(isManagedProfile(caller.getUserId())); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); admin.organizationColor = color; saveSettingsLocked(caller.getUserId()); } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_ORGANIZATION_COLOR) .setAdmin(caller.getComponentName()) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOrganizationColor 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
setOrganizationColor
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static RequestHeaders toArmeriaRequestHeaders(ChannelHandlerContext ctx, Http2Headers headers, boolean endOfStream, String scheme, ServerConfig cfg) { final RequestHeadersBuilder builder = RequestHeaders.builder(); toArmeria(builder, headers, endOfStream); // A CONNECT request might not have ":scheme". See https://tools.ietf.org/html/rfc7540#section-8.1.2.3 if (!builder.contains(HttpHeaderNames.SCHEME)) { builder.add(HttpHeaderNames.SCHEME, scheme); } if (!builder.contains(HttpHeaderNames.AUTHORITY)) { final String defaultHostname = cfg.defaultVirtualHost().defaultHostname(); final int port = ((InetSocketAddress) ctx.channel().localAddress()).getPort(); builder.add(HttpHeaderNames.AUTHORITY, defaultHostname + ':' + port); } return builder.build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toArmeriaRequestHeaders File: core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
toArmeriaRequestHeaders
core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
boolean destroyIfPossible(String reason) { setState(FINISHING, "destroyIfPossible"); // Make sure the record is cleaned out of other places. mTaskSupervisor.mStoppingActivities.remove(this); final Task rootTask = getRootTask(); final TaskDisplayArea taskDisplayArea = getDisplayArea(); // TODO(b/137329632): Exclude current activity when looking for the next one with // DisplayContent#topRunningActivity(). final ActivityRecord next = taskDisplayArea.topRunningActivity(); final boolean isLastRootTaskOverEmptyHome = next == null && rootTask.isFocusedRootTaskOnDisplay() && taskDisplayArea.getOrCreateRootHomeTask() != null; if (isLastRootTaskOverEmptyHome) { // Don't destroy activity immediately if this is the last activity on the display and // the display contains root home task. Although there is no next activity at the // moment, another home activity should be started later. Keep this activity alive // until next home activity is resumed. This way the user won't see a temporary black // screen. addToFinishingAndWaitForIdle(); return false; } makeFinishingLocked(); final boolean activityRemoved = destroyImmediately("finish-imm:" + reason); // If the display does not have running activity, the configuration may need to be // updated for restoring original orientation of the display. if (next == null) { mRootWindowContainer.ensureVisibilityAndConfig(next, getDisplayId(), false /* markFrozenIfConfigChanged */, true /* deferResume */); } if (activityRemoved) { mRootWindowContainer.resumeFocusedTasksTopActivities(); } ProtoLog.d(WM_DEBUG_CONTAINERS, "destroyIfPossible: r=%s destroy returned " + "removed=%s", this, activityRemoved); return activityRemoved; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroyIfPossible 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
destroyIfPossible
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private void migrate81(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Projects.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { if (element.element("serviceDeskName") == null) element.addElement("serviceDeskName").setText(Project.NULL_SERVICE_DESK_PREFIX + UUID.randomUUID().toString()); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate81 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate81
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public String getTempFolderPath() { return tempFolderPath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTempFolderPath File: samples/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
getTempFolderPath
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public ApiScenrioExportResult export(ApiScenarioBatchRequest request) { ApiScenrioExportResult result = new ApiScenrioExportResult(); result.setData(getExportResult(request)); result.setProjectId(request.getProjectId()); result.setVersion(System.getenv("MS_VERSION")); if (CollectionUtils.isNotEmpty(result.getData())) { List<String> names = result.getData().stream().map(ApiScenarioWithBLOBs::getName).collect(Collectors.toList()); request.setName(String.join(",", names)); List<String> ids = result.getData().stream().map(ApiScenarioWithBLOBs::getId).collect(Collectors.toList()); request.setId(JSON.toJSONString(ids)); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: export File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
export
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
public static <K, V> ConcurrentMap<K, V> newConcurrentHashMap() { return new ConcurrentHashMap<K, V>(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newConcurrentHashMap 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
newConcurrentHashMap
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
public <T> T get(Env env, String path, Class<T> responseType, Object... urlVariables) throws RestClientException { return execute(HttpMethod.GET, env, path, null, responseType, urlVariables); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RetryableRestTemplate.java Repository: apolloconfig/apollo The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-15170
MEDIUM
6.8
apolloconfig/apollo
get
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RetryableRestTemplate.java
ae9ba6cfd32ed80469f162e5e3583e2477862ddf
0
Analyze the following code function for security vulnerabilities
@Override protected void log(String s) { Log.d(getTag(), s); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: log 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
log
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
protected void manageBooleanOptions(Map<String, Object> options) { for (String key : Printer.BOOLEAN_KEYS) { Object option = options.get(key); boolean value = option instanceof Boolean && (boolean) option; if (!value) { options.remove(key); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: manageBooleanOptions File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java Repository: jline/jline3 The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-50572
MEDIUM
5.5
jline/jline3
manageBooleanOptions
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
0
Analyze the following code function for security vulnerabilities
public static File getTempWorkDirFile() { File tempDirFile = new File(getTempWorkDir()); if(!tempDirFile.exists()) { tempDirFile.mkdirs(); } return tempDirFile; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTempWorkDirFile File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
getTempWorkDirFile
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection get(final String path1, final String path2, final Route.Handler handler) { return new Route.Collection( new Route.Definition[]{get(path1, handler), get(path2, handler)}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
get
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
protected final Long _parseLong(DeserializationContext ctxt, String text) throws IOException { try { return NumberInput.parseLong(text); } catch (IllegalArgumentException iae) { } return (Long) ctxt.handleWeirdStringValue(Long.class, text, "not a valid `java.lang.Long` value"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _parseLong 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
_parseLong
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
@Override public boolean serveDevModeRequest(HttpServletRequest request, HttpServletResponse response) throws IOException { // Do not serve requests if dev server starting or failed to start. if (isDevServerFailedToStart.get() || !devServerStartFuture.isDone()) { return false; } // Since we have 'publicPath=/VAADIN/' in webpack config, // a valid request for webpack-dev-server should start with '/VAADIN/' String requestFilename = request.getPathInfo(); if (HandlerHelper.isPathUnsafe(requestFilename)) { getLogger().info("Blocked attempt to access file: {}", requestFilename); response.setStatus(HttpServletResponse.SC_FORBIDDEN); return true; } // Redirect theme source request if (APP_THEME_PATTERN.matcher(requestFilename).find()) { requestFilename = "/VAADIN/static" + requestFilename; } HttpURLConnection connection = prepareConnection(requestFilename, request.getMethod()); // Copies all the headers from the original request Enumeration<String> headerNames = request.getHeaderNames(); while (headerNames.hasMoreElements()) { String header = headerNames.nextElement(); connection.setRequestProperty(header, // Exclude keep-alive "Connect".equals(header) ? "close" : request.getHeader(header)); } // Send the request getLogger().debug("Requesting resource to webpack {}", connection.getURL()); int responseCode = connection.getResponseCode(); if (responseCode == HTTP_NOT_FOUND) { getLogger().debug("Resource not served by webpack {}", requestFilename); // webpack cannot access the resource, return false so as flow can // handle it return false; } getLogger().debug("Served resource by webpack: {} {}", responseCode, requestFilename); // Copies response headers connection.getHeaderFields().forEach((header, values) -> { if (header != null) { response.addHeader(header, values.get(0)); } }); if (responseCode == HTTP_OK) { // Copies response payload writeStream(response.getOutputStream(), connection.getInputStream()); } else if (responseCode < 400) { response.setStatus(responseCode); } else { // Copies response code response.sendError(responseCode); } // Close request to avoid issues in CI and Chrome response.getOutputStream().close(); return true; }
Vulnerability Classification: - CWE: CWE-172 - CVE: CVE-2021-33604 - Severity: LOW - CVSS Score: 1.2 Description: fix: prevent passing bad character to dev-server The webpack dev-server does not escape " character, as it is not valid URL. This limitation was not checked when passing request to it via DevModeHandlerImpl. Function: serveDevModeRequest File: vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java Repository: vaadin/flow Fixed Code: @Override public boolean serveDevModeRequest(HttpServletRequest request, HttpServletResponse response) throws IOException { // Do not serve requests if dev server starting or failed to start. if (isDevServerFailedToStart.get() || !devServerStartFuture.isDone()) { return false; } // Since we have 'publicPath=/VAADIN/' in webpack config, // a valid request for webpack-dev-server should start with '/VAADIN/' String requestFilename = request.getPathInfo(); if (HandlerHelper.isPathUnsafe(requestFilename) || WEBPACK_ILLEGAL_CHAR_PATTERN.matcher(requestFilename) .find()) { getLogger().info("Blocked attempt to access file: {}", requestFilename); response.setStatus(HttpServletResponse.SC_FORBIDDEN); return true; } // Redirect theme source request if (APP_THEME_PATTERN.matcher(requestFilename).find()) { requestFilename = "/VAADIN/static" + requestFilename; } HttpURLConnection connection = prepareConnection(requestFilename, request.getMethod()); // Copies all the headers from the original request Enumeration<String> headerNames = request.getHeaderNames(); while (headerNames.hasMoreElements()) { String header = headerNames.nextElement(); connection.setRequestProperty(header, // Exclude keep-alive "Connect".equals(header) ? "close" : request.getHeader(header)); } // Send the request getLogger().debug("Requesting resource to webpack {}", connection.getURL()); int responseCode = connection.getResponseCode(); if (responseCode == HTTP_NOT_FOUND) { getLogger().debug("Resource not served by webpack {}", requestFilename); // webpack cannot access the resource, return false so as flow can // handle it return false; } getLogger().debug("Served resource by webpack: {} {}", responseCode, requestFilename); // Copies response headers connection.getHeaderFields().forEach((header, values) -> { if (header != null) { response.addHeader(header, values.get(0)); } }); if (responseCode == HTTP_OK) { // Copies response payload writeStream(response.getOutputStream(), connection.getInputStream()); } else if (responseCode < 400) { response.setStatus(responseCode); } else { // Copies response code response.sendError(responseCode); } // Close request to avoid issues in CI and Chrome response.getOutputStream().close(); return true; }
[ "CWE-172" ]
CVE-2021-33604
LOW
1.2
vaadin/flow
serveDevModeRequest
vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
2a801c42b406a00c44f4a85b4b4e4a4c5bf89adc
1
Analyze the following code function for security vulnerabilities
private void handleDoubleTapOnHome() { if (mDoubleTapOnHomeBehavior == DOUBLE_TAP_HOME_RECENT_SYSTEM_UI) { mHomeConsumed = true; toggleRecentApps(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleDoubleTapOnHome 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
handleDoubleTapOnHome
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public void addURL(URL url) { super.addURL(url); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addURL 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
addURL
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@Override public boolean isBlocked() { return blocked; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBlocked File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
isBlocked
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
public void connect() throws IOException { if (mDevice == null) throw new IOException("Connect is called on null device"); try { if (mSocketState == SocketState.CLOSED) throw new IOException("socket closed"); IBluetooth bluetoothProxy = BluetoothAdapter.getDefaultAdapter().getBluetoothService(null); if (bluetoothProxy == null) throw new IOException("Bluetooth is off"); mPfd = bluetoothProxy.connectSocket(mDevice, mType, mUuid, mPort, getSecurityFlags()); synchronized(this) { if (DBG) Log.d(TAG, "connect(), SocketState: " + mSocketState + ", mPfd: " + mPfd); if (mSocketState == SocketState.CLOSED) throw new IOException("socket closed"); if (mPfd == null) throw new IOException("bt socket connect failed"); FileDescriptor fd = mPfd.getFileDescriptor(); mSocket = new LocalSocket(fd); mSocketIS = mSocket.getInputStream(); mSocketOS = mSocket.getOutputStream(); } int channel = readInt(mSocketIS); if (channel <= 0) throw new IOException("bt socket connect failed"); mPort = channel; waitSocketSignal(mSocketIS); synchronized(this) { if (mSocketState == SocketState.CLOSED) throw new IOException("bt socket closed"); mSocketState = SocketState.CONNECTED; } } catch (RemoteException e) { Log.e(TAG, Log.getStackTraceString(new Throwable())); throw new IOException("unable to send RPC: " + e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connect File: core/java/android/bluetooth/BluetoothSocket.java Repository: Genymobile/f2ut_platform_frameworks_base The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2014-9908
LOW
3.3
Genymobile/f2ut_platform_frameworks_base
connect
core/java/android/bluetooth/BluetoothSocket.java
f24cec326f5f65c693544fb0b92c37f633bacda2
0
Analyze the following code function for security vulnerabilities
public static KeyguardUpdateMonitor getInstance(Context context) { if (sInstance == null) { sInstance = new KeyguardUpdateMonitor(context); } return sInstance; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstance File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
getInstance
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public void onForegroundServiceNotificationUpdate(boolean shown, Notification notification, int id, String pkg, @UserIdInt int userId) { synchronized (ActivityManagerService.this) { mServices.onForegroundServiceNotificationUpdateLocked(shown, notification, id, pkg, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onForegroundServiceNotificationUpdate 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
onForegroundServiceNotificationUpdate
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
void startSpecificActivityLocked(ActivityRecord r, boolean andResume, boolean checkConfig) { // Is this activity's application already running? ProcessRecord app = mService.getProcessRecordLocked(r.processName, r.info.applicationInfo.uid, true); r.task.stack.setLaunchTime(r); if (app != null && app.thread != null) { try { if ((r.info.flags&ActivityInfo.FLAG_MULTIPROCESS) == 0 || !"android".equals(r.info.packageName)) { // Don't add this if it is a platform component that is marked // to run in multiple processes, because this is actually // part of the framework so doesn't make sense to track as a // separate apk in the process. app.addPackage(r.info.packageName, r.info.applicationInfo.versionCode, mService.mProcessStats); } realStartActivityLocked(r, app, andResume, checkConfig); return; } catch (RemoteException e) { Slog.w(TAG, "Exception when starting activity " + r.intent.getComponent().flattenToShortString(), e); } // If a dead object exception was thrown -- fall through to // restart the application. } mService.startProcessLocked(r.processName, r.info.applicationInfo, true, 0, "activity", r.intent.getComponent(), false, false, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startSpecificActivityLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
startSpecificActivityLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public boolean isValid() { boolean atpRunning = true; try { atpRunning = applicationThreadPool.isShutdown(); } catch (Exception ignore) { // isShutdown() will thrown an exception in an EE7 environment // when using a ManagedExecutorService. // When this is the case, we assume it's running. } return atpRunning; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValid File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
isValid
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0