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 AndroidGraphics getNullGraphics() { if (nullGraphics == null) { Bitmap bitmap = Bitmap.createBitmap(getDisplayWidth()==0?100:getDisplayWidth(), getDisplayHeight()==0?100:getDisplayHeight(), Bitmap.Config.ARGB_8888); nullGraphics = (AndroidGraphics) this.getNativeGraphics(bitmap); } return nullGraphics; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNullGraphics 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
getNullGraphics
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void onPause() { super.onPause(); mForeground = false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPause File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
onPause
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
@Override public boolean isTopActivityImmersive() { enforceNotIsolatedCaller("isTopActivityImmersive"); synchronized (mGlobalLock) { final Task topFocusedRootTask = getTopDisplayFocusedRootTask(); if (topFocusedRootTask == null) { return false; } final ActivityRecord r = topFocusedRootTask.topRunningActivity(); return r != null && r.immersive; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTopActivityImmersive File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
isTopActivityImmersive
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void setRecentsComponentCallback(RecentsComponent.Callbacks cb) { sRecentsComponentCallbacks = cb; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRecentsComponentCallback File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0813
MEDIUM
6.6
android
setRecentsComponentCallback
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
0
Analyze the following code function for security vulnerabilities
private int handleAnimatingStoppedAndTransitionLocked() { int changes = 0; mAppTransition.setIdle(); for (int i = mNoAnimationNotifyOnTransitionFinished.size() - 1; i >= 0; i--) { final IBinder token = mNoAnimationNotifyOnTransitionFinished.get(i); mAppTransition.notifyAppTransitionFinishedLocked(token); } mNoAnimationNotifyOnTransitionFinished.clear(); if (mDeferredHideWallpaper != null) { hideWallpapersLocked(mDeferredHideWallpaper); mDeferredHideWallpaper = null; } // Restore window app tokens to the ActivityManager views ArrayList<TaskStack> stacks = getDefaultDisplayContentLocked().getStacks(); for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) { final ArrayList<Task> tasks = stacks.get(stackNdx).getTasks(); for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) { final AppTokenList tokens = tasks.get(taskNdx).mAppTokens; for (int tokenNdx = tokens.size() - 1; tokenNdx >= 0; --tokenNdx) { tokens.get(tokenNdx).sendingToBottom = false; } } } rebuildAppWindowListLocked(); changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT; if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "Wallpaper layer changed: assigning layers + relayout"); moveInputMethodWindowsIfNeededLocked(true); mInnerFields.mWallpaperMayChange = true; // Since the window list has been rebuilt, focus might // have to be recomputed since the actual order of windows // might have changed again. mFocusMayChange = true; return changes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleAnimatingStoppedAndTransitionLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
handleAnimatingStoppedAndTransitionLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity<?> entity) { Response response; if ("POST".equals(method)) { response = invocationBuilder.post(entity); } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else { response = invocationBuilder.method(method); } return response; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendRequest File: samples/client/petstore/java/resteasy/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
sendRequest
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public boolean onQueryTextChange(String newText) { if (searchPublishSubject == null) { searchPublishSubject = PublishSubject.create(); searchPublishSubject .debounce(400, TimeUnit.MILLISECONDS) .distinctUntilChanged() .map(s -> getNewsReaderDetailFragment().performSearch(s)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(getNewsReaderDetailFragment().searchResultObserver) .isDisposed(); } searchPublishSubject.onNext(newText); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onQueryTextChange File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java Repository: nextcloud/news-android The code follows secure coding practices.
[ "CWE-829" ]
CVE-2021-41256
MEDIUM
5.8
nextcloud/news-android
onQueryTextChange
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
private void basicInitialization() { rootEglBase = EglBase.create(); createCameraEnumerator(); //Create a new PeerConnectionFactory instance. PeerConnectionFactory.Options options = new PeerConnectionFactory.Options(); DefaultVideoEncoderFactory defaultVideoEncoderFactory = new DefaultVideoEncoderFactory( rootEglBase.getEglBaseContext(), true, true); DefaultVideoDecoderFactory defaultVideoDecoderFactory = new DefaultVideoDecoderFactory( rootEglBase.getEglBaseContext()); peerConnectionFactory = PeerConnectionFactory.builder() .setOptions(options) .setVideoEncoderFactory(defaultVideoEncoderFactory) .setVideoDecoderFactory(defaultVideoDecoderFactory) .createPeerConnectionFactory(); //Create MediaConstraints - Will be useful for specifying video and audio constraints. audioConstraints = new MediaConstraints(); videoConstraints = new MediaConstraints(); localStream = peerConnectionFactory.createLocalMediaStream("NCMS"); // Create and audio manager that will take care of audio routing, // audio modes, audio device enumeration etc. audioManager = MagicAudioManager.create(getApplicationContext(), isVoiceOnlyCall); // Store existing audio settings and change audio mode to // MODE_IN_COMMUNICATION for best possible VoIP performance. Log.d(TAG, "Starting the audio manager..."); audioManager.start(this::onAudioManagerDevicesChanged); if (isVoiceOnlyCall) { setAudioOutputChannel(MagicAudioManager.AudioDevice.EARPIECE); } else { setAudioOutputChannel(MagicAudioManager.AudioDevice.SPEAKER_PHONE); } iceServers = new ArrayList<>(); //create sdpConstraints sdpConstraints = new MediaConstraints(); sdpConstraintsForMCU = new MediaConstraints(); sdpConstraints.mandatory.add(new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true")); String offerToReceiveVideoString = "true"; if (isVoiceOnlyCall) { offerToReceiveVideoString = "false"; } sdpConstraints.mandatory.add( new MediaConstraints.KeyValuePair("OfferToReceiveVideo", offerToReceiveVideoString)); sdpConstraintsForMCU.mandatory.add(new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "false")); sdpConstraintsForMCU.mandatory.add(new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "false")); sdpConstraintsForMCU.optional.add(new MediaConstraints.KeyValuePair("internalSctpDataChannels", "true")); sdpConstraintsForMCU.optional.add(new MediaConstraints.KeyValuePair("DtlsSrtpKeyAgreement", "true")); sdpConstraints.optional.add(new MediaConstraints.KeyValuePair("internalSctpDataChannels", "true")); sdpConstraints.optional.add(new MediaConstraints.KeyValuePair("DtlsSrtpKeyAgreement", "true")); if (!isVoiceOnlyCall) { cameraInitialization(); } microphoneInitialization(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: basicInitialization File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
basicInitialization
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
@Override public void set(Object key, Object value) { throw new UnsupportedOperationException(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: set File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
set
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
public String formatDate(Date date) { return dateFormat.format(date); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: formatDate File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
formatDate
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public String getStreamId() { if (!isConnected()) { return null; } return streamId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStreamId File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
getStreamId
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
private String getRelativeAssetPath(String inode, String fileName) { String _inode = inode; String path = ""; path = java.io.File.separator + _inode.charAt(0) + java.io.File.separator + _inode.charAt(1) + java.io.File.separator + _inode + java.io.File.separator + "fileAsset" + java.io.File.separator+ fileName; return path; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelativeAssetPath File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
getRelativeAssetPath
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0
Analyze the following code function for security vulnerabilities
boolean isDreamWindow() { return mActivityRecord != null && mActivityRecord.getActivityType() == ACTIVITY_TYPE_DREAM; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDreamWindow 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
isDreamWindow
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private boolean checkWebpackConnection() { try { prepareConnection("/", "GET").getResponseCode(); return true; } catch (IOException e) { getLogger().debug("Error checking webpack dev server connection", e); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkWebpackConnection 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
checkWebpackConnection
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
@Override public void setNetworkLoggingEnabled(@Nullable ComponentName admin, @NonNull String packageName, boolean enabled) { if (!mHasFeature) { return; } final CallerIdentity caller = getCallerIdentity(admin, packageName); final boolean isManagedProfileOwner = isProfileOwner(caller) && isManagedProfile(caller.getUserId()); Preconditions.checkCallAuthorization((caller.hasAdminComponent() && (isDefaultDeviceOwner(caller) || isManagedProfileOwner)) || (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_NETWORK_LOGGING))); synchronized (getLockObject()) { if (enabled == isNetworkLoggingEnabledInternalLocked()) { // already in the requested state return; } final ActiveAdmin activeAdmin = getDeviceOrProfileOwnerAdminLocked(caller.getUserId()); activeAdmin.isNetworkLoggingEnabled = enabled; if (!enabled) { activeAdmin.numNetworkLoggingNotifications = 0; activeAdmin.lastNetworkLoggingNotificationTimeMs = 0; } saveSettingsLocked(caller.getUserId()); setNetworkLoggingActiveInternal(enabled); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_NETWORK_LOGGING_ENABLED) .setAdmin(caller.getPackageName()) .setBoolean(/* isDelegate */ admin == null) .setInt(enabled ? 1 : 0) .setStrings(isManagedProfileOwner ? LOG_TAG_PROFILE_OWNER : LOG_TAG_DEVICE_OWNER) .write(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNetworkLoggingEnabled File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
setNetworkLoggingEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting @Override Rect getAnimationBounds(int appRootTaskClipMode) { // Use TaskFragment-bounds if available so that activity-level letterbox (maxAspectRatio) is // included in the animation. final TaskFragment taskFragment = getTaskFragment(); return taskFragment != null ? taskFragment.getBounds() : getBounds(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAnimationBounds 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
getAnimationBounds
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
protected String getNavbar(Map<String, Object> data) { String html = "<div class=\"nav-no-collapse header-nav\"><ul class=\"nav pull-right\">\n"; html += getHomeLink(data); if ((Boolean) data.get("is_logged_in")) { html += getInbox(data); } html += getShortcut(data); html += getUserMenu(data); html += "</ul></div>\n"; return html; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNavbar File: wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
getNavbar
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(token); mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); reply.readException(); Bundle bundle = reply.readBundle(); ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle); data.recycle(); reply.recycle(); return options; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActivityOptions File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getActivityOptions
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
boolean isUserSetupComplete() { return Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUserSetupComplete 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
isUserSetupComplete
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
protected Object invokeMethod(Object o, String methodName, Object[] params) { Method methods[] = o.getClass().getMethods(); for (int i = 0; i < methods.length; ++i) { if (methodName.equals(methods[i].getName())) { try { methods[i].setAccessible(true); return methods[i].invoke(o, params); } catch (IllegalAccessException ex) { return null; } catch (InvocationTargetException ite) { return null; } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invokeMethod File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
invokeMethod
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
public void getRemoveWarning(@Nullable ComponentName admin, RemoteCallback result) { if (mService != null) { try { mService.getRemoveWarning(admin, result, myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRemoveWarning File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getRemoveWarning
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getAffiliationIds(ComponentName admin) { if (!mHasFeature) { return Collections.emptyList(); } Objects.requireNonNull(admin); final CallerIdentity caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller)); synchronized (getLockObject()) { return new ArrayList<String>(getUserData(caller.getUserId()).mAffiliationIds); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAffiliationIds File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
getAffiliationIds
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@GuardedBy({"mPm.mInstallLock", "mPm.mLock"}) public void installPackagesFromDir(File scanDir, List<File> frameworkSplits, int parseFlags, int scanFlags, PackageParser2 packageParser, ExecutorService executorService) { final File[] files = scanDir.listFiles(); if (ArrayUtils.isEmpty(files)) { Log.d(TAG, "No files in app dir " + scanDir); return; } if (DEBUG_PACKAGE_SCANNING) { Log.d(TAG, "Scanning app dir " + scanDir + " scanFlags=" + scanFlags + " flags=0x" + Integer.toHexString(parseFlags)); } ParallelPackageParser parallelPackageParser = new ParallelPackageParser(packageParser, executorService, frameworkSplits); // Submit files for parsing in parallel int fileCount = 0; for (File file : files) { final boolean isPackage = (isApkFile(file) || file.isDirectory()) && !PackageInstallerService.isStageName(file.getName()); if (!isPackage) { // Ignore entries which are not packages continue; } if ((scanFlags & SCAN_DROP_CACHE) != 0) { final PackageCacher cacher = new PackageCacher(mPm.getCacheDir()); Log.w(TAG, "Dropping cache of " + file.getAbsolutePath()); cacher.cleanCachedResult(file); } parallelPackageParser.submit(file, parseFlags); fileCount++; } // Process results one by one for (; fileCount > 0; fileCount--) { ParallelPackageParser.ParseResult parseResult = parallelPackageParser.take(); Throwable throwable = parseResult.throwable; int errorCode = PackageManager.INSTALL_SUCCEEDED; String errorMsg = null; if (throwable == null) { // TODO(b/194319951): move lower in the scan chain // Static shared libraries have synthetic package names if (parseResult.parsedPackage.isStaticSharedLibrary()) { PackageManagerService.renameStaticSharedLibraryPackage( parseResult.parsedPackage); } try { addForInitLI(parseResult.parsedPackage, parseFlags, scanFlags, null); } catch (PackageManagerException e) { errorCode = e.error; errorMsg = "Failed to scan " + parseResult.scanFile + ": " + e.getMessage(); Slog.w(TAG, errorMsg); } } else if (throwable instanceof PackageManagerException) { PackageManagerException e = (PackageManagerException) throwable; errorCode = e.error; errorMsg = "Failed to parse " + parseResult.scanFile + ": " + e.getMessage(); Slog.w(TAG, errorMsg); } else { throw new IllegalStateException("Unexpected exception occurred while parsing " + parseResult.scanFile, throwable); } if ((scanFlags & SCAN_AS_APK_IN_APEX) != 0 && errorCode != INSTALL_SUCCEEDED) { mApexManager.reportErrorWithApkInApex(scanDir.getAbsolutePath(), errorMsg); } // Delete invalid userdata apps if ((scanFlags & SCAN_AS_SYSTEM) == 0 && errorCode != PackageManager.INSTALL_SUCCEEDED) { logCriticalInfo(Log.WARN, "Deleting invalid package at " + parseResult.scanFile); mRemovePackageHelper.removeCodePathLI(parseResult.scanFile); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installPackagesFromDir File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
installPackagesFromDir
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
protected void validateName(NameValidator<K> validator, boolean forAdd, K name) { validator.validateName(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateName File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
validateName
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public void visitUris(@NonNull Consumer<Uri> visitor) { visitor.accept(sound); if (tickerView != null) tickerView.visitUris(visitor); if (contentView != null) contentView.visitUris(visitor); if (bigContentView != null) bigContentView.visitUris(visitor); if (headsUpContentView != null) headsUpContentView.visitUris(visitor); visitIconUri(visitor, mSmallIcon); visitIconUri(visitor, mLargeIcon); if (actions != null) { for (Action action : actions) { visitIconUri(visitor, action.getIcon()); } } if (extras != null) { visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class)); visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class)); // NOTE: The documentation of EXTRA_AUDIO_CONTENTS_URI explicitly says that it is a // String representation of a Uri, but the previous implementation (and unit test) of // this method has always treated it as a Uri object. Given the inconsistency, // supporting both going forward is the safest choice. Object audioContentsUri = extras.get(EXTRA_AUDIO_CONTENTS_URI); if (audioContentsUri instanceof Uri) { visitor.accept((Uri) audioContentsUri); } else if (audioContentsUri instanceof String) { visitor.accept(Uri.parse((String) audioContentsUri)); } if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) { visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI))); } ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST); if (people != null && !people.isEmpty()) { for (Person p : people) { visitor.accept(p.getIconUri()); } } final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class); if (person != null) { visitor.accept(person.getIconUri()); } } if (isStyle(MessagingStyle.class) && extras != null) { final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES); if (!ArrayUtils.isEmpty(messages)) { for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(messages)) { visitor.accept(message.getDataUri()); Person senderPerson = message.getSenderPerson(); if (senderPerson != null) { visitor.accept(senderPerson.getIconUri()); } } } final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES); if (!ArrayUtils.isEmpty(historic)) { for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(historic)) { visitor.accept(message.getDataUri()); Person senderPerson = message.getSenderPerson(); if (senderPerson != null) { visitor.accept(senderPerson.getIconUri()); } } } } if (isStyle(CallStyle.class) & extras != null) { Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON); if (callPerson != null) { visitor.accept(callPerson.getIconUri()); } visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON)); } if (mBubbleMetadata != null) { visitIconUri(visitor, mBubbleMetadata.getIcon()); } }
Vulnerability Classification: - CWE: CWE-862 - CVE: CVE-2023-21244 - Severity: MEDIUM - CVSS Score: 6.7 Description: Verify URI permissions for EXTRA_REMOTE_INPUT_HISTORY_ITEMS. Also added the person URIs in the test, since they weren't being checked. Test: atest NotificationManagerServiceTest & tested with POC from bug Bug: 276729064 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:43b1711332763788c7abf05c3baa931296c45bbb) Merged-In: I848545f7aee202495c515f47a32871a2cb6ae707 Change-Id: I848545f7aee202495c515f47a32871a2cb6ae707 Function: visitUris File: core/java/android/app/Notification.java Repository: android Fixed Code: public void visitUris(@NonNull Consumer<Uri> visitor) { visitor.accept(sound); if (tickerView != null) tickerView.visitUris(visitor); if (contentView != null) contentView.visitUris(visitor); if (bigContentView != null) bigContentView.visitUris(visitor); if (headsUpContentView != null) headsUpContentView.visitUris(visitor); visitIconUri(visitor, mSmallIcon); visitIconUri(visitor, mLargeIcon); if (actions != null) { for (Action action : actions) { visitIconUri(visitor, action.getIcon()); } } if (extras != null) { visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class)); visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class)); // NOTE: The documentation of EXTRA_AUDIO_CONTENTS_URI explicitly says that it is a // String representation of a Uri, but the previous implementation (and unit test) of // this method has always treated it as a Uri object. Given the inconsistency, // supporting both going forward is the safest choice. Object audioContentsUri = extras.get(EXTRA_AUDIO_CONTENTS_URI); if (audioContentsUri instanceof Uri) { visitor.accept((Uri) audioContentsUri); } else if (audioContentsUri instanceof String) { visitor.accept(Uri.parse((String) audioContentsUri)); } if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) { visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI))); } ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST); if (people != null && !people.isEmpty()) { for (Person p : people) { visitor.accept(p.getIconUri()); } } final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class); if (person != null) { visitor.accept(person.getIconUri()); } final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[]) extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS); if (history != null) { for (int i = 0; i < history.length; i++) { RemoteInputHistoryItem item = history[i]; if (item.getUri() != null) { visitor.accept(item.getUri()); } } } } if (isStyle(MessagingStyle.class) && extras != null) { final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES); if (!ArrayUtils.isEmpty(messages)) { for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(messages)) { visitor.accept(message.getDataUri()); Person senderPerson = message.getSenderPerson(); if (senderPerson != null) { visitor.accept(senderPerson.getIconUri()); } } } final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES); if (!ArrayUtils.isEmpty(historic)) { for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(historic)) { visitor.accept(message.getDataUri()); Person senderPerson = message.getSenderPerson(); if (senderPerson != null) { visitor.accept(senderPerson.getIconUri()); } } } } if (isStyle(CallStyle.class) & extras != null) { Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON); if (callPerson != null) { visitor.accept(callPerson.getIconUri()); } visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON)); } if (mBubbleMetadata != null) { visitIconUri(visitor, mBubbleMetadata.getIcon()); } }
[ "CWE-862" ]
CVE-2023-21244
MEDIUM
6.7
android
visitUris
core/java/android/app/Notification.java
3a448067ac9ebdf669951e90678c2daa592a81d3
1
Analyze the following code function for security vulnerabilities
public String[] getShellArgs() { if ( ( shellArgs == null ) || shellArgs.isEmpty() ) { return null; } else { return (String[]) shellArgs.toArray( new String[shellArgs.size()] ); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getShellArgs File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
getShellArgs
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
public static int maxCompressedLength(int byteSize) { return impl.maxCompressedLength(byteSize); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maxCompressedLength File: src/main/java/org/xerial/snappy/Snappy.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34454
HIGH
7.5
xerial/snappy-java
maxCompressedLength
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
private void parseMap(final Node map) throws GameParseException { final List<Element> grids = getChildren("grid", map); parseGrids(grids); // get the Territories final List<Element> territories = getChildren("territory", map); parseTerritories(territories); final List<Element> connections = getChildren("connection", map); parseConnections(connections); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseMap File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseMap
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
public static void copy(Reader input, File output) throws IOException { FileOutputStream fos = new FileOutputStream(output); IOUtils.copy(input, fos); fos.flush(); fos.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copy File: src/main/java/com/openkm/util/FileUtils.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-377" ]
CVE-2022-3969
MEDIUM
5.5
openkm/document-management-system
copy
src/main/java/com/openkm/util/FileUtils.java
c069e4d73ab8864345c25119d8459495f45453e1
0
Analyze the following code function for security vulnerabilities
@Override public void notifyActivityDrawn(IBinder token) { if (DEBUG_VISIBILITY) Slog.d(TAG_VISIBILITY, "notifyActivityDrawn: token=" + token); synchronized (this) { ActivityRecord r = mStackSupervisor.isInAnyStackLocked(token); if (r != null) { r.task.stack.notifyActivityDrawnLocked(r); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyActivityDrawn 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
notifyActivityDrawn
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public static CountingReader readerFor(Object input, String compressionAlgo) throws IOException { return readerFor(input, null, null, compressionAlgo); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readerFor File: core/src/main/java/apoc/util/FileUtils.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23532
MEDIUM
6.5
neo4j-contrib/neo4j-apoc-procedures
readerFor
core/src/main/java/apoc/util/FileUtils.java
01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522
0
Analyze the following code function for security vulnerabilities
private void checkAbnormalConnectionFailureAndTakeBugReport(String ssid) { if (mDeviceConfigFacade.isAbnormalConnectionFailureBugreportEnabled()) { int reasonCode = mWifiScoreCard.detectAbnormalConnectionFailure(ssid); if (reasonCode != WifiHealthMonitor.REASON_NO_FAILURE) { String bugTitle = "Wi-Fi BugReport"; String bugDetail = "Detect abnormal " + WifiHealthMonitor.FAILURE_REASON_NAME[reasonCode]; mWifiDiagnostics.takeBugReport(bugTitle, bugDetail); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkAbnormalConnectionFailureAndTakeBugReport 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
checkAbnormalConnectionFailureAndTakeBugReport
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public int getSelectionLimit() { return selectionLimit; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSelectionLimit File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getSelectionLimit
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public void onTurnEnded(TurnEndedEvent event) { super.onTurnEnded(event); final String out = event.getTurnSnapshot().getRobots()[0].getOutputStreamSnapshot(); if (out.contains("access denied (java.net.SocketPermission") || out.contains("access denied (\"java.net.SocketPermission\"")) { messagedAccessDenied = true; } }
Vulnerability Classification: - CWE: CWE-862 - CVE: CVE-2019-10648 - Severity: HIGH - CVSS Score: 7.5 Description: Bug-406: DNS interaction is not blocked by Robocode's security manager + test(s) to verify the fix Function: onTurnEnded File: robocode.tests/src/test/java/net/sf/robocode/test/robots/TestHttpAttack.java Repository: robo-code/robocode Fixed Code: @Override public void onTurnEnded(TurnEndedEvent event) { super.onTurnEnded(event); final String out = event.getTurnSnapshot().getRobots()[0].getOutputStreamSnapshot(); if (out.contains("java.lang.SecurityException:")) { securityExceptionOccurred = true; } }
[ "CWE-862" ]
CVE-2019-10648
HIGH
7.5
robo-code/robocode
onTurnEnded
robocode.tests/src/test/java/net/sf/robocode/test/robots/TestHttpAttack.java
836c84635e982e74f2f2771b2c8640c3a34221bd
1
Analyze the following code function for security vulnerabilities
@Override public void notifyPinnedStackAnimationEnded() { synchronized (this) { mHandler.removeMessages(NOTIFY_PINNED_STACK_ANIMATION_ENDED_LISTENERS_MSG); mHandler.obtainMessage( NOTIFY_PINNED_STACK_ANIMATION_ENDED_LISTENERS_MSG).sendToTarget(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyPinnedStackAnimationEnded 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
notifyPinnedStackAnimationEnded
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@POST @Operation(summary = "Post attachment", description = "Upload the attachment of a message.") @Path("posts/{messageKey}/attachments") @ApiResponse(responseCode = "200", description = "Ok.") @ApiResponse(responseCode = "404", description = " The identity or the portrait not found") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response replyToPostAttachment(@PathParam("messageKey") Long messageKey, @FormParam("filename") String filename, @FormParam("file") String file, @Context HttpServletRequest request) { byte[] fileAsBytes = Base64.decodeBase64(file); InputStream in = new ByteArrayInputStream(fileAsBytes); return attachToPost(messageKey, filename, in, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replyToPostAttachment File: src/main/java/org/olat/modules/fo/restapi/ForumWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
replyToPostAttachment
src/main/java/org/olat/modules/fo/restapi/ForumWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
private boolean extractPkcs12Internal(String password) throws Exception { // TODO: add test about this java.security.KeyStore keystore = java.security.KeyStore.getInstance("PKCS12"); PasswordProtection passwordProtection = new PasswordProtection(password.toCharArray()); keystore.load(new ByteArrayInputStream(getData(KeyChain.EXTRA_PKCS12)), passwordProtection.getPassword()); Enumeration<String> aliases = keystore.aliases(); if (!aliases.hasMoreElements()) { return false; } while (aliases.hasMoreElements()) { String alias = aliases.nextElement(); KeyStore.Entry entry = keystore.getEntry(alias, passwordProtection); Log.d(TAG, "extracted alias = " + alias + ", entry=" + entry.getClass()); if (entry instanceof PrivateKeyEntry) { if (TextUtils.isEmpty(mName)) { mName = alias; } return installFrom((PrivateKeyEntry) entry); } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractPkcs12Internal File: src/com/android/certinstaller/CredentialHelper.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
extractPkcs12Internal
src/com/android/certinstaller/CredentialHelper.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
public String getMaterialOptions() { return first() == null ? "" : first().getType(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaterialOptions File: domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
getMaterialOptions
domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
private void handleSendNetworkLoggingNotification() { final PackageManagerInternal pm = mInjector.getPackageManagerInternal(); final Intent intent = new Intent(DevicePolicyManager.ACTION_SHOW_DEVICE_MONITORING_DIALOG); intent.setPackage(pm.getSystemUiServiceComponent().getPackageName()); mNetworkLoggingNotificationUserId = getCurrentForegroundUserId(); // Simple notification clicks are immutable final PendingIntent pendingIntent = PendingIntent.getBroadcastAsUser(mContext, 0, intent, PendingIntent.FLAG_IMMUTABLE, UserHandle.CURRENT); final String title = getNetworkLoggingTitle(); final String text = getNetworkLoggingText(); Notification notification = new Notification.Builder(mContext, SystemNotificationChannels.DEVICE_ADMIN) .setSmallIcon(R.drawable.ic_info_outline) .setContentTitle(title) .setContentText(text) .setTicker(title) .setShowWhen(true) .setContentIntent(pendingIntent) .setStyle(new Notification.BigTextStyle().bigText(text)) .build(); Slogf.i(LOG_TAG, "Sending network logging notification to user %d", mNetworkLoggingNotificationUserId); mInjector.getNotificationManager().notifyAsUser(/* tag= */ null, SystemMessage.NOTE_NETWORK_LOGGING, notification, UserHandle.of(mNetworkLoggingNotificationUserId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleSendNetworkLoggingNotification File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
handleSendNetworkLoggingNotification
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void onFocusChange (View v, boolean hasFocus) { final int id = v.getId(); if (hasFocus && (id == R.id.subject || id == R.id.body)) { // Collapse cc/bcc iff both are empty final boolean showCcBccFields = !TextUtils.isEmpty(mCc.getText()) || !TextUtils.isEmpty(mBcc.getText()); mCcBccView.show(false /* animate */, showCcBccFields, showCcBccFields); mCcBccButton.setVisibility(showCcBccFields ? View.GONE : View.VISIBLE); // On phones autoscroll down so that Cc aligns to the top if we are showing cc/bcc. if (getResources().getBoolean(R.bool.auto_scroll_cc) && showCcBccFields) { final int[] coords = new int[2]; mCc.getLocationOnScreen(coords); // Subtract status bar and action bar height from y-coord. getWindow().getDecorView().getWindowVisibleDisplayFrame(mRect); final int deltaY = coords[1] - getSupportActionBar().getHeight() - mRect.top; // Only scroll down if (deltaY > 0) { mScrollView.smoothScrollBy(0, deltaY); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onFocusChange 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
onFocusChange
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private OnClickListener getSettingsOnClickListener() { if (mAppUid >= 0 && mOnSettingsClickListener != null && mIsDeviceProvisioned) { final int appUidF = mAppUid; return ((View view) -> { mOnSettingsClickListener.onClick(view, mNotificationChannel, appUidF); }); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSettingsOnClickListener File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
getSettingsOnClickListener
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
private boolean isGlobalLogout(Request request) { return request.getParameter(GeneralConstants.GLOBAL_LOGOUT) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isGlobalLogout 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
isGlobalLogout
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
public SerializationConfig addPortableFactoryClass(int factoryId, Class<? extends PortableFactory> portableFactoryClass) { String portableFactoryClassName = isNotNull(portableFactoryClass, "portableFactoryClass").getName(); return addPortableFactoryClass(factoryId, portableFactoryClassName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addPortableFactoryClass File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
addPortableFactoryClass
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public int getDispatchQueueSize() { synchronized (dispatchQueue) { return dispatchQueue.size(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDispatchQueueSize File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
getDispatchQueueSize
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
@Override public void flingTopOverscroll(float velocity, boolean open) { if (!mQsOverscrollExpansionEnabled) { return; } mLastOverscroll = 0f; mQsExpansionFromOverscroll = false; setQsExpansion(mQsExpansionHeight); flingSettings(!mQsExpansionEnabled && open ? 0f : velocity, open && mQsExpansionEnabled, new Runnable() { @Override public void run() { mStackScrollerOverscrolling = false; setOverScrolling(false); updateQsState(); } }, false /* isClick */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: flingTopOverscroll File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
flingTopOverscroll
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public WebSocket.Definition ws(final String path, final WebSocket.OnOpen handler) { WebSocket.Definition ws = new WebSocket.Definition(path, handler); checkArgument(bag.add(ws), "Duplicated path: '%s'", path); return ws; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ws File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
ws
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public Builder extend(Builder builder);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extend File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
extend
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public String getMessage(String messageId, Object... args) { Context ctx = Context.getCurrentContext(); return getMessage(messageId, ctx.getLocale(), args); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMessage File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java Repository: spacewalkproject/spacewalk The code follows secure coding practices.
[ "CWE-79" ]
CVE-2016-3079
MEDIUM
4.3
spacewalkproject/spacewalk
getMessage
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
7b9ff9ad
0
Analyze the following code function for security vulnerabilities
private static NamingException handleException(Exception e) { final Logger LOGGER = Logging.getLogger(GeoTools.class); final String propFileName = "jndi.properties"; if (LOGGER.isLoggable(Level.WARNING)) { StringBuilder sb = new StringBuilder(); sb.append("Error while retriving Initial Context.\n\n") .append("Exception: ") .append(e.getMessage()) .append("\n"); Object contextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY); sb.append("Factory could be taken from System property: ") .append(Context.INITIAL_CONTEXT_FACTORY) .append("=") .append(contextFactory == null ? "" : (String) contextFactory) .append("\n"); Enumeration<URL> urls = AccessController.doPrivileged( new PrivilegedAction<Enumeration<URL>>() { @Override public Enumeration<URL> run() { try { return ClassLoader.getSystemResources(propFileName); } catch (IOException e) { return null; } } }); if (urls != null) { sb.append("Or from these property files:\n"); while (urls.hasMoreElements()) { sb.append(urls.nextElement().getPath()).append("\n"); } sb.append("\n"); } String javaHome = AccessController.doPrivileged( new PrivilegedAction<String>() { @Override public String run() { try { String javahome = System.getProperty("java.home"); if (javahome == null) { return null; } String pathname = javahome + java.io.File.separator + "lib" + java.io.File.separator + propFileName; return pathname; } catch (Exception e) { return null; } } }); if (javaHome != null) { sb.append("Or from a file specified by system property java.home:\n") .append(javaHome) .append("\n"); } LOGGER.log(Level.WARNING, sb.toString()); } NamingException throwing = new NamingException("Couldn't get Initial context."); throwing.setRootCause(e); return throwing; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleException File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java Repository: geotools The code follows secure coding practices.
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
handleException
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
@Override public Node appendChild(Node newChild) throws DOMException { return doc.appendChild(newChild); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendChild File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
appendChild
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Override public int getFormatFeatures() { // No parser features, yet return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFormatFeatures File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
getFormatFeatures
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public void reloadConfig(boolean init, boolean reset) { Path curConfig = Paths.get("config.yaml"); if (init) { if (reset) { InputStream is = this.getClass().getClassLoader().getResourceAsStream("config.yaml"); configStr = IOUtil.readStringFromIs(is); } else { if (Files.exists(curConfig)) { try { configStr = new String(Files.readAllBytes(curConfig)); } catch (Exception ex) { logger.error(ex); } } else { InputStream is = this.getClass().getClassLoader().getResourceAsStream("config.yaml"); configStr = IOUtil.readStringFromIs(is); } } } else { if (Files.exists(curConfig)) { try { configStr = new String(Files.readAllBytes(curConfig)); } catch (Exception ex) { logger.error(ex); } } } configTemplate = configStr; Yaml yaml = new Yaml(); configObj = yaml.load(configStr); try { if (StringUtil.notEmpty(configPath)) { Files.write(Paths.get(configPath), configStr.getBytes(StandardCharsets.UTF_8)); Files.write(curConfig, configStr.getBytes(StandardCharsets.UTF_8)); } } catch (Exception ex) { logger.error(ex); } for (Map.Entry<String, Object> entry : configObj.entrySet()) { if (entry.getKey().equals("plugins")) { Map<String, Object> plugins = (Map<String, Object>) entry.getValue(); for (Map.Entry<String, Object> plugin : plugins.entrySet()) { if (plugin.getKey().equals("baseline")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); baselineCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("brute-force")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); bruteForceCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("cmd-injection")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); cmdInjectionCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("crlf-injection")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); crlfInjectionCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("dirscan")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); dirscanCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("fastjson")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); fastjsonCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("jsonp")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); jsonpCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("path-traversal")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); pathTraversalCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("phantasm")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); phantasmCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("redirect")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); redirectCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("shiro")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); shiroCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("sqldet")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); sqldetCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("ssrf")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); ssrfCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("struts")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); strutsCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("thinkphp")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); thinkphpCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("upload")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); uploadCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("xss")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); xssCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("xxe")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); xxeCheckBox.setSelected((boolean) (items.get("enabled"))); } } } } String data = null; for (Map.Entry<String, Object> entry : configObj.entrySet()) { if (entry.getKey().equals("http")) { Map<String, Object> httpModule = (Map<String, Object>) entry.getValue(); data = (String) httpModule.get("proxy"); } } if (data != null) { proxyText.setText(data); } for (Map.Entry<String, Object> entry : configObj.entrySet()) { if (entry.getKey().equals("reverse")) { Map<String, Object> reverse = (Map<String, Object>) entry.getValue(); Map<String, Object> client = (Map<String, Object>) reverse.get("client"); String token = (String) reverse.get("token"); String httpUrl = (String) client.get("http_base_url"); String dnsServer = (String) client.get("dns_server_ip"); if (StringUtil.notEmpty(httpUrl) || StringUtil.notEmpty(dnsServer)) { client.put("remote_server", true); } tokenText.setText(token); httpReverseText.setText(httpUrl); dnsText.setText(dnsServer); } } }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2022-41958 - Severity: HIGH - CVSS Score: 7.8 Description: yaml rce Function: reloadConfig File: src/main/java/com/chaitin/xray/form/MainForm.java Repository: 4ra1n/super-xray Fixed Code: @SuppressWarnings("unchecked") public void reloadConfig(boolean init, boolean reset) { Path curConfig = Paths.get("config.yaml"); if (init) { if (reset) { InputStream is = this.getClass().getClassLoader().getResourceAsStream("config.yaml"); configStr = IOUtil.readStringFromIs(is); } else { if (Files.exists(curConfig)) { try { configStr = new String(Files.readAllBytes(curConfig)); } catch (Exception ex) { logger.error(ex); } } else { InputStream is = this.getClass().getClassLoader().getResourceAsStream("config.yaml"); configStr = IOUtil.readStringFromIs(is); } } } else { if (Files.exists(curConfig)) { try { configStr = new String(Files.readAllBytes(curConfig)); } catch (Exception ex) { logger.error(ex); } } } configTemplate = configStr; Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); configObj = yaml.load(configStr); try { if (StringUtil.notEmpty(configPath)) { Files.write(Paths.get(configPath), configStr.getBytes(StandardCharsets.UTF_8)); Files.write(curConfig, configStr.getBytes(StandardCharsets.UTF_8)); } } catch (Exception ex) { logger.error(ex); } for (Map.Entry<String, Object> entry : configObj.entrySet()) { if (entry.getKey().equals("plugins")) { Map<String, Object> plugins = (Map<String, Object>) entry.getValue(); for (Map.Entry<String, Object> plugin : plugins.entrySet()) { if (plugin.getKey().equals("baseline")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); baselineCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("brute-force")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); bruteForceCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("cmd-injection")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); cmdInjectionCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("crlf-injection")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); crlfInjectionCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("dirscan")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); dirscanCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("fastjson")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); fastjsonCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("jsonp")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); jsonpCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("path-traversal")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); pathTraversalCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("phantasm")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); phantasmCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("redirect")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); redirectCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("shiro")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); shiroCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("sqldet")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); sqldetCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("ssrf")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); ssrfCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("struts")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); strutsCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("thinkphp")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); thinkphpCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("upload")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); uploadCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("xss")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); xssCheckBox.setSelected((boolean) (items.get("enabled"))); } if (plugin.getKey().equals("xxe")) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); xxeCheckBox.setSelected((boolean) (items.get("enabled"))); } } } } String data = null; for (Map.Entry<String, Object> entry : configObj.entrySet()) { if (entry.getKey().equals("http")) { Map<String, Object> httpModule = (Map<String, Object>) entry.getValue(); data = (String) httpModule.get("proxy"); } } if (data != null) { proxyText.setText(data); } for (Map.Entry<String, Object> entry : configObj.entrySet()) { if (entry.getKey().equals("reverse")) { Map<String, Object> reverse = (Map<String, Object>) entry.getValue(); Map<String, Object> client = (Map<String, Object>) reverse.get("client"); String token = (String) reverse.get("token"); String httpUrl = (String) client.get("http_base_url"); String dnsServer = (String) client.get("dns_server_ip"); if (StringUtil.notEmpty(httpUrl) || StringUtil.notEmpty(dnsServer)) { client.put("remote_server", true); } tokenText.setText(token); httpReverseText.setText(httpUrl); dnsText.setText(dnsServer); } } }
[ "CWE-502" ]
CVE-2022-41958
HIGH
7.8
4ra1n/super-xray
reloadConfig
src/main/java/com/chaitin/xray/form/MainForm.java
4d0d59663596db03f39d7edd2be251d48b52dcfc
1
Analyze the following code function for security vulnerabilities
private void setRightManagementAttributes(final HttpRequest request, final long domainRight) { request.setAttribute("isDomainRW", ((domainRight & ACTION_CREATE_GROUP) != 0) || ((domainRight & ACTION_CREATE_USER) != 0)); request.setAttribute("isUserRW", (domainRight & ACTION_CREATE_USER) != 0); request.setAttribute("isDomainSync", ((domainRight & ACTION_SYNCHRO_USER) != 0) || ((domainRight & ACTION_SYNCHRO_GROUP) != 0)); request.setAttribute("isDomainUnsync", ((domainRight & ACTION_UNSYNCHRO_USER) != 0) || ((domainRight & ACTION_UNSYNCHRO_GROUP) != 0)); request.setAttribute("isDomainListener", ((domainRight & ACTION_RECEIVE_USER) != 0) || ((domainRight & ACTION_RECEIVE_GROUP) != 0)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRightManagementAttributes File: core-war/src/main/java/org/silverpeas/web/jobdomain/servlets/JobDomainPeasRequestRouter.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
setRightManagementAttributes
core-war/src/main/java/org/silverpeas/web/jobdomain/servlets/JobDomainPeasRequestRouter.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
public static <V> SortedMap<Integer,V> filter(SortedMap<Integer,V> map, String from, String to) { if(from==null && to==null) return map; if(to==null) return map.headMap(Integer.parseInt(from)-1); if(from==null) return map.tailMap(Integer.parseInt(to)); return map.subMap(Integer.parseInt(to),Integer.parseInt(from)-1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filter File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
filter
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public String getRemoteAddr() { return remoteAddr; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRemoteAddr File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getRemoteAddr
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public String getAttributePrefix(int index){ return parser.getAttributePrefix(index); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttributePrefix File: main/src/com/google/refine/importers/XmlImporter.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20157
MEDIUM
5
OpenRefine
getAttributePrefix
main/src/com/google/refine/importers/XmlImporter.java
6a0d7d56e4ffb420316ce7849fde881344fbf881
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasKey() { return keySpec != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasKey File: src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
hasKey
src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
@Exported(visibility=3) public String getUpstreamUrl() { return upstreamUrl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUpstreamUrl File: core/src/main/java/hudson/model/Cause.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2067
LOW
3.5
jenkinsci/jenkins
getUpstreamUrl
core/src/main/java/hudson/model/Cause.java
5d57c855f3147bfc5e7fda9252317b428a700014
0
Analyze the following code function for security vulnerabilities
protected void fireIntentResult() { if (intentResult.size() > 0) { final IntentResult response = (IntentResult) intentResult.get(0); if (intentResultListener != null && response != null) { Display.getInstance().callSerially(new Runnable() { @Override public void run() { intentResultListener.onActivityResult(response.getRequestCode(), response.getResultCode(), response.getData()); } }); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fireIntentResult File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
fireIntentResult
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public ClockDifference getClockDifference() { return ClockDifference.ZERO; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClockDifference 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
getClockDifference
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@Deprecated public Notification getNotification() { return build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNotification File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getNotification
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public DescriptorExtensionList compute(Class key) { return DescriptorExtensionList.createDescriptorList(Jenkins.this,key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compute 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
compute
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private boolean isRequestDestroyed(HttpServletRequest request) { return request.getAttribute(REQUEST_DESTROYED) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRequestDestroyed File: impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java Repository: weld/core The code follows secure coding practices.
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
isRequestDestroyed
impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java
8e413202fa1af08c09c580f444e4fd16874f9c65
0
Analyze the following code function for security vulnerabilities
public AbstractProject getBuildingDownstream() { Set<Task> unblockedTasks = Jenkins.getInstance().getQueue().getUnblockedTasks(); for (AbstractProject tup : getTransitiveDownstreamProjects()) { if (tup!=this && (tup.isBuilding() || unblockedTasks.contains(tup))) return tup; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBuildingDownstream File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getBuildingDownstream
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public Object deserialize(JsonParser p, DeserializationContext ctxt, Object bean) throws IOException { // [databind#631]: Assign current value, to be accessible by custom serializers p.setCurrentValue(bean); if (_injectables != null) { injectValues(ctxt, bean); } if (_unwrappedPropertyHandler != null) { return deserializeWithUnwrapped(p, ctxt, bean); } if (_externalTypeIdHandler != null) { return deserializeWithExternalTypeId(p, ctxt, bean); } String propName; // 23-Mar-2010, tatu: In some cases, we start with full JSON object too... if (p.isExpectedStartObjectToken()) { propName = p.nextFieldName(); if (propName == null) { return bean; } } else { if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME)) { propName = p.currentName(); } else { return bean; } } if (_needViewProcesing) { Class<?> view = ctxt.getActiveView(); if (view != null) { return deserializeWithView(p, ctxt, bean, view); } } do { p.nextToken(); SettableBeanProperty prop = _beanProperties.find(propName); if (prop != null) { // normal case try { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt); } continue; } handleUnknownVanilla(p, ctxt, bean, propName); } while ((propName = p.nextFieldName()) != null); return bean; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserialize File: src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42004
HIGH
7.5
FasterXML/jackson-databind
deserialize
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
063183589218fec19a9293ed2f17ec53ea80ba88
0
Analyze the following code function for security vulnerabilities
private PdfArray findOrphanPages() { PdfArray pages = new PdfArray(); for (int idx = 0; idx < xrefObj.size(); ++idx) { PdfObject obj = getPdfObject(idx); if (obj == null || !obj.isDictionary()) continue; PdfDictionary dict = (PdfDictionary)(obj); if (!PdfName.PAGE.equals(dict.get(PdfName.TYPE))) continue; pages.add(new PRIndirectReference(this, idx)); } return pages; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findOrphanPages File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
findOrphanPages
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public static String generateClient(String language, GeneratorInput opts) { return generate(language, opts, Type.CLIENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateClient File: modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21428
MEDIUM
4.4
OpenAPITools/openapi-generator
generateClient
modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java
be64b6f1b3d4d7b6cfdce12c0f3953be6a1ff195
0
Analyze the following code function for security vulnerabilities
Bundle getBundleForUnreadConversation() { Bundle b = new Bundle(); String author = null; if (mParticipants != null && mParticipants.length > 1) { author = mParticipants[0]; } Parcelable[] messages = new Parcelable[mMessages.length]; for (int i = 0; i < messages.length; i++) { Bundle m = new Bundle(); m.putString(KEY_TEXT, mMessages[i]); m.putString(KEY_AUTHOR, author); messages[i] = m; } b.putParcelableArray(KEY_MESSAGES, messages); if (mRemoteInput != null) { b.putParcelable(KEY_REMOTE_INPUT, mRemoteInput); } b.putParcelable(KEY_ON_REPLY, mReplyPendingIntent); b.putParcelable(KEY_ON_READ, mReadPendingIntent); b.putStringArray(KEY_PARTICIPANTS, mParticipants); b.putLong(KEY_TIMESTAMP, mLatestTimestamp); return b; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBundleForUnreadConversation File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getBundleForUnreadConversation
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void setCaptcha(String captcha) { this.captcha = captcha; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCaptcha File: src/com/dotmarketing/cms/comment/struts/CommentsForm.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-254", "CWE-264" ]
CVE-2016-8600
MEDIUM
5
dotCMS/core
setCaptcha
src/com/dotmarketing/cms/comment/struts/CommentsForm.java
cb84b130065c9eed1d1df9e4770ffa5d4bd30569
0
Analyze the following code function for security vulnerabilities
@Override public void setNonce(long nonce) { n = nonce; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNonce File: src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
setNonce
src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
public String localBranch() { return RefSpecHelper.localBranch(branch); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: localBranch 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
localBranch
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public void setFrontActivityScreenCompatMode(int mode) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFrontActivityScreenCompatMode File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setFrontActivityScreenCompatMode
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override boolean check(LockConfig c1, LockConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getName(), c2.getName()) && nullSafeEqual(c1.getQuorumName(), c2.getQuorumName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private T buildFromCodec(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder) { int maxConsecutiveEmptyDataFrames = decoderEnforceMaxConsecutiveEmptyDataFrames(); if (maxConsecutiveEmptyDataFrames > 0) { decoder = new Http2EmptyDataFrameConnectionDecoder(decoder, maxConsecutiveEmptyDataFrames); } final T handler; try { // Call the abstract build method handler = build(decoder, encoder, initialSettings); } catch (Throwable t) { encoder.close(); decoder.close(); throw new IllegalStateException("failed to build an Http2ConnectionHandler", t); } // Setup post build options handler.gracefulShutdownTimeoutMillis(gracefulShutdownTimeoutMillis); if (handler.decoder().frameListener() == null) { handler.decoder().frameListener(frameListener); } return handler; }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-44487 - Severity: HIGH - CVSS Score: 7.5 Description: Merge pull request from GHSA-xpw8-rcwv-8f8p Motivation: It's possible for a remote peer to overload a remote system by issue a huge amount of RST frames. While this is completely valid in terms of the RFC we need to limit the amount to protect against DDOS attacks. Modifications: Add protection against RST floods which is enabled by default. Result: Protect against DDOS caused by RST floods (CVE-2023-44487) Function: buildFromCodec File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java Repository: netty Fixed Code: private T buildFromCodec(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder) { int maxConsecutiveEmptyDataFrames = decoderEnforceMaxConsecutiveEmptyDataFrames(); if (maxConsecutiveEmptyDataFrames > 0) { decoder = new Http2EmptyDataFrameConnectionDecoder(decoder, maxConsecutiveEmptyDataFrames); } if (maxRstFramesPerWindow > 0 && secondsPerWindow > 0) { decoder = new Http2MaxRstFrameDecoder(decoder, maxRstFramesPerWindow, secondsPerWindow); } final T handler; try { // Call the abstract build method handler = build(decoder, encoder, initialSettings); } catch (Throwable t) { encoder.close(); decoder.close(); throw new IllegalStateException("failed to build an Http2ConnectionHandler", t); } // Setup post build options handler.gracefulShutdownTimeoutMillis(gracefulShutdownTimeoutMillis); if (handler.decoder().frameListener() == null) { handler.decoder().frameListener(frameListener); } return handler; }
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
netty
buildFromCodec
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
1
Analyze the following code function for security vulnerabilities
public Date getRequestedOn() { return requestedOn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequestedOn File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4727
MEDIUM
6.1
openmrs/openmrs-module-appointmentscheduling
getRequestedOn
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
public @Nullable Time getTime( String c, java.util.@Nullable Calendar cal) throws SQLException { return getTime(findColumn(c), cal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTime 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
getTime
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
protected boolean isContentAlwaysEmpty(HttpMessage msg) { if (msg instanceof HttpResponse) { HttpResponse res = (HttpResponse) msg; int code = res.status().code(); // Correctly handle return codes of 1xx. // // See: // - https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html Section 4.4 // - https://github.com/netty/netty/issues/222 if (code >= 100 && code < 200) { // One exception: Hixie 76 websocket handshake response return !(code == 101 && !res.headers().contains(HttpHeaderNames.SEC_WEBSOCKET_ACCEPT) && res.headers().contains(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET, true)); } switch (code) { case 204: case 304: return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isContentAlwaysEmpty File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-21295
LOW
2.6
netty
isContentAlwaysEmpty
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
89c241e3b1795ff257af4ad6eadc616cb2fb3dc4
0
Analyze the following code function for security vulnerabilities
@Transactional @Override public void move(Collection<Project> projects, Project parent) { for (Project project: projects) { String oldPath = project.getPath(); project.setParent(parent); save(project, oldPath); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: move File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
move
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
public static void initPageVariables(JellyContext context) { String rootURL = Stapler.getCurrentRequest().getContextPath(); Functions h = new Functions(); context.setVariable("h", h); // The path starts with a "/" character but does not end with a "/" character. context.setVariable("rootURL", rootURL); /* load static resources from the path dedicated to a specific version. This "/static/VERSION/abc/def.ghi" path is interpreted by stapler to be the same thing as "/abc/def.ghi", but this avoids the stale cache problem when the user upgrades to new Jenkins. Stapler also sets a long future expiration dates for such static resources. see https://wiki.jenkins-ci.org/display/JENKINS/Hyperlinks+in+HTML */ context.setVariable("resURL",rootURL+getResourcePath()); context.setVariable("imagesURL",rootURL+getResourcePath()+"/images"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initPageVariables File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
initPageVariables
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public void setPendingIntentLaunchFlags(@android.content.Intent.Flags int flags) { mPendingIntentLaunchFlags = flags; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPendingIntentLaunchFlags File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
setPendingIntentLaunchFlags
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
private String normalizeText(String text) { String[] tokens = StringUtils.split(text, "\n"); for (int i = 0; i < tokens.length; i++) { tokens[i] = tokens[i].trim(); } return StringUtils.join(tokens, " ").trim(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: normalizeText File: src/main/java/apoc/load/Xml.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000820
HIGH
7.5
neo4j-contrib/neo4j-apoc-procedures
normalizeText
src/main/java/apoc/load/Xml.java
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
0
Analyze the following code function for security vulnerabilities
private File file(String ...paths) { File rc = null ; for (String path : paths) { if( rc == null ) { rc = new File(path); } else { rc = new File(rc, path); } } return rc; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: file File: hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java Repository: fusesource/hawtjni The code follows secure coding practices.
[ "CWE-94" ]
CVE-2013-2035
MEDIUM
4.4
fusesource/hawtjni
file
hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java
92c266170ce98edc200c656bd034a237098b8aa5
0
Analyze the following code function for security vulnerabilities
@Override public void resizeTask(int taskId, Rect r) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(taskId); r.writeToParcel(data, 0); mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizeTask File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
resizeTask
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public static String serialize(Node node) { return serialize(node, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serialize File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java Repository: xwiki/xwiki-commons The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-24898
MEDIUM
4
xwiki/xwiki-commons
serialize
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
947e8921ebd95462d5a7928f397dd1b64f77c7d5
0
Analyze the following code function for security vulnerabilities
public void addErrorToDropBox(String eventType, ProcessRecord process, String processName, ActivityRecord activity, ActivityRecord parent, String subject, final String report, final File dataFile, final ApplicationErrorReport.CrashInfo crashInfo) { // NOTE -- this must never acquire the ActivityManagerService lock, // otherwise the watchdog may be prevented from resetting the system. // Bail early if not published yet if (ServiceManager.getService(Context.DROPBOX_SERVICE) == null) return; final DropBoxManager dbox = mContext.getSystemService(DropBoxManager.class); // Exit early if the dropbox isn't configured to accept this report type. final String dropboxTag = processClass(process) + "_" + eventType; if (dbox == null || !dbox.isTagEnabled(dropboxTag)) return; // Rate-limit how often we're willing to do the heavy lifting below to // collect and record logs; currently 5 logs per 10 second period. final long now = SystemClock.elapsedRealtime(); if (now - mWtfClusterStart > 10 * DateUtils.SECOND_IN_MILLIS) { mWtfClusterStart = now; mWtfClusterCount = 1; } else { if (mWtfClusterCount++ >= 5) return; } final StringBuilder sb = new StringBuilder(1024); appendDropBoxProcessHeaders(process, processName, sb); if (process != null) { sb.append("Foreground: ") .append(process.isInterestingToUserLocked() ? "Yes" : "No") .append("\n"); } if (activity != null) { sb.append("Activity: ").append(activity.shortComponentName).append("\n"); } if (parent != null && parent.app != null && parent.app.pid != process.pid) { sb.append("Parent-Process: ").append(parent.app.processName).append("\n"); } if (parent != null && parent != activity) { sb.append("Parent-Activity: ").append(parent.shortComponentName).append("\n"); } if (subject != null) { sb.append("Subject: ").append(subject).append("\n"); } sb.append("Build: ").append(Build.FINGERPRINT).append("\n"); if (Debug.isDebuggerConnected()) { sb.append("Debugger: Connected\n"); } sb.append("\n"); // Do the rest in a worker thread to avoid blocking the caller on I/O // (After this point, we shouldn't access AMS internal data structures.) Thread worker = new Thread("Error dump: " + dropboxTag) { @Override public void run() { if (report != null) { sb.append(report); } String setting = Settings.Global.ERROR_LOGCAT_PREFIX + dropboxTag; int lines = Settings.Global.getInt(mContext.getContentResolver(), setting, 0); int maxDataFileSize = DROPBOX_MAX_SIZE - sb.length() - lines * RESERVED_BYTES_PER_LOGCAT_LINE; if (dataFile != null && maxDataFileSize > 0) { try { sb.append(FileUtils.readTextFile(dataFile, maxDataFileSize, "\n\n[[TRUNCATED]]")); } catch (IOException e) { Slog.e(TAG, "Error reading " + dataFile, e); } } if (crashInfo != null && crashInfo.stackTrace != null) { sb.append(crashInfo.stackTrace); } if (lines > 0) { sb.append("\n"); // Merge several logcat streams, and take the last N lines InputStreamReader input = null; try { java.lang.Process logcat = new ProcessBuilder( "/system/bin/timeout", "-k", "15s", "10s", "/system/bin/logcat", "-v", "threadtime", "-b", "events", "-b", "system", "-b", "main", "-b", "crash", "-t", String.valueOf(lines)) .redirectErrorStream(true).start(); try { logcat.getOutputStream().close(); } catch (IOException e) {} try { logcat.getErrorStream().close(); } catch (IOException e) {} input = new InputStreamReader(logcat.getInputStream()); int num; char[] buf = new char[8192]; while ((num = input.read(buf)) > 0) sb.append(buf, 0, num); } catch (IOException e) { Slog.e(TAG, "Error running logcat", e); } finally { if (input != null) try { input.close(); } catch (IOException e) {} } } dbox.addText(dropboxTag, sb.toString()); } }; if (process == null) { // If process is null, we are being called from some internal code // and may be about to die -- run this synchronously. final int oldMask = StrictMode.allowThreadDiskWritesMask(); try { worker.run(); } finally { StrictMode.setThreadPolicyMask(oldMask); } } else { worker.start(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addErrorToDropBox 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
addErrorToDropBox
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override protected void onResume() { super.onResume(); if (mState == STATE_INIT) { mState = STATE_RUNNING; } else { if (mNextAction != null) { mNextAction.run(this); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onResume File: src/com/android/certinstaller/CertInstaller.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
onResume
src/com/android/certinstaller/CertInstaller.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
public Object get(String key) throws JSONException { Object o = opt(key); if (o == null) { throw new JSONException("JSONObject[" + quote(key) + "] not found."); } return o; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
get
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public int[] getPackageGidsEtc(String packageName, int flags, int userId) { if (!sUserManager.exists(userId)) { return null; } enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "getPackageGids"); // reader synchronized (mPackages) { final PackageParser.Package p = mPackages.get(packageName); if (p != null) { PackageSetting ps = (PackageSetting) p.mExtras; return ps.getPermissionsState().computeGids(userId); } if ((flags & PackageManager.GET_UNINSTALLED_PACKAGES) != 0) { final PackageSetting ps = mSettings.mPackages.get(packageName); if (ps != null) { return ps.getPermissionsState().computeGids(userId); } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageGidsEtc 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
getPackageGidsEtc
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public boolean isBleTurningOff() { return mIsBleTurningOff; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBleTurningOff 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
isBleTurningOff
src/com/android/bluetooth/btservice/AdapterState.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
private static File getStateFile(int userId) { return new File(Environment.getUserSystemDirectory(userId), STATE_FILENAME); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStateFile 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
getStateFile
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public HistoryEntryManager getHistoryEntryManager() { return new FileHistoryEntryManager(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHistoryEntryManager File: main/src/com/google/refine/io/FileProjectManager.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-37476
HIGH
7.8
OpenRefine
getHistoryEntryManager
main/src/com/google/refine/io/FileProjectManager.java
e9c1e65d58b47aec8cd676bd5c07d97b002f205e
0
Analyze the following code function for security vulnerabilities
@Nullable public String getJournalMode() { return mJournalMode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJournalMode File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
getJournalMode
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public void setData(Map<String, Object> data) { this.data = data; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setData File: web/play-java-forms/src/main/java/play/data/DynamicForm.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
setData
web/play-java-forms/src/main/java/play/data/DynamicForm.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
public static void validate(StartElement startElement, String tag) { String foundElementTag = getStartElementName(startElement); if (!tag.equals(foundElementTag)) throw logger.parserExpectedTag(tag, foundElementTag); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validate File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java Repository: keycloak The code follows secure coding practices.
[ "CWE-200" ]
CVE-2017-2582
MEDIUM
4
keycloak
validate
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
0cb5ba0f6e83162d221681f47b470c3042eef237
0
Analyze the following code function for security vulnerabilities
final ProcessRecord getProcessRecordLocked(String processName, int uid, boolean keepIfLarge) { if (uid == Process.SYSTEM_UID) { // The system gets to run in any process. If there are multiple // processes with the same uid, just pick the first (this // should never happen). SparseArray<ProcessRecord> procs = mProcessNames.getMap().get(processName); if (procs == null) return null; final int N = procs.size(); for (int i = 0; i < N; i++) { if (UserHandle.isSameUser(procs.keyAt(i), uid)) return procs.valueAt(i); } } ProcessRecord proc = mProcessNames.get(processName, uid); if (false && proc != null && !keepIfLarge && proc.setProcState >= ActivityManager.PROCESS_STATE_CACHED_EMPTY && proc.lastCachedPss >= 4000) { // Turn this condition on to cause killing to happen regularly, for testing. if (proc.baseProcessTracker != null) { proc.baseProcessTracker.reportCachedKill(proc.pkgList, proc.lastCachedPss); } proc.kill(Long.toString(proc.lastCachedPss) + "k from cached", true); } else if (proc != null && !keepIfLarge && mLastMemoryLevel > ProcessStats.ADJ_MEM_FACTOR_NORMAL && proc.setProcState >= ActivityManager.PROCESS_STATE_CACHED_EMPTY) { if (DEBUG_PSS) Slog.d(TAG, "May not keep " + proc + ": pss=" + proc.lastCachedPss); if (proc.lastCachedPss >= mProcessList.getCachedRestoreThresholdKb()) { if (proc.baseProcessTracker != null) { proc.baseProcessTracker.reportCachedKill(proc.pkgList, proc.lastCachedPss); } proc.kill(Long.toString(proc.lastCachedPss) + "k from cached", true); } } return proc; }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2015-3844 - Severity: MEDIUM - CVSS Score: 6.8 Description: Prevent system uid component from running in an app process Bug: 21669445 Change-Id: I11d0bc5301d7e2a64972221f54f3cbd611f8e404 (cherry picked from commit 44368567f840e3469b5fd2c9399ed444b6f46ebf) Function: getProcessRecordLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android Fixed Code: final ProcessRecord getProcessRecordLocked(String processName, int uid, boolean keepIfLarge) { if (uid == Process.SYSTEM_UID) { // The system gets to run in any process. If there are multiple // processes with the same uid, just pick the first (this // should never happen). SparseArray<ProcessRecord> procs = mProcessNames.getMap().get(processName); if (procs == null) return null; final int procCount = procs.size(); for (int i = 0; i < procCount; i++) { final int procUid = procs.keyAt(i); if (UserHandle.isApp(procUid) || !UserHandle.isSameUser(procUid, uid)) { // Don't use an app process or different user process for system component. continue; } return procs.valueAt(i); } } ProcessRecord proc = mProcessNames.get(processName, uid); if (false && proc != null && !keepIfLarge && proc.setProcState >= ActivityManager.PROCESS_STATE_CACHED_EMPTY && proc.lastCachedPss >= 4000) { // Turn this condition on to cause killing to happen regularly, for testing. if (proc.baseProcessTracker != null) { proc.baseProcessTracker.reportCachedKill(proc.pkgList, proc.lastCachedPss); } proc.kill(Long.toString(proc.lastCachedPss) + "k from cached", true); } else if (proc != null && !keepIfLarge && mLastMemoryLevel > ProcessStats.ADJ_MEM_FACTOR_NORMAL && proc.setProcState >= ActivityManager.PROCESS_STATE_CACHED_EMPTY) { if (DEBUG_PSS) Slog.d(TAG, "May not keep " + proc + ": pss=" + proc.lastCachedPss); if (proc.lastCachedPss >= mProcessList.getCachedRestoreThresholdKb()) { if (proc.baseProcessTracker != null) { proc.baseProcessTracker.reportCachedKill(proc.pkgList, proc.lastCachedPss); } proc.kill(Long.toString(proc.lastCachedPss) + "k from cached", true); } } return proc; }
[ "CWE-264" ]
CVE-2015-3844
MEDIUM
6.8
android
getProcessRecordLocked
services/core/java/com/android/server/am/ActivityManagerService.java
e3cde784e3d99966f313fe00dcecf191f6a44a31
1
Analyze the following code function for security vulnerabilities
@Override public Collection<LBMember> listMembers() { return members.values(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listMembers File: src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java Repository: floodlight The code follows secure coding practices.
[ "CWE-362", "CWE-476" ]
CVE-2015-6569
MEDIUM
4.3
floodlight
listMembers
src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java
7f5bedb625eec3ff4d29987c31cef2553a962b36
0
Analyze the following code function for security vulnerabilities
@Override public ActivityManager.TaskDescription getTaskDescription(int id) { synchronized (mGlobalLock) { enforceTaskPermission("getTaskDescription()"); final Task tr = mRootWindowContainer.anyTaskForId(id, MATCH_ATTACHED_TASK_OR_RECENT_TASKS); if (tr != null) { return tr.getTaskDescription(); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTaskDescription File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getTaskDescription
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public void setCredentialManagerPolicy(PackagePolicy policy) { if (!mHasFeature) { return; } final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(canWriteCredentialManagerPolicy(caller)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller.getUserId()); if (Objects.equals(admin.mCredentialManagerPolicy, policy)) { return; } admin.mCredentialManagerPolicy = policy; saveSettingsLocked(caller.getUserId()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCredentialManagerPolicy 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
setCredentialManagerPolicy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void resumeAppSwitches() { enforceCallerIsRecentsOrHasPermission(STOP_APP_SWITCHES, "resumeAppSwitches"); synchronized(this) { // Note that we don't execute any pending app switches... we will // let those wait until either the timeout, or the next start // activity request. mAppSwitchesAllowedTime = 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resumeAppSwitches 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
resumeAppSwitches
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected boolean regCodeIsRoaming (int code) { // 5 is "in service -- roam" return 5 == code; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: regCodeIsRoaming File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
regCodeIsRoaming
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0