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 powerLongPress() { final int behavior = getResolvedLongPressOnPowerBehavior(); switch (behavior) { case LONG_PRESS_POWER_NOTHING: break; case LONG_PRESS_POWER_GLOBAL_ACTIONS: mPowerKeyHandled = true; if (!performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false)) { performAuditoryFeedbackForAccessibilityIfNeed(); } showGlobalActionsInternal(); break; case LONG_PRESS_POWER_SHUT_OFF: case LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM: mPowerKeyHandled = true; performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false); sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS); mWindowManagerFuncs.shutdown(behavior == LONG_PRESS_POWER_SHUT_OFF); break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: powerLongPress File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
powerLongPress
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public BootstrapUrlPredicate getBootstrapUrlPredicate() { if (bootstrapUrlPredicate == null) { bootstrapUrlPredicate = request -> true; } return bootstrapUrlPredicate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBootstrapUrlPredicate File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
getBootstrapUrlPredicate
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
@Override public Object listenSocket(int port) { return new SocketImpl().listen(port); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listenSocket 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
listenSocket
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override protected Bitmap doInBackground(Message... params) { if (isCancelled()) { return null; } message = params[0]; try { XmppActivity activity = this.activity.get(); if (activity != null && activity.xmppConnectionService != null) { return activity.xmppConnectionService.getFileBackend().getThumbnail(message, (int) (activity.metrics.density * 288), false); } else { return null; } } catch (IOException e) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doInBackground File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
doInBackground
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
void commitVisibility(boolean visible, boolean performLayout, boolean fromTransition) { // Reset the state of mVisibleSetFromTransferredStartingWindow since visibility is actually // been set by the app now. mVisibleSetFromTransferredStartingWindow = false; if (visible == isVisible()) { return; } final int windowsCount = mChildren.size(); for (int i = 0; i < windowsCount; i++) { mChildren.get(i).onAppVisibilityChanged(visible, isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION)); } setVisible(visible); setVisibleRequested(visible); if (!visible) { stopFreezingScreen(true, true); } else { // If we are being set visible, and the starting window is not yet displayed, // then make sure it doesn't get displayed. if (mStartingWindow != null && !mStartingWindow.isDrawn() && (firstWindowDrawn || allDrawn)) { mStartingWindow.clearPolicyVisibilityFlag(LEGACY_POLICY_VISIBILITY); mStartingWindow.mLegacyPolicyVisibilityAfterAnim = false; } // We are becoming visible, so better freeze the screen with the windows that are // getting visible so we also wait for them. forAllWindows(mWmService::makeWindowFreezingScreenIfNeededLocked, true); } // dispatchTaskInfoChangedIfNeeded() right after ActivityRecord#setVisibility() can report // the stale visible state, because the state will be updated after the app transition. // So tries to report the actual visible state again where the state is changed. Task task = getOrganizedTask(); while (task != null) { task.dispatchTaskInfoChangedIfNeeded(false /* force */); task = task.getParent().asTask(); } ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "commitVisibility: %s: visible=%b mVisibleRequested=%b", this, isVisible(), mVisibleRequested); final DisplayContent displayContent = getDisplayContent(); displayContent.getInputMonitor().setUpdateInputWindowsNeededLw(); if (performLayout) { mWmService.updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES, false /*updateInputWindows*/); mWmService.mWindowPlacerLocked.performSurfacePlacement(); } displayContent.getInputMonitor().updateInputWindowsLw(false /*force*/); mUseTransferredAnimation = false; postApplyAnimation(visible, fromTransition); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: commitVisibility 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
commitVisibility
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public void setFallbackMulticastFilter(boolean enabled) { sendMessage(CMD_SET_FALLBACK_PACKET_FILTERING, enabled); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFallbackMulticastFilter File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
setFallbackMulticastFilter
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void onWikiAttachment(String name, InputStream content, Long size, FilterEventParameters parameters) throws FilterException { endAttachment(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onWikiAttachment File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/filter/output/XWikiDocumentOutputFilterStream.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
onWikiAttachment
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/filter/output/XWikiDocumentOutputFilterStream.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
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 { int uid = AppGlobals.getPackageManager() .getPackageUid(rec.key.packageName, 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 packges " + 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-284" ]
CVE-2015-3833
MEDIUM
4.3
android
cancelIntentSender
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mLock") long getLastResetTimeLocked() { updateTimesLocked(); return mRawLastResetTime.get(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastResetTimeLocked 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
getLastResetTimeLocked
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public KBTemplate findByUuid_First(String uuid, OrderByComparator<KBTemplate> orderByComparator) throws NoSuchTemplateException { KBTemplate kbTemplate = fetchByUuid_First(uuid, orderByComparator); if (kbTemplate != null) { return kbTemplate; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("uuid="); msg.append(uuid); msg.append(StringPool.CLOSE_CURLY_BRACE); throw new NoSuchTemplateException(msg.toString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findByUuid_First 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
findByUuid_First
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
public Form<T> bindFromRequestData( Lang lang, TypedMap attrs, Map<String, String[]> requestData, String... allowedFields) { return bindFromRequestData(lang, attrs, requestData, Collections.emptyMap(), allowedFields); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindFromRequestData File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
bindFromRequestData
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
private void sendVerificationRequest(int userId, int verificationId, IntentFilterVerificationState ivs) { Intent verificationIntent = new Intent(Intent.ACTION_INTENT_FILTER_NEEDS_VERIFICATION); verificationIntent.putExtra( PackageManager.EXTRA_INTENT_FILTER_VERIFICATION_ID, verificationId); verificationIntent.putExtra( PackageManager.EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME, getDefaultScheme()); verificationIntent.putExtra( PackageManager.EXTRA_INTENT_FILTER_VERIFICATION_HOSTS, ivs.getHostsString()); verificationIntent.putExtra( PackageManager.EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME, ivs.getPackageName()); verificationIntent.setComponent(mIntentFilterVerifierComponent); verificationIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); UserHandle user = new UserHandle(userId); mContext.sendBroadcastAsUser(verificationIntent, user); if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Sending IntentFilter verification broadcast"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendVerificationRequest File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
sendVerificationRequest
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void sslConfigXmlGenerator(XmlGenerator gen, SSLConfig ssl) { if (ssl != null) { ssl = new SSLConfig(ssl); String factoryClassName = classNameOrImplClass(ssl.getFactoryClassName(), ssl.getFactoryImplementation()); if (factoryClassName != null) { ssl.setFactoryClassName(factoryClassName); } Properties props = ssl.getProperties(); if (maskSensitiveFields && props.containsKey("trustStorePassword")) { props.setProperty("trustStorePassword", MASK_FOR_SENSITIVE_DATA); } if (maskSensitiveFields && props.containsKey("keyStorePassword")) { props.setProperty("keyStorePassword", MASK_FOR_SENSITIVE_DATA); } } factoryWithPropertiesXmlGenerator(gen, "ssl", ssl); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sslConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-522" ]
CVE-2023-33264
MEDIUM
4.3
hazelcast
sslConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
public static void init() throws Exception { variantList.clear(); variant = null; errorMsg = ""; Download.init(); if (!Input.idStr.isEmpty()) { initVariant(); } else { initVariantList(); Download.generateFile(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: src/main/java/model/Output.java Repository: nickzren/alsdb The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15021
MEDIUM
5.2
nickzren/alsdb
init
src/main/java/model/Output.java
cbc79a68145e845f951113d184b4de207c341599
0
Analyze the following code function for security vulnerabilities
private String removeSpaces(final String content) { StringBuffer sb = null; for (int i=content.length()-1; i>=0; --i) { if (Character.isWhitespace(content.charAt(i))) { if (sb == null) { sb = new StringBuffer(content); } sb.deleteCharAt(i); } } return (sb == null) ? content : sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeSpaces File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
removeSpaces
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@Override protected String redirectAfterCreateItem(StaplerRequest req, TopLevelItem result) throws IOException { String redirect = result.getUrl()+"configure"; List<Ancestor> ancestors = req.getAncestors(); for (int i = ancestors.size() - 1; i >= 0; i--) { Object o = ancestors.get(i).getObject(); if (o instanceof View) { redirect = req.getContextPath() + '/' + ((View)o).getUrl() + redirect; break; } } return redirect; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: redirectAfterCreateItem 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
redirectAfterCreateItem
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
protected final long vtableOffset(Object receiver) { /*[IF]*/ /* Must be 'referenceClass' rather than 'type().parameterType(0)' or * 'defc' so that the itable index matches the defining interface at * handle creation time, otherwise handles on interfaces methods defined * in parent interfaces will crash */ /*[ENDIF]*/ Class<?> interfaceClass = referenceClass; if (interfaceClass.isInstance(receiver)) { long interfaceJ9Class = getJ9ClassFromClass(interfaceClass); long receiverJ9Class = getJ9ClassFromClass(receiver.getClass()); return convertITableIndexToVTableIndex(interfaceJ9Class, (int)vmSlot, receiverJ9Class) << VTABLE_ENTRY_SHIFT; } else { throw new IncompatibleClassChangeError(); } }
Vulnerability Classification: - CWE: CWE-440, CWE-250 - CVE: CVE-2021-41035 - Severity: HIGH - CVSS Score: 7.5 Description: Throw IAE when an InterfaceHandle thunk finds a non-public method The interface dispatch implemented by InterfaceHandle is supposed to throw IllegalAccessError (IAE) when the dispatched callee is not public, just like the dispatch performed by invokeinterface. Function: vtableOffset File: jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java Repository: eclipse-openj9/openj9 Fixed Code: protected final long vtableOffset(Object receiver) { /*[IF]*/ /* Must be 'referenceClass' rather than 'type().parameterType(0)' or * 'defc' so that the itable index matches the defining interface at * handle creation time, otherwise handles on interfaces methods defined * in parent interfaces will crash */ /*[ENDIF]*/ Class<?> interfaceClass = referenceClass; if (interfaceClass.isInstance(receiver)) { long interfaceJ9Class = getJ9ClassFromClass(interfaceClass); long receiverJ9Class = getJ9ClassFromClass(receiver.getClass()); int result = convertITableIndexToVTableIndex(interfaceJ9Class, (int)vmSlot, receiverJ9Class) << VTABLE_ENTRY_SHIFT; if (result < 0) { throw new IllegalAccessError(); } return result; } else { throw new IncompatibleClassChangeError(); } }
[ "CWE-440", "CWE-250" ]
CVE-2021-41035
HIGH
7.5
eclipse-openj9/openj9
vtableOffset
jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java
c6e0d9296ff9a3084965d83e207403de373c0bad
1
Analyze the following code function for security vulnerabilities
@Test public void getNewInstance(TestContext context) { Async async = context.async(); PostgresClient c1 = PostgresClient.getInstance(vertx); c1.closeClient(a -> { assertSuccess(context, a); PostgresClient c2 = PostgresClient.getInstance(vertx); context.assertNotEquals(c1, c2, "different instance"); c2.closeClient(context.asyncAssertSuccess()); async.complete(); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNewInstance File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
getNewInstance
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public boolean setScale(float scale, boolean animate) { final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getInstance().getConnection( mService.mConnectionId); if (connection != null) { try { return connection.setMagnificationScaleAndCenter( scale, Float.NaN, Float.NaN, animate); } catch (RemoteException re) { Log.w(LOG_TAG, "Failed to set scale", re); re.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setScale File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
setScale
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
public static int defaultConnectionTimeOutInMs() { return Integer.getInteger(ASYNC_CLIENT + "connectionTimeoutInMs", 60 * 1000); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultConnectionTimeOutInMs 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
defaultConnectionTimeOutInMs
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
public String displayForm(DocumentReference classReference, XWikiContext context) { List<BaseObject> objects = getXObjects(classReference); if (objects == null) { return ""; } BaseObject firstobject = null; Iterator<BaseObject> foit = objects.iterator(); while ((firstobject == null) && foit.hasNext()) { firstobject = foit.next(); } if (firstobject == null) { return ""; } BaseClass bclass = firstobject.getXClass(context); if (bclass.getPropertyList().size() == 0) { return ""; } StringBuilder result = new StringBuilder(); result.append("{table}\n"); boolean first = true; for (String propertyName : bclass.getPropertyList()) { if (first == true) { first = false; } else { result.append("|"); } PropertyClass pclass = (PropertyClass) bclass.getField(propertyName); result.append(pclass.getPrettyName()); } result.append("\n"); for (int i = 0; i < objects.size(); i++) { BaseObject object = objects.get(i); if (object != null) { first = true; for (String propertyName : bclass.getPropertyList()) { if (first == true) { first = false; } else { result.append("|"); } String data = display(propertyName, object, context); data = data.trim(); data = data.replaceAll("\n", " "); if (data.length() == 0) { result.append("&nbsp;"); } else { result.append(data); } } result.append("\n"); } } result.append("{table}\n"); return result.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayForm 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
displayForm
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public static void copyBinaryResource(String respathin, File dest) throws FileNotFoundException, IOException { String respath = respathin; if (dest.exists()) { // E.info("destination file already exists - not copying " + dest); return; } // E.info("installing " + dest); if (respath.startsWith(rootPath)) { respath = respath.substring(rootPath.length()+1,respath.length()); } extractRelativeResource(rootClass, respath, dest); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyBinaryResource File: src/main/java/org/lemsml/jlems/io/util/JUtil.java Repository: LEMS/jLEMS The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-4583
HIGH
8.8
LEMS/jLEMS
copyBinaryResource
src/main/java/org/lemsml/jlems/io/util/JUtil.java
8c224637d7d561076364a9e3c2c375daeaf463dc
0
Analyze the following code function for security vulnerabilities
public @NonNull List<SplitPermissionInfo> getSplitPermissions() { if (mSplitPermissionInfos != null) { return mSplitPermissionInfos; } List<SplitPermissionInfoParcelable> parcelableList; try { parcelableList = ActivityThread.getPermissionManager().getSplitPermissions(); } catch (RemoteException e) { Slog.e(LOG_TAG, "Error getting split permissions", e); return Collections.emptyList(); } mSplitPermissionInfos = splitPermissionInfoListToNonParcelableList(parcelableList); return mSplitPermissionInfos; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSplitPermissions File: core/java/android/permission/PermissionManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
getSplitPermissions
core/java/android/permission/PermissionManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
private void dispatchUidsChangedForObserver(IUidObserver observer, UidObserverRegistration reg, int changesSize) { if (observer == null) { return; } try { for (int j = 0; j < changesSize; j++) { UidRecord.ChangeItem item = mActiveUidChanges[j]; final int change = item.change; if (change == UidRecord.CHANGE_PROCSTATE && (reg.which & ActivityManager.UID_OBSERVER_PROCSTATE) == 0) { // No-op common case: no significant change, the observer is not // interested in all proc state changes. continue; } final long start = SystemClock.uptimeMillis(); if ((change & UidRecord.CHANGE_IDLE) != 0) { if ((reg.which & ActivityManager.UID_OBSERVER_IDLE) != 0) { if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "UID idle uid=" + item.uid); observer.onUidIdle(item.uid, item.ephemeral); } } else if ((change & UidRecord.CHANGE_ACTIVE) != 0) { if ((reg.which & ActivityManager.UID_OBSERVER_ACTIVE) != 0) { if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "UID active uid=" + item.uid); observer.onUidActive(item.uid); } } if ((reg.which & ActivityManager.UID_OBSERVER_CACHED) != 0) { if ((change & UidRecord.CHANGE_CACHED) != 0) { if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "UID cached uid=" + item.uid); observer.onUidCachedChanged(item.uid, true); } else if ((change & UidRecord.CHANGE_UNCACHED) != 0) { if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "UID active uid=" + item.uid); observer.onUidCachedChanged(item.uid, false); } } if ((change & UidRecord.CHANGE_GONE) != 0) { if ((reg.which & ActivityManager.UID_OBSERVER_GONE) != 0) { if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "UID gone uid=" + item.uid); observer.onUidGone(item.uid, item.ephemeral); } if (reg.lastProcStates != null) { reg.lastProcStates.delete(item.uid); } } else { if ((reg.which & ActivityManager.UID_OBSERVER_PROCSTATE) != 0) { if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "UID CHANGED uid=" + item.uid + ": " + item.processState); boolean doReport = true; if (reg.cutpoint >= ActivityManager.MIN_PROCESS_STATE) { final int lastState = reg.lastProcStates.get(item.uid, ActivityManager.PROCESS_STATE_UNKNOWN); if (lastState != ActivityManager.PROCESS_STATE_UNKNOWN) { final boolean lastAboveCut = lastState <= reg.cutpoint; final boolean newAboveCut = item.processState <= reg.cutpoint; doReport = lastAboveCut != newAboveCut; } else { doReport = item.processState != ActivityManager.PROCESS_STATE_NONEXISTENT; } } if (doReport) { if (reg.lastProcStates != null) { reg.lastProcStates.put(item.uid, item.processState); } observer.onUidStateChanged(item.uid, item.processState, item.procStateSeq); } } } final int duration = (int) (SystemClock.uptimeMillis() - start); if (reg.mMaxDispatchTime < duration) { reg.mMaxDispatchTime = duration; } if (duration >= SLOW_UID_OBSERVER_THRESHOLD_MS) { reg.mSlowDispatchCount++; } } } catch (RemoteException e) { } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchUidsChangedForObserver 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
dispatchUidsChangedForObserver
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public synchronized void updateNull(String columnName) throws SQLException { updateNull(findColumn(columnName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNull File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateNull
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public Pattern getBlacklistPattern() { return blacklistPattern; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBlacklistPattern File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getBlacklistPattern
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
@Override public Locale getLocale() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocale File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getLocale
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
private static Bundle initializeAttachmentFds(final Context context, final List<Attachment> attachments) { if (attachments == null || attachments.size() == 0) { return null; } final Bundle result = new Bundle(attachments.size()); final ContentResolver resolver = context.getContentResolver(); for (Attachment attachment : attachments) { if (attachment == null || Utils.isEmpty(attachment.contentUri)) { continue; } ParcelFileDescriptor fileDescriptor; try { fileDescriptor = resolver.openFileDescriptor(attachment.contentUri, "r"); } catch (FileNotFoundException e) { LogUtils.e(LOG_TAG, e, "Exception attempting to open attachment"); fileDescriptor = null; } catch (SecurityException e) { // We have encountered a security exception when attempting to open the file // specified by the content uri. If the attachment has been cached, this // isn't a problem, as even through the original permission may have been // revoked, we have cached the file. This will happen when saving/sending // a previously saved draft. // TODO(markwei): Expose whether the attachment has been cached through the // attachment object. This would allow us to limit when the log is made, as // if the attachment has been cached, this really isn't an error LogUtils.e(LOG_TAG, e, "Security Exception attempting to open attachment"); // Just set the file descriptor to null, as the underlying provider needs // to handle the file descriptor not being set. fileDescriptor = null; } if (fileDescriptor != null) { result.putParcelable(attachment.contentUri.toString(), fileDescriptor); } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeAttachmentFds File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
initializeAttachmentFds
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private void migrate49(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Projects.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { Element buildSettingElement = element.element("buildSetting"); buildSettingElement.addElement("defaultFixedIssueFilters"); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate49 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
migrate49
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public String getPageUrlByType(String pageType) throws IndexUnreachableException { StringBuilder sbUrl = new StringBuilder(); sbUrl.append(BeanUtils.getServletPathWithHostAsUrlFromJsfContext()) .append('/') .append(PageType.getByName(pageType).getName()) .append('/') .append(getPersistentIdentifier()) .append('/'); return sbUrl.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageUrlByType File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
getPageUrlByType
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
public void setLockScreenShown(boolean shown) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLockScreenShown File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setLockScreenShown
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public void buildingBuildInstance(Stage stage) { if (!stage.getJobInstances().isEmpty()) { JobInstance jobInstance = stage.getJobInstances().get(0); jobInstance.setAgentUuid(AGENT_UUID); jobInstance.changeState(JobState.Building); jobInstanceDao.updateAssignedInfo(jobInstance); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildingBuildInstance File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
buildingBuildInstance
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
private int readEncryptedData(final ByteBuffer dst, final int pending) { final int bioRead; if (dst.isDirect() && dst.remaining() >= pending) { final int pos = dst.position(); final long addr = Buffer.address(dst) + pos; bioRead = SSL.readFromBIO(networkBIO, addr, pending); if (bioRead > 0) { dst.position(pos + bioRead); return bioRead; } } else { final ByteBuf buf = alloc.directBuffer(pending); try { final long addr = memoryAddress(buf); bioRead = SSL.readFromBIO(networkBIO, addr, pending); if (bioRead > 0) { int oldLimit = dst.limit(); dst.limit(dst.position() + bioRead); buf.getBytes(0, dst); dst.limit(oldLimit); return bioRead; } } finally { buf.release(); } } return bioRead; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readEncryptedData File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
readEncryptedData
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
@Override public SaReactorFilter setAuth(SaFilterAuthStrategy auth) { this.auth = auth; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAuth File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
setAuth
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
@CalledByNative public void onLoadStarted() { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLoadStarted File: components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
onLoadStarted
components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public ServerBuilder port(int port, SessionProtocol... protocols) { return port(new ServerPort(port, protocols)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: port File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
port
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
default Document parseXmlSafely(final int contentLength, final Reader reader) throws WebdavException { if (contentLength == 0) { return null; } if (reader == null) { // No content? return null; } try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(false); factory.setFeature("http://javax.xml.XMLConstants/feature/secure-processing", true); factory.setFeature("http://xml.org/sax/features/external-general-entities", false); factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); factory.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(reader)); } catch (SAXException exception) { throw new WebdavBadRequest(exception.getMessage()); } catch (Throwable t) { throw new WebdavException(t); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-20000 - Severity: MEDIUM - CVSS Score: 5.0 Description: format: follow the repo code style, and welcome mvnvm props to manage maven versions Function: parseXmlSafely File: src/main/java/org/bedework/webdav/servlet/common/SecureXml.java Repository: Bedework/bw-webdav Fixed Code: default Document parseXmlSafely(final int contentLength, final Reader reader) throws WebdavException { if (contentLength == 0) { return null; } if (reader == null) { // No content? return null; } try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(false); factory.setFeature("http://javax.xml.XMLConstants/feature/secure-processing", true); factory.setFeature("http://xml.org/sax/features/external-general-entities", false); factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); factory.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(reader)); } catch (SAXException exception) { throw new WebdavBadRequest(exception.getMessage()); } catch (Throwable t) { throw new WebdavException(t); } }
[ "CWE-611" ]
CVE-2018-20000
MEDIUM
5
Bedework/bw-webdav
parseXmlSafely
src/main/java/org/bedework/webdav/servlet/common/SecureXml.java
0ce2007b3515a23b5f287ef521300bcb1f748edc
1
Analyze the following code function for security vulnerabilities
boolean isAlive() { return mClient.asBinder().isBinderAlive(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAlive File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
isAlive
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
boolean isResolverOrDelegateActivity() { return isResolverActivity(mActivityComponent.getClassName()) || Objects.equals( mActivityComponent, mAtmService.mTaskSupervisor.getSystemChooserActivity()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isResolverOrDelegateActivity 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
isResolverOrDelegateActivity
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void setElements(int elements) { this.elements = elements; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setElements 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
setElements
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public void unregisterUidObserver(IUidObserver observer) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterUidObserver File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
unregisterUidObserver
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public void switchToConversation(Conversation conversation) { switchToConversation(conversation, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchToConversation File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
switchToConversation
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void setLockTaskFeatures(ComponentName who, String callerPackageName, int flags) { // Throw if Overview is used without Home. boolean hasHome = (flags & LOCK_TASK_FEATURE_HOME) != 0; boolean hasOverview = (flags & LOCK_TASK_FEATURE_OVERVIEW) != 0; Preconditions.checkArgument(hasHome || !hasOverview, "Cannot use LOCK_TASK_FEATURE_OVERVIEW without LOCK_TASK_FEATURE_HOME"); boolean hasNotification = (flags & LOCK_TASK_FEATURE_NOTIFICATIONS) != 0; Preconditions.checkArgument(hasHome || !hasNotification, "Cannot use LOCK_TASK_FEATURE_NOTIFICATIONS without LOCK_TASK_FEATURE_HOME"); CallerIdentity caller; if (isPolicyEngineForFinanceFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); } final int userHandle = caller.getUserId(); synchronized (getLockObject()) { checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_LOCK_TASK_FEATURES); } if (isPolicyEngineForFinanceFlagEnabled()) { EnforcingAdmin enforcingAdmin; synchronized (getLockObject()) { enforcingAdmin = enforceCanCallLockTaskLocked(who, caller.getPackageName()); enforceCanSetLockTaskFeaturesOnFinancedDevice(caller, flags); } LockTaskPolicy currentPolicy = mDevicePolicyEngine.getLocalPolicySetByAdmin( PolicyDefinition.LOCK_TASK, enforcingAdmin, caller.getUserId()); LockTaskPolicy policy; if (currentPolicy == null) { policy = new LockTaskPolicy(flags); } else { policy = new LockTaskPolicy(currentPolicy); policy.setFlags(flags); } if (policy.getPackages().isEmpty() && policy.getFlags() == DevicePolicyManager.LOCK_TASK_FEATURE_NONE) { mDevicePolicyEngine.removeLocalPolicy( PolicyDefinition.LOCK_TASK, enforcingAdmin, caller.getUserId()); } else { mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.LOCK_TASK, enforcingAdmin, policy, caller.getUserId()); } } else { Objects.requireNonNull(who, "ComponentName is null"); synchronized (getLockObject()) { enforceCanCallLockTaskLocked(caller); enforceCanSetLockTaskFeaturesOnFinancedDevice(caller, flags); setLockTaskFeaturesLocked(userHandle, flags); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLockTaskFeatures 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
setLockTaskFeatures
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private ComponentName getIntentFilterVerifierComponentNameLPr() { final Intent verification = new Intent(Intent.ACTION_INTENT_FILTER_NEEDS_VERIFICATION); final List<ResolveInfo> receivers = queryIntentReceivers(verification, PACKAGE_MIME_TYPE, PackageManager.GET_DISABLED_COMPONENTS, 0 /* userId */); ComponentName verifierComponentName = null; int priority = -1000; final int N = receivers.size(); for (int i = 0; i < N; i++) { final ResolveInfo info = receivers.get(i); if (info.activityInfo == null) { continue; } final String packageName = info.activityInfo.packageName; final PackageSetting ps = mSettings.mPackages.get(packageName); if (ps == null) { continue; } if (checkPermission(android.Manifest.permission.INTENT_FILTER_VERIFICATION_AGENT, packageName, UserHandle.USER_OWNER) != PackageManager.PERMISSION_GRANTED) { continue; } // Select the IntentFilterVerifier with the highest priority if (priority < info.priority) { priority = info.priority; verifierComponentName = new ComponentName(packageName, info.activityInfo.name); if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Selecting IntentFilterVerifier: " + verifierComponentName + " with priority: " + info.priority); } } return verifierComponentName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntentFilterVerifierComponentNameLPr File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
getIntentFilterVerifierComponentNameLPr
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public static void abort(ActivityOptions options) { if (options != null) { options.abort(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: abort File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
abort
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
protected boolean shouldEnableAttachFromServiceMenu(Account mAccount) { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldEnableAttachFromServiceMenu File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
shouldEnableAttachFromServiceMenu
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@Override public final WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions, int userId) { enforceNotIsolatedCaller("startActivityAndWait"); userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, ALLOW_FULL_ONLY, "startActivityAndWait", null); WaitResult res = new WaitResult(); // TODO: Switch to user app stacks here. mActivityStarter.startActivityMayWait(caller, -1, callingPackage, intent, resolvedType, null, null, resultTo, resultWho, requestCode, startFlags, profilerInfo, res, null, bOptions, false, userId, null, null); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityAndWait File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
startActivityAndWait
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public void setIgnoreDuplicates(boolean ignoreDuplicates) { this.ignoreDuplicates = ignoreDuplicates; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIgnoreDuplicates File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java Repository: quartz-scheduler/quartz The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-13990
HIGH
7.5
quartz-scheduler/quartz
setIgnoreDuplicates
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
0
Analyze the following code function for security vulnerabilities
private int getStatusInt(final Presence presence) { return getStatus(presence).ordinal(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatusInt File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
getStatusInt
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public String getRedirectUrl(String domain) { return "https://" + domain + REDIRECT_PATH; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRedirectUrl File: src/main/java/com/mxgraph/online/AbsAuthServlet.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-601", "CWE-918" ]
CVE-2022-1767
MEDIUM
5
jgraph/drawio
getRedirectUrl
src/main/java/com/mxgraph/online/AbsAuthServlet.java
c63f3a04450f30798df47f9badbc74eb8a69fbdf
0
Analyze the following code function for security vulnerabilities
private ActivityManager.RecentTaskInfo createRecentTaskInfoFromTaskRecord(TaskRecord tr) { // Update the task description to reflect any changes in the task stack tr.updateTaskDescription(); // Compose the recent task info ActivityManager.RecentTaskInfo rti = new ActivityManager.RecentTaskInfo(); rti.id = tr.getTopActivity() == null ? INVALID_TASK_ID : tr.taskId; rti.persistentId = tr.taskId; rti.baseIntent = new Intent(tr.getBaseIntent()); rti.origActivity = tr.origActivity; rti.description = tr.lastDescription; rti.stackId = tr.stack != null ? tr.stack.mStackId : -1; rti.userId = tr.userId; rti.taskDescription = new ActivityManager.TaskDescription(tr.lastTaskDescription); rti.firstActiveTime = tr.firstActiveTime; rti.lastActiveTime = tr.lastActiveTime; rti.affiliatedTaskId = tr.mAffiliatedTaskId; rti.affiliatedTaskColor = tr.mAffiliatedTaskColor; rti.numActivities = 0; ActivityRecord base = null; ActivityRecord top = null; ActivityRecord tmp; for (int i = tr.mActivities.size() - 1; i >= 0; --i) { tmp = tr.mActivities.get(i); if (tmp.finishing) { continue; } base = tmp; if (top == null || (top.state == ActivityState.INITIALIZING)) { top = base; } rti.numActivities++; } rti.baseActivity = (base != null) ? base.intent.getComponent() : null; rti.topActivity = (top != null) ? top.intent.getComponent() : null; return rti; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRecentTaskInfoFromTaskRecord 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
createRecentTaskInfoFromTaskRecord
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public boolean startInstrumentation(ComponentName className, String profileFile, int flags, Bundle arguments, IInstrumentationWatcher watcher, IUiAutomationConnection uiAutomationConnection, int userId, String abiOverride) { enforceNotIsolatedCaller("startInstrumentation"); userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, ALLOW_FULL_ONLY, "startInstrumentation", null); // Refuse possible leaked file descriptors if (arguments != null && arguments.hasFileDescriptors()) { throw new IllegalArgumentException("File descriptors passed in Bundle"); } synchronized(this) { InstrumentationInfo ii = null; ApplicationInfo ai = null; try { ii = mContext.getPackageManager().getInstrumentationInfo( className, STOCK_PM_FLAGS); ai = AppGlobals.getPackageManager().getApplicationInfo( ii.targetPackage, STOCK_PM_FLAGS, userId); } catch (PackageManager.NameNotFoundException e) { } catch (RemoteException e) { } if (ii == null) { reportStartInstrumentationFailure(watcher, className, "Unable to find instrumentation info for: " + className); return false; } if (ai == null) { reportStartInstrumentationFailure(watcher, className, "Unable to find instrumentation target package: " + ii.targetPackage); return false; } int match = mContext.getPackageManager().checkSignatures( ii.targetPackage, ii.packageName); if (match < 0 && match != PackageManager.SIGNATURE_FIRST_NOT_SIGNED) { String msg = "Permission Denial: starting instrumentation " + className + " from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingPid() + " not allowed because package " + ii.packageName + " does not have a signature matching the target " + ii.targetPackage; reportStartInstrumentationFailure(watcher, className, msg); throw new SecurityException(msg); } final long origId = Binder.clearCallingIdentity(); // Instrumentation can kill and relaunch even persistent processes forceStopPackageLocked(ii.targetPackage, -1, true, false, true, true, false, userId, "start instr"); ProcessRecord app = addAppLocked(ai, false, abiOverride); app.instrumentationClass = className; app.instrumentationInfo = ai; app.instrumentationProfileFile = profileFile; app.instrumentationArguments = arguments; app.instrumentationWatcher = watcher; app.instrumentationUiAutomationConnection = uiAutomationConnection; app.instrumentationResultClass = className; Binder.restoreCallingIdentity(origId); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startInstrumentation 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
startInstrumentation
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@RequestMapping("zip") @Csrf public String doZip(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, String path, HttpServletRequest request, ModelMap model) { if (CommonUtils.notEmpty(path)) { String filepath = siteComponent.getWebFilePath(site.getId(), path); if (CmsFileUtils.isDirectory(filepath)) { try { String zipFileName = null; if (path.endsWith("/") || path.endsWith("\\")) { zipFileName = CommonUtils.joinString(filepath, "files.zip"); } else { zipFileName = CommonUtils.joinString(filepath, ".zip"); } ZipUtils.zip(filepath, zipFileName); } catch (IOException e) { model.addAttribute(CommonConstants.ERROR, e.getMessage()); log.error(e.getMessage(), e); } } logOperateService .save(new LogOperate(site.getId(), admin.getId(), admin.getDeptId(), LogLoginService.CHANNEL_WEB_MANAGER, "zip.web.webfile", RequestUtils.getIpAddress(request), CommonUtils.getDate(), path)); } return CommonConstants.TEMPLATE_DONE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doZip File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/cms/CmsWebFileAdminController.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-51252
MEDIUM
5.4
sanluan/PublicCMS
doZip
publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/cms/CmsWebFileAdminController.java
2459a3f92c680ae011a369f32306c17df07caaa0
0
Analyze the following code function for security vulnerabilities
public void setTurningOn(boolean isTurningOn) { mIsTurningOn = isTurningOn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTurningOn File: src/com/android/bluetooth/btservice/AdapterState.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
setTurningOn
src/com/android/bluetooth/btservice/AdapterState.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public static boolean validateNetworkSpecifier(WifiNetworkSpecifier specifier) { if (!isValidNetworkSpecifier(specifier)) { Log.e(TAG, "validateNetworkSpecifier failed : invalid network specifier"); return false; } if (isMatchNoneNetworkSpecifier(specifier)) { Log.e(TAG, "validateNetworkSpecifier failed : match-none specifier"); return false; } if (isMatchAllNetworkSpecifier(specifier)) { Log.e(TAG, "validateNetworkSpecifier failed : match-all specifier"); return false; } if (!WifiNetworkSpecifier.validateBand(getBand(specifier))) { return false; } WifiConfiguration config = specifier.wifiConfiguration; if (specifier.ssidPatternMatcher.getType() == PatternMatcher.PATTERN_LITERAL) { // For literal SSID matches, the value should satisfy SSID requirements. // WifiConfiguration.SSID needs quotes around ASCII SSID. if (!validateSsid(addEnclosingQuotes(specifier.ssidPatternMatcher.getPath()), true)) { return false; } } else { if (config.hiddenSSID) { Log.e(TAG, "validateNetworkSpecifier failed : ssid pattern not supported " + "for hidden networks"); return false; } } if (Objects.equals(specifier.bssidPatternMatcher.second, MacAddress.BROADCAST_ADDRESS)) { // For literal BSSID matches, the value should satisfy MAC address requirements. if (!validateBssid(specifier.bssidPatternMatcher.first)) { return false; } } else { if (!validateBssidPattern(specifier.bssidPatternMatcher)) { return false; } } if (!validateBitSets(config)) { return false; } if (!validateKeyMgmt(config.allowedKeyManagement)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_PSK) && !validatePassword(config.preSharedKey, true, false)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_SAE) && !validatePassword(config.preSharedKey, true, true)) { return false; } // TBD: Validate some enterprise params as well in the future here. return true; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21252 - Severity: MEDIUM - CVSS Score: 5.5 Description: Update password check for WAPI Do not allow arbitrarily large passwords. Bug: 275339978 Test: compile (cherry picked from commit 38707fb4ff1405663cc24affc95244f4cc830499) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:36deae20de1a8905e6cc72764e449b2d6e469f9e) Merged-In: I15f3aff373af56c253a50c308d886a7acf661e59 Change-Id: I15f3aff373af56c253a50c308d886a7acf661e59 Function: validateNetworkSpecifier File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android Fixed Code: public static boolean validateNetworkSpecifier(WifiNetworkSpecifier specifier) { if (!isValidNetworkSpecifier(specifier)) { Log.e(TAG, "validateNetworkSpecifier failed : invalid network specifier"); return false; } if (isMatchNoneNetworkSpecifier(specifier)) { Log.e(TAG, "validateNetworkSpecifier failed : match-none specifier"); return false; } if (isMatchAllNetworkSpecifier(specifier)) { Log.e(TAG, "validateNetworkSpecifier failed : match-all specifier"); return false; } if (!WifiNetworkSpecifier.validateBand(getBand(specifier))) { return false; } WifiConfiguration config = specifier.wifiConfiguration; if (specifier.ssidPatternMatcher.getType() == PatternMatcher.PATTERN_LITERAL) { // For literal SSID matches, the value should satisfy SSID requirements. // WifiConfiguration.SSID needs quotes around ASCII SSID. if (!validateSsid(addEnclosingQuotes(specifier.ssidPatternMatcher.getPath()), true)) { return false; } } else { if (config.hiddenSSID) { Log.e(TAG, "validateNetworkSpecifier failed : ssid pattern not supported " + "for hidden networks"); return false; } } if (Objects.equals(specifier.bssidPatternMatcher.second, MacAddress.BROADCAST_ADDRESS)) { // For literal BSSID matches, the value should satisfy MAC address requirements. if (!validateBssid(specifier.bssidPatternMatcher.first)) { return false; } } else { if (!validateBssidPattern(specifier.bssidPatternMatcher)) { return false; } } if (!validateBitSets(config)) { return false; } if (!validateKeyMgmt(config.allowedKeyManagement)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_PSK) && !validatePassword(config.preSharedKey, true, false, false)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_SAE) && !validatePassword(config.preSharedKey, true, true, false)) { return false; } // TBD: Validate some enterprise params as well in the future here. return true; }
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
validateNetworkSpecifier
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
1
Analyze the following code function for security vulnerabilities
private boolean isDraftDirty() { synchronized (mDraftLock) { // The message should only be saved if: // It hasn't been sent AND // Some text has been added to the message OR // an attachment has been added or removed // AND there is actually something in the draft to save. return (mTextChanged || mAttachmentsChanged || mReplyFromChanged) && !isBlank(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDraftDirty File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
isDraftDirty
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public Object unmarshal(HierarchicalStreamReader reader, Object root, DataHolder dataHolder) { try { return marshallingStrategy.unmarshal(root, reader, dataHolder, converterLookup, mapper); } catch (ConversionException e) { Package pkg = getClass().getPackage(); String version = pkg != null ? pkg.getImplementationVersion() : null; e.add("version", version != null ? version : "not available"); throw e; } }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2021-43859 - Severity: MEDIUM - CVSS Score: 5.0 Description: Describe and fix CVE-2021-43859. Function: unmarshal File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream Fixed Code: public Object unmarshal(HierarchicalStreamReader reader, Object root, DataHolder dataHolder) { try { if (collectionUpdateLimit >= 0) { if (dataHolder == null) { dataHolder = new MapBackedDataHolder(); } dataHolder.put(COLLECTION_UPDATE_LIMIT, new Integer(collectionUpdateLimit)); dataHolder.put(COLLECTION_UPDATE_SECONDS, new Integer(0)); } return marshallingStrategy.unmarshal(root, reader, dataHolder, converterLookup, mapper); } catch (ConversionException e) { Package pkg = getClass().getPackage(); String version = pkg != null ? pkg.getImplementationVersion() : null; e.add("version", version != null ? version : "not available"); throw e; } }
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
unmarshal
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
1
Analyze the following code function for security vulnerabilities
@Override public int available() throws IOException { if (uncompressedCursor < uncompressedLimit) { return uncompressedLimit - uncompressedCursor; } else { if (hasNextChunk()) { return uncompressedLimit - uncompressedCursor; } else { return 0; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: available File: src/main/java/org/xerial/snappy/SnappyInputStream.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-34455
HIGH
7.5
xerial/snappy-java
available
src/main/java/org/xerial/snappy/SnappyInputStream.java
3bf67857fcf70d9eea56eed4af7c925671e8eaea
0
Analyze the following code function for security vulnerabilities
public IntentBuilder setProfileToUnify(int profileId, LockscreenCredential credential) { mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_ID, profileId); mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_CREDENTIAL, credential); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProfileToUnify File: src/com/android/settings/password/ChooseLockPattern.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
setProfileToUnify
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
protected DataSource createDataSource() throws SQLException { InitialContext context = null; DataSource source = null; try { context = GeoTools.getInitialContext(); source = (DataSource) context.lookup(datasourceName); } catch (IllegalArgumentException | NoInitialContextException exception) { // Fall back on 'return null' below. } catch (NamingException exception) { registerInto = context; // Fall back on 'return null' below. } return source; }
Vulnerability Classification: - CWE: CWE-917 - CVE: CVE-2022-24818 - Severity: HIGH - CVSS Score: 7.5 Description: [GEOT-7115] Streamline JNDI lookups Function: createDataSource File: modules/library/referencing/src/main/java/org/geotools/referencing/factory/epsg/ThreadedEpsgFactory.java Repository: geotools Fixed Code: protected DataSource createDataSource() throws SQLException { DataSource source = null; try { source = (DataSource) GeoTools.jndiLookup(datasourceName); } catch (IllegalArgumentException | NamingException exception) { // Fall back on 'return null' below. } return source; }
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
createDataSource
modules/library/referencing/src/main/java/org/geotools/referencing/factory/epsg/ThreadedEpsgFactory.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
1
Analyze the following code function for security vulnerabilities
@Override public void shutdown() { // Don't call super.shutdown(), which emits a warning... }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shutdown File: provider_src/com/android/email/provider/AttachmentProvider.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3918
MEDIUM
4.3
android
shutdown
provider_src/com/android/email/provider/AttachmentProvider.java
6b2b0bd7c771c698f11d7be89c2c57c8722c7454
0
Analyze the following code function for security vulnerabilities
public void testRead(File tgtDirPath) throws Exception { List<SsurgeonPattern> patterns = readFromDirectory(tgtDirPath); System.out.println("Patterns, num = "+patterns.size()); int num = 1; for (SsurgeonPattern pattern : patterns) { System.out.println("\n# "+(num++)); System.out.println(pattern); } System.out.println("\n\nRESOURCES "); for (SsurgeonWordlist rsrc : inst().getResources()) { System.out.println(rsrc+"* * * * *"); } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); boolean runFlag = true; Ssurgeon.inst().initLog(new File("./ssurgeon_run.log")); while (runFlag) { try { System.out.println("Enter a sentence:"); String line = in.readLine(); if (line.isEmpty()) { System.exit(0); } System.out.println("Parsing..."); SemanticGraph sg = SemanticGraph.valueOf(line); System.out.println("Graph = "+sg); Collection<SemanticGraph> generated = Ssurgeon.inst().exhaustFromPatterns(patterns, sg); System.out.println("# generated = "+generated.size()); int index = 1; for (SemanticGraph gsg : generated) { System.out.println("\n# "+index); System.out.println(gsg); index++; } } catch (Exception e) { log.error(e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testRead File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
testRead
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
public static void main( String[] args ) { try { Properties env = System.getProperties(); String includeDbObjects = env.getProperty("includeDbObjects"); String excludeDbObjects = env.getProperty("excludeDbObjects"); String valuePatterns = env.getProperty("valuePatterns"); String valueReplacements = env.getProperty("valueReplacements"); copyDb( env.getProperty("jdbcDriverSource"), env.getProperty("usernameSource"), env.getProperty("passwordSource"), env.getProperty("jdbcUrlSource"), env.getProperty("jdbcDriverTarget"), env.getProperty("usernameTarget"), env.getProperty("passwordTarget"), env.getProperty("jdbcUrlTarget"), includeDbObjects == null ? Collections.<String>emptyList() : Arrays.asList(includeDbObjects.split(",")), excludeDbObjects == null ? Collections.<String>emptyList() : Arrays.asList(excludeDbObjects.split(",")), valuePatterns == null ? Collections.<String>emptyList() : Arrays.asList(valuePatterns.split(",")), valueReplacements == null ? Collections.<String>emptyList() : Arrays.asList(valueReplacements.split(",")), System.out ); } catch (Exception e) { new ServiceException(e).log(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: main File: core/src/main/java/org/opencrx/kernel/tools/CopyDb.java Repository: opencrx The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-25959
MEDIUM
4.3
opencrx
main
core/src/main/java/org/opencrx/kernel/tools/CopyDb.java
14e75f95e5f56fbe7ee897bdf5d858788072e818
0
Analyze the following code function for security vulnerabilities
void removePackageParticipantsLocked(String[] packageNames, int oldUid) { if (packageNames == null) { Slog.w(TAG, "removePackageParticipants with null list"); return; } if (MORE_DEBUG) Slog.v(TAG, "removePackageParticipantsLocked: uid=" + oldUid + " #" + packageNames.length); for (String pkg : packageNames) { // Known previous UID, so we know which package set to check HashSet<String> set = mBackupParticipants.get(oldUid); if (set != null && set.contains(pkg)) { removePackageFromSetLocked(set, pkg); if (set.isEmpty()) { if (MORE_DEBUG) Slog.v(TAG, " last one of this uid; purging set"); mBackupParticipants.remove(oldUid); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removePackageParticipantsLocked File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
removePackageParticipantsLocked
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
protected void scanCharacters(XMLStringBuffer buffer, int delimiter) throws IOException { if (DEBUG_BUFFER) { fCurrentEntity.debugBufferIfNeeded("(scanCharacters, delimiter="+delimiter+": "); } while (true) { int c = fCurrentEntity.read(); if (c == -1 || (c == '<' || c == '&')) { if (c != -1) { fCurrentEntity.rewind(); } break; } // Patch supplied by Jonathan Baxter else if (c == '\r' || c == '\n') { fCurrentEntity.rewind(); int newlines = skipNewlines(); for (int i = 0; i < newlines; i++) { buffer.append('\n'); } } else { appendChar(buffer, c); if (c == '\n') { fCurrentEntity.incLine(); } } } if (fStyle) { if (fStyleStripCommentDelims) { reduceToContent(buffer, "<!--", "-->"); } if (fStyleStripCDATADelims) { reduceToContent(buffer, "<![CDATA[", "]]>"); } } if (buffer.length > 0 && fDocumentHandler != null && fElementCount >= fElementDepth) { if (DEBUG_CALLBACKS) { System.out.println("characters("+buffer+")"); } fEndLineNumber = fCurrentEntity.getLineNumber(); fEndColumnNumber = fCurrentEntity.getColumnNumber(); fEndCharacterOffset = fCurrentEntity.getCharacterOffset(); fDocumentHandler.characters(buffer, locationAugs()); } if (DEBUG_BUFFER) { fCurrentEntity.debugBufferIfNeeded(")scanCharacters: "); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scanCharacters File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
scanCharacters
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
private String generateWhereStatement(Object[][] whereParams, int previousIndex) { StringBuilder str = new StringBuilder(); int index = previousIndex; str.append(" where "); for (int i = 0; i < whereParams.length; i++) { if (i > 0) { if (whereParams[i - 1].length >= 4 && whereParams[i - 1][3] != "" && whereParams[i - 1][3] != null) { str.append(" "); str.append(whereParams[i - 1][3]); str.append(" "); } else { str.append(" and "); } } str.append(whereParams[i][0]); if (whereParams[i].length >= 3 && whereParams[i][2] != "" && whereParams[i][2] != null) { str.append(" "); str.append(whereParams[i][2]); str.append(" "); } else { str.append(" = "); } str.append(" ?"); if (index > -1) { str.append(++index); } } return str.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateWhereStatement File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
generateWhereStatement
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
public boolean displayCustomViewInline() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayCustomViewInline File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
displayCustomViewInline
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override @CanIgnoreReturnValue public MergeTarget setField(Descriptors.FieldDescriptor field, Object value) { extensions.setField(field, value); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setField File: java/core/src/main/java/com/google/protobuf/MessageReflection.java Repository: protocolbuffers/protobuf The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-3509
HIGH
7.5
protocolbuffers/protobuf
setField
java/core/src/main/java/com/google/protobuf/MessageReflection.java
a3888f53317a8018e7a439bac4abeb8f3425d5e9
0
Analyze the following code function for security vulnerabilities
private void gotNewKeys() { final Digest hash = kex.getHash(); final byte[] H = kex.getH(); if (sessionID == null) // session id is 'H' from the first key exchange and does not change thereafter sessionID = H; final Buffer.PlainBuffer hashInput = new Buffer.PlainBuffer() .putMPInt(kex.getK()) .putRawBytes(H) .putByte((byte) 0) // <placeholder> .putRawBytes(sessionID); final int pos = hashInput.available() - sessionID.length - 1; // Position of <placeholder> hashInput.array()[pos] = 'A'; hash.update(hashInput.array(), 0, hashInput.available()); final byte[] initialIV_C2S = hash.digest(); hashInput.array()[pos] = 'B'; hash.update(hashInput.array(), 0, hashInput.available()); final byte[] initialIV_S2C = hash.digest(); hashInput.array()[pos] = 'C'; hash.update(hashInput.array(), 0, hashInput.available()); final byte[] encryptionKey_C2S = hash.digest(); hashInput.array()[pos] = 'D'; hash.update(hashInput.array(), 0, hashInput.available()); final byte[] encryptionKey_S2C = hash.digest(); hashInput.array()[pos] = 'E'; hash.update(hashInput.array(), 0, hashInput.available()); final byte[] integrityKey_C2S = hash.digest(); hashInput.array()[pos] = 'F'; hash.update(hashInput.array(), 0, hashInput.available()); final byte[] integrityKey_S2C = hash.digest(); final Cipher cipher_C2S = Factory.Named.Util.create(transport.getConfig().getCipherFactories(), negotiatedAlgs.getClient2ServerCipherAlgorithm()); cipher_C2S.init(Cipher.Mode.Encrypt, resizedKey(encryptionKey_C2S, cipher_C2S.getBlockSize(), hash, kex.getK(), kex.getH()), initialIV_C2S); final Cipher cipher_S2C = Factory.Named.Util.create(transport.getConfig().getCipherFactories(), negotiatedAlgs.getServer2ClientCipherAlgorithm()); cipher_S2C.init(Cipher.Mode.Decrypt, resizedKey(encryptionKey_S2C, cipher_S2C.getBlockSize(), hash, kex.getK(), kex.getH()), initialIV_S2C); /* * For AES-GCM ciphers, MAC will also be AES-GCM, so it is handled by the cipher itself. * In that case, both s2c and c2s MACs are ignored. * * Refer to RFC5647 Section 5.1 */ MAC mac_C2S = null; if(cipher_C2S.getAuthenticationTagSize() == 0) { mac_C2S = Factory.Named.Util.create(transport.getConfig().getMACFactories(), negotiatedAlgs .getClient2ServerMACAlgorithm()); mac_C2S.init(resizedKey(integrityKey_C2S, mac_C2S.getBlockSize(), hash, kex.getK(), kex.getH())); } MAC mac_S2C = null; if(cipher_S2C.getAuthenticationTagSize() == 0) { mac_S2C = Factory.Named.Util.create(transport.getConfig().getMACFactories(), negotiatedAlgs.getServer2ClientMACAlgorithm()); mac_S2C.init(resizedKey(integrityKey_S2C, mac_S2C.getBlockSize(), hash, kex.getK(), kex.getH())); } final Compression compression_S2C = Factory.Named.Util.create(transport.getConfig().getCompressionFactories(), negotiatedAlgs.getServer2ClientCompressionAlgorithm()); final Compression compression_C2S = Factory.Named.Util.create(transport.getConfig().getCompressionFactories(), negotiatedAlgs.getClient2ServerCompressionAlgorithm()); transport.getEncoder().setAlgorithms(cipher_C2S, mac_C2S, compression_C2S); transport.getDecoder().setAlgorithms(cipher_S2C, mac_S2C, compression_S2C); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gotNewKeys File: src/main/java/net/schmizz/sshj/transport/KeyExchanger.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
gotNewKeys
src/main/java/net/schmizz/sshj/transport/KeyExchanger.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
public void setPhase2Method(int phase2Method) { switch (phase2Method) { case Phase2.NONE: mFields.put(PHASE2_KEY, EMPTY_VALUE); break; /** Valid methods */ case Phase2.PAP: case Phase2.MSCHAP: case Phase2.MSCHAPV2: case Phase2.GTC: mFields.put(PHASE2_KEY, convertToQuotedString( Phase2.PREFIX + Phase2.strings[phase2Method])); break; default: throw new IllegalArgumentException("Unknown Phase 2 method"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPhase2Method File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
setPhase2Method
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
private void readLinesLoop(Pattern success, Pattern failure, InputStreamReader reader) throws IOException { StringBuilder line = new StringBuilder(); for (int i; (i = reader.read()) >= 0;) { char ch = (char) i; console("%c", ch); line.append(ch); if (ch == '\n') { processLine(line.toString(), success, failure); line.setLength(0); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readLinesLoop File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
readLinesLoop
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
@Override public void startLockTaskMode(int taskId) { final TaskRecord task; long ident = Binder.clearCallingIdentity(); try { synchronized (this) { task = mStackSupervisor.anyTaskForIdLocked(taskId); } } finally { Binder.restoreCallingIdentity(ident); } if (task != null) { startLockTaskMode(task); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startLockTaskMode 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
startLockTaskMode
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void updateSubmoduleWithInit(ConsoleOutputStreamConsumer outputStreamConsumer, boolean shallow) { if (!gitSubmoduleEnabled()) { return; } log(outputStreamConsumer, "Updating git sub-modules"); String[] initArgs = new String[]{"submodule", "init"}; CommandLine initCmd = gitWd().withArgs(initArgs); runOrBomb(initCmd); submoduleSync(); if (shallow && version().supportsSubmoduleDepth()) { tryToShallowUpdateSubmodules(); } else { updateSubmodule(); } log(outputStreamConsumer, "Cleaning unversioned files and sub-modules"); printSubmoduleStatus(outputStreamConsumer); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSubmoduleWithInit File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
updateSubmoduleWithInit
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public static StringBuilder makePage(final String htmlheader, final String title, final String subtitle, final String body) { final StringBuilder buf = new StringBuilder( BOILERPLATE_LENGTH + (htmlheader == null ? 0 : htmlheader.length()) + title.length() + subtitle.length() + body.length()); buf.append(PAGE_HEADER_START) .append(title) .append(PAGE_HEADER_MID); if (htmlheader != null) { buf.append(htmlheader); } buf.append(PAGE_HEADER_END_BODY_START) .append(subtitle) .append(PAGE_BODY_MID) .append(body) .append(PAGE_FOOTER); return buf; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makePage File: src/tsd/HttpQuery.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
makePage
src/tsd/HttpQuery.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
@Override public void run() { try { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); // status checkout if (model.getStatus() != FileDownloadStatus.pending) { if (model.getStatus() == FileDownloadStatus.paused) { if (FileDownloadLog.NEED_LOG) { /** * @see FileDownloadThreadPool#cancel(int), the invoking simultaneously * with here. And this area is invoking before there, so, * {@code cancel(int)} is fail. * * High concurrent cause. */ FileDownloadLog.d(this, "High concurrent cause, start runnable but " + "already paused %d", model.getId()); } } else { onError(new RuntimeException( FileDownloadUtils.formatString("Task[%d] can't start the download" + " runnable, because its status is %d not %d", model.getId(), model.getStatus(), FileDownloadStatus.pending))); } return; } if (!paused) { statusCallback.onStartThread(); } do { if (paused) { if (FileDownloadLog.NEED_LOG) { /** * @see FileDownloadThreadPool#cancel(int), the invoking simultaneously * with here. And this area is invoking before there, so, * {@code cancel(int)} is fail. * * High concurrent cause. */ FileDownloadLog.d(this, "High concurrent cause, start runnable but " + "already paused %d", model.getId()); } return; } try { // 1. check env state checkupBeforeConnect(); // 2. trial connect trialConnect(); // 3. reuse same task checkupAfterGetFilename(); // 4. check local resume model final List<ConnectionModel> connectionOnDBList = database .findConnectionModel(model.getId()); inspectTaskModelResumeAvailableOnDB(connectionOnDBList); if (paused) { model.setStatus(FileDownloadStatus.paused); return; } final long totalLength = model.getTotal(); // 5. pre-allocate if need. handlePreAllocate(totalLength, model.getTempFilePath()); // 6. calculate block count final int connectionCount = calcConnectionCount(totalLength); if (connectionCount <= 0) { throw new IllegalAccessException(FileDownloadUtils .formatString("invalid connection count %d, the connection count" + " must be larger than 0", connectionCount)); } if (totalLength == 0) { return; } if (paused) { model.setStatus(FileDownloadStatus.paused); return; } // 7. start real connect and fetch to local filesystem isSingleConnection = connectionCount == 1; if (isSingleConnection) { // single connection realDownloadWithSingleConnection(totalLength); } else { // multiple connection statusCallback.onMultiConnection(); if (isResumeAvailableOnDB) { realDownloadWithMultiConnectionFromResume(connectionCount, connectionOnDBList); } else { realDownloadWithMultiConnectionFromBeginning(totalLength, connectionCount); } } } catch (IOException | IllegalAccessException | InterruptedException | IllegalArgumentException | FileDownloadGiveUpRetryException e) { if (isRetry(e)) { onRetry(e); continue; } else { onError(e); } } catch (DiscardSafely discardSafely) { return; } catch (RetryDirectly retryDirectly) { model.setStatus(FileDownloadStatus.retry); continue; } break; } while (true); } finally { statusCallback.discardAllMessage(); if (paused) { statusCallback.onPausedDirectly(); } else if (error) { statusCallback.onErrorDirectly(errorException); } else { try { statusCallback.onCompletedDirectly(); } catch (IOException e) { statusCallback.onErrorDirectly(e); } } alive.set(false); } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2018-11248 - Severity: HIGH - CVSS Score: 7.5 Description: fix: fix directory traversal vulnerability security issue closes #1028 Function: run File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader Fixed Code: @Override public void run() { try { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); // status checkout if (model.getStatus() != FileDownloadStatus.pending) { if (model.getStatus() == FileDownloadStatus.paused) { if (FileDownloadLog.NEED_LOG) { /** * @see FileDownloadThreadPool#cancel(int), the invoking simultaneously * with here. And this area is invoking before there, so, * {@code cancel(int)} is fail. * * High concurrent cause. */ FileDownloadLog.d(this, "High concurrent cause, start runnable but " + "already paused %d", model.getId()); } } else { onError(new RuntimeException( FileDownloadUtils.formatString("Task[%d] can't start the download" + " runnable, because its status is %d not %d", model.getId(), model.getStatus(), FileDownloadStatus.pending))); } return; } if (!paused) { statusCallback.onStartThread(); } do { if (paused) { if (FileDownloadLog.NEED_LOG) { /** * @see FileDownloadThreadPool#cancel(int), the invoking simultaneously * with here. And this area is invoking before there, so, * {@code cancel(int)} is fail. * * High concurrent cause. */ FileDownloadLog.d(this, "High concurrent cause, start runnable but " + "already paused %d", model.getId()); } return; } try { // 1. check env state checkupBeforeConnect(); // 2. trial connect trialConnect(); // 3. reuse same task checkupAfterGetFilename(); // 4. check local resume model final List<ConnectionModel> connectionOnDBList = database .findConnectionModel(model.getId()); inspectTaskModelResumeAvailableOnDB(connectionOnDBList); if (paused) { model.setStatus(FileDownloadStatus.paused); return; } final long totalLength = model.getTotal(); // 5. pre-allocate if need. handlePreAllocate(totalLength, model.getTempFilePath()); // 6. calculate block count final int connectionCount = calcConnectionCount(totalLength); if (connectionCount <= 0) { throw new IllegalAccessException(FileDownloadUtils .formatString("invalid connection count %d, the connection count" + " must be larger than 0", connectionCount)); } if (totalLength == 0) { return; } if (paused) { model.setStatus(FileDownloadStatus.paused); return; } // 7. start real connect and fetch to local filesystem isSingleConnection = connectionCount == 1; if (isSingleConnection) { // single connection realDownloadWithSingleConnection(totalLength); } else { // multiple connection statusCallback.onMultiConnection(); if (isResumeAvailableOnDB) { realDownloadWithMultiConnectionFromResume(connectionCount, connectionOnDBList); } else { realDownloadWithMultiConnectionFromBeginning(totalLength, connectionCount); } } } catch (IOException | IllegalAccessException | InterruptedException | IllegalArgumentException | FileDownloadSecurityException | FileDownloadGiveUpRetryException e) { if (isRetry(e)) { onRetry(e); continue; } else { onError(e); } } catch (DiscardSafely discardSafely) { return; } catch (RetryDirectly retryDirectly) { model.setStatus(FileDownloadStatus.retry); continue; } break; } while (true); } finally { statusCallback.discardAllMessage(); if (paused) { statusCallback.onPausedDirectly(); } else if (error) { statusCallback.onErrorDirectly(errorException); } else { try { statusCallback.onCompletedDirectly(); } catch (IOException e) { statusCallback.onErrorDirectly(e); } } alive.set(false); } }
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
run
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
1
Analyze the following code function for security vulnerabilities
@Override public void diffFile(String projectName, String repositoryName, Revision from, Revision to, Query query, AsyncMethodCallback resultHandler) { // FIXME(trustin): Remove the firstNonNull() on the change content once we make it optional. handle(projectManager.get(projectName).repos().get(repositoryName) .diff(convert(from), convert(to), convert(query)) .thenApply(change -> new DiffFileResult(convert(change.type()), firstNonNull(change.contentAsText(), ""))), resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: diffFile File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
diffFile
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
public void setIgnorePendingIntentCreatorForegroundState(boolean state) { mIgnorePendingIntentCreatorForegroundState = state; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIgnorePendingIntentCreatorForegroundState File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
setIgnorePendingIntentCreatorForegroundState
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public static Builder defaultBuilder() { Builder b = new Builder(); return b; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultBuilder 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
defaultBuilder
src/itest/java/com/hierynomus/sshj/SshdContainer.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
private void networkConfigXmlGenerator(XmlGenerator gen, Config config) { if (config.getAdvancedNetworkConfig().isEnabled()) { return; } NetworkConfig netCfg = config.getNetworkConfig(); gen.open("network") .node("public-address", netCfg.getPublicAddress()) .node("port", netCfg.getPort(), "port-count", netCfg.getPortCount(), "auto-increment", netCfg.isPortAutoIncrement()) .node("reuse-address", netCfg.isReuseAddress()); Collection<String> outboundPortDefinitions = netCfg.getOutboundPortDefinitions(); if (CollectionUtil.isNotEmpty(outboundPortDefinitions)) { gen.open("outbound-ports"); for (String def : outboundPortDefinitions) { gen.node("ports", def); } gen.close(); } JoinConfig join = netCfg.getJoin(); gen.open("join"); autoDetectionConfigXmlGenerator(gen, join); multicastConfigXmlGenerator(gen, join); tcpIpConfigXmlGenerator(gen, join); aliasedDiscoveryConfigsGenerator(gen, aliasedDiscoveryConfigsFrom(join)); discoveryStrategyConfigXmlGenerator(gen, join.getDiscoveryConfig()); gen.close(); interfacesConfigXmlGenerator(gen, netCfg.getInterfaces()); sslConfigXmlGenerator(gen, netCfg.getSSLConfig()); socketInterceptorConfigXmlGenerator(gen, netCfg.getSocketInterceptorConfig()); symmetricEncInterceptorConfigXmlGenerator(gen, netCfg.getSymmetricEncryptionConfig()); memberAddressProviderConfigXmlGenerator(gen, netCfg.getMemberAddressProviderConfig()); failureDetectorConfigXmlGenerator(gen, netCfg.getIcmpFailureDetectorConfig()); restApiXmlGenerator(gen, netCfg); memcacheProtocolXmlGenerator(gen, netCfg); tpcSocketConfigXmlGenerator(gen, netCfg.getTpcSocketConfig()); gen.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: networkConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-522" ]
CVE-2023-33264
MEDIUM
4.3
hazelcast
networkConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
public void setConfigProvider(String cp) { if (cp == null) { throw logger.nullArgumentError("configProvider"); } Class<?> clazz = SecurityActions.loadClass(getClass(), cp); if (clazz == null) { throw new RuntimeException(logger.classNotLoadedError(cp)); } try { configProvider = (SAMLConfigurationProvider) clazz.newInstance(); } catch (Exception e) { throw new RuntimeException(logger.couldNotCreateInstance(cp, e)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConfigProvider File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
setConfigProvider
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
@Override public void onNetworkEapSimGsmAuthRequest(NetworkRequestEapSimGsmAuthParams params) { synchronized (mLock) { mNetworkHal.logCallback("onNetworkEapSimGsmAuthRequest"); String[] data = new String[params.rands.length]; int i = 0; for (GsmRand rand : params.rands) { data[i++] = NativeUtil.hexStringFromByteArray(rand.data); } mWifiMonitor.broadcastNetworkGsmAuthRequestEvent( mIfaceName, mFrameworkNetworkId, mSsid, data); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onNetworkEapSimGsmAuthRequest File: service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onNetworkEapSimGsmAuthRequest
service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void engineSetPadding(String padding) throws NoSuchPaddingException { String paddingName = Strings.toUpperCase(padding); // TDOD: make this meaningful... if (paddingName.equals("NOPADDING")) { } else if (paddingName.equals("PKCS5PADDING") || paddingName.equals("PKCS7PADDING")) { } else { throw new NoSuchPaddingException("padding not available with IESCipher"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineSetPadding File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineSetPadding
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
@Override public void bindRemoteViewsService(String callingPackage, int appWidgetId, Intent intent, IBinder callbacks) { final int userId = UserHandle.getCallingUserId(); if (DEBUG) { Slog.i(TAG, "bindRemoteViewsService() " + userId); } // Make sure the package runs under the caller uid. mSecurityPolicy.enforceCallFromPackage(callingPackage); synchronized (mLock) { ensureGroupStateLoadedLocked(userId); // NOTE: The lookup is enforcing security across users by making // sure the caller can only access widgets it hosts or provides. Widget widget = lookupWidgetLocked(appWidgetId, Binder.getCallingUid(), callingPackage); if (widget == null) { throw new IllegalArgumentException("Bad widget id"); } // Make sure the widget has a provider. if (widget.provider == null) { throw new IllegalArgumentException("No provider for widget " + appWidgetId); } ComponentName componentName = intent.getComponent(); // Ensure that the service belongs to the same package as the provider. // But this is not enough as they may be under different users - see below... String providerPackage = widget.provider.id.componentName.getPackageName(); String servicePackage = componentName.getPackageName(); if (!servicePackage.equals(providerPackage)) { throw new SecurityException("The taget service not in the same package" + " as the widget provider"); } // Make sure this service exists under the same user as the provider and // requires a permission which allows only the system to bind to it. mSecurityPolicy.enforceServiceExistsAndRequiresBindRemoteViewsPermission( componentName, widget.provider.getUserId()); // Good to go - the service pakcage is correct, it exists for the correct // user, and requires the bind permission. // If there is already a connection made for this service intent, then // disconnect from that first. (This does not allow multiple connections // to the same service under the same key). ServiceConnectionProxy connection = null; FilterComparison fc = new FilterComparison(intent); Pair<Integer, FilterComparison> key = Pair.create(appWidgetId, fc); if (mBoundRemoteViewsServices.containsKey(key)) { connection = (ServiceConnectionProxy) mBoundRemoteViewsServices.get(key); connection.disconnect(); unbindService(connection); mBoundRemoteViewsServices.remove(key); } // Bind to the RemoteViewsService (which will trigger a callback to the // RemoteViewsAdapter.onServiceConnected()) connection = new ServiceConnectionProxy(callbacks); bindService(intent, connection, widget.provider.info.getProfile()); mBoundRemoteViewsServices.put(key, connection); // Add it to the mapping of RemoteViewsService to appWidgetIds so that we // can determine when we can call back to the RemoteViewsService later to // destroy associated factories. Pair<Integer, FilterComparison> serviceId = Pair.create(widget.provider.id.uid, fc); incrementAppWidgetServiceRefCount(appWidgetId, serviceId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindRemoteViewsService 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
bindRemoteViewsService
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public boolean playBlockBreakEffect(Vector3 position, BlockType type) { World world = getWorld(); world.playEffect(BukkitAdapter.adapt(world, position), Effect.STEP_SOUND, BukkitAdapter.adapt(type)); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: playBlockBreakEffect File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
playBlockBreakEffect
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
public boolean canGoBack() { return mContentViewCore != null && mContentViewCore.canGoBack(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canGoBack File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
canGoBack
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private static final String indent(int indent) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < indent; i++) { sb.append(' '); } return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: indent File: src/main/java/org/json/XML.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2022-45688
HIGH
7.5
stleary/JSON-java
indent
src/main/java/org/json/XML.java
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
0
Analyze the following code function for security vulnerabilities
public Builder setIOThreadMultiplier(int multiplier) { this.ioThreadMultiplier = multiplier; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIOThreadMultiplier File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setIOThreadMultiplier
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public int getUserInfoRefreshRate() { return getProperty(PROP_USERINFOREFRESHRATE, 600000); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserInfoRefreshRate File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java Repository: xwiki-contrib/oidc The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39387
HIGH
7.5
xwiki-contrib/oidc
getUserInfoRefreshRate
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
0247af1417925b9734ab106ad7cd934ee870ac89
0
Analyze the following code function for security vulnerabilities
void wtf(String message, Throwable e) { if (e == null) { e = new RuntimeException("Stacktrace"); } synchronized (mWtfLock) { mWtfCount++; mLastWtfStacktrace = new Exception("Last failure was logged here:"); } Slog.wtf(TAG, message, e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wtf 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
wtf
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private VerifyResult verifyJar(String jarName) throws Exception { try (JarFile jarFile = new JarFile(jarName, true)) { Vector<JarEntry> entriesVec = new Vector<JarEntry>(); byte[] buffer = new byte[8192]; Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry je = entries.nextElement(); entriesVec.addElement(je); InputStream is = jarFile.getInputStream(je); try { while (is.read(buffer, 0, buffer.length) != -1) { // we just read. this will throw a SecurityException // if a signature/digest check fails. } } finally { if (is != null) { is.close(); } } } return verifyJarEntryCerts(jarName, jarFile.getManifest() != null, entriesVec); } catch (Exception e) { LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, e); throw e; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyJar File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.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
verifyJar
core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java
2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99
0
Analyze the following code function for security vulnerabilities
@NonNull public Builder setShowWhen(boolean show) { mN.extras.putBoolean(EXTRA_SHOW_WHEN, show); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShowWhen File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setShowWhen
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public List<AttachmentDiff> getAttachmentDiff(Document origdoc, Document newdoc) { try { if ((origdoc == null) && (newdoc == null)) { return Collections.emptyList(); } if (origdoc == null) { return wrapAttachmentDiff(this.doc.getAttachmentDiff(new XWikiDocument(newdoc.getDocumentReference()), newdoc.doc, getXWikiContext())); } if (newdoc == null) { return wrapAttachmentDiff(this.doc.getAttachmentDiff(origdoc.doc, new XWikiDocument(origdoc.getDocumentReference()), getXWikiContext())); } return wrapAttachmentDiff(this.doc.getAttachmentDiff(origdoc.doc, newdoc.doc, getXWikiContext())); } catch (Exception e) { java.lang.Object[] args = { (origdoc != null) ? origdoc.getFullName() : null, (origdoc != null) ? origdoc.getVersion() : null, (newdoc != null) ? newdoc.getVersion() : null }; List list = new ArrayList(); XWikiException xe = new XWikiException(XWikiException.MODULE_XWIKI_DIFF, XWikiException.ERROR_XWIKI_DIFF_ATTACHMENT_ERROR, "Error while making attachment diff of {0} between version {1} and version {2}", e, args); String errormsg = Util.getHTMLExceptionMessage(xe, getXWikiContext()); list.add(errormsg); return list; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachmentDiff File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getAttachmentDiff
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public Date parseDate(String str) { try { return dateFormat.parse(str); } catch (java.text.ParseException e) { throw new RuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseDate File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
parseDate
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public ResourceInfo findViewResource(String resourceName, String contentType, FacesContext facesContext) { String localePrefix = getLocalePrefix(facesContext); List<String> contracts = getResourceLibraryContracts(facesContext); ResourceInfo info = getFromCache(resourceName, null, localePrefix, contracts); if (info == null) { if (isCompressable(contentType, facesContext)) { info = findResourceCompressed(null, resourceName, true, localePrefix, contracts, facesContext); } else { info = findResourceNonCompressed(null, resourceName, true, localePrefix, contracts, facesContext); } } return info; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findViewResource File: impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-14371
MEDIUM
5
eclipse-ee4j/mojarra
findViewResource
impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
1b434748d9239f42eae8aa7d37d7a0930c061e24
0
Analyze the following code function for security vulnerabilities
@Override protected Class<?> getClassForNode(Node node) { Class<?> type = node.getType(); if (type.getAnnotation(Editable.class) != null && !ClassUtils.isConcrete(type)) { ImplementationRegistry registry = OneDev.getInstance(ImplementationRegistry.class); for (Class<?> implementationClass: registry.getImplementations(node.getType())) { String implementationTag = new Tag("!" + implementationClass.getSimpleName()).getValue(); if (implementationTag.equals(node.getTag().getValue())) return implementationClass; } } return super.getClassForNode(node); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2021-21249 - Severity: MEDIUM - CVSS Score: 6.5 Description: Fix security vulnerability issue caused by SnakeYaml deserialization Function: getClassForNode File: server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java Repository: theonedev/onedev Fixed Code: @Override protected Class<?> getClassForNode(Node node) { if (node instanceof VersionedYamlDoc) { return super.getClassForNode(node); } else { Class<?> type = node.getType(); if (type.getAnnotation(Editable.class) == null) { // Do not deserialize unknown classes to avoid security vulnerabilities throw new IllegalStateException(String.format("Unexpected yaml node (type: %s, tag: %s)", type, node.getTag())); } else { if (!ClassUtils.isConcrete(type)) { ImplementationRegistry registry = OneDev.getInstance(ImplementationRegistry.class); for (Class<?> implementationClass: registry.getImplementations(node.getType())) { String implementationTag = new Tag("!" + implementationClass.getSimpleName()).getValue(); if (implementationTag.equals(node.getTag().getValue())) return implementationClass; } } return super.getClassForNode(node); } } }
[ "CWE-502" ]
CVE-2021-21249
MEDIUM
6.5
theonedev/onedev
getClassForNode
server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
d6fc4212b1ac1e9bbe3ce444e95f9af1e3ab8b66
1
Analyze the following code function for security vulnerabilities
@Override public final int startActivities(IApplicationThread caller, String callingPackage, Intent[] intents, String[] resolvedTypes, IBinder resultTo, Bundle bOptions, int userId) { final String reason = "startActivities"; enforceNotIsolatedCaller(reason); userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, ALLOW_FULL_ONLY, reason, null); // TODO: Switch to user app stacks here. int ret = mActivityStartController.startActivities(caller, -1, callingPackage, intents, resolvedTypes, resultTo, SafeActivityOptions.fromBundle(bOptions), userId, reason); return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivities 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
startActivities
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
ActivityRecord build() { if (mConfiguration == null) { mConfiguration = mAtmService.getConfiguration(); } return new ActivityRecord(mAtmService, mCallerApp, mLaunchedFromPid, mLaunchedFromUid, mLaunchedFromPackage, mLaunchedFromFeature, mIntent, mResolvedType, mActivityInfo, mConfiguration, mResultTo, mResultWho, mRequestCode, mComponentSpecified, mRootVoiceInteraction, mAtmService.mTaskSupervisor, mOptions, mSourceRecord, mPersistentState, mTaskDescription, mCreateTime); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: build 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
build
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public ArrayList<BaseObject> getObjectsToRemove() { return (ArrayList<BaseObject>) getXObjectsToRemove(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectsToRemove 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
getObjectsToRemove
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
@PUT @Path("singlepage") @Operation(summary = "Attach a Single Page Element on course", description = "This attaches a Single Page Element onto a given course. The element will\n" + " be inserted underneath the supplied parentNodeId") @ApiResponse(responseCode = "200", description = "The course node metadatas", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or parentNode not found") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response attachSinglePage(@PathParam("courseId") Long courseId, @Context HttpServletRequest request) { InputStream in = null; MultipartReader reader = null; try { reader = new MultipartReader(request); String parentNodeId = reader.getValue("parentNodeId"); Integer position = reader.getIntegerValue("position"); String shortTitle = reader.getValue("shortTitle"); String longTitle = reader.getValue("longTitle"); String objectives = reader.getValue("objectives"); String visibilityExpertRules = reader.getValue("visibilityExpertRules"); String accessExpertRules = reader.getValue("accessExpertRules"); String filename = reader.getValue("filename", "attachment"); in = new FileInputStream(reader.getFile()); SinglePageCustomConfig config = new SinglePageCustomConfig(in, filename); return attach(courseId, parentNodeId, "sp", position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request); } catch (Exception e) { log.error("", e); return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build(); } finally { MultipartReader.closeQuietly(reader); IOUtils.closeQuietly(in); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachSinglePage File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
attachSinglePage
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public static Policy getInstance(File file) throws PolicyException { try { URI uri = file.toURI(); return getInstance(uri.toURL()); } catch (IOException e) { throw new PolicyException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstance File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
getInstance
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0