instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public long getTimeMillis(CharSequence name, long defaultValue) { return headers.getTimeMillis(name, defaultValue); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTimeMillis 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
getTimeMillis
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
07aa6b5938a8b6ed7a6586e066400e2643897323
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("rawtypes") public int nextSpanTransition(int start, int limit, Class type) { return mSpanned.nextSpanTransition(start, limit, type); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nextSpanTransition File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
nextSpanTransition
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
public XWikiWebDriver getDriver() { return TestUtils.context.getDriver(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDriver File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getDriver
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public void calcFillSettings(String field, Map<String,Object> attributes) { String capitalizedFieldName = StringUtils.capitalize(field); String methodName = "doFill" + capitalizedFieldName + "Items"; Method method = ReflectionUtils.getPublicMethodNamed(getClass(), methodName); if(method==null) throw new IllegalStateException(String.format("%s doesn't have the %s method for filling a drop-down list", getClass(), methodName)); // build query parameter line by figuring out what should be submitted List<String> depends = buildFillDependencies(method, new ArrayList<String>()); if (!depends.isEmpty()) attributes.put("fillDependsOn",Util.join(depends," ")); attributes.put("fillUrl", String.format("%s/%s/fill%sItems", getCurrentDescriptorByNameUrl(), getDescriptorUrl(), capitalizedFieldName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calcFillSettings File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
calcFillSettings
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public String getCertTypeSubSSLCA() { return certTypeSubSSLCA; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertTypeSubSSLCA 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
getCertTypeSubSSLCA
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public boolean isPlaceholderAllowed() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPlaceholderAllowed File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
isPlaceholderAllowed
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
0
Analyze the following code function for security vulnerabilities
public void updateBeforeConnect(int networkId, int callingUid, @NonNull String packageName) { userEnabledNetwork(networkId); if (!enableNetwork(networkId, true, callingUid, null) || !updateLastConnectUid(networkId, callingUid)) { Log.i(TAG, "connect Allowing uid " + callingUid + " packageName " + packageName + " with insufficient permissions to connect=" + networkId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBeforeConnect 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
updateBeforeConnect
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
protected boolean shouldUnlockOnMenuPressed() { return mDeviceInteractive && mState != StatusBarState.SHADE && mStatusBarKeyguardViewManager.shouldDismissOnMenuPressed(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldUnlockOnMenuPressed 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
shouldUnlockOnMenuPressed
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public JSON getJSON() { return json; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJSON 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
getJSON
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void onReceive(Context context, Intent intent) { post(new Runnable() { @Override public void run() { updateCameraVisibility(); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onReceive 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
onReceive
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public Connection onCreateIncomingConnection( PhoneAccountHandle connectionManagerPhoneAccount, ConnectionRequest request) { FakeConnection fakeConnection = new FakeConnection( mVideoState == INVALID_VIDEO_STATE ? request.getVideoState() : mVideoState, request.getAddress()); mLatestConnection = fakeConnection; if (mCapabilities != NOT_SPECIFIED) { fakeConnection.setConnectionCapabilities(mCapabilities); } if (mProperties != NOT_SPECIFIED) { fakeConnection.setConnectionProperties(mProperties); } return fakeConnection; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21283 - Severity: MEDIUM - CVSS Score: 5.5 Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634 Fixes: 285211549 Fixes: 280797684 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15) Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Function: onCreateIncomingConnection File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android Fixed Code: @Override public Connection onCreateIncomingConnection( PhoneAccountHandle connectionManagerPhoneAccount, ConnectionRequest request) { FakeConnection fakeConnection = new FakeConnection( mVideoState == INVALID_VIDEO_STATE ? request.getVideoState() : mVideoState, request.getAddress()); mLatestConnection = fakeConnection; if (mCapabilities != NOT_SPECIFIED) { fakeConnection.setConnectionCapabilities(mCapabilities); } if (mProperties != NOT_SPECIFIED) { fakeConnection.setConnectionProperties(mProperties); } // Testing for StatusHints image icon cross user access if (request.getExtras() != null) { fakeConnection.setStatusHints( request.getExtras().getParcelable(STATUS_HINTS_EXTRA)); } return fakeConnection; }
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
onCreateIncomingConnection
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
1
Analyze the following code function for security vulnerabilities
private AuthenticatorDescription[] getAuthenticatorTypesInternal(int userId) { mAuthenticatorCache.updateServices(userId); Collection<AccountAuthenticatorCache.ServiceInfo<AuthenticatorDescription>> authenticatorCollection = mAuthenticatorCache.getAllServices(userId); AuthenticatorDescription[] types = new AuthenticatorDescription[authenticatorCollection.size()]; int i = 0; for (AccountAuthenticatorCache.ServiceInfo<AuthenticatorDescription> authenticator : authenticatorCollection) { types[i] = authenticator.type; i++; } return types; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthenticatorTypesInternal File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
getAuthenticatorTypesInternal
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public MapSession getSession(String id, boolean updateTTL) { return Optional.ofNullable(cache.get(id)) .map(v -> (MapSession) v.get()) .map(v -> updateTTL(v, updateTTL)) .orElse(null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSession File: spring/spring5/spring5-common/src/main/java/org/infinispan/spring/common/session/AbstractInfinispanSessionRepository.java Repository: infinispan The code follows secure coding practices.
[ "CWE-384" ]
CVE-2019-10158
HIGH
7.5
infinispan
getSession
spring/spring5/spring5-common/src/main/java/org/infinispan/spring/common/session/AbstractInfinispanSessionRepository.java
f3efef8de7fec4108dd5ab725cea6ae09f14815d
0
Analyze the following code function for security vulnerabilities
private Locale getDefaultLocale(Document document) { if (document.isTranslation()) { // The default locale field is not always set on document translations: // // * it is empty for translation pages created by the user because the save action doesn't set it and the // edit form doesn't include this field; // * it may be set for translation pages that are part of an XWiki extension because the XAR Maven plugin // used to build the extension has a rule to enforce it; // // So we should take the default locale from the original document. try { XWikiContext xcontext = this.xcontextProvider.get(); return xcontext.getWiki().getDocument(document.getDocumentReference(), xcontext).getRealLocale(); } catch (XWikiException e) { this.logger.warn("Failed to get the default locale from [{}]. Root cause is [{}].", document.getDocumentReference(), ExceptionUtils.getRootCauseMessage(e)); // Fall-back on the default locale specified on the translation page, which may not be accurate. return document.getDefaultLocale(); } } else { return document.getRealLocale(); } }
Vulnerability Classification: - CWE: CWE-668 - CVE: CVE-2023-35151 - Severity: HIGH - CVSS Score: 7.5 Description: XWIKI-16138: Improved REST properties cleanup Function: getDefaultLocale File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java Repository: xwiki/xwiki-platform Fixed Code: private Locale getDefaultLocale(Document document) { if (document.isTranslation()) { // The default locale field is not always set on document translations: // // * it is empty for translation pages created by the user because the save action doesn't set it and the // edit form doesn't include this field; // * it may be set for translation pages that are part of an XWiki extension because the XAR Maven plugin // used to build the extension has a rule to enforce it; // // So we should take the default locale from the original document. try { XWikiContext xcontext = this.xcontextProvider.get(); return xcontext.getWiki().getDocument(document.getDocumentReference(), xcontext).getRealLocale(); } catch (XWikiException e) { this.logger.warn("Failed to get the default locale from [{}]. Root cause is [{}].", document.getDocumentReference(), getRootCauseMessage(e)); // Fall-back on the default locale specified on the translation page, which may not be accurate. return document.getDefaultLocale(); } } else { return document.getRealLocale(); } }
[ "CWE-668" ]
CVE-2023-35151
HIGH
7.5
xwiki/xwiki-platform
getDefaultLocale
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
824cd742ecf5439971247da11bfe7e0ad2b10ede
1
Analyze the following code function for security vulnerabilities
@Override public ParcelFileDescriptor getLifeMonitor() { if (!isCallerShell()) { throw new SecurityException("Only shell can call it"); } synchronized (mProcLock) { try { if (mLifeMonitorFds == null) { mLifeMonitorFds = ParcelFileDescriptor.createPipe(); } // The returned FD will be closed, but we want to keep our reader open, // so return a dup instead. return mLifeMonitorFds[0].dup(); } catch (IOException e) { Slog.w(TAG, "Unable to create pipe", e); return null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLifeMonitor 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
getLifeMonitor
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private boolean isPackage(CallerIdentity caller, String packageName) { return isCallingFromPackage(packageName, caller.getUid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPackage 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
isPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void rewind(String packageName, int pid, int uid) { try { final String reason = TAG + ":rewind"; mService.tempAllowlistTargetPkgIfPossible(getUid(), getPackageName(), pid, uid, packageName, reason); mCb.onRewind(packageName, pid, uid); } catch (RemoteException e) { Log.e(TAG, "Remote failure in rewind.", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rewind File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
rewind
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
public void setRCSVersion(Version version) { this.version = version; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRCSVersion 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
setRCSVersion
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public void broadcastWpsOverlapEvent(String iface) { sendMessage(iface, WPS_OVERLAP_EVENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastWpsOverlapEvent File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
broadcastWpsOverlapEvent
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; // also set the date format for model (de)serialization with Date properties this.json.setDateFormat((DateFormat) dateFormat.clone()); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDateFormat File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setDateFormat
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Test public void deleteByCriterionDeleteFails(TestContext context) { postgresClientQueryFails().delete(FOO, new Criterion(), context.asyncAssertFailure(fail -> { context.assertTrue(fail.getMessage().contains("postgresClientQueryFails")); })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteByCriterionDeleteFails File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
deleteByCriterionDeleteFails
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
boolean hasMethodWriteReplace() { return (methodWriteReplace != null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasMethodWriteReplace File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
hasMethodWriteReplace
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public void writeTo(DataOutputStream os) throws IOException { os.writeByte(type); os.writeShort(channel); if (accumulator != null) { os.writeInt(accumulator.size()); accumulator.writeTo(os); } else { os.writeInt(payload.length); os.write(payload); } os.write(AMQP.FRAME_END); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeTo File: src/main/java/com/rabbitmq/client/impl/Frame.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
writeTo
src/main/java/com/rabbitmq/client/impl/Frame.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
private BluetoothActivityEnergyInfo reportActivityInfo() { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, "Need BLUETOOTH permission"); BluetoothActivityEnergyInfo info = new BluetoothActivityEnergyInfo(SystemClock.elapsedRealtime(), mStackReportedState, mTxTimeTotalMs, mRxTimeTotalMs, mIdleTimeTotalMs, mEnergyUsedTotalVoltAmpSecMicro); // Read on clear values; a record of data is created with // timstamp and new samples are collected until read again mStackReportedState = 0; mTxTimeTotalMs = 0; mRxTimeTotalMs = 0; mIdleTimeTotalMs = 0; mEnergyUsedTotalVoltAmpSecMicro = 0; return info; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportActivityInfo File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
reportActivityInfo
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean rewrite(File f, File backup) throws InvalidKeyException, IOException { return rewrite(f); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rewrite File: core/src/main/java/hudson/util/SecretRewriter.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-326" ]
CVE-2017-2598
MEDIUM
4
jenkinsci/jenkins
rewrite
core/src/main/java/hudson/util/SecretRewriter.java
e6aa166246d1734f4798a9e31f78842f4c85c28b
0
Analyze the following code function for security vulnerabilities
public void onTrackingStarted() { runPostCollapseRunnables(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTrackingStarted 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
onTrackingStarted
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
void sendAdminCommandLocked(ActiveAdmin admin, String action, Bundle adminExtras, BroadcastReceiver result) { sendAdminCommandLocked(admin, action, adminExtras, result, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendAdminCommandLocked 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
sendAdminCommandLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder cdata(byte[] data);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cdata File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
cdata
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private void handleShortPressOnHome() { // If there's a dream running then use home to escape the dream // but don't actually go home. if (mDreamManagerInternal != null && mDreamManagerInternal.isDreaming()) { mDreamManagerInternal.stopDream(false /*immediate*/); return; } // Go home! launchHomeFromHotKey(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleShortPressOnHome 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
handleShortPressOnHome
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override void removeImmediately() { if (mRemoved) { // Nothing to do. ProtoLog.v(WM_DEBUG_ADD_REMOVE, "WS.removeImmediately: %s Already removed...", this); return; } mRemoved = true; // Destroy surface before super call. The general pattern is that the children need // to be removed before the parent (so that the sync-engine tracking works). Since // WindowStateAnimator is a "virtual" child, we have to do it manually here. mWinAnimator.destroySurfaceLocked(getSyncTransaction()); super.removeImmediately(); mWillReplaceWindow = false; if (mReplacementWindow != null) { mReplacementWindow.mSkipEnterAnimationForSeamlessReplacement = false; } final DisplayContent dc = getDisplayContent(); if (isImeLayeringTarget()) { // Remove the IME screenshot surface if the layering target is not animating. dc.removeImeScreenshotIfPossible(); // Make sure to set mImeLayeringTarget as null when the removed window is the // IME target, in case computeImeTarget may use the outdated target. dc.setImeLayeringTarget(null); dc.computeImeTarget(true /* updateImeTarget */); } if (dc.getImeInputTarget() == this && (mActivityRecord == null || !mActivityRecord.isRelaunching())) { dc.updateImeInputAndControlTarget(null); } final int type = mAttrs.type; if (WindowManagerService.excludeWindowTypeFromTapOutTask(type)) { dc.mTapExcludedWindows.remove(this); } // Remove this window from mTapExcludeProvidingWindows. If it was not registered, this will // not do anything. dc.mTapExcludeProvidingWindows.remove(this); dc.getDisplayPolicy().removeWindowLw(this); disposeInputChannel(); mOnBackInvokedCallbackInfo = null; mSession.windowRemovedLocked(); try { mClient.asBinder().unlinkToDeath(mDeathRecipient, 0); } catch (RuntimeException e) { // Ignore if it has already been removed (usually because // we are doing this as part of processing a death note.) } mWmService.postWindowRemoveCleanupLocked(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeImmediately File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
removeImmediately
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public SerializableComparator<T> getComparator( SortDirection sortDirection) { Objects.requireNonNull(comparator, "No comparator defined for sorted column."); boolean reverse = sortDirection != SortDirection.ASCENDING; return reverse ? (t1, t2) -> comparator.reversed().compare(t1, t2) : comparator; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComparator File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getComparator
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public final NokogiriHandler getNokogiriHandler() { return handler; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNokogiriHandler File: ext/java/nokogiri/XmlSaxParserContext.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
getNokogiriHandler
ext/java/nokogiri/XmlSaxParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
0
Analyze the following code function for security vulnerabilities
public int validateUser(boolean withConfirmEmail, XWikiContext context) throws XWikiException { try { XWikiRequest request = context.getRequest(); // Get the user document String username = convertUsername(request.getParameter("xwikiname"), context); if (username.indexOf('.') == -1) { username = "XWiki." + username; } XWikiDocument userDocument = getDocument(username, context); // Get the stored validation key BaseObject userObject = userDocument.getObject("XWiki.XWikiUsers", 0); String storedKey = userObject.getStringValue("validkey"); // Get the validation key from the URL String validationKey = request.getParameter("validkey"); PropertyInterface validationKeyClass = getClass("XWiki.XWikiUsers", context).get("validkey"); if (validationKeyClass instanceof PasswordClass) { validationKey = ((PasswordClass) validationKeyClass).getEquivalentPassword(storedKey, validationKey); } // Compare the two keys if ((!storedKey.equals("") && (storedKey.equals(validationKey)))) { XWikiUser xWikiUser = new XWikiUser(userDocument.getDocumentReference()); xWikiUser.setDisabled(false, context); xWikiUser.setEmailChecked(true, context); saveDocument(userDocument, context); if (withConfirmEmail) { String email = userObject.getStringValue("email"); String password = userObject.getStringValue("password"); sendValidationEmail(username, password, email, request.getParameter("validkey"), "confirmation_email_content", context); } return 0; } else { return -1; } } catch (Exception e) { LOGGER.error(e.getMessage(), e); throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_VALIDATE_USER, "Exception while validating user", e, null); } }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2021-32620 - Severity: MEDIUM - CVSS Score: 4.0 Description: XWIKI-17942: Email validation check is not properly reset * Ensure to reset the validation email key once validated Function: validateUser File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform Fixed Code: public int validateUser(boolean withConfirmEmail, XWikiContext context) throws XWikiException { try { XWikiRequest request = context.getRequest(); // Get the user document String username = convertUsername(request.getParameter("xwikiname"), context); if (username.indexOf('.') == -1) { username = "XWiki." + username; } XWikiDocument userDocument = getDocument(username, context); // Get the stored validation key BaseObject userObject = userDocument.getObject("XWiki.XWikiUsers", 0); String storedKey = userObject.getStringValue("validkey"); // Get the validation key from the URL String validationKey = request.getParameter("validkey"); PropertyInterface validationKeyClass = getClass("XWiki.XWikiUsers", context).get("validkey"); if (validationKeyClass instanceof PasswordClass) { validationKey = ((PasswordClass) validationKeyClass).getEquivalentPassword(storedKey, validationKey); } // Compare the two keys if ((!storedKey.equals("") && (storedKey.equals(validationKey)))) { // Ensure to remove the validation key value, so it cannot be used afterwards to enable back // a disabled user. userObject.setStringValue("validkey", ""); saveDocument(userDocument, context); XWikiUser xWikiUser = new XWikiUser(userDocument.getDocumentReference()); xWikiUser.setDisabled(false, context); xWikiUser.setEmailChecked(true, context); if (withConfirmEmail) { String email = userObject.getStringValue("email"); String password = userObject.getStringValue("password"); sendValidationEmail(username, password, email, request.getParameter("validkey"), "confirmation_email_content", context); } return 0; } else { return -1; } } catch (Exception e) { LOGGER.error(e.getMessage(), e); throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_VALIDATE_USER, "Exception while validating user", e, null); } }
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
validateUser
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
1
Analyze the following code function for security vulnerabilities
public Iterator keys() { return dataHolder != null ? dataHolder.keys() : Collections.EMPTY_MAP.keySet().iterator(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keys File: xstream/src/java/com/thoughtworks/xstream/core/TreeUnmarshaller.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
keys
xstream/src/java/com/thoughtworks/xstream/core/TreeUnmarshaller.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
@Override @Exported public SubversionRepositoryBrowser getBrowser() { return browser; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBrowser File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
getBrowser
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Override public List<Collection> findAll(Context context) throws SQLException { MetadataField nameField = metadataFieldService.findByElement(context, MetadataSchemaEnum.DC.getName(), "title", null); if (nameField == null) { throw new IllegalArgumentException( "Required metadata field '" + MetadataSchemaEnum.DC.getName() + ".title' doesn't exist!"); } return collectionDAO.findAll(context, nameField); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findAll File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
findAll
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
ActivityRecord getHomeActivity() { return getHomeActivityForUser(mCurrentUser); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHomeActivity 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
getHomeActivity
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
private void parseProductionRules(final List<Element> elements) throws GameParseException { for (final Element current : elements) { final String name = current.getAttribute("name"); final ProductionRule rule = new ProductionRule(name, data); parseCosts(rule, getChildren("cost", current)); parseResults(rule, getChildren("result", current)); data.getProductionRuleList().addProductionRule(rule); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseProductionRules File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseProductionRules
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
private static boolean isExternal(ApplicationInfo info) { return (info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isExternal 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
isExternal
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void _setToLong(long n) { if (n == Long.MIN_VALUE) { readBigIntegerToBcd(BigInteger.valueOf(n).negate()); } else if (n <= Integer.MAX_VALUE) { readIntToBcd((int) n); } else { readLongToBcd(n); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _setToLong File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
_setToLong
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
private static void xorBlock(byte[] input, int inputOffset, byte[] output, int outputOffset, int length, int[] block) { int posn = 0; int value; while (length >= 4) { value = block[posn++]; output[outputOffset] = (byte)(input[inputOffset] ^ value); output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); output[outputOffset + 3] = (byte)(input[inputOffset + 3] ^ (value >> 24)); inputOffset += 4; outputOffset += 4; length -= 4; } if (length == 3) { value = block[posn]; output[outputOffset] = (byte)(input[inputOffset] ^ value); output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); } else if (length == 2) { value = block[posn]; output[outputOffset] = (byte)(input[inputOffset] ^ value); output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); } else if (length == 1) { value = block[posn]; output[outputOffset] = (byte)(input[inputOffset] ^ value); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: xorBlock File: src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
xorBlock
src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { return internal.equals(((SFile) obj).internal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
equals
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
private boolean isNetworkLoggingEnabledInternalLocked() { ActiveAdmin activeAdmin = getNetworkLoggingControllingAdminLocked(); return (activeAdmin != null) && activeAdmin.isNetworkLoggingEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNetworkLoggingEnabledInternalLocked 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
isNetworkLoggingEnabledInternalLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void registerAccountListener(String[] accountTypes, String opPackageName, UserAccounts accounts) { synchronized (accounts.mReceiversForType) { if (accountTypes == null) { // null for any type accountTypes = new String[] {null}; } for (String type : accountTypes) { Map<String, Integer> receivers = accounts.mReceiversForType.get(type); if (receivers == null) { receivers = new HashMap<>(); accounts.mReceiversForType.put(type, receivers); } Integer cnt = receivers.get(opPackageName); receivers.put(opPackageName, cnt != null ? cnt + 1 : 1); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerAccountListener File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
registerAccountListener
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Nullable private static TypedArray obtainDayNightAttributes(@NonNull Context ctx, @NonNull @StyleableRes int[] attrs) { // when testing, the mock context may have no theme if (ctx.getTheme() == null) { return null; } Resources.Theme theme = new ContextThemeWrapper(ctx, R.style.Theme_DeviceDefault_DayNight).getTheme(); return theme.obtainStyledAttributes(attrs); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: obtainDayNightAttributes File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
obtainDayNightAttributes
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private static native int nativeGetResourceValue(long ptr, @AnyRes int resId, short density, @NonNull TypedValue outValue, boolean resolveReferences);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeGetResourceValue 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
nativeGetResourceValue
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public ExceptionHandler getExceptionHandler() { return exceptionHandler; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExceptionHandler File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
getExceptionHandler
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting int getBlockStateForUid(UidRecord uidRec) { // Denotes whether uid's process state is currently allowed network access. final boolean isAllowed = isProcStateAllowedWhileIdleOrPowerSaveMode(uidRec.curProcState) || isProcStateAllowedWhileOnRestrictBackground(uidRec.curProcState); // Denotes whether uid's process state was previously allowed network access. final boolean wasAllowed = isProcStateAllowedWhileIdleOrPowerSaveMode(uidRec.setProcState) || isProcStateAllowedWhileOnRestrictBackground(uidRec.setProcState); // When the uid is coming to foreground, AMS should inform the app thread that it should // block for the network rules to get updated before launching an activity. if (!wasAllowed && isAllowed) { return NETWORK_STATE_BLOCK; } // When the uid is going to background, AMS should inform the app thread that if an // activity launch is blocked for the network rules to get updated, it should be unblocked. if (wasAllowed && !isAllowed) { return NETWORK_STATE_UNBLOCK; } return NETWORK_STATE_NO_CHANGE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBlockStateForUid File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
getBlockStateForUid
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected void putAttachmentFilename(String attachmentName, String type) throws Exception { String content = "ATTACHMENT CONTENT"; String attachmentURI = buildURIForThisPage(AttachmentResource.class, attachmentName); GetMethod getMethod = executeGet(attachmentURI); Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_NOT_FOUND, getMethod.getStatusCode()); PutMethod putMethod = executePut(attachmentURI, content, MediaType.TEXT_PLAIN, TestUtils.SUPER_ADMIN_CREDENTIALS.getUserName(), TestUtils.SUPER_ADMIN_CREDENTIALS.getPassword()); Assert.assertEquals(getHttpMethodInfo(putMethod), HttpStatus.SC_CREATED, putMethod.getStatusCode()); getMethod = executeGet(attachmentURI); Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode()); Assert.assertEquals(content, getMethod.getResponseBodyAsString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putAttachmentFilename File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
putAttachmentFilename
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
int settingsGlobalGetInt(String name, int def) { return Settings.Global.getInt(mContext.getContentResolver(), name, def); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: settingsGlobalGetInt 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
settingsGlobalGetInt
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public QName get(String name, Namespace namespace) { Map<String, QName> cache = getNamespaceCache(namespace); QName answer = null; if (name != null) { answer = cache.get(name); } else { name = ""; } if (answer == null) { answer = createQName(name, namespace); answer.setDocumentFactory(documentFactory); cache.put(name, answer); } return answer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: src/main/java/org/dom4j/tree/QNameCache.java Repository: dom4j The code follows secure coding practices.
[ "CWE-91" ]
CVE-2018-1000632
MEDIUM
5
dom4j
get
src/main/java/org/dom4j/tree/QNameCache.java
e598eb43d418744c4dbf62f647dd2381c9ce9387
0
Analyze the following code function for security vulnerabilities
@Override public Bundle getAppWidgetOptions(String callingPackage, int appWidgetId) { final int userId = UserHandle.getCallingUserId(); if (DEBUG) { Slog.i(TAG, "getAppWidgetOptions() " + userId); } // Make sure the package runs under the caller uid. mSecurityPolicy.enforceCallFromPackage(callingPackage); synchronized (mLock) { ensureGroupStateLoadedLocked(userId); // NOTE: The lookup is enforcing security across users by making // sure the caller can only access widgets it hosts or provides. Widget widget = lookupWidgetLocked(appWidgetId, Binder.getCallingUid(), callingPackage); if (widget != null && widget.options != null) { return cloneIfLocalBinder(widget.options); } return Bundle.EMPTY; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppWidgetOptions File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
getAppWidgetOptions
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private Document execute(String query, int start) throws ApplicationException { HttpClient httpClient = new DefaultHttpClient(); HttpGet httpget; try { httpget = new HttpGet(createRequestString(query, start == 0 ? 1 : start)); httpClient.getParams().setParameter(HttpProtocolParams.HTTP_CONTENT_CHARSET, "UTF-8"); HttpResponse response = httpClient.execute(httpget); InputStream instream = response.getEntity().getContent(); Document document = new Document(); document.load(instream); if (document.getRoot().getElementsByTagName("errors").size() > 0) { if (i++ > ids.length - 1) i = 0; CUSTOM_SEARCH_ENGINE_ID = ids[i]; API_KEY = keys[i]; httpget = new HttpGet(createRequestString(query, start == 0 ? 1 : start)); response = httpClient.execute(httpget); instream = response.getEntity().getContent(); document.load(instream); } return document; } catch (ClientProtocolException e) { throw new ApplicationException(e.getMessage(), e); } catch (IOException e) { throw new ApplicationException(e.getMessage(), e); } catch (ParseException e) { throw new ApplicationException(e.getMessage(), e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execute File: src/main/java/custom/application/search.java Repository: m0ver/bible-online The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-4454
CRITICAL
9.8
m0ver/bible-online
execute
src/main/java/custom/application/search.java
6ef0aabfb2d4ccd53fcaa9707781303af357410e
0
Analyze the following code function for security vulnerabilities
public int getPort() { return portOrDefault(port, isSSL()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPort File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
getPort
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
protected abstract void readIntToBcd(int input);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readIntToBcd File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
readIntToBcd
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
boolean isDimming() { return mIsDimming; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDimming File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
isDimming
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public static Data fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element element = document.getDocumentElement(); return fromDOM(element); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: fromXML File: base/common/src/main/java/com/netscape/certsrv/base/PKIException.java Repository: dogtagpki/pki Fixed Code: public static Data fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element element = document.getDocumentElement(); return fromDOM(element); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromXML
base/common/src/main/java/com/netscape/certsrv/base/PKIException.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
public static String getRelativePath(SVNURL repoURL, SVNRepository repository) throws SVNException { String repoPath = repoURL.getPath().substring(repository.getRepositoryRoot(false).getPath().length()); if(!repoPath.startsWith("/")) repoPath="/"+repoPath; return repoPath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelativePath File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
getRelativePath
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Override public final int startActivityIntentSender(IIntentSender intentSender) throws TransactionTooLargeException { mService.enforceNotIsolatedCaller("ActivityContainer.startActivityIntentSender"); if (!(intentSender instanceof PendingIntentRecord)) { throw new IllegalArgumentException("Bad PendingIntent object"); } final int userId = mService.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), mCurrentUser, false, ActivityManagerService.ALLOW_FULL_ONLY, "ActivityContainer", null); final PendingIntentRecord pendingIntent = (PendingIntentRecord) intentSender; checkEmbeddedAllowedInner(userId, pendingIntent.key.requestIntent, pendingIntent.key.requestResolvedType); return pendingIntent.sendInner(0, null, null, null, null, null, null, 0, FORCE_NEW_TASK_FLAGS, FORCE_NEW_TASK_FLAGS, null, this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityIntentSender 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
startActivityIntentSender
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public MvcClass excludes(final List<String> excludes) { this.excludes = excludes; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: excludes 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
excludes
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public void setEscapeForwardSlashAlways(boolean escapeForwardSlashAlways) { this.escapeForwardSlashAlways = escapeForwardSlashAlways; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEscapeForwardSlashAlways File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
setEscapeForwardSlashAlways
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
boolean isShuttingDownLocked() { return mShuttingDown; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isShuttingDownLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
isShuttingDownLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected Map.Entry<String, String> comparePreferredKexProposalOption(KexProposalOption option) { String[] clientPreferences = GenericUtils.split(clientProposal.get(option), ','); String clientValue = GenericUtils.isEmpty(clientPreferences) ? null : clientPreferences[0]; String[] serverPreferences = GenericUtils.split(serverProposal.get(option), ','); String serverValue = GenericUtils.isEmpty(serverPreferences) ? null : serverPreferences[0]; if (GenericUtils.isEmpty(clientValue) || GenericUtils.isEmpty(serverValue) || (!Objects.equals(clientValue, serverValue))) { return new SimpleImmutableEntry<>(clientValue, serverValue); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: comparePreferredKexProposalOption 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
comparePreferredKexProposalOption
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@Override public String resolve(IFile file, String baseLocation, String publicId, String systemId) { if(null != systemId) { try { URI proposalByPreviousResolver = org.eclipse.emf.common.util.URI.createURI(systemId); String host = proposalByPreviousResolver.host(); /* * The host is empty (not null) */ if(!(null == host || host.isEmpty()) ) { return REFUSE_EXTERNAL_URI; } } catch(IllegalArgumentException ignore) { //If it is no a valid URI, there is nothing to do here. } } return null; //Don't alter the proposal of previous resolver extensions by proposing something else }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2019-9843 - Severity: MEDIUM - CVSS Score: 5.1 Description: Applied Spotless. Refactored preferences. Updated README. Function: resolve File: _ext/eclipse-wtp/src/main/java/com/diffplug/spotless/extra/eclipse/wtp/PreventExternalURIResolverExtension.java Repository: diffplug/spotless Fixed Code: @Override public String resolve(IFile file, String baseLocation, String publicId, String systemId) { if (null != systemId) { try { URI proposalByPreviousResolver = org.eclipse.emf.common.util.URI.createURI(systemId); String host = proposalByPreviousResolver.host(); /* * The host is empty (not null) */ if (!(null == host || host.isEmpty())) { return REFUSE_EXTERNAL_URI; } } catch (IllegalArgumentException ignore) { //If it is no a valid URI, there is nothing to do here. } } return null; //Don't alter the proposal of previous resolver extensions by proposing something else }
[ "CWE-611" ]
CVE-2019-9843
MEDIUM
5.1
diffplug/spotless
resolve
_ext/eclipse-wtp/src/main/java/com/diffplug/spotless/extra/eclipse/wtp/PreventExternalURIResolverExtension.java
451251ff6a8534173e0db7cbd9dd7cbc26522cf7
1
Analyze the following code function for security vulnerabilities
@Override public UserInfo getCurrentUser() { if ((checkCallingPermission(INTERACT_ACROSS_USERS) != PackageManager.PERMISSION_GRANTED) && ( checkCallingPermission(INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED)) { String msg = "Permission Denial: getCurrentUser() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + INTERACT_ACROSS_USERS; Slog.w(TAG, msg); throw new SecurityException(msg); } synchronized (this) { int userId = mTargetUserId != UserHandle.USER_NULL ? mTargetUserId : mCurrentUserId; return getUserManagerLocked().getUserInfo(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentUser 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
getCurrentUser
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void addSharedAccountsFromParentUser(int parentUserId, int userId, String opPackageName) { checkManageOrCreateUsersPermission("addSharedAccountsFromParentUser"); Account[] accounts = getAccountsAsUser(null, parentUserId, opPackageName); for (Account account : accounts) { addSharedAccountAsUser(account, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addSharedAccountsFromParentUser File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
addSharedAccountsFromParentUser
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
boolean setStringValueAndCheckIfDiff( ContentValues cv, String key, String value, boolean assumeDiff, int index) { final String valueFromLocalCache = mApnData.getString(index); if (VDBG) { Log.d(TAG, "setStringValueAndCheckIfDiff: assumeDiff: " + assumeDiff + " key: " + key + " value: '" + value + "' valueFromDb: '" + valueFromLocalCache + "'"); } final boolean isDiff = assumeDiff || !((TextUtils.isEmpty(value) && TextUtils.isEmpty(valueFromLocalCache)) || (value != null && value.equals(valueFromLocalCache))); if (isDiff && value != null) { cv.put(key, value); } return isDiff; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStringValueAndCheckIfDiff File: src/com/android/settings/network/apn/ApnEditor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40125
HIGH
7.8
android
setStringValueAndCheckIfDiff
src/com/android/settings/network/apn/ApnEditor.java
63d464c3fa5c7b9900448fef3844790756e557eb
0
Analyze the following code function for security vulnerabilities
private VaadinSession findOrCreateVaadinSession(VaadinRequest request) throws SessionExpiredException, ServiceException { boolean requestCanCreateSession = requestCanCreateSession(request); WrappedSession wrappedSession = getWrappedSession(request, requestCanCreateSession); try { lockSession(wrappedSession); } catch (IllegalStateException e) { throw new SessionExpiredException(); } try { return doFindOrCreateVaadinSession(request, requestCanCreateSession); } finally { unlockSession(wrappedSession); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findOrCreateVaadinSession File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
findOrCreateVaadinSession
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
int[] getUsersLocked() { UserManagerService ums = getUserManagerLocked(); return ums != null ? ums.getUserIds() : new int[] { 0 }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUsersLocked 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
getUsersLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void writeI16(short i16) throws TException { buffer[0] = (byte) (0xff & (i16 >> 8)); buffer[1] = (byte) (0xff & (i16)); trans_.write(buffer, 0, 2); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeI16 File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
writeI16
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
private void handleIPv4Success(DhcpResultsParcelable dhcpResults) { if (mVerboseLoggingEnabled) { logd("handleIPv4Success <" + dhcpResults.toString() + ">"); logd("link address " + dhcpResults.baseConfiguration.getIpAddress()); } Inet4Address addr; synchronized (mDhcpResultsParcelableLock) { mDhcpResultsParcelable = dhcpResults; addr = (Inet4Address) dhcpResults.baseConfiguration.getIpAddress().getAddress(); } if (mIsAutoRoaming) { int previousAddress = mWifiInfo.getIpAddress(); int newAddress = Inet4AddressUtils.inet4AddressToIntHTL(addr); if (previousAddress != newAddress) { logd("handleIPv4Success, roaming and address changed" + mWifiInfo + " got: " + addr); } } mWifiInfo.setInetAddress(addr); final WifiConfiguration config = getConnectedWifiConfigurationInternal(); if (config != null) { updateWifiInfoWhenConnected(config); mWifiConfigManager.updateRandomizedMacExpireTime(config, dhcpResults.leaseDuration); mWifiBlocklistMonitor.handleDhcpProvisioningSuccess(mLastBssid, mWifiInfo.getSSID()); } // Set meteredHint if DHCP result says network is metered if (dhcpResults.vendorInfo != null && dhcpResults.vendorInfo.contains("ANDROID_METERED")) { mWifiInfo.setMeteredHint(true); mWifiMetrics.addMeteredStat(config, true); } else { mWifiMetrics.addMeteredStat(config, false); } updateCapabilities(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleIPv4Success 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
handleIPv4Success
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public static ProfileOutput fromDOM(Element profileOutputElement) { ProfileOutput profileOutput = new ProfileOutput(); profileOutput.setId(profileOutputElement.getAttribute("id")); NodeList nameList = profileOutputElement.getElementsByTagName("name"); if (nameList.getLength() > 0) { profileOutput.setName(nameList.item(0).getTextContent()); } NodeList textList = profileOutputElement.getElementsByTagName("text"); if (textList.getLength() > 0) { profileOutput.setText(textList.item(0).getTextContent()); } NodeList classIdList = profileOutputElement.getElementsByTagName("classId"); if (classIdList.getLength() > 0) { profileOutput.setClassId(classIdList.item(0).getTextContent()); } NodeList paList = profileOutputElement.getElementsByTagName("attributes"); int paCount = paList.getLength(); for (int i = 0; i < paCount; i++) { Element paElement = (Element) paList.item(i); ProfileAttribute pa = ProfileAttribute.fromDOM(paElement); profileOutput.addAttribute(pa); } return profileOutput; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.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/profile/ProfileOutput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public Client getHttpClient() { return httpClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHttpClient File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getHttpClient
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public boolean isMember(Group owningGroup, Group childGroup) { return owningGroup.contains(childGroup); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMember File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
isMember
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
private boolean isDiskCacheHit(final HttpQuery query, final long end_time, final int max_age, final String basepath) throws IOException { final String cachepath = basepath + (query.hasQueryStringParam("ascii") ? ".txt" : ".png"); final File cachedfile = new File(cachepath); if (cachedfile.exists()) { final long bytes = cachedfile.length(); if (bytes < 21) { // Minimum possible size for a PNG: 21 bytes. // For .txt files, <21 bytes is almost impossible. logWarn(query, "Cached " + cachepath + " is too small (" + bytes + " bytes) to be valid. Ignoring it."); return false; } if (staleCacheFile(query, end_time, max_age, cachedfile)) { return false; } if (query.hasQueryStringParam("json")) { HashMap<String, Object> map = loadCachedJson(query, end_time, max_age, basepath); if (map == null) { map = new HashMap<String, Object>(); } map.put("timing", query.processingTimeMillis()); map.put("cachehit", "disk"); query.sendReply(JSON.serializeToBytes(map)); } else if (query.hasQueryStringParam("png") || query.hasQueryStringParam("ascii")) { query.sendFile(cachepath, max_age); } else { query.sendReply(HttpQuery.makePage("TSDB Query", "Your graph is ready", "<img src=\"" + query.request().getUri() + "&amp;png\"/><br/>" + "<small>(served from disk cache)</small>")); } graphs_diskcache_hit.incrementAndGet(); return true; } // We didn't find an image. Do a negative cache check. If we've seen // this query before but there was no result, we at least wrote the JSON. final HashMap<String, Object> map = loadCachedJson(query, end_time, max_age, basepath); // If we don't have a JSON file it's a complete cache miss. If we have // one, and it says 0 data points were plotted, it's a negative cache hit. if (map == null || !map.containsKey("plotted") || ((Integer)map.get("plotted")) == 0) { return false; } if (query.hasQueryStringParam("json")) { map.put("timing", query.processingTimeMillis()); map.put("cachehit", "disk"); query.sendReply(JSON.serializeToBytes(map)); } else if (query.hasQueryStringParam("png")) { query.sendReply(" "); // Send back an empty response... } else { query.sendReply(HttpQuery.makePage("TSDB Query", "No results", "Sorry, your query didn't return anything.<br/>" + "<small>(served from disk cache)</small>")); } graphs_diskcache_hit.incrementAndGet(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDiskCacheHit File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
isDiskCacheHit
src/tsd/GraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
public void delete(EntityReference reference) throws Exception { Class<?> resource = getResourceAPI(reference); TestUtils.assertStatusCodes(executeDelete(resource, toElements(reference)), true, STATUS_NO_CONTENT_NOT_FOUND); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
delete
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public void requestUnbindListener(INotificationListener token) { long identity = Binder.clearCallingIdentity(); try { // allow bound services to disable themselves final ManagedServiceInfo info = mListeners.checkServiceTokenLocked(token); info.getOwner().setComponentState(info.component, false); } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestUnbindListener File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
requestUnbindListener
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private void setupParserListener(ParserEnvironment environment, MultiSourceReader multiSourceReader, GraphqlParser parser, GraphqlAntlrToLanguage toLanguage) { ParserOptions parserOptions = toLanguage.getParserOptions(); ParsingListener parsingListener = parserOptions.getParsingListener(); int maxTokens = parserOptions.getMaxTokens(); // prevent a billion laugh attacks by restricting how many tokens we allow ParseTreeListener listener = new GraphqlBaseListener() { int count = 0; @Override public void visitTerminal(TerminalNode node) { final Token token = node.getSymbol(); parsingListener.onToken(new ParsingListener.Token() { @Override public String getText() { return token == null ? null : token.getText(); } @Override public int getLine() { return token == null ? -1 : token.getLine(); } @Override public int getCharPositionInLine() { return token == null ? -1 : token.getCharPositionInLine(); } }); count++; if (count > maxTokens) { throwCancelParseIfTooManyTokens(environment, token, maxTokens, multiSourceReader); } } }; parser.addParseListener(listener); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2023-28867 - Severity: HIGH - CVSS Score: 7.5 Description: Preventing stack overflow exceptions via limiting the depth of the parser rules Function: setupParserListener File: src/main/java/graphql/parser/Parser.java Repository: graphql-java Fixed Code: private void setupParserListener(ParserEnvironment environment, MultiSourceReader multiSourceReader, GraphqlParser parser, GraphqlAntlrToLanguage toLanguage) { ParserOptions parserOptions = toLanguage.getParserOptions(); ParsingListener parsingListener = parserOptions.getParsingListener(); int maxTokens = parserOptions.getMaxTokens(); int maxRuleDepth = parserOptions.getMaxRuleDepth(); // prevent a billion laugh attacks by restricting how many tokens we allow ParseTreeListener listener = new GraphqlBaseListener() { int count = 0; int depth = 0; @Override public void enterEveryRule(ParserRuleContext ctx) { depth++; if (depth > maxRuleDepth) { throwIfTokenProblems( environment, ctx.getStart(), maxRuleDepth, multiSourceReader, ParseCancelledTooDeepException.class ); } } @Override public void exitEveryRule(ParserRuleContext ctx) { depth--; } @Override public void visitTerminal(TerminalNode node) { final Token token = node.getSymbol(); parsingListener.onToken(new ParsingListener.Token() { @Override public String getText() { return token == null ? null : token.getText(); } @Override public int getLine() { return token == null ? -1 : token.getLine(); } @Override public int getCharPositionInLine() { return token == null ? -1 : token.getCharPositionInLine(); } }); count++; if (count > maxTokens) { throwIfTokenProblems( environment, token, maxTokens, multiSourceReader, ParseCancelledException.class ); } } }; parser.addParseListener(listener); }
[ "CWE-770" ]
CVE-2023-28867
HIGH
7.5
graphql-java
setupParserListener
src/main/java/graphql/parser/Parser.java
8a1c884c81c0b656db201cfd95881feb0f430a55
1
Analyze the following code function for security vulnerabilities
private GMSSRootCalc generateCurrentAuthpathAndRoot(byte[] lowerRoot, Vector currentStack, byte[] seed, int h) { byte[] help = new byte[mdLength]; byte[] OTSseed = new byte[mdLength]; OTSseed = gmssRandom.nextSeed(seed); WinternitzOTSignature ots; // data structure that constructs the whole tree and stores // the initial values for treehash, Auth and retain GMSSRootCalc treeToConstruct = new GMSSRootCalc(this.heightOfTrees[h], this.K[h], digestProvider); treeToConstruct.initialize(currentStack); // generate the first leaf if (h == numLayer - 1) { ots = new WinternitzOTSignature(OTSseed, digestProvider.get(), otsIndex[h]); help = ots.getPublicKey(); } else { // for all layers except the lowest, generate the signature of the // underlying root // and reuse this signature to compute the first leaf of acual layer // more efficiently (by verifiing the signature) ots = new WinternitzOTSignature(OTSseed, digestProvider.get(), otsIndex[h]); currentRootSigs[h] = ots.getSignature(lowerRoot); WinternitzOTSVerify otsver = new WinternitzOTSVerify(digestProvider.get(), otsIndex[h]); help = otsver.Verify(lowerRoot, currentRootSigs[h]); } // update the tree with the first leaf treeToConstruct.update(help); int seedForTreehashIndex = 3; int count = 0; // update the tree 2^(H) - 1 times, from the second to the last leaf for (int i = 1; i < (1 << this.heightOfTrees[h]); i++) { // initialize the seeds for the leaf generation with index 3 * 2^h if (i == seedForTreehashIndex && count < this.heightOfTrees[h] - this.K[h]) { treeToConstruct.initializeTreehashSeed(seed, count); seedForTreehashIndex *= 2; count++; } OTSseed = gmssRandom.nextSeed(seed); ots = new WinternitzOTSignature(OTSseed, digestProvider.get(), otsIndex[h]); treeToConstruct.update(ots.getPublicKey()); } if (treeToConstruct.wasFinished()) { return treeToConstruct; } System.err.println("Baum noch nicht fertig konstruiert!!!"); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateCurrentAuthpathAndRoot File: core/src/main/java/org/bouncycastle/pqc/crypto/gmss/GMSSKeyPairGenerator.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
generateCurrentAuthpathAndRoot
core/src/main/java/org/bouncycastle/pqc/crypto/gmss/GMSSKeyPairGenerator.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
private static String normalizeOsReleaseVariableValue(String value) { // Variable assignment values may be enclosed in double or single quotes. return value.trim().replaceAll("[\"']", ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: normalizeOsReleaseVariableValue 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
normalizeOsReleaseVariableValue
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private boolean validateForCommonR1andR2() { // Required: PerProviderSubscription/<X+>/HomeSP if (mHomeSp == null || !mHomeSp.validate()) { return false; } // Required: PerProviderSubscription/<X+>/Credential if (mCredential == null || !mCredential.validate()) { return false; } // Optional: PerProviderSubscription/<X+>/Policy if (mPolicy != null && !mPolicy.validate()) { return false; } // Optional: DecoratedIdentityPrefix if (!TextUtils.isEmpty(mDecoratedIdentityPrefix)) { if (!mDecoratedIdentityPrefix.endsWith("!")) { EventLog.writeEvent(0x534e4554, "246539931", -1, "Invalid decorated identity prefix"); return false; } String[] decoratedIdentityPrefixArray = mDecoratedIdentityPrefix.split("!"); if (decoratedIdentityPrefixArray.length > MAX_NUMBER_OF_ENTRIES) { Log.d(TAG, "too many decoratedIdentityPrefix"); return false; } for (String prefix : decoratedIdentityPrefixArray) { if (prefix.length() > MAX_STRING_LENGTH) { Log.d(TAG, "The decoratedIdentityPrefix is too long: " + prefix); return false; } } } if (mAaaServerTrustedNames != null) { if (mAaaServerTrustedNames.length > MAX_NUMBER_OF_ENTRIES) { Log.d(TAG, "Too many AaaServerTrustedNames"); return false; } for (String fqdn : mAaaServerTrustedNames) { if (fqdn.getBytes(StandardCharsets.UTF_8).length > MAX_STRING_LENGTH) { Log.d(TAG, "AaaServerTrustedNames is too long"); return false; } } } if (mSubscriptionType != null) { if (mSubscriptionType.getBytes(StandardCharsets.UTF_8).length > MAX_STRING_LENGTH) { Log.d(TAG, "SubscriptionType is too long"); return false; } } if (mTrustRootCertList != null) { if (mTrustRootCertList.size() > MAX_NUMBER_OF_ENTRIES) { Log.d(TAG, "Too many TrustRootCert"); return false; } for (Map.Entry<String, byte[]> entry : mTrustRootCertList.entrySet()) { String url = entry.getKey(); byte[] certFingerprint = entry.getValue(); if (TextUtils.isEmpty(url)) { Log.d(TAG, "Empty URL"); return false; } if (url.getBytes(StandardCharsets.UTF_8).length > MAX_URL_BYTES) { Log.d(TAG, "URL bytes exceeded the max: " + url.getBytes(StandardCharsets.UTF_8).length); return false; } if (certFingerprint == null) { Log.d(TAG, "Fingerprint not specified"); return false; } if (certFingerprint.length != CERTIFICATE_SHA256_BYTES) { Log.d(TAG, "Incorrect size of trust root certificate SHA-256 fingerprint: " + certFingerprint.length); return false; } } } return true; }
Vulnerability Classification: - CWE: CWE-120 - CVE: CVE-2023-21243 - Severity: MEDIUM - CVSS Score: 5.5 Description: Limit the ServiceFriendlyNames and limit the number of Passpoint per App Reject the suggestion passpoint with ServiceFriendlyNames Bug: 274445194 Test: atest com.android.server.wifi (cherry picked from commit ac5284c457b3113f5a50e8ee79a7290ceca29143) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f83296b5fbede5fdf9ea185cc50215f2a16cdf48) Merged-In: I8c1b858c8990c60cea48a59fc390f57a40ed86ba Change-Id: I8c1b858c8990c60cea48a59fc390f57a40ed86ba Function: validateForCommonR1andR2 File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android Fixed Code: private boolean validateForCommonR1andR2() { // Required: PerProviderSubscription/<X+>/HomeSP if (mHomeSp == null || !mHomeSp.validate()) { return false; } // Required: PerProviderSubscription/<X+>/Credential if (mCredential == null || !mCredential.validate()) { return false; } // Optional: PerProviderSubscription/<X+>/Policy if (mPolicy != null && !mPolicy.validate()) { return false; } // Optional: DecoratedIdentityPrefix if (!TextUtils.isEmpty(mDecoratedIdentityPrefix)) { if (!mDecoratedIdentityPrefix.endsWith("!")) { EventLog.writeEvent(0x534e4554, "246539931", -1, "Invalid decorated identity prefix"); return false; } String[] decoratedIdentityPrefixArray = mDecoratedIdentityPrefix.split("!"); if (decoratedIdentityPrefixArray.length > MAX_NUMBER_OF_ENTRIES) { Log.e(TAG, "too many decoratedIdentityPrefix"); return false; } for (String prefix : decoratedIdentityPrefixArray) { if (prefix.length() > MAX_STRING_LENGTH) { Log.e(TAG, "The decoratedIdentityPrefix is too long: " + prefix); return false; } } } if (mAaaServerTrustedNames != null) { if (mAaaServerTrustedNames.length > MAX_NUMBER_OF_ENTRIES) { Log.e(TAG, "Too many AaaServerTrustedNames"); return false; } for (String fqdn : mAaaServerTrustedNames) { if (fqdn.getBytes(StandardCharsets.UTF_8).length > MAX_STRING_LENGTH) { Log.e(TAG, "AaaServerTrustedNames is too long"); return false; } } } if (mSubscriptionType != null) { if (mSubscriptionType.getBytes(StandardCharsets.UTF_8).length > MAX_STRING_LENGTH) { Log.e(TAG, "SubscriptionType is too long"); return false; } } if (mTrustRootCertList != null) { if (mTrustRootCertList.size() > MAX_NUMBER_OF_ENTRIES) { Log.e(TAG, "Too many TrustRootCert"); return false; } for (Map.Entry<String, byte[]> entry : mTrustRootCertList.entrySet()) { String url = entry.getKey(); byte[] certFingerprint = entry.getValue(); if (TextUtils.isEmpty(url)) { Log.e(TAG, "Empty URL"); return false; } if (url.getBytes(StandardCharsets.UTF_8).length > MAX_URL_BYTES) { Log.e(TAG, "URL bytes exceeded the max: " + url.getBytes(StandardCharsets.UTF_8).length); return false; } if (certFingerprint == null) { Log.e(TAG, "Fingerprint not specified"); return false; } if (certFingerprint.length != CERTIFICATE_SHA256_BYTES) { Log.e(TAG, "Incorrect size of trust root certificate SHA-256 fingerprint: " + certFingerprint.length); return false; } } } if (mServiceFriendlyNames != null) { if (mServiceFriendlyNames.size() > MAX_NUMBER_OF_ENTRIES) { Log.e(TAG, "ServiceFriendlyNames exceed the max!"); return false; } for (Map.Entry<String, String> names : mServiceFriendlyNames.entrySet()) { if (names.getKey() == null || names.getValue() == null) { Log.e(TAG, "Service friendly name entry should not be null"); return false; } if (names.getKey().length() > MAX_STRING_LENGTH || names.getValue().length() > MAX_STRING_LENGTH) { Log.e(TAG, "Service friendly name is to long"); return false; } } } return true; }
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
validateForCommonR1andR2
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
1
Analyze the following code function for security vulnerabilities
@Override public void start() throws Exception { try { synchronized (this) { starting = true; if (taskRunnerFactory != null) { taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: " + getRemoteAddress()); } else { taskRunner = null; } transport.start(); active = true; BrokerInfo info = connector.getBrokerInfo().copy(); if (connector.isUpdateClusterClients()) { info.setPeerBrokerInfos(this.broker.getPeerBrokerInfos()); } else { info.setPeerBrokerInfos(null); } dispatchAsync(info); connector.onStarted(this); } } catch (Exception e) { // Force clean up on an error starting up. pendingStop = true; throw e; } finally { // stop() can be called from within the above block, // but we want to be sure start() completes before // stop() runs, so queue the stop until right now: setStarting(false); if (isPendingStop()) { LOG.debug("Calling the delayed stop() after start() {}", this); stop(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start 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
start
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
private boolean isGlobalOrSecureSettingRestrictedForUser(String setting, int userId, String value, int callingUid) { String restriction; switch (setting) { case Settings.Secure.LOCATION_MODE: // Note LOCATION_MODE will be converted into LOCATION_PROVIDERS_ALLOWED // in android.provider.Settings.Secure.putStringForUser(), so we shouldn't come // here normally, but we still protect it here from a direct provider write. if (String.valueOf(Settings.Secure.LOCATION_MODE_OFF).equals(value)) return false; restriction = UserManager.DISALLOW_SHARE_LOCATION; break; case Settings.Secure.LOCATION_PROVIDERS_ALLOWED: // See SettingsProvider.updateLocationProvidersAllowedLocked. "-" is to disable // a provider, which should be allowed even if the user restriction is set. if (value != null && value.startsWith("-")) return false; restriction = UserManager.DISALLOW_SHARE_LOCATION; break; case Settings.Secure.INSTALL_NON_MARKET_APPS: if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES; break; case Settings.Global.ADB_ENABLED: if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_DEBUGGING_FEATURES; break; case Settings.Global.PACKAGE_VERIFIER_ENABLE: case Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB: if ("1".equals(value)) return false; restriction = UserManager.ENSURE_VERIFY_APPS; break; case Settings.Global.PREFERRED_NETWORK_MODE: restriction = UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS; break; case Settings.Secure.ALWAYS_ON_VPN_APP: case Settings.Secure.ALWAYS_ON_VPN_LOCKDOWN: // Whitelist system uid (ConnectivityService) and root uid to change always-on vpn if (callingUid == Process.SYSTEM_UID || callingUid == Process.ROOT_UID) { return false; } restriction = UserManager.DISALLOW_CONFIG_VPN; break; default: if (setting != null && setting.startsWith(Settings.Global.DATA_ROAMING)) { if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_DATA_ROAMING; break; } return false; } return mUserManager.hasUserRestriction(restriction, UserHandle.of(userId)); }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3876 - Severity: HIGH - CVSS Score: 7.2 Description: Block user from setting safe boot setting via adb Bug: 29900345 Change-Id: Id3b4472b59ded2c7c29762ddf008ee8486009dbb Function: isGlobalOrSecureSettingRestrictedForUser File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android Fixed Code: private boolean isGlobalOrSecureSettingRestrictedForUser(String setting, int userId, String value, int callingUid) { String restriction; switch (setting) { case Settings.Secure.LOCATION_MODE: // Note LOCATION_MODE will be converted into LOCATION_PROVIDERS_ALLOWED // in android.provider.Settings.Secure.putStringForUser(), so we shouldn't come // here normally, but we still protect it here from a direct provider write. if (String.valueOf(Settings.Secure.LOCATION_MODE_OFF).equals(value)) return false; restriction = UserManager.DISALLOW_SHARE_LOCATION; break; case Settings.Secure.LOCATION_PROVIDERS_ALLOWED: // See SettingsProvider.updateLocationProvidersAllowedLocked. "-" is to disable // a provider, which should be allowed even if the user restriction is set. if (value != null && value.startsWith("-")) return false; restriction = UserManager.DISALLOW_SHARE_LOCATION; break; case Settings.Secure.INSTALL_NON_MARKET_APPS: if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES; break; case Settings.Global.ADB_ENABLED: if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_DEBUGGING_FEATURES; break; case Settings.Global.PACKAGE_VERIFIER_ENABLE: case Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB: if ("1".equals(value)) return false; restriction = UserManager.ENSURE_VERIFY_APPS; break; case Settings.Global.PREFERRED_NETWORK_MODE: restriction = UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS; break; case Settings.Secure.ALWAYS_ON_VPN_APP: case Settings.Secure.ALWAYS_ON_VPN_LOCKDOWN: // Whitelist system uid (ConnectivityService) and root uid to change always-on vpn if (callingUid == Process.SYSTEM_UID || callingUid == Process.ROOT_UID) { return false; } restriction = UserManager.DISALLOW_CONFIG_VPN; break; case Settings.Global.SAFE_BOOT_DISALLOWED: if ("1".equals(value)) return false; restriction = UserManager.DISALLOW_SAFE_BOOT; break; default: if (setting != null && setting.startsWith(Settings.Global.DATA_ROAMING)) { if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_DATA_ROAMING; break; } return false; } return mUserManager.hasUserRestriction(restriction, UserHandle.of(userId)); }
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
isGlobalOrSecureSettingRestrictedForUser
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
1
Analyze the following code function for security vulnerabilities
protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { continue; } auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateParamsForAuth File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/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
updateParamsForAuth
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void enableVerboseLogging(boolean verbose) { if (verbose) { mVerboseLoggingEnabled = true; setLogRecSize(mActivityManager.isLowRamDevice() ? NUM_LOG_RECS_VERBOSE_LOW_MEMORY : NUM_LOG_RECS_VERBOSE); } else { mVerboseLoggingEnabled = false; setLogRecSize(mWifiGlobals.getClientModeImplNumLogRecs()); } mWifiScoreReport.enableVerboseLogging(mVerboseLoggingEnabled); mSupplicantStateTracker.enableVerboseLogging(mVerboseLoggingEnabled); mQosPolicyRequestHandler.enableVerboseLogging(mVerboseLoggingEnabled); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enableVerboseLogging 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
enableVerboseLogging
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void handleApplicationStrictModeViolation(IBinder app, int violationMask, StrictMode.ViolationInfo info) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(app); data.writeInt(violationMask); info.writeToParcel(data, 0); mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); reply.readException(); reply.recycle(); data.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleApplicationStrictModeViolation File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
handleApplicationStrictModeViolation
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public void setDelegate(UrlBarDelegate delegate) { mUrlBarDelegate = delegate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDelegate File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
setDelegate
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
public void setProfile(Profile profile) { mProfile = profile; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProfile File: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2015-1261
MEDIUM
5
chromium
setProfile
chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
5bf8a2dccf4777c5f065d918d1d9a2bbaa013f9f
0
Analyze the following code function for security vulnerabilities
public static String joinPath(String... components) { StringBuilder buf = new StringBuilder(); for (String s : components) { if (s.length()==0) continue; if (buf.length()>0) { if (buf.charAt(buf.length()-1)!='/') buf.append('/'); if (s.charAt(0)=='/') s=s.substring(1); } buf.append(s); } return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: joinPath File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
joinPath
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public AsyncHttpClientConfigBean setSslContext(SSLContext sslContext) { this.sslContext = sslContext; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSslContext File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setSslContext
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
private String getDbProperties() { return PathKit.getWebRootPath() + "/WEB-INF/db.properties"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDbProperties File: web/src/main/java/com/zrlog/web/config/ZrLogConfig.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
getDbProperties
web/src/main/java/com/zrlog/web/config/ZrLogConfig.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@WorkbenchMenu public Menus getMenus() { return menus; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMenus File: jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/taskdetailsmulti/TaskDetailsMultiPresenter.java Repository: kiegroup/jbpm-wb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-6465
LOW
3.5
kiegroup/jbpm-wb
getMenus
jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/taskdetailsmulti/TaskDetailsMultiPresenter.java
4818204506e8e94645b52adb9426bedfa9ffdd04
0
Analyze the following code function for security vulnerabilities
private static long dumpJavaTracesTombstoned(int pid, String fileName, long timeoutMs) { final long timeStart = SystemClock.elapsedRealtime(); boolean javaSuccess = Debug.dumpJavaBacktraceToFileTimeout(pid, fileName, (int) (timeoutMs / 1000)); if (javaSuccess) { // Check that something is in the file, actually. Try-catch should not be necessary, // but better safe than sorry. try { long size = new File(fileName).length(); if (size < JAVA_DUMP_MINIMUM_SIZE) { Slog.w(TAG, "Successfully created Java ANR file is empty!"); javaSuccess = false; } } catch (Exception e) { Slog.w(TAG, "Unable to get ANR file size", e); javaSuccess = false; } } if (!javaSuccess) { Slog.w(TAG, "Dumping Java threads failed, initiating native stack dump."); if (!Debug.dumpNativeBacktraceToFileTimeout(pid, fileName, (NATIVE_DUMP_TIMEOUT_MS / 1000))) { Slog.w(TAG, "Native stack dump failed!"); } } return SystemClock.elapsedRealtime() - timeStart; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpJavaTracesTombstoned 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
dumpJavaTracesTombstoned
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void setLastHeartbeatTimestamp(long lastHeartbeat) { lastHeartbeatTimestamp = lastHeartbeat; HeartbeatEvent heartbeatEvent = new HeartbeatEvent(ui, lastHeartbeat); getListeners(HeartbeatListener.class) .forEach(listener -> listener.heartbeat(heartbeatEvent)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLastHeartbeatTimestamp File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
setLastHeartbeatTimestamp
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
T apply(E t);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: apply File: src/main/java/com/github/pagehelper/Page.java Repository: pagehelper/Mybatis-PageHelper The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-28111
HIGH
7.5
pagehelper/Mybatis-PageHelper
apply
src/main/java/com/github/pagehelper/Page.java
554a524af2d2b30d09505516adc412468a84d8fa
0
Analyze the following code function for security vulnerabilities
void pendingAssistExtrasTimedOut(PendingAssistExtras pae) { IResultReceiver receiver; synchronized (this) { mPendingAssistExtras.remove(pae); receiver = pae.receiver; } if (receiver != null) { // Caller wants result sent back to them. Bundle sendBundle = new Bundle(); // At least return the receiver extras sendBundle.putBundle(VoiceInteractionSession.KEY_RECEIVER_EXTRAS, pae.receiverExtras); try { pae.receiver.send(0, sendBundle); } catch (RemoteException e) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pendingAssistExtrasTimedOut File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
pendingAssistExtrasTimedOut
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
boolean readPaxExtendedHeader(InputStream instream, FileMetadata info) throws IOException { // We should never see a pax extended header larger than this if (info.size > 32*1024) { Slog.w(TAG, "Suspiciously large pax header size " + info.size + " - aborting"); throw new IOException("Sanity failure: pax header size " + info.size); } // read whole blocks, not just the content size int numBlocks = (int)((info.size + 511) >> 9); byte[] data = new byte[numBlocks * 512]; if (readExactly(instream, data, 0, data.length) < data.length) { throw new IOException("Unable to read full pax header"); } mBytes += data.length; final int contentSize = (int) info.size; int offset = 0; do { // extract the line at 'offset' int eol = offset+1; while (eol < contentSize && data[eol] != ' ') eol++; if (eol >= contentSize) { // error: we just hit EOD looking for the end of the size field throw new IOException("Invalid pax data"); } // eol points to the space between the count and the key int linelen = (int) extractRadix(data, offset, eol - offset, 10); int key = eol + 1; // start of key=value eol = offset + linelen - 1; // trailing LF int value; for (value = key+1; data[value] != '=' && value <= eol; value++); if (value > eol) { throw new IOException("Invalid pax declaration"); } // pax requires that key/value strings be in UTF-8 String keyStr = new String(data, key, value-key, "UTF-8"); // -1 to strip the trailing LF String valStr = new String(data, value+1, eol-value-1, "UTF-8"); if ("path".equals(keyStr)) { info.path = valStr; } else if ("size".equals(keyStr)) { info.size = Long.parseLong(valStr); } else { if (DEBUG) Slog.i(TAG, "Unhandled pax key: " + key); } offset += linelen; } while (offset < contentSize); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readPaxExtendedHeader 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
readPaxExtendedHeader
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private void clearChangeListeners() { mSubject.removeTextChangedListener(this); mBodyView.removeTextChangedListener(this); mTo.removeTextChangedListener(mToListener); mCc.removeTextChangedListener(mCcListener); mBcc.removeTextChangedListener(mBccListener); mFromSpinner.setOnAccountChangedListener(null); mAttachmentsView.setAttachmentChangesListener(null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearChangeListeners File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
clearChangeListeners
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@Override public ExitCode runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException { if (saveFilename != null && loadFilename != null) { params.getConsole().printErrorText("Can't use both --load and --save"); return ExitCode.COMMANDLINE_ERROR; } if (saveFilename != null) { invalidateChanges(params); RemoteDaemonicParserState state = params.getParser().storeParserState(params.getCell()); try (FileOutputStream fos = new FileOutputStream(saveFilename); ZipOutputStream zipos = new ZipOutputStream(fos)) { zipos.putNextEntry(new ZipEntry("parser_data")); try (ObjectOutputStream oos = new ObjectOutputStream(zipos)) { oos.writeObject(state); } } } else if (loadFilename != null) { try (FileInputStream fis = new FileInputStream(loadFilename); ZipInputStream zipis = new ZipInputStream(fis)) { ZipEntry entry = zipis.getNextEntry(); Preconditions.checkState(entry.getName().equals("parser_data")); try (ObjectInputStream ois = new ObjectInputStream(zipis)) { RemoteDaemonicParserState state; try { state = (RemoteDaemonicParserState) ois.readObject(); } catch (ClassNotFoundException e) { params.getConsole().printErrorText("Invalid file format"); return ExitCode.COMMANDLINE_ERROR; } params.getParser().restoreParserState(state, params.getCell()); } } invalidateChanges(params); ParserConfig configView = params.getBuckConfig().getView(ParserConfig.class); if (configView.isParserCacheMutationWarningEnabled()) { params .getConsole() .printErrorText( params .getConsole() .getAnsi() .asWarningText( "WARNING: Buck injected a parser state that may not match the local state.")); } } return ExitCode.SUCCESS; }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2018-6331 - Severity: HIGH - CVSS Score: 7.5 Description: Prevent deserialization of random objects Summary: Fixed security issue with buck parser-cache command. This diff prevent deserialization of random objects. Reviewed By: jtorkkola fbshipit-source-id: 24e8221 Function: runWithoutHelp File: src/com/facebook/buck/cli/ParserCacheCommand.java Repository: facebook/buck Fixed Code: @Override public ExitCode runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException { if (saveFilename != null && loadFilename != null) { params.getConsole().printErrorText("Can't use both --load and --save"); return ExitCode.COMMANDLINE_ERROR; } if (saveFilename != null) { invalidateChanges(params); RemoteDaemonicParserState state = params.getParser().storeParserState(params.getCell()); try (FileOutputStream fos = new FileOutputStream(saveFilename); ZipOutputStream zipos = new ZipOutputStream(fos)) { zipos.putNextEntry(new ZipEntry("parser_data")); try (ObjectOutputStream oos = new ObjectOutputStream(zipos)) { oos.writeObject(state); } } } else if (loadFilename != null) { try (FileInputStream fis = new FileInputStream(loadFilename); ZipInputStream zipis = new ZipInputStream(fis)) { ZipEntry entry = zipis.getNextEntry(); Preconditions.checkState(entry.getName().equals("parser_data")); try (ObjectInputStream ois = new ParserStateObjectInputStream(zipis)) { RemoteDaemonicParserState state; try { state = (RemoteDaemonicParserState) ois.readObject(); } catch (ClassNotFoundException e) { params.getConsole().printErrorText("Invalid file format"); return ExitCode.COMMANDLINE_ERROR; } params.getParser().restoreParserState(state, params.getCell()); } } invalidateChanges(params); ParserConfig configView = params.getBuckConfig().getView(ParserConfig.class); if (configView.isParserCacheMutationWarningEnabled()) { params .getConsole() .printErrorText( params .getConsole() .getAnsi() .asWarningText( "WARNING: Buck injected a parser state that may not match the local state.")); } } return ExitCode.SUCCESS; }
[ "CWE-502" ]
CVE-2018-6331
HIGH
7.5
facebook/buck
runWithoutHelp
src/com/facebook/buck/cli/ParserCacheCommand.java
8c5500981812564877bd122c0f8fab48d3528ddf
1
Analyze the following code function for security vulnerabilities
protected void onDropRows(JsonArray keys) { for (int i = 0; i < keys.length(); ++i) { handler.dropActiveData(keys.getString(i)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDropRows File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-20" ]
CVE-2021-33609
MEDIUM
4
vaadin/framework
onDropRows
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
0