instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private void forUpdatedPackages(@UserIdInt int userId, long lastScanTime, boolean afterOta, Consumer<ApplicationInfo> callback) { if (DEBUG || DEBUG_REBOOT) { Slog.d(TAG, "forUpdatedPackages for user " + userId + ", lastScanTime=" + lastScanTime + " afterOta=" + afterOta); } final List<PackageInfo> list = getInstalledPackages(userId); for (int i = list.size() - 1; i >= 0; i--) { final PackageInfo pi = list.get(i); // If the package has been updated since the last scan time, then scan it. // Also if it's right after an OTA, always re-scan all apps anyway, since the // shortcut parser might have changed. if (afterOta || (pi.lastUpdateTime >= lastScanTime)) { if (DEBUG || DEBUG_REBOOT) { Slog.d(TAG, "Found updated package " + pi.packageName + " updateTime=" + pi.lastUpdateTime); } callback.accept(pi.applicationInfo); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forUpdatedPackages File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
forUpdatedPackages
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public void registerCallback(String packageName, ISessionControllerCallback cb) { synchronized (mLock) { // If this session is already destroyed tell the caller and // don't add them. if (mDestroyed) { try { cb.onSessionDestroyed(); } catch (Exception e) { // ignored } return; } if (getControllerHolderIndexForCb(cb) < 0) { ISessionControllerCallbackHolder holder = new ISessionControllerCallbackHolder( cb, packageName, Binder.getCallingUid(), () -> unregisterCallback(cb)); mControllerCallbackHolders.add(holder); if (DEBUG) { Log.d(TAG, "registering controller callback " + cb + " from controller" + packageName); } // Avoid callback leaks try { // cb is not referenced outside of the MediaSessionRecord, so the death // handler won't prevent MediaSessionRecord to be garbage collected. cb.asBinder().linkToDeath(holder.mDeathMonitor, 0); } catch (RemoteException e) { unregisterCallback(cb); Log.w(TAG, "registerCallback failed to linkToDeath", e); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerCallback 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
registerCallback
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
public String getTarget() { FolderTreeModel ftm = (FolderTreeModel) selTree.getTreeModel(); return ftm.getSelectedPath(selTree.getSelectedNode()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTarget File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
getTarget
src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
final StandardTemplateParams hideSnoozeButton(boolean hideSnoozeButton) { this.mHideSnoozeButton = hideSnoozeButton; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hideSnoozeButton File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
hideSnoozeButton
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public boolean providesOptionDao() { return provideOptionDao; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: providesOptionDao File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
providesOptionDao
src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
public void userActivity() { if (mSecurityCallback != null) { mSecurityCallback.userActivity(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: userActivity File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21245
HIGH
7.8
android
userActivity
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
a33159e8cb297b9eee6fa5c63c0e343d05fad622
0
Analyze the following code function for security vulnerabilities
public static boolean checkSignatureValid(String xmlString, String idAttribute, String issuer) { String certAlias = null; boolean valid = true; Map entries = (Map) SAMLServiceManager.getAttribute( SAMLConstants.PARTNER_URLS); if (entries != null) { SAMLServiceManager.SOAPEntry srcSite = (SAMLServiceManager.SOAPEntry) entries.get(issuer); if (srcSite != null) { certAlias = srcSite.getCertAlias(); } } try { SAMLUtils.debug.message("SAMLUtils.checkSignatureValid for certAlias {}", certAlias); XMLSignatureManager manager = XMLSignatureManager.getInstance(); valid = manager.verifyXMLSignature(xmlString, idAttribute, certAlias); } catch (Exception e) { SAMLUtils.debug.warning("SAMLUtils.checkSignatureValid:"+ " signature validation exception", e); valid = false; } if (!valid) { if (SAMLUtils.debug.messageEnabled()) { SAMLUtils.debug.message("SAMLUtils.checkSignatureValid:"+ " Couldn't verify signature."); } } return valid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkSignatureValid File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java Repository: OpenIdentityPlatform/OpenAM The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-37471
CRITICAL
9.8
OpenIdentityPlatform/OpenAM
checkSignatureValid
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
7c18543d126e8a567b83bb4535631825aaa9d742
0
Analyze the following code function for security vulnerabilities
@Nullable public static Element findChildElement( Element parent) { for (org.w3c.dom.Node node = parent.getFirstChild(); node != null; node = node.getNextSibling()) { if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) { return (Element) node; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findChildElement File: bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java Repository: dbeaver The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3836
MEDIUM
4.3
dbeaver
findChildElement
bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
4debf8f25184b7283681ed3fb5e9e887d9d4fe22
0
Analyze the following code function for security vulnerabilities
@Override public int getStrongAuthForUser(int userId) { checkPasswordReadPermission(userId); return mStrongAuthTracker.getStrongAuthForUser(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStrongAuthForUser File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
getStrongAuthForUser
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
private boolean hasCallingOrSelfPermission(String permission) { return mContext.checkCallingOrSelfPermission(permission) == PackageManager.PERMISSION_GRANTED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasCallingOrSelfPermission 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
hasCallingOrSelfPermission
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition options() { return appendDefinition(OPTIONS, "*", handler(OptionsHandler.class)).name("*.options"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: options 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
options
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public List<UserHandle> getSecondaryUsers(@NonNull ComponentName admin) { throwIfParentInstance("getSecondaryUsers"); try { return mService.getSecondaryUsers(admin); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecondaryUsers File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getSecondaryUsers
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
int getLaunchedFromPid() { return launchedFromPid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLaunchedFromPid File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
getLaunchedFromPid
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private List<PackageInfo> getInstalledPackages(IPackageManager pm, int flags, int userId) throws RemoteException { ParceledListSlice<PackageInfo> slice = pm.getInstalledPackages(flags, userId); return slice.getList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstalledPackages File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
getInstalledPackages
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
public static void addChangeListener(final ChangeListener listener) { removeChangeListener(listener); // Ensure singleton. LISTENERS.add(ChangeListener.class, listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addChangeListener File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java Repository: geotools The code follows secure coding practices.
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
addChangeListener
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
@Override public void handoverComplete(String callId, Session.Info sessionInfo) {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handoverComplete File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
handoverComplete
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public void onDisplayRemoved(int displayId) { mH.sendMessage(mH.obtainMessage(H.DO_DISPLAY_REMOVED, displayId, 0)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDisplayRemoved File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
onDisplayRemoved
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public final void setMaxCreateAndGetWaitTimeInSeconds(final long maxCreateAndGetWaitTimeInSeconds) { this.maxCreateAndGetWaitTimeInSeconds = maxCreateAndGetWaitTimeInSeconds; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxCreateAndGetWaitTimeInSeconds File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java Repository: mapfish/mapfish-print The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-15231
MEDIUM
4.3
mapfish/mapfish-print
setMaxCreateAndGetWaitTimeInSeconds
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
89155f2506b9cee822e15ce60ccae390a1419d5e
0
Analyze the following code function for security vulnerabilities
public abstract int get(String name, int defaultValue) throws IOException, IllegalArgumentException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
get
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public final void reset() throws IOException { ensureOpen(); nativeAssetSeek(mAssetNativePtr, mMarkPos, -1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reset 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
reset
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
void setResumedActivityUncheckLocked(ActivityRecord r, String reason) { final Task task = r.getTask(); if (task.isActivityTypeStandard()) { if (mCurAppTimeTracker != r.appTimeTracker) { // We are switching app tracking. Complete the current one. if (mCurAppTimeTracker != null) { mCurAppTimeTracker.stop(); mH.obtainMessage( REPORT_TIME_TRACKER_MSG, mCurAppTimeTracker).sendToTarget(); mRootWindowContainer.clearOtherAppTimeTrackers(r.appTimeTracker); mCurAppTimeTracker = null; } if (r.appTimeTracker != null) { mCurAppTimeTracker = r.appTimeTracker; startTimeTrackingFocusedActivityLocked(); } } else { startTimeTrackingFocusedActivityLocked(); } } else { r.appTimeTracker = null; } // TODO: VI Maybe r.task.voiceInteractor || r.voiceInteractor != null // TODO: Probably not, because we don't want to resume voice on switching // back to this activity if (task.voiceInteractor != null) { startRunningVoiceLocked(task.voiceSession, r.info.applicationInfo.uid); } else { finishRunningVoiceLocked(); if (mLastResumedActivity != null) { final IVoiceInteractionSession session; final Task lastResumedActivityTask = mLastResumedActivity.getTask(); if (lastResumedActivityTask != null && lastResumedActivityTask.voiceSession != null) { session = lastResumedActivityTask.voiceSession; } else { session = mLastResumedActivity.voiceSession; } if (session != null) { // We had been in a voice interaction session, but now focused has // move to something different. Just finish the session, we can't // return to it and retain the proper state and synchronization with // the voice interaction service. finishVoiceTask(session); } } } if (mLastResumedActivity != null && r.mUserId != mLastResumedActivity.mUserId) { mAmInternal.sendForegroundProfileChanged(r.mUserId); } final Task prevTask = mLastResumedActivity != null ? mLastResumedActivity.getTask() : null; updateResumedAppTrace(r); mLastResumedActivity = r; final boolean changed = r.mDisplayContent.setFocusedApp(r); if (changed) { mWindowManager.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/); } if (prevTask == null || task != prevTask) { if (prevTask != null) { mTaskChangeNotificationController.notifyTaskFocusChanged(prevTask.mTaskId, false); } mTaskChangeNotificationController.notifyTaskFocusChanged(task.mTaskId, true); } applyUpdateLockStateLocked(r); applyUpdateVrModeLocked(r); EventLogTags.writeWmSetResumedActivity( r == null ? -1 : r.mUserId, r == null ? "NULL" : r.shortComponentName, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResumedActivityUncheckLocked File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
setResumedActivityUncheckLocked
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public ContainerResource<String, LogWatch, InputStream, PipedOutputStream, OutputStream, PipedInputStream, String, ExecWatch, Boolean, InputStream, Boolean> inContainer(String containerId) { return new PodOperationsImpl(getContext().withContainerId(containerId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inContainer File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
inContainer
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
public static String pluginImage(String pluginId, String hash) { return BASE + PLUGIN_ID_HASH_PATH.replaceAll(":plugin_id", pluginId).replaceAll(":hash", hash); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pluginImage File: spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
pluginImage
spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
public void handleTrustStorageUpdate() { if (acceptedIssuers == null) { trustedCertificateIndex.reset(); } else { trustedCertificateIndex.reset(trustAnchors(acceptedIssuers)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleTrustStorageUpdate File: src/platform/java/org/conscrypt/TrustManagerImpl.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-345" ]
CVE-2016-0818
MEDIUM
4.3
android
handleTrustStorageUpdate
src/platform/java/org/conscrypt/TrustManagerImpl.java
c4ab1b959280413fb11bf4fd7f6b4c2ba38bd779
0
Analyze the following code function for security vulnerabilities
@Override public PhoneAccountHandle getUserSelectedOutgoingPhoneAccount() { synchronized (mLock) { try { PhoneAccountHandle userSelectedOutgoingPhoneAccount = mPhoneAccountRegistrar.getUserSelectedOutgoingPhoneAccount(); // Make sure that the calling user can see this phone account. if (!isVisibleToCaller(userSelectedOutgoingPhoneAccount)) { Log.w(this, "No account found for the calling user"); return null; } return userSelectedOutgoingPhoneAccount; } catch (Exception e) { Log.e(this, e, "getUserSelectedOutgoingPhoneAccount"); throw e; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserSelectedOutgoingPhoneAccount File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
getUserSelectedOutgoingPhoneAccount
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
private void sendPrivateKeyAliasResponse(final String alias, final IBinder responseBinder) { final IKeyChainAliasCallback keyChainAliasResponse = IKeyChainAliasCallback.Stub.asInterface(responseBinder); // Send the response. It's OK to do this from the main thread because IKeyChainAliasCallback // is oneway, which means it won't block if the recipient lives in another process. try { keyChainAliasResponse.alias(alias); } catch (Exception e) { // Caller could throw RuntimeException or RemoteException back across processes. Catch // everything just to be sure. Slogf.e(LOG_TAG, "error while responding to callback", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendPrivateKeyAliasResponse 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
sendPrivateKeyAliasResponse
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void onAuthenticationSucceeded(AuthenticationResult result) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAuthenticationSucceeded File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onAuthenticationSucceeded
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
static long getThemeFreeFunction() { return nativeGetThemeFreeFunction(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getThemeFreeFunction 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
getThemeFreeFunction
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private void migrate96(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Settings.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String key = element.elementTextTrim("key"); if (key.equals("SERVICE_DESK_SETTING")) { Element valueElement = element.element("value"); if (valueElement != null) { Element preserveBeforeElement = valueElement.element("preserveBefore"); if (preserveBeforeElement != null) preserveBeforeElement.detach(); } } } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate96 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate96
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public TMessage readMessageBegin() throws TException { int size = readI32(); if (size < 0) { int version = size & VERSION_MASK; if (version != VERSION_1) { throw new TProtocolException( TProtocolException.BAD_VERSION, "Bad version in readMessageBegin"); } return new TMessage(readString(), (byte) (size & 0x000000ff), readI32()); } else { if (strictRead_) { throw new TProtocolException( TProtocolException.BAD_VERSION, "Missing version in readMessageBegin, old client?"); } return new TMessage(readStringBody(size), readByte(), readI32()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readMessageBegin 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
readMessageBegin
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
private void execJSUnsafe(WebView web, String js) { if (useEvaluateJavascript()) { web.evaluateJavascript(js, null); } else { web.loadUrl("javascript:(function(){"+js+"})()"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execJSUnsafe File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
execJSUnsafe
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public String getURL(String fullname, String action, String querystring) throws XWikiException { return this.xwiki.getURL(fullname, action, querystring, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
void applyStyleToTheme(long themePtr, @StyleRes int resId, boolean force) { synchronized (this) { // Need to synchronize on AssetManager because we will be accessing // the native implementation of AssetManager. ensureValidLocked(); nativeThemeApplyStyle(mObject, themePtr, resId, force); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyStyleToTheme 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
applyStyleToTheme
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public void setCrossProfilePackages( @NonNull ComponentName admin, @NonNull Set<String> packageNames) { throwIfParentInstance("setCrossProfilePackages"); if (mService != null) { try { mService.setCrossProfilePackages(admin, new ArrayList<>(packageNames)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCrossProfilePackages File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setCrossProfilePackages
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private InsertionHandleController getInsertionHandleController() { if (mInsertionHandleController == null) { mInsertionHandleController = new InsertionHandleController( getContainerView(), mPositionObserver) { private static final int AVERAGE_LINE_HEIGHT = 14; @Override public void setCursorPosition(int x, int y) { if (mNativeContentViewCore != 0) { nativeMoveCaret(mNativeContentViewCore, x, y - mRenderCoordinates.getContentOffsetYPix()); } } @Override public void paste() { mImeAdapter.paste(); hideHandles(); } @Override public int getLineHeight() { return (int) Math.ceil( mRenderCoordinates.fromLocalCssToPix(AVERAGE_LINE_HEIGHT)); } @Override public void showHandle() { super.showHandle(); } }; mInsertionHandleController.hideAndDisallowAutomaticShowing(); } return mInsertionHandleController; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInsertionHandleController File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getInsertionHandleController
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public boolean validate(String[] classNames, XWikiContext context) throws XWikiException { boolean isValid = true; if ((classNames == null) || (classNames.length == 0)) { for (DocumentReference classReference : getXObjects().keySet()) { BaseClass bclass = context.getWiki().getXClass(classReference, context); List<BaseObject> objects = getXObjects(classReference); for (BaseObject obj : objects) { if (obj != null) { isValid &= bclass.validateObject(obj, context); } } } } else { for (String className : classNames) { List<BaseObject> objects = getXObjects(getCurrentMixedDocumentReferenceResolver().resolve(className)); if (objects != null) { for (BaseObject obj : objects) { if (obj != null) { BaseClass bclass = obj.getXClass(context); isValid &= bclass.validateObject(obj, context); } } } } } String validationScript = ""; XWikiRequest req = context.getRequest(); if (req != null) { validationScript = req.get("xvalidation"); } if ((validationScript == null) || (validationScript.trim().equals(""))) { validationScript = getValidationScript(); } if ((validationScript != null) && (!validationScript.trim().equals(""))) { isValid &= executeValidationScript(context, validationScript); } return isValid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validate 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
validate
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
private native int connectSocketNative(byte[] address, int type, byte[] uuid, int port, int flag);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connectSocketNative 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
connectSocketNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public void setServiceLocators(List<ServiceLocator> serviceLocators) { this.serviceLocators = serviceLocators; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServiceLocators 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
setServiceLocators
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
private void throwIfDestroyed() { if (mDestroyed) { throw new IllegalStateException("cannot interact with a destroyed instance"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: throwIfDestroyed File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
throwIfDestroyed
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
private static JSONException recursivelyDefinedObjectException(String key) { return new JSONException( "JavaBean object contains recursively defined member variable of key " + quote(key) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: recursivelyDefinedObjectException File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
recursivelyDefinedObjectException
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(observer != null ? observer.asBinder() : null); mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterProcessObserver File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
unregisterProcessObserver
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
protected void convertNumberToLong() throws IOException { if ((_numTypesValid & NR_INT) != 0) { _numberLong = (long) _numberInt; } else if ((_numTypesValid & NR_BIGINT) != 0) { if (BI_MIN_LONG.compareTo(_numberBigInt) > 0 || BI_MAX_LONG.compareTo(_numberBigInt) < 0) { reportOverflowLong(); } _numberLong = _numberBigInt.longValue(); } else if ((_numTypesValid & NR_DOUBLE) != 0) { if (_numberDouble < MIN_LONG_D || _numberDouble > MAX_LONG_D) { reportOverflowLong(); } _numberLong = (long) _numberDouble; } else if ((_numTypesValid & NR_FLOAT) != 0) { if (_numberFloat < MIN_LONG_D || _numberFloat > MAX_LONG_D) { reportOverflowInt(); } _numberLong = (long) _numberFloat; } else if ((_numTypesValid & NR_BIGDECIMAL) != 0) { if (BD_MIN_LONG.compareTo(_numberBigDecimal) > 0 || BD_MAX_LONG.compareTo(_numberBigDecimal) < 0) { reportOverflowLong(); } _numberLong = _numberBigDecimal.longValue(); } else { _throwInternal(); } _numTypesValid |= NR_LONG; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertNumberToLong File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
convertNumberToLong
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
private String nowTimestamp() { final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HHmmss", Locale.US); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return simpleDateFormat.format(Instant.now().toEpochMilli()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nowTimestamp File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-41044
LOW
3.8
Graylog2/graylog2-server
nowTimestamp
graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
02b8792e6f4b829f0c1d87fcbf2d58b73458b938
0
Analyze the following code function for security vulnerabilities
public static boolean defaultStrict302Handling() { return Boolean.getBoolean(ASYNC_CLIENT + "strict302Handling"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultStrict302Handling File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7398
MEDIUM
4.3
AsyncHttpClient/async-http-client
defaultStrict302Handling
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
void updateSetting(ConnectionInfo info) { connInfoMap.put(info.name, info); info.lastAccess = ticker++; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSetting File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
updateSetting
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
private byte[] getKey(K key) { return stringSerializer.serialize(CommonUtils.joinString(region, Constants.DOT, key)); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2023-46990 - Severity: CRITICAL - CVSS Score: 9.8 Description: https://github.com/sanluan/PublicCMS/issues/76 Function: getKey File: publiccms-parent/publiccms-cache/src/main/java/com/publiccms/common/redis/RedisCacheEntity.java Repository: sanluan/PublicCMS Fixed Code: private byte[] getKey(K key) { return stringSerializer.serialize(CommonUtils.joinString(CACHE_PREFIX, region, Constants.DOT, key)); }
[ "CWE-502" ]
CVE-2023-46990
CRITICAL
9.8
sanluan/PublicCMS
getKey
publiccms-parent/publiccms-cache/src/main/java/com/publiccms/common/redis/RedisCacheEntity.java
c7bf58bf07fdc60a71134c6a73a4947c7709abf7
1
Analyze the following code function for security vulnerabilities
public void setDocumentArchive(XWikiDocumentArchive arch) { // We are using a SoftReference which will allow the archive to be // discarded by the Garbage collector as long as the context is closed (usually during the // request) if (arch != null) { this.archive = new SoftReference<XWikiDocumentArchive>(arch); } else { // Some APIs are expecting the archive to be null for loading it // (e.g. VersioningStore#loadXWikiDocumentArchive), so we allow setting it back to null. this.archive = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDocumentArchive File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
setDocumentArchive
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
@Override public void cancelIntentSender(IIntentSender sender) { if (!(sender instanceof PendingIntentRecord)) { return; } synchronized(this) { PendingIntentRecord rec = (PendingIntentRecord)sender; try { final int uid = AppGlobals.getPackageManager().getPackageUid(rec.key.packageName, MATCH_DEBUG_TRIAGED_MISSING, UserHandle.getCallingUserId()); if (!UserHandle.isSameApp(uid, Binder.getCallingUid())) { String msg = "Permission Denial: cancelIntentSender() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " is not allowed to cancel package " + rec.key.packageName; Slog.w(TAG, msg); throw new SecurityException(msg); } } catch (RemoteException e) { throw new SecurityException(e); } cancelIntentSenderLocked(rec, true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelIntentSender 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
cancelIntentSender
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
void moveUserToForeground(UserStartedState uss, int oldUserId, int newUserId) { boolean homeInFront = mStackSupervisor.switchUserLocked(newUserId, uss); if (homeInFront) { startHomeActivityLocked(newUserId, "moveUserToFroreground"); } else { mStackSupervisor.resumeTopActivitiesLocked(); } EventLogTags.writeAmSwitchUser(newUserId); getUserManagerLocked().userForeground(newUserId); sendUserSwitchBroadcastsLocked(oldUserId, newUserId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveUserToForeground 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
moveUserToForeground
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override @Transactional(rollbackFor = Exception.class) public void addUserWithDepart(SysUser user, String selectedParts) { // this.save(user); //保存角色的时候已经添加过一次了 if(oConvertUtils.isNotEmpty(selectedParts)) { String[] arr = selectedParts.split(","); for (String deaprtId : arr) { SysUserDepart userDeaprt = new SysUserDepart(user.getId(), deaprtId); sysUserDepartMapper.insert(userDeaprt); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addUserWithDepart File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
addUserWithDepart
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0
Analyze the following code function for security vulnerabilities
protected byte[] sendKexInit(Map<KexProposalOption, String> proposal) throws Exception { boolean debugEnabled = log.isDebugEnabled(); if (debugEnabled) { log.debug("sendKexInit({}) Send SSH_MSG_KEXINIT", this); } Buffer buffer = createBuffer(SshConstants.SSH_MSG_KEXINIT); int p = buffer.wpos(); buffer.wpos(p + SshConstants.MSG_KEX_COOKIE_SIZE); synchronized (random) { random.fill(buffer.array(), p, SshConstants.MSG_KEX_COOKIE_SIZE); } boolean traceEnabled = log.isTraceEnabled(); if (traceEnabled) { log.trace("sendKexInit({}) cookie={}", this, BufferUtils.toHex(buffer.array(), p, SshConstants.MSG_KEX_COOKIE_SIZE, ':')); } for (KexProposalOption paramType : KexProposalOption.VALUES) { String s = proposal.get(paramType); if (traceEnabled) { log.trace("sendKexInit({})[{}] {}", this, paramType.getDescription(), s); } buffer.putString(GenericUtils.trimToEmpty(s)); } buffer.putBoolean(false); // first kex packet follows buffer.putUInt(0L); // reserved (FFU) ReservedSessionMessagesHandler handler = getReservedSessionMessagesHandler(); IoWriteFuture future = (handler == null) ? null : handler.sendKexInitRequest(this, proposal, buffer); byte[] data = buffer.getCompactData(); if (future == null) { writePacket(buffer); } else { if (debugEnabled) { log.debug("sendKexInit({}) KEX handled by reserved messages handler", this); } } return data; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendKexInit 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
sendKexInit
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
private ValueNode parseIntFromBuffer(char[] buffer, int start, int length) throws TomlStreamReadException { if (length > 2) { char baseChar = buffer[start + 1]; if (baseChar == 'x' || baseChar == 'o' || baseChar == 'b') { start += 2; length -= 2; String text = new String(buffer, start, length); try { // note: we parse all these as unsigned. Hence the weird int limits. // hex if (baseChar == 'x') { if (length <= 31 / 4) { return factory.numberNode(Integer.parseInt(text, 16)); } else if (length <= 63 / 4) { return factory.numberNode(Long.parseLong(text, 16)); } else { return factory.numberNode(NumberInput.parseBigIntegerWithRadix( text, 16, tomlFactory.isEnabled(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER))); } } // octal if (baseChar == 'o') { // this is a bit conservative, but who uses octal anyway? if (length <= 31 / 3) { return factory.numberNode(Integer.parseInt(text, 8)); } else if (text.length() <= 63 / 3) { return factory.numberNode(Long.parseLong(text, 8)); } else { return factory.numberNode(NumberInput.parseBigIntegerWithRadix( text, 8, tomlFactory.isEnabled(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER))); } } // binary assert baseChar == 'b'; if (length <= 31) { return factory.numberNode(Integer.parseUnsignedInt(text, 2)); } else if (length <= 63) { return factory.numberNode(Long.parseUnsignedLong(text, 2)); } else { return factory.numberNode(NumberInput.parseBigIntegerWithRadix( text, 2, tomlFactory.isEnabled(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER))); } } catch (NumberFormatException e) { throw errorContext.atPosition(lexer).invalidNumber(e, text); } } } // decimal boolean negative; if (buffer[start] == '-') { start++; length--; negative = true; } else if (buffer[start] == '+') { start++; length--; negative = false; } else { negative = false; } // adapted from JsonParserBase if (length <= 9) { int v = NumberInput.parseInt(buffer, start, length); if (negative) v = -v; return factory.numberNode(v); } if (length <= 18 || NumberInput.inLongRange(buffer, start, length, negative)) { long v = NumberInput.parseLong(buffer, start, length); if (negative) v = -v; // Might still fit in int, need to check if ((int) v == v) { return factory.numberNode((int) v); } else { return factory.numberNode(v); } } String text = null; try { tomlFactory.streamReadConstraints().validateIntegerLength(length); } catch (NumberFormatException | StreamConstraintsException e) { final String reportNum = length <= MAX_CHARS_TO_REPORT ? text == null ? new String(buffer, start, length) : text : (text == null ? new String(buffer, start, MAX_CHARS_TO_REPORT) : text.substring(0, MAX_CHARS_TO_REPORT)) + " [truncated]"; throw errorContext.atPosition(lexer).invalidNumber(e, reportNum); } text = new String(buffer, start, length); return factory.numberNode(NumberInput.parseBigInteger( text, tomlFactory.isEnabled(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseIntFromBuffer File: toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java Repository: FasterXML/jackson-dataformats-text The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-3894
HIGH
7.5
FasterXML/jackson-dataformats-text
parseIntFromBuffer
toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java
20a209387931dba31e1a027b74976911c3df39fe
0
Analyze the following code function for security vulnerabilities
public static boolean isCurrent(final URL source, final VersionString version, long lastModified) { if (!isCacheable(source)) throw new IllegalArgumentException(source + " is not a cacheable resource"); try { CacheEntry entry = new CacheEntry(source, version); // could pool this boolean result = entry.isCurrent(lastModified); LOG.info("isCurrent: {} = {}", source, result); return result; } catch (Exception ex) { LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, ex); return isCached(source, version); // if can't connect return whether already in cache } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCurrent File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
isCurrent
core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
protected String studyEventAndFormMetaCondition(int parentStudyId, int studyId, boolean isIncludedSite) { return " where sed.study_id = " + parentStudyId + " and sed.status_id not in (5,7) and " + this.getEventDefinitionCrfCondition(studyId, parentStudyId, isIncludedSite) + " and edc.status_id not in (5,7) and edc.crf_id = crf.crf_id and crf.status_id not in (5,7) and crf.crf_id = cv.crf_id and (cv.status_id not in (5,7))" + " and exists (select ifm.crf_version_id from item_form_metadata ifm, item_group_metadata igm" + " where cv.crf_version_id = ifm.crf_version_id and cv.crf_version_id = igm.crf_version_id and ifm.item_id = igm.item_id)" + " order by sed.ordinal, edc.ordinal, edc.crf_id, cv.crf_version_id desc"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: studyEventAndFormMetaCondition File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
studyEventAndFormMetaCondition
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public synchronized void login() throws XMPPException, SmackException, IOException, InterruptedException { // The previously used username, password and resource take over precedence over the // ones from the connection configuration CharSequence username = usedUsername != null ? usedUsername : config.getUsername(); String password = usedPassword != null ? usedPassword : config.getPassword(); Resourcepart resource = usedResource != null ? usedResource : config.getResource(); login(username, password, resource); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: login File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
login
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public void releasePage(int pageNum) { if (refsp == null) return; --pageNum; if (pageNum < 0 || pageNum >= size()) return; if (pageNum != lastPageRead) return; lastPageRead = -1; reader.lastXrefPartial = refsp.get(pageNum); reader.releaseLastXrefPartial(); refsp.remove(pageNum); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: releasePage File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
releasePage
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@Override public void setUserRestrictionGlobally(String callerPackage, String key) { final CallerIdentity caller = getCallerIdentity(callerPackage); EnforcingAdmin admin = enforcePermissionForUserRestriction( /* who= */ null, key, caller.getPackageName(), UserHandle.USER_ALL ); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_USER_RESTRICTION); if (!isPolicyEngineForFinanceFlagEnabled()) { throw new IllegalStateException("Feature flag is not enabled."); } if (isDeviceOwner(caller) || isProfileOwner(caller)) { throw new SecurityException("Admins are not allowed to call this API."); } if (!mInjector.isChangeEnabled( ENABLE_COEXISTENCE_CHANGE, callerPackage, caller.getUserId())) { throw new IllegalStateException("Calling package is not targeting Android U."); } if (!UserRestrictionsUtils.isValidRestriction(key)) { throw new IllegalArgumentException("Invalid restriction key: " + key); } setGlobalUserRestrictionInternal(admin, key, /* enabled= */ true); logUserRestrictionCall(key, /* enabled= */ true, /* parent= */ false, caller); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserRestrictionGlobally File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setUserRestrictionGlobally
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
void stopAssociationLocked(int sourceUid, String sourceProcess, int targetUid, ComponentName targetComponent) { if (!mTrackingAssociations) { return; } ArrayMap<ComponentName, SparseArray<ArrayMap<String, Association>>> components = mAssociations.get(targetUid); if (components == null) { return; } SparseArray<ArrayMap<String, Association>> sourceUids = components.get(targetComponent); if (sourceUids == null) { return; } ArrayMap<String, Association> sourceProcesses = sourceUids.get(sourceUid); if (sourceProcesses == null) { return; } Association ass = sourceProcesses.get(sourceProcess); if (ass == null || ass.mNesting <= 0) { return; } ass.mNesting--; if (ass.mNesting == 0) { ass.mTime += SystemClock.uptimeMillis() - ass.mStartTime; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopAssociationLocked 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
stopAssociationLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
protected Range getPushRows() { return pushRows; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPushRows 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
getPushRows
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
0
Analyze the following code function for security vulnerabilities
@Override public List<KBTemplate> filterFindByGroupId(long groupId) { return filterFindByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filterFindByGroupId File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
filterFindByGroupId
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
int getCallState() { return mPhoneStateBroadcaster.getCallState(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallState File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
getCallState
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
@Override protected Buffer preProcessEncodeBuffer(int cmd, Buffer buffer) throws IOException { buffer = super.preProcessEncodeBuffer(cmd, buffer); // SSHD-968 - remember global request outgoing sequence number LongConsumer setter = globalSequenceNumbers.remove(buffer); if (setter != null) { setter.accept(seqo); } return buffer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: preProcessEncodeBuffer 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
preProcessEncodeBuffer
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@HotPath(caller = HotPath.PROCESS_CHANGE) @Override public boolean attachApplication(WindowProcessController wpc) throws RemoteException { synchronized (mGlobalLockWithoutBoost) { if (Trace.isTagEnabled(TRACE_TAG_WINDOW_MANAGER)) { Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "attachApplication:" + wpc.mName); } try { return mRootWindowContainer.attachApplication(wpc); } finally { Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachApplication File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
attachApplication
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override boolean fillsParent() { return occludesParent(true /* includingFinishing */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fillsParent File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
fillsParent
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
void setNativeDebuggingAppLocked(ApplicationInfo app, String processName) { boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0")); if (!isDebuggable) { if ((app.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) { throw new SecurityException("Process not debuggable: " + app.packageName); } } mNativeDebuggingApp = processName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNativeDebuggingAppLocked 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
setNativeDebuggingAppLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected String readAuthTokenInternal(UserAccounts accounts, Account account, String authTokenType) { // Fast path - check if account is already cached synchronized (accounts.cacheLock) { Map<String, String> authTokensForAccount = accounts.authTokenCache.get(account); if (authTokensForAccount != null) { return authTokensForAccount.get(authTokenType); } } // If not cached yet - do slow path and sync with db if necessary synchronized (accounts.dbLock) { synchronized (accounts.cacheLock) { Map<String, String> authTokensForAccount = accounts.authTokenCache.get(account); if (authTokensForAccount == null) { // need to populate the cache for this account authTokensForAccount = accounts.accountsDb.findAuthTokensByAccount(account); accounts.authTokenCache.put(account, authTokensForAccount); } return authTokensForAccount.get(authTokenType); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readAuthTokenInternal 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
readAuthTokenInternal
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public MvcClass attr(final String name, final Object value) { attrs.put(name, value); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attr 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
attr
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private StringBuilder buildParameterList(Method method, StringBuilder query) { for (Parameter p : ReflectionUtils.getParameters(method)) { QueryParameter qp = p.annotation(QueryParameter.class); if (qp!=null) { String name = qp.value(); if (name.length()==0) name = p.name(); if (name==null || name.length()==0) continue; // unknown parameter name. we'll report the error when the form is submitted. RelativePath rp = p.annotation(RelativePath.class); if (rp!=null) name = rp.value()+'/'+name; if (query.length()==0) query.append("+qs(this)"); if (name.equals("value")) { // The special 'value' parameter binds to the the current field query.append(".addThis()"); } else { query.append(".nearBy('"+name+"')"); } continue; } Method m = ReflectionUtils.getPublicMethodNamed(p.type(), "fromStapler"); if (m!=null) buildParameterList(m,query); } return query; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildParameterList 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
buildParameterList
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override protected void configure() { super.configure(); bind(JettyRunner.class).to(DefaultJettyRunner.class); bind(ServletContextHandler.class).toProvider(DefaultJettyRunner.class); bind(ObjectMapper.class).toProvider(ObjectMapperProvider.class).in(Singleton.class); bind(ValidatorFactory.class).toProvider(new com.google.inject.Provider<ValidatorFactory>() { @Override public ValidatorFactory get() { Configuration<?> configuration = Validation.byDefaultProvider().configure(); return configuration.buildValidatorFactory(); } }).in(Singleton.class); bind(Validator.class).toProvider(ValidatorProvider.class).in(Singleton.class); // configure markdown bind(MarkdownManager.class).to(DefaultMarkdownManager.class); configurePersistence(); configureRestServices(); configureWeb(); configureBuild(); bind(GitConfig.class).toProvider(GitConfigProvider.class); /* * Declare bindings explicitly instead of using ImplementedBy annotation as * HK2 to guice bridge can only search in explicit bindings in Guice */ bind(StorageManager.class).to(DefaultStorageManager.class); bind(SettingManager.class).to(DefaultSettingManager.class); bind(DataManager.class).to(DefaultDataManager.class); bind(TaskScheduler.class).to(DefaultTaskScheduler.class); bind(PullRequestCommentManager.class).to(DefaultPullRequestCommentManager.class); bind(CodeCommentManager.class).to(DefaultCodeCommentManager.class); bind(PullRequestManager.class).to(DefaultPullRequestManager.class); bind(PullRequestUpdateManager.class).to(DefaultPullRequestUpdateManager.class); bind(ProjectManager.class).to(DefaultProjectManager.class); bind(UserManager.class).to(DefaultUserManager.class); bind(PullRequestReviewManager.class).to(DefaultPullRequestReviewManager.class); bind(BuildManager.class).to(DefaultBuildManager.class); bind(BuildDependenceManager.class).to(DefaultBuildDependenceManager.class); bind(JobManager.class).to(DefaultJobManager.class); bind(LogManager.class).to(DefaultLogManager.class); bind(PullRequestBuildManager.class).to(DefaultPullRequestBuildManager.class); bind(MailManager.class).to(DefaultMailManager.class); bind(IssueManager.class).to(DefaultIssueManager.class); bind(IssueFieldManager.class).to(DefaultIssueFieldManager.class); bind(BuildParamManager.class).to(DefaultBuildParamManager.class); bind(UserAuthorizationManager.class).to(DefaultUserAuthorizationManager.class); bind(GroupAuthorizationManager.class).to(DefaultGroupAuthorizationManager.class); bind(PullRequestWatchManager.class).to(DefaultPullRequestWatchManager.class); bind(RoleManager.class).to(DefaultRoleManager.class); bind(CommitInfoManager.class).to(DefaultCommitInfoManager.class); bind(UserInfoManager.class).to(DefaultUserInfoManager.class); bind(BatchWorkManager.class).to(DefaultBatchWorkManager.class); bind(GroupManager.class).to(DefaultGroupManager.class); bind(MembershipManager.class).to(DefaultMembershipManager.class); bind(PullRequestChangeManager.class).to(DefaultPullRequestChangeManager.class); bind(CodeCommentReplyManager.class).to(DefaultCodeCommentReplyManager.class); bind(AttachmentStorageManager.class).to(DefaultAttachmentStorageManager.class); bind(CodeCommentRelationInfoManager.class).to(DefaultCodeCommentRelationInfoManager.class); bind(CodeCommentRelationManager.class).to(DefaultCodeCommentRelationManager.class); bind(WorkExecutor.class).to(DefaultWorkExecutor.class); bind(PullRequestNotificationManager.class); bind(CommitNotificationManager.class); bind(BuildNotificationManager.class); bind(IssueNotificationManager.class); bind(EntityReferenceManager.class); bind(CodeCommentNotificationManager.class); bind(CodeCommentManager.class).to(DefaultCodeCommentManager.class); bind(IssueWatchManager.class).to(DefaultIssueWatchManager.class); bind(IssueChangeManager.class).to(DefaultIssueChangeManager.class); bind(IssueVoteManager.class).to(DefaultIssueVoteManager.class); bind(MilestoneManager.class).to(DefaultMilestoneManager.class); bind(Session.class).toProvider(SessionProvider.class); bind(EntityManager.class).toProvider(SessionProvider.class); bind(SessionFactory.class).toProvider(SessionFactoryProvider.class); bind(EntityManagerFactory.class).toProvider(SessionFactoryProvider.class); bind(IssueCommentManager.class).to(DefaultIssueCommentManager.class); bind(IssueQuerySettingManager.class).to(DefaultIssueQuerySettingManager.class); bind(PullRequestQuerySettingManager.class).to(DefaultPullRequestQuerySettingManager.class); bind(CodeCommentQuerySettingManager.class).to(DefaultCodeCommentQuerySettingManager.class); bind(CommitQuerySettingManager.class).to(DefaultCommitQuerySettingManager.class); bind(BuildQuerySettingManager.class).to(DefaultBuildQuerySettingManager.class); bind(WebHookManager.class); contribute(ObjectMapperConfigurator.class, GitObjectMapperConfigurator.class); contribute(ObjectMapperConfigurator.class, HibernateObjectMapperConfigurator.class); bind(Realm.class).to(OneAuthorizingRealm.class); bind(RememberMeManager.class).to(OneRememberMeManager.class); bind(WebSecurityManager.class).to(OneWebSecurityManager.class); bind(FilterChainResolver.class).to(OneFilterChainResolver.class); bind(BasicAuthenticationFilter.class); bind(PasswordService.class).to(OnePasswordService.class); bind(ShiroFilter.class); install(new ShiroAopModule()); contribute(FilterChainConfigurator.class, new FilterChainConfigurator() { @Override public void configure(FilterChainManager filterChainManager) { filterChainManager.createChain("/**/info/refs", "noSessionCreation, authcBasic"); filterChainManager.createChain("/**/git-upload-pack", "noSessionCreation, authcBasic"); filterChainManager.createChain("/**/git-receive-pack", "noSessionCreation, authcBasic"); } }); contributeFromPackage(Authenticator.class, Authenticator.class); contribute(ImplementationProvider.class, new ImplementationProvider() { @Override public Class<?> getAbstractClass() { return JobExecutor.class; } @Override public Collection<Class<?>> getImplementations() { return Sets.newHashSet(AutoDiscoveredJobExecutor.class); } }); contribute(CodePullAuthorizationSource.class, DefaultJobManager.class); bind(IndexManager.class).to(DefaultIndexManager.class); bind(SearchManager.class).to(DefaultSearchManager.class); bind(EntityValidator.class).to(DefaultEntityValidator.class); bind(GitFilter.class); bind(GitPreReceiveCallback.class); bind(GitPostReceiveCallback.class); bind(ExecutorService.class).toProvider(new Provider<ExecutorService>() { @Override public ExecutorService get() { return new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>()) { @Override public void execute(Runnable command) { try { super.execute(SecurityUtils.inheritSubject(command)); } catch (RejectedExecutionException e) { if (!isShutdown()) throw ExceptionUtils.unchecked(e); } } }; } }).in(Singleton.class); bind(ForkJoinPool.class).toInstance(new ForkJoinPool() { @Override public ForkJoinTask<?> submit(Runnable task) { return super.submit(SecurityUtils.inheritSubject(task)); } @Override public void execute(Runnable task) { super.execute(SecurityUtils.inheritSubject(task)); } @Override public <T> ForkJoinTask<T> submit(Callable<T> task) { return super.submit(SecurityUtils.inheritSubject(task)); } @Override public <T> ForkJoinTask<T> submit(Runnable task, T result) { return super.submit(SecurityUtils.inheritSubject(task), result); } @Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return super.invokeAny(SecurityUtils.inheritSubject(tasks)); } @Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return super.invokeAny(SecurityUtils.inheritSubject(tasks), timeout, unit); } @Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { return super.invokeAll(SecurityUtils.inheritSubject(tasks), timeout, unit); } @Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) { return super.invokeAll(SecurityUtils.inheritSubject(tasks)); } }); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2021-21244 - Severity: HIGH - CVSS Score: 7.5 Description: fix issue #88: Users able to edit build spec can execute arbitrary java code Function: configure File: server-core/src/main/java/io/onedev/server/CoreModule.java Repository: theonedev/onedev Fixed Code: @Override protected void configure() { super.configure(); bind(JettyRunner.class).to(DefaultJettyRunner.class); bind(ServletContextHandler.class).toProvider(DefaultJettyRunner.class); bind(ObjectMapper.class).toProvider(ObjectMapperProvider.class).in(Singleton.class); bind(ValidatorFactory.class).toProvider(new com.google.inject.Provider<ValidatorFactory>() { @Override public ValidatorFactory get() { Configuration<?> configuration = Validation .byDefaultProvider() .configure() .messageInterpolator(new ParameterMessageInterpolator()); return configuration.buildValidatorFactory(); } }).in(Singleton.class); bind(Validator.class).toProvider(ValidatorProvider.class).in(Singleton.class); // configure markdown bind(MarkdownManager.class).to(DefaultMarkdownManager.class); configurePersistence(); configureRestServices(); configureWeb(); configureBuild(); bind(GitConfig.class).toProvider(GitConfigProvider.class); /* * Declare bindings explicitly instead of using ImplementedBy annotation as * HK2 to guice bridge can only search in explicit bindings in Guice */ bind(StorageManager.class).to(DefaultStorageManager.class); bind(SettingManager.class).to(DefaultSettingManager.class); bind(DataManager.class).to(DefaultDataManager.class); bind(TaskScheduler.class).to(DefaultTaskScheduler.class); bind(PullRequestCommentManager.class).to(DefaultPullRequestCommentManager.class); bind(CodeCommentManager.class).to(DefaultCodeCommentManager.class); bind(PullRequestManager.class).to(DefaultPullRequestManager.class); bind(PullRequestUpdateManager.class).to(DefaultPullRequestUpdateManager.class); bind(ProjectManager.class).to(DefaultProjectManager.class); bind(UserManager.class).to(DefaultUserManager.class); bind(PullRequestReviewManager.class).to(DefaultPullRequestReviewManager.class); bind(BuildManager.class).to(DefaultBuildManager.class); bind(BuildDependenceManager.class).to(DefaultBuildDependenceManager.class); bind(JobManager.class).to(DefaultJobManager.class); bind(LogManager.class).to(DefaultLogManager.class); bind(PullRequestBuildManager.class).to(DefaultPullRequestBuildManager.class); bind(MailManager.class).to(DefaultMailManager.class); bind(IssueManager.class).to(DefaultIssueManager.class); bind(IssueFieldManager.class).to(DefaultIssueFieldManager.class); bind(BuildParamManager.class).to(DefaultBuildParamManager.class); bind(UserAuthorizationManager.class).to(DefaultUserAuthorizationManager.class); bind(GroupAuthorizationManager.class).to(DefaultGroupAuthorizationManager.class); bind(PullRequestWatchManager.class).to(DefaultPullRequestWatchManager.class); bind(RoleManager.class).to(DefaultRoleManager.class); bind(CommitInfoManager.class).to(DefaultCommitInfoManager.class); bind(UserInfoManager.class).to(DefaultUserInfoManager.class); bind(BatchWorkManager.class).to(DefaultBatchWorkManager.class); bind(GroupManager.class).to(DefaultGroupManager.class); bind(MembershipManager.class).to(DefaultMembershipManager.class); bind(PullRequestChangeManager.class).to(DefaultPullRequestChangeManager.class); bind(CodeCommentReplyManager.class).to(DefaultCodeCommentReplyManager.class); bind(AttachmentStorageManager.class).to(DefaultAttachmentStorageManager.class); bind(CodeCommentRelationInfoManager.class).to(DefaultCodeCommentRelationInfoManager.class); bind(CodeCommentRelationManager.class).to(DefaultCodeCommentRelationManager.class); bind(WorkExecutor.class).to(DefaultWorkExecutor.class); bind(PullRequestNotificationManager.class); bind(CommitNotificationManager.class); bind(BuildNotificationManager.class); bind(IssueNotificationManager.class); bind(EntityReferenceManager.class); bind(CodeCommentNotificationManager.class); bind(CodeCommentManager.class).to(DefaultCodeCommentManager.class); bind(IssueWatchManager.class).to(DefaultIssueWatchManager.class); bind(IssueChangeManager.class).to(DefaultIssueChangeManager.class); bind(IssueVoteManager.class).to(DefaultIssueVoteManager.class); bind(MilestoneManager.class).to(DefaultMilestoneManager.class); bind(Session.class).toProvider(SessionProvider.class); bind(EntityManager.class).toProvider(SessionProvider.class); bind(SessionFactory.class).toProvider(SessionFactoryProvider.class); bind(EntityManagerFactory.class).toProvider(SessionFactoryProvider.class); bind(IssueCommentManager.class).to(DefaultIssueCommentManager.class); bind(IssueQuerySettingManager.class).to(DefaultIssueQuerySettingManager.class); bind(PullRequestQuerySettingManager.class).to(DefaultPullRequestQuerySettingManager.class); bind(CodeCommentQuerySettingManager.class).to(DefaultCodeCommentQuerySettingManager.class); bind(CommitQuerySettingManager.class).to(DefaultCommitQuerySettingManager.class); bind(BuildQuerySettingManager.class).to(DefaultBuildQuerySettingManager.class); bind(WebHookManager.class); contribute(ObjectMapperConfigurator.class, GitObjectMapperConfigurator.class); contribute(ObjectMapperConfigurator.class, HibernateObjectMapperConfigurator.class); bind(Realm.class).to(OneAuthorizingRealm.class); bind(RememberMeManager.class).to(OneRememberMeManager.class); bind(WebSecurityManager.class).to(OneWebSecurityManager.class); bind(FilterChainResolver.class).to(OneFilterChainResolver.class); bind(BasicAuthenticationFilter.class); bind(PasswordService.class).to(OnePasswordService.class); bind(ShiroFilter.class); install(new ShiroAopModule()); contribute(FilterChainConfigurator.class, new FilterChainConfigurator() { @Override public void configure(FilterChainManager filterChainManager) { filterChainManager.createChain("/**/info/refs", "noSessionCreation, authcBasic"); filterChainManager.createChain("/**/git-upload-pack", "noSessionCreation, authcBasic"); filterChainManager.createChain("/**/git-receive-pack", "noSessionCreation, authcBasic"); } }); contributeFromPackage(Authenticator.class, Authenticator.class); contribute(ImplementationProvider.class, new ImplementationProvider() { @Override public Class<?> getAbstractClass() { return JobExecutor.class; } @Override public Collection<Class<?>> getImplementations() { return Sets.newHashSet(AutoDiscoveredJobExecutor.class); } }); contribute(CodePullAuthorizationSource.class, DefaultJobManager.class); bind(IndexManager.class).to(DefaultIndexManager.class); bind(SearchManager.class).to(DefaultSearchManager.class); bind(EntityValidator.class).to(DefaultEntityValidator.class); bind(GitFilter.class); bind(GitPreReceiveCallback.class); bind(GitPostReceiveCallback.class); bind(ExecutorService.class).toProvider(new Provider<ExecutorService>() { @Override public ExecutorService get() { return new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>()) { @Override public void execute(Runnable command) { try { super.execute(SecurityUtils.inheritSubject(command)); } catch (RejectedExecutionException e) { if (!isShutdown()) throw ExceptionUtils.unchecked(e); } } }; } }).in(Singleton.class); bind(ForkJoinPool.class).toInstance(new ForkJoinPool() { @Override public ForkJoinTask<?> submit(Runnable task) { return super.submit(SecurityUtils.inheritSubject(task)); } @Override public void execute(Runnable task) { super.execute(SecurityUtils.inheritSubject(task)); } @Override public <T> ForkJoinTask<T> submit(Callable<T> task) { return super.submit(SecurityUtils.inheritSubject(task)); } @Override public <T> ForkJoinTask<T> submit(Runnable task, T result) { return super.submit(SecurityUtils.inheritSubject(task), result); } @Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return super.invokeAny(SecurityUtils.inheritSubject(tasks)); } @Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return super.invokeAny(SecurityUtils.inheritSubject(tasks), timeout, unit); } @Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { return super.invokeAll(SecurityUtils.inheritSubject(tasks), timeout, unit); } @Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) { return super.invokeAll(SecurityUtils.inheritSubject(tasks)); } }); }
[ "CWE-94" ]
CVE-2021-21244
HIGH
7.5
theonedev/onedev
configure
server-core/src/main/java/io/onedev/server/CoreModule.java
4f5dc6fb9e50f2c41c4929b0d8c5824b2cca3d65
1
Analyze the following code function for security vulnerabilities
public TrustAnchor findByIssuerAndSignature(X509Certificate cert) { X500Principal issuer = cert.getIssuerX500Principal(); synchronized (subjectToTrustAnchors) { List<TrustAnchor> anchors = subjectToTrustAnchors.get(issuer); if (anchors == null) { return null; } for (TrustAnchor anchor : anchors) { PublicKey publicKey; try { X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { publicKey = caCert.getPublicKey(); } else { publicKey = anchor.getCAPublicKey(); } cert.verify(publicKey); return anchor; } catch (Exception ignored) { } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findByIssuerAndSignature File: src/platform/java/org/conscrypt/TrustedCertificateIndex.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-345" ]
CVE-2016-0818
MEDIUM
4.3
android
findByIssuerAndSignature
src/platform/java/org/conscrypt/TrustedCertificateIndex.java
4c9f9c2201116acf790fca25af43995d29980ee0
0
Analyze the following code function for security vulnerabilities
public static AppInterface getInstance() { int slotId = PhoneConstants.DEFAULT_CARD_INDEX; SubscriptionController sControl = SubscriptionController.getInstance(); if (sControl != null) { slotId = sControl.getSlotId(sControl.getDefaultSubId()); } return getInstance(null, null, null, slotId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstance File: src/java/com/android/internal/telephony/cat/CatService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3843
HIGH
9.3
android
getInstance
src/java/com/android/internal/telephony/cat/CatService.java
b48581401259439dc5ef6dcf8b0f303e4cbefbe9
0
Analyze the following code function for security vulnerabilities
public abstract List<JavaType> getInterfaces();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInterfaces File: src/main/java/com/fasterxml/jackson/databind/JavaType.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
getInterfaces
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private Map<String, Object> getClusterInfo() { ExecutorService executorService = Executors.newFixedThreadPool(3, new ThreadFactoryBuilder().setNameFormat("support-bundle-cluster-info-collector").build()); final Map<String, Object> clusterInfo = new ConcurrentHashMap<>(); final Map<String, Object> searchDb = new ConcurrentHashMap<>(); final CompletableFuture<?> clusterStats = timeLimitedOrErrorString(clusterStatsService::clusterStats, executorService).thenAccept(stats -> clusterInfo.put("cluster_stats", stats)); final CompletableFuture<?> searchDbVersion = timeLimitedOrErrorString(() -> elasticVersionProbe.probe(elasticsearchHosts) .map(SearchVersion::toString).orElse("Unknown"), executorService) .thenAccept(version -> searchDb.put("version", version)); final CompletableFuture<?> searchDbStats = timeLimitedOrErrorString(searchDbClusterAdapter::rawClusterStats, executorService).thenAccept(stats -> searchDb.put("stats", stats)); try { CompletableFuture.allOf(clusterStats, searchDbVersion, searchDbStats).get(); } catch (Exception e) { throw new RuntimeException("Failed collecting cluster info", e); } finally { executorService.shutdownNow(); } clusterInfo.put("search_db", searchDb); return clusterInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClusterInfo File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-41044
LOW
3.8
Graylog2/graylog2-server
getClusterInfo
graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
02b8792e6f4b829f0c1d87fcbf2d58b73458b938
0
Analyze the following code function for security vulnerabilities
@Nullable // TODO(b/266928216): Check what the admin capabilities are when deciding which admin to return. private ActiveAdmin getMostProbableDPCAdminForGlobalPolicy() { synchronized (getLockObject()) { ActiveAdmin deviceOwner = getDeviceOwnerAdminLocked(); if (deviceOwner != null) { return deviceOwner; } List<UserInfo> users = mUserManager.getUsers(); for (UserInfo userInfo : users) { if (isProfileOwnerOfOrganizationOwnedDevice(userInfo.id)) { return getProfileOwnerAdminLocked(userInfo.id); } } for (UserInfo userInfo : users) { ActiveAdmin profileOwner = getProfileOwnerLocked(userInfo.id); if (profileOwner != null) { return profileOwner; } } return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMostProbableDPCAdminForGlobalPolicy File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getMostProbableDPCAdminForGlobalPolicy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void migrate37(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Settings.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { if (element.elementTextTrim("key").equals("LICENSE")) element.detach(); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate37 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate37
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public @NotNull Builder addHostKeyCertificate(@NotNull String hostKeyCertificate) { certificates.add(hostKeyCertificate); sshdConfig.withHostKeyCertificate(hostKeyCertificate); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addHostKeyCertificate File: src/itest/java/com/hierynomus/sshj/SshdContainer.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
addHostKeyCertificate
src/itest/java/com/hierynomus/sshj/SshdContainer.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
private final boolean killPackageProcessesLocked(String packageName, int appId, int userId, int minOomAdj, boolean callerWillRestart, boolean allowRestart, boolean doit, boolean evenPersistent, String reason) { ArrayList<ProcessRecord> procs = new ArrayList<>(); // Remove all processes this package may have touched: all with the // same UID (except for the system or root user), and all whose name // matches the package name. final int NP = mProcessNames.getMap().size(); for (int ip=0; ip<NP; ip++) { SparseArray<ProcessRecord> apps = mProcessNames.getMap().valueAt(ip); final int NA = apps.size(); for (int ia=0; ia<NA; ia++) { ProcessRecord app = apps.valueAt(ia); if (app.persistent && !evenPersistent) { // we don't kill persistent processes continue; } if (app.removed) { if (doit) { procs.add(app); } continue; } // Skip process if it doesn't meet our oom adj requirement. if (app.setAdj < minOomAdj) { continue; } // If no package is specified, we call all processes under the // give user id. if (packageName == null) { if (userId != UserHandle.USER_ALL && app.userId != userId) { continue; } if (appId >= 0 && UserHandle.getAppId(app.uid) != appId) { continue; } // Package has been specified, we want to hit all processes // that match it. We need to qualify this by the processes // that are running under the specified app and user ID. } else { final boolean isDep = app.pkgDeps != null && app.pkgDeps.contains(packageName); if (!isDep && UserHandle.getAppId(app.uid) != appId) { continue; } if (userId != UserHandle.USER_ALL && app.userId != userId) { continue; } if (!app.pkgList.containsKey(packageName) && !isDep) { continue; } } // Process has passed all conditions, kill it! if (!doit) { return true; } app.removed = true; procs.add(app); } } int N = procs.size(); for (int i=0; i<N; i++) { removeProcessLocked(procs.get(i), callerWillRestart, allowRestart, reason); } updateOomAdjLocked(); return N > 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killPackageProcessesLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
killPackageProcessesLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public static void unzip(String zipFilePath, String targetPath, boolean overwrite) throws IOException { ZipFile zipFile = new ZipFile(zipFilePath, ENCODING); Enumeration<? extends ZipEntry> entryEnum = zipFile.getEntries(); if (null != entryEnum) { while (entryEnum.hasMoreElements()) { ZipEntry zipEntry = entryEnum.nextElement(); if (zipEntry.isDirectory()) { File dir = new File(targetPath + File.separator + zipEntry.getName()); dir.mkdirs(); } else { File targetFile = new File(targetPath + File.separator + zipEntry.getName()); if (!targetFile.exists() || overwrite) { targetFile.getParentFile().mkdirs(); try (InputStream inputStream = zipFile.getInputStream(zipEntry); FileOutputStream outputStream = new FileOutputStream(targetFile); FileLock fileLock = outputStream.getChannel().tryLock();) { StreamUtils.copy(inputStream, outputStream); } } } } } zipFile.close(); }
Vulnerability Classification: - CWE: CWE-434 - CVE: CVE-2018-12914 - Severity: HIGH - CVSS Score: 7.5 Description: https://github.com/sanluan/PublicCMS/issues/13 Unsafe Unzip bug fix Function: unzip File: publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/ZipUtils.java Repository: sanluan/PublicCMS Fixed Code: public static void unzip(String zipFilePath, String targetPath, boolean overwrite) throws IOException { ZipFile zipFile = new ZipFile(zipFilePath, ENCODING); Enumeration<? extends ZipEntry> entryEnum = zipFile.getEntries(); if (null != entryEnum) { while (entryEnum.hasMoreElements()) { ZipEntry zipEntry = entryEnum.nextElement(); String filePath = zipEntry.getName(); if (filePath.contains("..")) { filePath = filePath.replace("..", BLANK); } if (zipEntry.isDirectory()) { File dir = new File(targetPath + File.separator + filePath); dir.mkdirs(); } else { File targetFile = new File(targetPath + File.separator + filePath); if (!targetFile.exists() || overwrite) { targetFile.getParentFile().mkdirs(); try (InputStream inputStream = zipFile.getInputStream(zipEntry); FileOutputStream outputStream = new FileOutputStream(targetFile); FileLock fileLock = outputStream.getChannel().tryLock();) { StreamUtils.copy(inputStream, outputStream); } } } } } zipFile.close(); }
[ "CWE-434" ]
CVE-2018-12914
HIGH
7.5
sanluan/PublicCMS
unzip
publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/ZipUtils.java
f5e6eaeb4d46014df599be99328fa910dc44453d
1
Analyze the following code function for security vulnerabilities
@Override protected void validate(Document document) throws SAXException, IOException { verifier.verify(document); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validate File: ext/java/nokogiri/XmlRelaxng.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
validate
ext/java/nokogiri/XmlRelaxng.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
0
Analyze the following code function for security vulnerabilities
private void useResource(String resource, XWikiContext context) { LOGGER.debug("Using [{}] as [{}] extension", resource, this.getName()); getPulledResources(context).add(resource); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: useResource File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
useResource
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
@Override public StaticHandler setSendVaryHeader(boolean sendVaryHeader) { this.sendVaryHeader = sendVaryHeader; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSendVaryHeader File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
setSendVaryHeader
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
public boolean isIntegratedPlatform(String workspaceId, String platform) { IntegrationRequest request = new IntegrationRequest(); request.setPlatform(platform); request.setWorkspaceId(workspaceId); ServiceIntegration integration = baseIntegrationService.get(request); return StringUtils.isNotBlank(integration.getId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIntegratedPlatform File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
isIntegratedPlatform
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
private void tryUpgradeDbPropertiesFile(String dbFile, Properties properties) throws IOException { if (!"com.mysql.cj.jdbc.Driver".equals(properties.get("driverClass"))) { properties.put("driverClass", "com.mysql.cj.jdbc.Driver"); properties.put("jdbcUrl", properties.get("jdbcUrl") + "&" + JDBC_URL_BASE_QUERY_PARAM); properties.store(new FileOutputStream(dbFile), "Support mysql8"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tryUpgradeDbPropertiesFile 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
tryUpgradeDbPropertiesFile
web/src/main/java/com/zrlog/web/config/ZrLogConfig.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public void setImeAdapterForTest(ImeAdapter imeAdapter) { mImeAdapter = imeAdapter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setImeAdapterForTest File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
setImeAdapterForTest
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; getConfigFile().write(this); SaveableListener.fireOnChange(this, getConfigFile()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
save
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
protected CloseableHttpClient getAuthedHttpClient() { HttpClientBuilder cb = HttpClientBuilder.create(); CredentialsProvider provider = new BasicCredentialsProvider(); provider.setCredentials( new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM, AuthSchemes.DIGEST), new UsernamePasswordCredentials(downloadUser, downloadPassword)); return cb.build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthedHttpClient File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
getAuthedHttpClient
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
private JSONAware executePostRequest(HttpExchange pExchange, ParsedUri pUri) throws MalformedObjectNameException, IOException { String encoding = null; Headers headers = pExchange.getRequestHeaders(); String cType = headers.getFirst("Content-Type"); if (cType != null) { Matcher matcher = contentTypePattern.matcher(cType); if (matcher.matches()) { encoding = matcher.group(1); } } InputStream is = pExchange.getRequestBody(); return requestHandler.handlePostRequest(pUri.toString(),is, encoding, pUri.getParameterMap()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executePostRequest File: agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
executePostRequest
agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
public boolean isAProtectedResource(HttpServletRequest request) { boolean isProtected = false; if (request.getRequestURI().matches(UNPROTECTED_URI_RULE)) { isProtected = DEFAULT_PROTECTED_METHODS.contains(request.getMethod()); if (!isProtected && request.getMethod().equals("GET")) { String path = getRequestPath(request); isProtected = path.matches(DEFAULT_GET_RULE); } } return isProtected; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-47324 - Severity: MEDIUM - CVSS Score: 5.4 Description: Bug #13811: fixing stored XSS leading to full account takeover * making HTML sanitize processing accessible for JSTL instructions * sanitizing user notification title and contents on registering * sanitizing user notification title and contents on rendering * sanitizing browse bar parts * modifying the user and group saving action names in order to get the user token verifications * applying the token validation from component request router abstraction Function: isAProtectedResource File: core-rs/src/main/java/org/silverpeas/core/web/token/SynchronizerTokenService.java Repository: Silverpeas/Silverpeas-Core Fixed Code: public boolean isAProtectedResource(HttpServletRequest request, final boolean onKeywordsOnly) { boolean isProtected = false; if (request.getRequestURI().matches(UNPROTECTED_URI_RULE)) { isProtected = DEFAULT_PROTECTED_METHODS.contains(request.getMethod()); if (!isProtected && "GET".equals(request.getMethod())) { String path = getRequestPath(request); isProtected = onKeywordsOnly ? path.matches(DEFAULT_GET_RULE_ON_KEYWORD) : path.matches(DEFAULT_GET_RULE); } } return isProtected; }
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
isAProtectedResource
core-rs/src/main/java/org/silverpeas/core/web/token/SynchronizerTokenService.java
9a55728729a3b431847045c674b3e883507d1e1a
1
Analyze the following code function for security vulnerabilities
byte[] toByteArray() throws IOException, JMSException { ByteArrayOutputStream bout = new ByteArrayOutputStream(DEFAULT_MESSAGE_BODY_SIZE); ObjectOutputStream out = new ObjectOutputStream(bout); //write the class of the message so we can instantiate on the other end out.writeUTF(this.getClass().getName()); //write out message id out.writeUTF(this.internalMessageID); //write our JMS properties out.writeInt(this.rmqProperties.size()); for (Map.Entry<String, Serializable> entry : this.rmqProperties.entrySet()) { out.writeUTF(entry.getKey()); writePrimitive(entry.getValue(), out, true); } //write custom properties out.writeInt(this.userJmsProperties.size()); for (Map.Entry<String, Serializable> entry : this.userJmsProperties.entrySet()) { out.writeUTF(entry.getKey()); writePrimitive(entry.getValue(), out, true); } out.flush(); // ensure structured part written to byte stream this.writeBody(out, bout); out.flush(); // force any more structured data to byte stream return bout.toByteArray(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toByteArray File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
toByteArray
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public void updateStatistics(Collection<CmsContentStatistics> entitys) { for (CmsContentStatistics entityStatistics : entitys) { CmsContent entity = getEntity(entityStatistics.getId()); if (null != entity) { entity.setClicks(entity.getClicks() + entityStatistics.getClicks()); entity.setScores(entity.getScores() + entityStatistics.getScores()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateStatistics File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
updateStatistics
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
@Override public Response processBeginTransaction(TransactionInfo info) throws Exception { TransportConnectionState cs = lookupConnectionState(info.getConnectionId()); context = null; if (cs != null) { context = cs.getContext(); } if (cs == null) { throw new NullPointerException("Context is null"); } // Avoid replaying dup commands if (cs.getTransactionState(info.getTransactionId()) == null) { cs.addTransactionState(info.getTransactionId()); broker.beginTransaction(context, info.getTransactionId()); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processBeginTransaction 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
processBeginTransaction
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
private Setting getGlobalSetting(String name) { if (DEBUG) { Slog.v(LOG_TAG, "getGlobalSetting(" + name + ")"); } // Get the value. synchronized (mLock) { return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGlobalSetting File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
getGlobalSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
public static NativeObject jsFunction_getAllSubscriptionsOfApplication(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException, APIManagementException, ApplicationNotFoundException { return getAllSubscriptions(cx, thisObj, args, funObj, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_getAllSubscriptionsOfApplication File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_getAllSubscriptionsOfApplication
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
public boolean isThisGoneAway() { return thisGoneAway; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isThisGoneAway File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
isThisGoneAway
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
public String getLine1AlphaTagForSubscriber(int subId) { PhoneSubInfoProxy phoneSubInfoProxy = getPhoneSubInfoProxy(subId); if (phoneSubInfoProxy != null) { return phoneSubInfoProxy.getLine1AlphaTag(); } else { Rlog.e(TAG,"getLine1AlphaTag phoneSubInfoProxy is" + " null for Subscription:" + subId); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLine1AlphaTagForSubscriber File: src/java/com/android/internal/telephony/PhoneSubInfoController.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-0831
MEDIUM
4.3
android
getLine1AlphaTagForSubscriber
src/java/com/android/internal/telephony/PhoneSubInfoController.java
79eecef63f3ea99688333c19e22813f54d4a31b1
0
Analyze the following code function for security vulnerabilities
public static boolean zip(VFSContainer container, OutputStream out, VFSItemFilter filter, boolean withMetadata) { try(ZipOutputStream zipOut = new ZipOutputStream(new BufferedOutputStream(out, FileUtils.BSIZE))) { List<VFSItem> items=container.getItems(new VFSSystemItemFilter()); for(VFSItem item:items) { addToZip(item, "", zipOut, filter, withMetadata); } return true; } catch(IOException e) { handleIOException("", e); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: zip File: src/main/java/org/olat/core/util/ZipUtil.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
zip
src/main/java/org/olat/core/util/ZipUtil.java
5668a41ab3f1753102a89757be013487544279d5
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(USE_FINGERPRINT) public List<Fingerprint> getEnrolledFingerprints() { return getEnrolledFingerprints(UserHandle.myUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnrolledFingerprints File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
getEnrolledFingerprints
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public static NativeObject jsFunction_checkIfSubscriberRoleAttached(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws APIManagementException, AxisFault { String userName = (String) args[0]; Boolean valid; NativeObject row = new NativeObject(); if (userName != null) { APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration(); String serverURL = config.getFirstProperty(APIConstants.AUTH_MANAGER_URL); UserAdminStub userAdminStub = new UserAdminStub(null, serverURL + "UserAdmin"); String adminUsername = config.getFirstProperty(APIConstants.AUTH_MANAGER_USERNAME); String adminPassword = config.getFirstProperty(APIConstants.AUTH_MANAGER_PASSWORD); CarbonUtils.setBasicAccessSecurityHeaders(adminUsername, adminPassword, userAdminStub._getServiceClient()); String tenantDomain = MultitenantUtils.getTenantDomain(APIUtil.replaceEmailDomainBack(userName)); UserRegistrationConfigDTO signupConfig = SelfSignUpUtil.getSignupConfiguration(tenantDomain); //add user storage info userName = SelfSignUpUtil.getDomainSpecificUserName(userName, signupConfig ); try { valid = APIUtil.checkPermissionQuietly(userName, APIConstants.Permissions.API_SUBSCRIBE); if (valid) { row.put("error", row, false); return row; } } catch (Exception e) { handleException(e.getMessage(), e); row.put("error", row, true); row.put("message", row, "Error while checking if " + userName + " has subscriber role."); return row; } row.put("error", row, true); row.put("message", row, "User does not have subscriber role."); return row; } else { row.put("error", row, true); row.put("message", row, "Please provide a valid username"); return row; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_checkIfSubscriberRoleAttached File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_checkIfSubscriberRoleAttached
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
private void handleNotifyProviderChanged(Host host, IAppWidgetHost callbacks, int appWidgetId, AppWidgetProviderInfo info) { try { callbacks.providerChanged(appWidgetId, info); } catch (RemoteException re) { synchronized (mLock){ Slog.e(TAG, "Widget host dead: " + host.id, re); host.callbacks = null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleNotifyProviderChanged 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
handleNotifyProviderChanged
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public AwTestContainerView createAwTestContainerView(AwTestRunnerActivity activity, boolean allowHardwareAcceleration) { return new AwTestContainerView(activity, allowHardwareAcceleration); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAwTestContainerView File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5155
MEDIUM
4.3
chromium
createAwTestContainerView
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
0