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
public String display(String fieldname, XWikiContext context) { String result = ""; try { BaseObject object = getXObject(); if (object == null) { object = getFirstObject(fieldname, context); } result = display(fieldname, object, context); } catch (Exception e) { LOGGER.error("Failed to display field [" + fieldname + "] of document [" + getDefaultEntityReferenceSerializer().serialize(getDocumentReference()) + "]", e); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: display File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
display
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private void closeFile(PrintWriter writer) { writer.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeFile File: web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-24830
HIGH
7.5
OpenClinica
closeFile
web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java
6f864e86543f903bd20d6f9fc7056115106441f3
0
Analyze the following code function for security vulnerabilities
public Pipeline newPipelineWithFirstStageFailed(PipelineConfig config) throws SQLException { Pipeline pipeline = instanceFactory.createPipelineInstance(config, BuildCause.createManualForced(modifyOneFile(new MaterialConfigConverter().toMaterials(config.materialConfigs()), ModificationsMother.currentRevision()), Username.ANONYMOUS), new DefaultSchedulingContext( GoConstants.DEFAULT_APPROVED_BY), md5, new TimeProvider()); savePipelineWithStagesAndMaterials(pipeline); failStage(pipeline.getFirstStage()); return pipeline; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newPipelineWithFirstStageFailed File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
newPipelineWithFirstStageFailed
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
public void rename(String file, String newName) { file = removeFilePrefix(file); new File(file).renameTo(new File(new File(file).getParentFile(), newName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rename 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
rename
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public boolean isTopLevelWindow(int windowType) { if (windowType >= WindowManager.LayoutParams.FIRST_SUB_WINDOW && windowType <= WindowManager.LayoutParams.LAST_SUB_WINDOW) { return (windowType == WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTopLevelWindow 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
isTopLevelWindow
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
protected void handleMessage(Buffer buffer) throws Exception { try { ThreadUtils.runAsInternal(() -> { doHandleMessage(buffer); return null; }); } catch (Throwable e) { DefaultKeyExchangeFuture kexFuture = kexFutureHolder.get(); // if have any ongoing KEX notify it about the failure if (kexFuture != null) { kexFuture.setValue(e); } if (e instanceof Exception) { throw (Exception) e; } else { throw new RuntimeSshException(e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleMessage File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
handleMessage
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public static boolean isDirectoryHidden(@NonNull File dir) { final String name = dir.getName(); if (name.startsWith(".")) { return true; } final File nomedia = new File(dir, ".nomedia"); // check for .nomedia presence if (!nomedia.exists()) { return false; } if (shouldBeVisible(dir.getAbsolutePath())) { nomedia.delete(); return false; } // Handle top-level default directories. These directories should always be visible, // regardless of .nomedia presence. final String[] relativePath = sanitizePath(extractRelativePath(dir.getAbsolutePath())); final boolean isTopLevelDir = relativePath.length == 1 && TextUtils.isEmpty(relativePath[0]); if (isTopLevelDir && isDefaultDirectoryName(name)) { nomedia.delete(); return false; } // DCIM/Camera should always be visible regardless of .nomedia presence. if (CAMERA_RELATIVE_PATH.equalsIgnoreCase( extractRelativePathWithDisplayName(dir.getAbsolutePath()))) { nomedia.delete(); return false; } if (isScreenshotsDirNonHidden(relativePath, name)) { nomedia.delete(); return false; } // .nomedia is present which makes this directory as hidden directory Logging.logPersistent("Observed non-standard " + nomedia); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDirectoryHidden File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
isDirectoryHidden
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
void handleApplicationCrashInner(String eventType, ProcessRecord r, String processName, ApplicationErrorReport.CrashInfo crashInfo) { float loadingProgress = 1; IncrementalMetrics incrementalMetrics = null; // Obtain Incremental information if available if (r != null && r.info != null && r.info.packageName != null) { IncrementalStatesInfo incrementalStatesInfo = mPackageManagerInt.getIncrementalStatesInfo(r.info.packageName, SYSTEM_UID, r.userId); if (incrementalStatesInfo != null) { loadingProgress = incrementalStatesInfo.getProgress(); } final String codePath = r.info.getCodePath(); if (codePath != null && !codePath.isEmpty() && IncrementalManager.isIncrementalPath(codePath)) { // Report in the main log about the incremental package Slog.e(TAG, "App crashed on incremental package " + r.info.packageName + " which is " + ((int) (loadingProgress * 100)) + "% loaded."); final IBinder incrementalService = ServiceManager.getService( Context.INCREMENTAL_SERVICE); if (incrementalService != null) { final IncrementalManager incrementalManager = new IncrementalManager( IIncrementalService.Stub.asInterface(incrementalService)); incrementalMetrics = incrementalManager.getMetrics(codePath); } } } EventLogTags.writeAmCrash(Binder.getCallingPid(), UserHandle.getUserId(Binder.getCallingUid()), processName, r == null ? -1 : r.info.flags, crashInfo.exceptionClassName, crashInfo.exceptionMessage, crashInfo.throwFileName, crashInfo.throwLineNumber); int processClassEnum = processName.equals("system_server") ? ServerProtoEnums.SYSTEM_SERVER : (r != null) ? r.getProcessClassEnum() : ServerProtoEnums.ERROR_SOURCE_UNKNOWN; int uid = (r != null) ? r.uid : -1; int pid = (r != null) ? r.getPid() : -1; FrameworkStatsLog.write(FrameworkStatsLog.APP_CRASH_OCCURRED, uid, eventType, processName, pid, (r != null && r.info != null) ? r.info.packageName : "", (r != null && r.info != null) ? (r.info.isInstantApp() ? FrameworkStatsLog.APP_CRASH_OCCURRED__IS_INSTANT_APP__TRUE : FrameworkStatsLog.APP_CRASH_OCCURRED__IS_INSTANT_APP__FALSE) : FrameworkStatsLog.APP_CRASH_OCCURRED__IS_INSTANT_APP__UNAVAILABLE, r != null ? (r.isInterestingToUserLocked() ? FrameworkStatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__FOREGROUND : FrameworkStatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__BACKGROUND) : FrameworkStatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__UNKNOWN, processClassEnum, incrementalMetrics != null /* isIncremental */, loadingProgress, incrementalMetrics != null ? incrementalMetrics.getMillisSinceOldestPendingRead() : -1, incrementalMetrics != null ? incrementalMetrics.getStorageHealthStatusCode() : -1, incrementalMetrics != null ? incrementalMetrics.getDataLoaderStatusCode() : -1, incrementalMetrics != null && incrementalMetrics.getReadLogsEnabled(), incrementalMetrics != null ? incrementalMetrics.getMillisSinceLastDataLoaderBind() : -1, incrementalMetrics != null ? incrementalMetrics.getDataLoaderBindDelayMillis() : -1, incrementalMetrics != null ? incrementalMetrics.getTotalDelayedReads() : -1, incrementalMetrics != null ? incrementalMetrics.getTotalFailedReads() : -1, incrementalMetrics != null ? incrementalMetrics.getLastReadErrorUid() : -1, incrementalMetrics != null ? incrementalMetrics.getMillisSinceLastReadError() : -1, incrementalMetrics != null ? incrementalMetrics.getLastReadErrorNumber() : 0, incrementalMetrics != null ? incrementalMetrics.getTotalDelayedReadsDurationMillis() : -1 ); if (eventType.equals("native_crash")) { CriticalEventLog.getInstance().logNativeCrash(processClassEnum, processName, uid, pid); } else if (eventType.equals("crash")) { CriticalEventLog.getInstance().logJavaCrash(crashInfo.exceptionClassName, processClassEnum, processName, uid, pid); } final int relaunchReason = r == null ? RELAUNCH_REASON_NONE : r.getWindowProcessController().computeRelaunchReason(); final String relaunchReasonString = relaunchReasonToString(relaunchReason); if (crashInfo.crashTag == null) { crashInfo.crashTag = relaunchReasonString; } else { crashInfo.crashTag = crashInfo.crashTag + " " + relaunchReasonString; } addErrorToDropBox( eventType, r, processName, null, null, null, null, null, null, crashInfo, new Float(loadingProgress), incrementalMetrics, null); mAppErrors.crashApplication(r, crashInfo); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleApplicationCrashInner File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
handleApplicationCrashInner
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public String getBaseResourcePath() { return BASE_RESOURCE_PATH; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseResourcePath File: impl/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-6950
MEDIUM
4.3
eclipse-ee4j/mojarra
getBaseResourcePath
impl/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java
cefbb9447e7be560e59da2da6bd7cb93776f7741
0
Analyze the following code function for security vulnerabilities
@Override public void setConnectionCapabilities(String callId, int connectionCapabilities, Session.Info sessionInfo) { Log.startSession(sessionInfo, "CSW.sCC", mPackageAbbreviation); long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { logIncoming("setConnectionCapabilities %s %d", callId, connectionCapabilities); Call call = mCallIdMapper.getCall(callId); if (call != null) { call.setConnectionCapabilities(connectionCapabilities); } else { // Log.w(ConnectionServiceWrapper.this, // "setConnectionCapabilities, unknown call id: %s", msg.obj); } } } catch (Throwable t) { Log.e(ConnectionServiceWrapper.this, t, ""); throw t; } finally { Binder.restoreCallingIdentity(token); Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConnectionCapabilities File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
setConnectionCapabilities
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
int getMaxAppShortcuts() { return mMaxShortcutsPerApp; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxAppShortcuts File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
getMaxAppShortcuts
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void setCheckInClear(boolean checkInClear) { mCheckInClear = checkInClear; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCheckInClear File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
setCheckInClear
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private static Object deserialize(String serialized) throws ClassNotFoundException, IOException { byte[] bytes = Base64.decode(serialized); ByteArrayInputStream bis = new ByteArrayInputStream(bytes); ObjectInput in = null; try { in = new ObjectInputStream(bis); return in.readObject(); } finally { try { if (in != null) { in.close(); } } catch (IOException ex) { ex.printStackTrace(); } } }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2020-1714 - Severity: MEDIUM - CVSS Score: 6.5 Description: [Keycloak-10162] Usage of ObjectInputStream without checking the object types Function: deserialize File: common/src/main/java/org/keycloak/common/util/KerberosSerializationUtils.java Repository: keycloak Fixed Code: private static Object deserialize(String serialized) throws ClassNotFoundException, IOException { byte[] bytes = Base64.decode(serialized); ByteArrayInputStream bis = new ByteArrayInputStream(bytes); ObjectInputStream in = null; try { DelegatingSerializationFilter filter = new DelegatingSerializationFilter(); in = new ObjectInputStream(bis); filter.setFilter(in, "javax.security.auth.kerberos.KerberosTicket;javax.security.auth.kerberos.KerberosPrincipal;javax.security.auth.kerberos.KeyImpl;java.net.InetAddress;java.util.Date;!*"); return in.readObject(); } finally { try { if (in != null) { in.close(); } } catch (IOException ex) { ex.printStackTrace(); } } }
[ "CWE-20" ]
CVE-2020-1714
MEDIUM
6.5
keycloak
deserialize
common/src/main/java/org/keycloak/common/util/KerberosSerializationUtils.java
d5483d884de797e2ef6e69f92085bc10bf87e864
1
Analyze the following code function for security vulnerabilities
@Override public List<UserHandle> listForegroundAffiliatedUsers() { checkIsDeviceOwner(getCallerIdentity()); return mInjector.binderWithCleanCallingIdentity(() -> { int userId = getCurrentForegroundUserId(); boolean isAffiliated; synchronized (getLockObject()) { isAffiliated = isUserAffiliatedWithDeviceLocked(userId); } if (!isAffiliated) return Collections.emptyList(); List<UserHandle> users = new ArrayList<>(1); users.add(UserHandle.of(userId)); return users; }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listForegroundAffiliatedUsers 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
listForegroundAffiliatedUsers
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private Object getFirstPropertyId(FieldGroup fieldGroup, Set<Field<?>> keySet) { for (Column c : getColumns()) { Object propertyId = c.getPropertyId(); Field<?> f = fieldGroup.getField(propertyId); if (keySet.contains(f)) { return propertyId; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFirstPropertyId 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
getFirstPropertyId
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public BaseObject updateObjectFromRequest(String className, String prefix, int num, XWikiContext context) throws XWikiException { return updateXObjectFromRequest( getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()), prefix, num, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateObjectFromRequest File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
updateObjectFromRequest
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
@Override public boolean isUidForeground(int uid) { return ActivityTaskManagerService.this.hasActiveVisibleWindow(uid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUidForeground 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
isUidForeground
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private void setClickXAndY(int x, int y) { mSingleTapX = x; mSingleTapY = y; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClickXAndY File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
setClickXAndY
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public List<X509Certificate> checkServerTrusted(X509Certificate[] chain, String authType, String host) throws CertificateException { return checkTrusted(chain, authType, host, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkServerTrusted File: src/platform/java/org/conscrypt/TrustManagerImpl.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-345" ]
CVE-2016-0818
MEDIUM
4.3
android
checkServerTrusted
src/platform/java/org/conscrypt/TrustManagerImpl.java
c4ab1b959280413fb11bf4fd7f6b4c2ba38bd779
0
Analyze the following code function for security vulnerabilities
@Override protected DocumentBuilder initialValue() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder(); } catch (ParserConfigurationException exc) { throw new IllegalArgumentException(exc); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-20318 - Severity: HIGH - CVSS Score: 7.5 Description: #889 修复一些潜在的XXE漏洞代码 Function: initialValue File: weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java Repository: Wechat-Group/WxJava Fixed Code: @Override protected DocumentBuilder initialValue() { try { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setExpandEntityReferences(false); return factory.newDocumentBuilder(); } catch (ParserConfigurationException exc) { throw new IllegalArgumentException(exc); } }
[ "CWE-611" ]
CVE-2018-20318
HIGH
7.5
Wechat-Group/WxJava
initialValue
weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java
6272639f02e397fed40828a2d0da66c30264bc0e
1
Analyze the following code function for security vulnerabilities
private boolean shouldSuppressFullScreenIntent(String key) { if (isDeviceInVrMode()) { return true; } if (mPowerManager.isInteractive()) { return mNotificationData.shouldSuppressScreenOn(key); } else { return mNotificationData.shouldSuppressScreenOff(key); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldSuppressFullScreenIntent File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
shouldSuppressFullScreenIntent
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
void finishInstrumentationLocked(ProcessRecord app, int resultCode, Bundle results) { if (app.instrumentationWatcher != null) { try { // NOTE: IInstrumentationWatcher *must* be oneway here app.instrumentationWatcher.instrumentationFinished( app.instrumentationClass, resultCode, results); } catch (RemoteException e) { } } if (app.instrumentationUiAutomationConnection != null) { try { app.instrumentationUiAutomationConnection.shutdown(); } catch (RemoteException re) { /* ignore */ } // Only a UiAutomation can set this flag and now that // it is finished we make sure it is reset to its default. mUserIsMonkey = false; } app.instrumentationWatcher = null; app.instrumentationUiAutomationConnection = null; app.instrumentationClass = null; app.instrumentationInfo = null; app.instrumentationProfileFile = null; app.instrumentationArguments = null; forceStopPackageLocked(app.info.packageName, -1, false, false, true, true, false, app.userId, "finished inst"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishInstrumentationLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
finishInstrumentationLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private boolean isInProgressMarkerFile(File file) { return hasExtension(file, IN_PROGRESS_MARKER_FILE_SUFFIX); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInProgressMarkerFile File: subprojects/core/src/main/java/org/gradle/internal/resource/local/DefaultPathKeyFileStore.java Repository: gradle The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35946
MEDIUM
5.5
gradle
isInProgressMarkerFile
subprojects/core/src/main/java/org/gradle/internal/resource/local/DefaultPathKeyFileStore.java
859eae2b2acf751ae7db3c9ffefe275aa5da0d5d
0
Analyze the following code function for security vulnerabilities
public String getAssignedTo() { return assignedTo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAssignedTo File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
getAssignedTo
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
public void goBack() { if (mWebContents != null) mWebContents.getNavigationController().goBack(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: goBack File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
goBack
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void setBlockedCandidate(boolean blockedCandidate) { this.blockedCandidate = blockedCandidate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBlockedCandidate 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
setBlockedCandidate
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
public boolean isEmailDomainApproved(String email) { if (StringUtils.isBlank(email)) { return false; } if (!APPROVED_DOMAINS.isEmpty() && !APPROVED_DOMAINS.contains(StringUtils.substringAfter(email, "@"))) { logger.warn("Attempted signin from an unknown domain - email {} is part of an unapproved domain.", email); return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEmailDomainApproved File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
isEmailDomainApproved
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public static SchemaFactory getSchemaFactory() throws SAXException { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); setProperty(schemaFactory, XMLConstants.ACCESS_EXTERNAL_SCHEMA); setProperty(schemaFactory, XMLConstants.ACCESS_EXTERNAL_DTD); return schemaFactory; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSchemaFactory File: hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-0265
HIGH
7.5
hazelcast
getSchemaFactory
hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java
4d6b666cd0291abd618c3b95cdbb51aa4208e748
0
Analyze the following code function for security vulnerabilities
private Map<String, Object> filterData(List<Long> newTargets, List<TempShareNode> shareNodes) { Map<String, Object> result = new HashMap<>(); List<Long> newUserIds = new ArrayList<>(); for (int i = 0; i < newTargets.size(); i++) { Long newTargetId = newTargets.get(i); Boolean isNew = true; for (int j = 0; j < shareNodes.size(); j++) { TempShareNode shareNode = shareNodes.get(j); Long sharedId = shareNode.getTargetId(); if (newTargetId.equals(sharedId)) { shareNode.setMatched(true); // 已分享 重新命中 isNew = false; } } if (isNew) { // 获取新增的 newUserIds.add(newTargetId); } } // 获取需要取消分享的 List<TempShareNode> missNodes = shareNodes.stream().filter(item -> !item.getMatched()) .collect(Collectors.toList()); result.put("add", newUserIds); result.put("red", missNodes); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filterData File: backend/src/main/java/io/dataease/service/panel/ShareService.java Repository: dataease The code follows secure coding practices.
[ "CWE-639" ]
CVE-2023-32310
HIGH
8.1
dataease
filterData
backend/src/main/java/io/dataease/service/panel/ShareService.java
72f428e87b5395c03d2f94ef6185fc247ddbc8dc
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public void setLargeStringValue(String className, String fieldName, String value) { setLargeStringValue( getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()), fieldName, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLargeStringValue File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
setLargeStringValue
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
public boolean isActivePasswordSufficientForDeviceRequirement() { if (!mParentInstance) { throw new SecurityException("only callable on the parent instance"); } if (mService != null) { try { return mService.isActivePasswordSufficientForDeviceRequirement(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isActivePasswordSufficientForDeviceRequirement 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
isActivePasswordSufficientForDeviceRequirement
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private Object getValue(DataValue dataValue) throws UaException { StatusCode statusCode = dataValue.getStatusCode(); if (statusCode == null) { throw new UaException(StatusCode.BAD); } if (statusCode.isBad()) { throw new UaException(statusCode); } return dataValue.getValue().getValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValue File: opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java Repository: eclipse/milo The code follows secure coding practices.
[ "CWE-770" ]
CVE-2022-25897
HIGH
7.5
eclipse/milo
getValue
opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java
4534381760d7d9f0bf00cbf6a8449bb0d13c6ce5
0
Analyze the following code function for security vulnerabilities
private void eventDownload(int event, int sourceId, int destinationId, byte[] additionalInfo, boolean oneShot) { ByteArrayOutputStream buf = new ByteArrayOutputStream(); // tag int tag = BerTlv.BER_EVENT_DOWNLOAD_TAG; buf.write(tag); // length buf.write(0x00); // place holder, assume length < 128. // event list tag = 0x80 | ComprehensionTlvTag.EVENT_LIST.value(); buf.write(tag); buf.write(0x01); // length buf.write(event); // event value // device identities tag = 0x80 | ComprehensionTlvTag.DEVICE_IDENTITIES.value(); buf.write(tag); buf.write(0x02); // length buf.write(sourceId); // source device id buf.write(destinationId); // destination device id /* * Check for type of event download to be sent to UICC - Browser * termination,Idle screen available, User activity, Language selection * etc as mentioned under ETSI TS 102 223 section 7.5 */ /* * Currently the below events are supported: * Language Selection Event. * Other event download commands should be encoded similar way */ /* TODO: eventDownload should be extended for other Envelope Commands */ switch (event) { case IDLE_SCREEN_AVAILABLE_EVENT: CatLog.d(sInstance, " Sending Idle Screen Available event download to ICC"); break; case LANGUAGE_SELECTION_EVENT: CatLog.d(sInstance, " Sending Language Selection event download to ICC"); tag = 0x80 | ComprehensionTlvTag.LANGUAGE.value(); buf.write(tag); // Language length should be 2 byte buf.write(0x02); break; default: break; } // additional information if (additionalInfo != null) { for (byte b : additionalInfo) { buf.write(b); } } byte[] rawData = buf.toByteArray(); // write real length int len = rawData.length - 2; // minus (tag + length) rawData[1] = (byte) len; String hexString = IccUtils.bytesToHexString(rawData); CatLog.d(this, "ENVELOPE COMMAND: " + hexString); mCmdIf.sendEnvelope(hexString, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: eventDownload File: src/java/com/android/internal/telephony/cat/CatService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3843
HIGH
9.3
android
eventDownload
src/java/com/android/internal/telephony/cat/CatService.java
b48581401259439dc5ef6dcf8b0f303e4cbefbe9
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition delete(final String path, final Route.Handler handler) { return appendDefinition(DELETE, path, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete 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
delete
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private boolean hasAccess(Right right, DocumentReference user, EntityReference entity) { return checkPreAccess(right) && this.authorizationManager.hasAccess(right, user, getFullReference(entity)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasAccess File: xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authorization/xwiki-platform-security-authorization-bridge/src/main/java/org/xwiki/security/authorization/internal/DefaultContextualAuthorizationManager.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
hasAccess
xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authorization/xwiki-platform-security-authorization-bridge/src/main/java/org/xwiki/security/authorization/internal/DefaultContextualAuthorizationManager.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
@Override public void configure(ICourse course, CourseNode newNode, ModuleConfiguration moduleConfig) { // Use default min and max scores and default cut value /* * //score granted (default is FALSE) Boolean scoreField = Boolean.FALSE; * modConfig.set(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD, scoreField); * //if score granted == TRUE we can set these values if (scoreField) { * modConfig.set(MSCourseNode.CONFIG_KEY_SCORE_MIN, 5.0f); * modConfig.set(MSCourseNode.CONFIG_KEY_SCORE_MAX, 10.0f); } * * * //display passed / failed (note that TRUE means automatic and FALSE * means manually)... //default is TRUE Boolean displayPassed = * Boolean.TRUE; modConfig.set(MSCourseNode.CONFIG_KEY_HAS_PASSED_FIELD, * displayPassed); //display set to false -> we can set these values * manually if (!displayPassed.booleanValue()) { //passed set to when * score higher than cut value * modConfig.set(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE, 5.0f); } */ // comment moduleConfig.set(MSCourseNode.CONFIG_KEY_HAS_COMMENT_FIELD, Boolean.TRUE); // info coach moduleConfig.set(MSCourseNode.CONFIG_KEY_INFOTEXT_COACH, "Info coach"); // info user moduleConfig.set(MSCourseNode.CONFIG_KEY_INFOTEXT_USER, "Info user"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: configure File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
configure
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public DeploymentConfiguration getDeploymentConfiguration() { return deploymentConfiguration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeploymentConfiguration File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
getDeploymentConfiguration
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
public String getTitleBarLabel() throws IndexUnreachableException, PresentationException, DAOException, ViewerConfigurationException { Locale locale = BeanUtils.getLocale(); if (locale != null) { return getTitleBarLabel(locale.getLanguage()); } return getTitleBarLabel(MultiLanguageMetadataValue.DEFAULT_LANGUAGE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTitleBarLabel File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
getTitleBarLabel
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
public Configuration getConfiguration() { Configuration ci; synchronized(this) { ci = new Configuration(mConfiguration); ci.userSetLocale = false; } return ci; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguration File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
getConfiguration
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public Pager getPager(String pageParamName, HttpServletRequest req) { return pagerFromParams(pageParamName, req); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPager File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getPager
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
static void cancelNotification(Context context) { NotificationManager nm = (NotificationManager) context.getSystemService(Activity.NOTIFICATION_SERVICE); nm.cancel(getNotifyId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelNotification File: Ports/Android/src/com/codename1/impl/android/PushNotificationService.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
cancelNotification
Ports/Android/src/com/codename1/impl/android/PushNotificationService.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public boolean isCallbackOrderingPostreq(OFType type, String name) { return (type.equals(OFType.PACKET_IN) && name.equals("forwarding")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCallbackOrderingPostreq 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
isCallbackOrderingPostreq
src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java
7f5bedb625eec3ff4d29987c31cef2553a962b36
0
Analyze the following code function for security vulnerabilities
@Override protected DataCommunicatorState getState(boolean markAsDirty) { return (DataCommunicatorState) super.getState(markAsDirty); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getState File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-20" ]
CVE-2021-33609
MEDIUM
4
vaadin/framework
getState
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
0
Analyze the following code function for security vulnerabilities
protected boolean dumpActivity(FileDescriptor fd, PrintWriter pw, String name, String[] args, int opti, boolean dumpAll) { ArrayList<ActivityRecord> activities; synchronized (this) { activities = mStackSupervisor.getDumpActivitiesLocked(name); } if (activities.size() <= 0) { return false; } String[] newArgs = new String[args.length - opti]; System.arraycopy(args, opti, newArgs, 0, args.length - opti); TaskRecord lastTask = null; boolean needSep = false; for (int i=activities.size()-1; i>=0; i--) { ActivityRecord r = activities.get(i); if (needSep) { pw.println(); } needSep = true; synchronized (this) { if (lastTask != r.task) { lastTask = r.task; pw.print("TASK "); pw.print(lastTask.affinity); pw.print(" id="); pw.println(lastTask.taskId); if (dumpAll) { lastTask.dump(pw, " "); } } } dumpActivity(" ", fd, pw, activities.get(i), newArgs, dumpAll); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpActivity File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
dumpActivity
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private static native int nativeGetResourceBagValue(long ptr, @AnyRes int resId, int bagEntryId, @NonNull TypedValue outValue);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeGetResourceBagValue File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
nativeGetResourceBagValue
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public void scheduleWriteFallbackFilesJob() { final Context context = getContext(); final JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); if (jobScheduler == null) { // Might happen: SettingsProvider is created before JobSchedulerService in system server return; } // Check if the job is already scheduled. If so, skip scheduling another one if (jobScheduler.getPendingJob(WRITE_FALLBACK_SETTINGS_FILES_JOB_ID) != null) { return; } // Back up all settings files final PersistableBundle bundle = new PersistableBundle(); final File globalSettingsFile = mSettingsRegistry.getSettingsFile( makeKey(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM)); final File systemSettingsFile = mSettingsRegistry.getSettingsFile( makeKey(SETTINGS_TYPE_SYSTEM, UserHandle.USER_SYSTEM)); final File secureSettingsFile = mSettingsRegistry.getSettingsFile( makeKey(SETTINGS_TYPE_SECURE, UserHandle.USER_SYSTEM)); final File ssaidSettingsFile = mSettingsRegistry.getSettingsFile( makeKey(SETTINGS_TYPE_SSAID, UserHandle.USER_SYSTEM)); final File configSettingsFile = mSettingsRegistry.getSettingsFile( makeKey(SETTINGS_TYPE_CONFIG, UserHandle.USER_SYSTEM)); bundle.putString(TABLE_GLOBAL, globalSettingsFile.getAbsolutePath()); bundle.putString(TABLE_SYSTEM, systemSettingsFile.getAbsolutePath()); bundle.putString(TABLE_SECURE, secureSettingsFile.getAbsolutePath()); bundle.putString(TABLE_SSAID, ssaidSettingsFile.getAbsolutePath()); bundle.putString(TABLE_CONFIG, configSettingsFile.getAbsolutePath()); // Schedule the job to write the fallback files, once daily when phone is charging jobScheduler.schedule(new JobInfo.Builder(WRITE_FALLBACK_SETTINGS_FILES_JOB_ID, new ComponentName(context, WriteFallbackSettingsFilesJobService.class)) .setExtras(bundle) .setPeriodic(ONE_DAY_INTERVAL_MILLIS) .setRequiresCharging(true) .setPersisted(true) .build()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleWriteFallbackFilesJob File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
scheduleWriteFallbackFilesJob
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
@Override public void registerAnrController(AnrController controller) { mActivityTaskManager.registerAnrController(controller); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerAnrController File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
registerAnrController
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private ResolveInfo findPersistentPreferredActivityLP(Intent intent, String resolvedType, int flags, List<ResolveInfo> query, boolean debug, int userId) { final int N = query.size(); PersistentPreferredIntentResolver ppir = mSettings.mPersistentPreferredActivities .get(userId); // Get the list of persistent preferred activities that handle the intent if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Looking for presistent preferred activities..."); List<PersistentPreferredActivity> pprefs = ppir != null ? ppir.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId) : null; if (pprefs != null && pprefs.size() > 0) { final int M = pprefs.size(); for (int i=0; i<M; i++) { final PersistentPreferredActivity ppa = pprefs.get(i); if (DEBUG_PREFERRED || debug) { Slog.v(TAG, "Checking PersistentPreferredActivity ds=" + (ppa.countDataSchemes() > 0 ? ppa.getDataScheme(0) : "<none>") + "\n component=" + ppa.mComponent); ppa.dump(new LogPrinter(Log.VERBOSE, TAG, Log.LOG_ID_SYSTEM), " "); } final ActivityInfo ai = getActivityInfo(ppa.mComponent, flags | PackageManager.GET_DISABLED_COMPONENTS, userId); if (DEBUG_PREFERRED || debug) { Slog.v(TAG, "Found persistent preferred activity:"); if (ai != null) { ai.dump(new LogPrinter(Log.VERBOSE, TAG, Log.LOG_ID_SYSTEM), " "); } else { Slog.v(TAG, " null"); } } if (ai == null) { // This previously registered persistent preferred activity // component is no longer known. Ignore it and do NOT remove it. continue; } for (int j=0; j<N; j++) { final ResolveInfo ri = query.get(j); if (!ri.activityInfo.applicationInfo.packageName .equals(ai.applicationInfo.packageName)) { continue; } if (!ri.activityInfo.name.equals(ai.name)) { continue; } // Found a persistent preference that can handle the intent. if (DEBUG_PREFERRED || debug) { Slog.v(TAG, "Returning persistent preferred activity: " + ri.activityInfo.packageName + "/" + ri.activityInfo.name); } return ri; } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findPersistentPreferredActivityLP 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
findPersistentPreferredActivityLP
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public void clearSavedANRState() { synchronized (ActivityManagerService.this) { mLastANRState = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearSavedANRState 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
clearSavedANRState
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
int grabFlowControlBytes(int bytesToGrab) { if(bytesToGrab <= 0) { return 0; } int min; synchronized (flowControlLock) { min = (int) Math.min(bytesToGrab, sendWindowSize); if (bytesToGrab > FLOW_CONTROL_MIN_WINDOW && min <= FLOW_CONTROL_MIN_WINDOW) { //this can cause problems with padding, so we just return 0 return 0; } min = Math.min(sendMaxFrameSize, min); sendWindowSize -= min; } return min; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grabFlowControlBytes File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
grabFlowControlBytes
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
private void copyOriginalFilesIfEnabled() throws AndrolibException { if (mConfig.copyOriginalFiles) { File originalDir = new File(mApkDir, "original"); if (originalDir.exists()) { try { LOGGER.info("Copy original files..."); Directory in = (new ExtFile(originalDir)).getDirectory(); if (in.containsFile("AndroidManifest.xml")) { LOGGER.info("Copy AndroidManifest.xml..."); in.copyToDir(new File(mApkDir, APK_DIRNAME), "AndroidManifest.xml"); } if (in.containsFile("stamp-cert-sha256")) { LOGGER.info("Copy stamp-cert-sha256..."); in.copyToDir(new File(mApkDir, APK_DIRNAME), "stamp-cert-sha256"); } if (in.containsDir("META-INF")) { LOGGER.info("Copy META-INF..."); in.copyToDir(new File(mApkDir, APK_DIRNAME), "META-INF"); } } catch (DirectoryException ex) { throw new AndrolibException(ex); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyOriginalFilesIfEnabled File: brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
copyOriginalFilesIfEnabled
brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
@Override protected void onStart() { super.onStart(); if (!xmppConnectionServiceBound) { if (this.mSkipBackgroundBinding) { Log.d(Config.LOGTAG,"skipping background binding"); } else { connectToBackend(); } } else { this.registerListeners(); this.onBackendConnected(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStart File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onStart
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private void onAddUserClicked(int userType) { synchronized (mUserLock) { if (mRemovingUserId == -1 && !mAddingUser) { switch (userType) { case USER_TYPE_USER: showDialog(DIALOG_ADD_USER); break; case USER_TYPE_RESTRICTED_PROFILE: if (hasLockscreenSecurity()) { addUserNow(USER_TYPE_RESTRICTED_PROFILE); } else { showDialog(DIALOG_NEED_LOCKSCREEN); } break; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAddUserClicked File: src/com/android/settings/users/UserSettings.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
onAddUserClicked
src/com/android/settings/users/UserSettings.java
bd5d5176c74021e8cf4970f93f273ba3023c3d72
0
Analyze the following code function for security vulnerabilities
@Override public boolean onLongClick(View v) { handleTrustCircleClick(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLongClick File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onLongClick
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public boolean getUseClientMode() { return clientMode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUseClientMode File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
getUseClientMode
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
public static PolicyConstraintValue fromDOM(Element pcvElement) { PolicyConstraintValue pcv = new PolicyConstraintValue(); String id = pcvElement.getAttribute("id"); pcv.setName(id); NodeList valueList = pcvElement.getElementsByTagName("value"); if (valueList.getLength() > 0) { String value = valueList.item(0).getTextContent(); pcv.setValue(value); } NodeList descriptorList = pcvElement.getElementsByTagName("descriptor"); if (descriptorList.getLength() > 0) { Element descriptorElement = (Element) descriptorList.item(0); Descriptor descriptor = Descriptor.fromDOM(descriptorElement); pcv.setDescriptor(descriptor); } return pcv; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private final IDevicePolicyManager getService() { return mService; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getService 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
getService
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected String getOCSubjectDataDNsSql(String studySubjectOids) { return "(select ss.oc_oid as study_subject_oid, dn.parent_dn_id, dn.discrepancy_note_id as dn_id, dn.description, dn.detailed_notes, " + " dn.owner_id, dn.date_created, rs.name as status, dnt.name" + " from discrepancy_note dn, dn_subject_map dnsm, study_subject ss, discrepancy_note_type dnt, resolution_status rs" + " where dn.entity_type = 'subject'" + " and dn.discrepancy_note_id = dnsm.discrepancy_note_id and ss.oc_oid in (" + studySubjectOids + ") and ss.subject_id = dnsm.subject_id and dn.resolution_status_id = rs.resolution_status_id" + " and dn.discrepancy_note_type_id = dnt.discrepancy_note_type_id) union" + "(select ss.oc_oid as study_subject_oid, dn.parent_dn_id, dn.discrepancy_note_id as dn_id, dn.description, dn.detailed_notes, " + " dn.owner_id, dn.date_created, rs.name as status, dnt.name" + " from discrepancy_note dn, dn_study_subject_map dnssm, study_subject ss, discrepancy_note_type dnt, resolution_status rs" + " where dn.entity_type = 'studySub'" + " and dn.discrepancy_note_id = dnssm.discrepancy_note_id and ss.oc_oid in (" + studySubjectOids + ") and ss.study_subject_id = dnssm.study_subject_id and dn.resolution_status_id = rs.resolution_status_id" + " and dn.discrepancy_note_type_id = dnt.discrepancy_note_type_id" + ") order by study_subject_oid, parent_dn_id, dn_id"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOCSubjectDataDNsSql File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getOCSubjectDataDNsSql
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
@Override public void broadcastIntentToManifestReceivers( Intent intent, UserHandle parentHandle, boolean requiresPermission) { Objects.requireNonNull(intent); Objects.requireNonNull(parentHandle); Slogf.i(LOG_TAG, "Sending %s broadcast to manifest receivers.", intent.getAction()); broadcastIntentToCrossProfileManifestReceivers( intent, parentHandle, requiresPermission); broadcastExplicitIntentToRoleHolder( intent, RoleManager.ROLE_DEVICE_POLICY_MANAGEMENT, parentHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastIntentToManifestReceivers 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
broadcastIntentToManifestReceivers
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void broadcastWnmEvent(String iface, WnmData wnmData) { if (mVerboseLoggingEnabled) Log.d(TAG, "WNM-Notification " + wnmData.getEventType()); switch (wnmData.getEventType()) { case WnmData.HS20_REMEDIATION_EVENT: sendMessage(iface, HS20_REMEDIATION_EVENT, wnmData); break; case WnmData.HS20_DEAUTH_IMMINENT_EVENT: sendMessage(iface, HS20_DEAUTH_IMMINENT_EVENT, wnmData); break; case WnmData.HS20_TERMS_AND_CONDITIONS_ACCEPTANCE_REQUIRED_EVENT: sendMessage(iface, HS20_TERMS_AND_CONDITIONS_ACCEPTANCE_REQUIRED_EVENT, wnmData); break; default: Log.e(TAG, "Broadcast request for an unknown WNM-notification " + wnmData.getEventType()); break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastWnmEvent File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
broadcastWnmEvent
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private boolean isStartingWindowAssociatedToTask() { return mStartingData != null && mStartingData.mAssociatedTask != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isStartingWindowAssociatedToTask 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
isStartingWindowAssociatedToTask
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setConfig(XWikiConfig config) { ConfigurationSource configuration = getConfiguration(); if (configuration instanceof XWikiCfgConfigurationSource) { ((XWikiCfgConfigurationSource) configuration).set(config); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConfig File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
setConfig
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private static final ArrayList<Pair<ProcessRecord, Integer>> sortProcessOomList(List<ProcessRecord> origList, String dumpPackage) { ArrayList<Pair<ProcessRecord, Integer>> list = new ArrayList<Pair<ProcessRecord, Integer>>(origList.size()); for (int i=0; i<origList.size(); i++) { ProcessRecord r = origList.get(i); if (dumpPackage != null && !r.pkgList.containsKey(dumpPackage)) { continue; } list.add(new Pair<ProcessRecord, Integer>(origList.get(i), i)); } Comparator<Pair<ProcessRecord, Integer>> comparator = new Comparator<Pair<ProcessRecord, Integer>>() { @Override public int compare(Pair<ProcessRecord, Integer> object1, Pair<ProcessRecord, Integer> object2) { if (object1.first.setAdj != object2.first.setAdj) { return object1.first.setAdj > object2.first.setAdj ? -1 : 1; } if (object1.first.setProcState != object2.first.setProcState) { return object1.first.setProcState > object2.first.setProcState ? -1 : 1; } if (object1.second.intValue() != object2.second.intValue()) { return object1.second.intValue() > object2.second.intValue() ? -1 : 1; } return 0; } }; Collections.sort(list, comparator); return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sortProcessOomList 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
sortProcessOomList
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void addOutput(ProfileOutput output) { ProfileOutput curOutput = getOutput(output.getName()); if (curOutput != null) { outputs.remove(curOutput); } outputs.add(output); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addOutput 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
addOutput
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public void init() throws FacesException { // TODO - mace codec configurable. registerResources(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java Repository: nuxeo/richfaces-3.3 The code follows secure coding practices.
[ "CWE-502" ]
CVE-2013-4521
HIGH
7.5
nuxeo/richfaces-3.3
init
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
0
Analyze the following code function for security vulnerabilities
public static byte[] extractBytesAtOffset(byte[] src, int offset, int length) { if (src == null) { throw new NullPointerException("src == null"); } if (offset < 0) { throw new IllegalArgumentException("offset hast to be >= 0"); } if (length < 0) { throw new IllegalArgumentException("length hast to be >= 0"); } if ((offset + length) > src.length) { throw new IllegalArgumentException("offset + length must not be greater then size of source array"); } byte[] out = new byte[length]; for (int i = 0; i < out.length; i++) { out[i] = src[offset + i]; } return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractBytesAtOffset File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
extractBytesAtOffset
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
@Override public void onPause() { super.onPause(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPause File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onPause
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public Mono<ActionExecutionResult> execute(APIConnection apiConnection, DatasourceConfiguration datasourceConfiguration, ActionConfiguration actionConfiguration) { // Unused function return Mono.error(new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Unsupported Operation")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execute File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-38298
HIGH
8.8
appsmithorg/appsmith
execute
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
0
Analyze the following code function for security vulnerabilities
public void setWikiNode(Object wikiNode) { this.wikiNode = wikiNode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWikiNode File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setWikiNode
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public void setMessage(String message) { this.message = parser.parseExpression(message, ParserContext.TEMPLATE_EXPRESSION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMessage File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setMessage
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public ActionForward unspecified(ActionMapping rMapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ActionErrors errors = new ActionErrors(); //Email parameters HttpSession session = request.getSession(); Host currentHost = hostWebAPI.getCurrentHost(request); User currentUser = (User) session.getAttribute(WebKeys.CMS_USER); String method = request.getMethod(); String errorURL = request.getParameter("errorURL"); errorURL = (!UtilMethods.isSet(errorURL) ? request.getHeader("referer") : errorURL); if(errorURL.indexOf("?") > -1) { errorURL = errorURL.substring(0,errorURL.lastIndexOf("?")); } String x = request.getRequestURI(); if(request.getParameterMap().size() <2){ return null; } //Checking for captcha boolean useCaptcha = Config.getBooleanProperty("FORCE_CAPTCHA",true); if(!useCaptcha){ useCaptcha = new Boolean(request.getParameter("useCaptcha")).booleanValue(); } String captcha = request.getParameter("captcha"); if (useCaptcha) { Captcha captchaObj = (Captcha) session.getAttribute(Captcha.NAME); String captchaSession=captchaObj!=null ? captchaObj.getAnswer() : null; if(captcha ==null && Config.getBooleanProperty("FORCE_CAPTCHA",true)){ response.getWriter().write("Captcha is required to submit this form ( FORCE_CAPTCHA=true ).<br>To change this, edit the dotmarketing-config.properties and set FORCE_CAPTCHA=false"); return null; } if(!UtilMethods.isSet(captcha) || !UtilMethods.isSet(captchaSession) || !captcha.equals(captchaSession)) { errors.add(Globals.ERROR_KEY, new ActionMessage("message.contentlet.required", "Validation Image")); request.setAttribute(Globals.ERROR_KEY, errors); session.setAttribute(Globals.ERROR_KEY, errors); String queryString = request.getQueryString(); String invalidCaptchaURL = request.getParameter("invalidCaptchaReturnUrl"); if(!UtilMethods.isSet(invalidCaptchaURL)) { invalidCaptchaURL = errorURL; } ActionForward af = new ActionForward(); af.setRedirect(true); if (UtilMethods.isSet(queryString)) { af.setPath(invalidCaptchaURL + "?" + queryString + "&error=Validation-Image"); } else { af.setPath(invalidCaptchaURL + "?error=Validation-Image"); } return af; } } Map<String, Object> parameters = null; if (request instanceof UploadServletRequest) { UploadServletRequest uploadReq = (UploadServletRequest) request; parameters = new HashMap<String, Object> (uploadReq.getParameterMap()); for (Entry<String, Object> entry : parameters.entrySet()) { if(entry.getKey().toLowerCase().indexOf("file") > -1 && !entry.getKey().equals("attachFiles")) { parameters.put(entry.getKey(), uploadReq.getFile(entry.getKey())); } } } else { parameters = new HashMap<String, Object> (request.getParameterMap()); } Set<String> toValidate = new java.util.HashSet<String>(parameters.keySet()); //Enhancing the ignored parameters not to be send in the email String ignoredParameters = (String) EmailFactory.getMapValue("ignore", parameters); if(ignoredParameters == null) { ignoredParameters = ""; } ignoredParameters += ":useCaptcha:captcha:invalidCaptchaReturnUrl:return:returnUrl:errorURL:ignore:to:from:cc:bcc:dispatch:order:prettyOrder:autoReplyTo:autoReplyFrom:autoReplyText:autoReplySubject:"; parameters.put("ignore", ignoredParameters); // getting categories from inodes // getting parent category name and child categories name // and replacing the "categories" parameter String categories = ""; String[] categoriesArray = request.getParameterValues("categories"); if (categoriesArray != null) { HashMap hashCategories = new HashMap<String, String>(); for (int i = 0; i < categoriesArray.length; i++) { Category node = (Category) InodeFactory.getInode(categoriesArray[i], Category.class); Category parent = (Category) InodeFactory.getParentOfClass(node, Category.class); String parentCategoryName = parent.getCategoryName(); if (hashCategories.containsKey(parentCategoryName)) { String childCategoryName = (String) hashCategories.get(parentCategoryName); if (UtilMethods.isSet(childCategoryName)) { childCategoryName += ", "; } childCategoryName += node.getCategoryName(); hashCategories.put(parentCategoryName, childCategoryName); } else { hashCategories.put(parentCategoryName, node.getCategoryName()); } } Set<String> keySet = hashCategories.keySet(); for (String stringKey: keySet) { if (UtilMethods.isSet(categories)) { categories += "; "; } categories += stringKey + " : " + (String) hashCategories.get(stringKey); parameters.put(stringKey, (String) hashCategories.get(stringKey)); } parameters.remove("categories"); } WebForm webForm = new WebForm(); try { /*validation parameter should ignore the returnUrl and erroURL field in the spam check*/ String[] removeParams = ignoredParameters.split(":"); for(String param : removeParams){ toValidate.remove(param); } parameters.put("request", request); parameters.put("response", response); //Sending the email webForm = EmailFactory.sendParameterizedEmail(parameters, toValidate, currentHost, currentUser); webForm.setCategories(categories); if(UtilMethods.isSet(request.getParameter("createAccount")) && request.getParameter("createAccount").equals("true")) { //if we create account set to true we create a user account and add user comments. createAccount(webForm, request); try{ String userInode = webForm.getUserInode(); String customFields = webForm.getCustomFields(); customFields += " User Inode = " + String.valueOf(userInode) + " | "; webForm.setCustomFields(customFields); } catch(Exception e){ } } if(UtilMethods.isSet(webForm.getFormType())){ HibernateUtil.saveOrUpdate(webForm); } if (request.getParameter("return") != null) { ActionForward af = new ActionForward(SecurityUtils.stripReferer(request, request.getParameter("return"))); af.setRedirect(true); return af; } else if (request.getParameter("returnUrl") != null) { ActionForward af = new ActionForward(SecurityUtils.stripReferer(request, request.getParameter("returnUrl"))); af.setRedirect(true); return af; } else { return rMapping.findForward("thankYouPage"); } } catch (DotRuntimeException e) { errors.add(Globals.ERROR_KEY, new ActionMessage("error.processing.your.email")); request.getSession().setAttribute(Globals.ERROR_KEY, errors); String queryString = request.getQueryString(); if (queryString == null) { java.util.Enumeration<String> parameterNames = request.getParameterNames(); queryString = ""; String parameterName; for (; parameterNames.hasMoreElements();) { parameterName = parameterNames.nextElement(); if (0 < queryString.length()) { queryString = queryString + "&" + parameterName + "=" + UtilMethods.encodeURL(request.getParameter(parameterName)); } else { queryString = parameterName + "=" + UtilMethods.encodeURL(request.getParameter(parameterName)); } } } ActionForward af; if (UtilMethods.isSet(queryString)) { af = new ActionForward(SecurityUtils.stripReferer(request, errorURL + "?" + queryString)); } else { af = new ActionForward(SecurityUtils.stripReferer(request, errorURL)); } af.setRedirect(true); return af; } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2016-4040 - Severity: MEDIUM - CVSS Score: 6.5 Description: fixes #8840 sort by sanitizing and email header injection Function: unspecified File: src/com/dotmarketing/cms/webforms/action/SubmitWebFormAction.java Repository: dotCMS/core Fixed Code: @SuppressWarnings("unchecked") public ActionForward unspecified(ActionMapping rMapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ActionErrors errors = new ActionErrors(); //Email parameters HttpSession session = request.getSession(); Host currentHost = hostWebAPI.getCurrentHost(request); User currentUser = (User) session.getAttribute(WebKeys.CMS_USER); String method = request.getMethod(); String errorURL = request.getParameter("errorURL"); errorURL = (!UtilMethods.isSet(errorURL) ? request.getHeader("referer") : errorURL); if(errorURL.indexOf("?") > -1) { errorURL = errorURL.substring(0,errorURL.lastIndexOf("?")); } String x = request.getRequestURI(); if(request.getParameterMap().size() <2){ return null; } //Checking for captcha boolean useCaptcha = Config.getBooleanProperty("FORCE_CAPTCHA",true); if(!useCaptcha){ useCaptcha = new Boolean(request.getParameter("useCaptcha")).booleanValue(); } String captcha = request.getParameter("captcha"); if (useCaptcha) { Captcha captchaObj = (Captcha) session.getAttribute(Captcha.NAME); String captchaSession=captchaObj!=null ? captchaObj.getAnswer() : null; if(captcha ==null && Config.getBooleanProperty("FORCE_CAPTCHA",true)){ response.getWriter().write("Captcha is required to submit this form ( FORCE_CAPTCHA=true ).<br>To change this, edit the dotmarketing-config.properties and set FORCE_CAPTCHA=false"); return null; } if(!UtilMethods.isSet(captcha) || !UtilMethods.isSet(captchaSession) || !captcha.equals(captchaSession)) { errors.add(Globals.ERROR_KEY, new ActionMessage("message.contentlet.required", "Validation Image")); request.setAttribute(Globals.ERROR_KEY, errors); session.setAttribute(Globals.ERROR_KEY, errors); String queryString = request.getQueryString(); String invalidCaptchaURL = request.getParameter("invalidCaptchaReturnUrl"); if(!UtilMethods.isSet(invalidCaptchaURL)) { invalidCaptchaURL = errorURL; } invalidCaptchaURL = invalidCaptchaURL.replaceAll("\\s", " "); ActionForward af = new ActionForward(); af.setRedirect(true); if (UtilMethods.isSet(queryString)) { af.setPath(invalidCaptchaURL + "?" + queryString + "&error=Validation-Image"); } else { af.setPath(invalidCaptchaURL + "?error=Validation-Image"); } return af; } } Map<String, Object> parameters = null; if (request instanceof UploadServletRequest) { UploadServletRequest uploadReq = (UploadServletRequest) request; parameters = new HashMap<String, Object> (uploadReq.getParameterMap()); for (Entry<String, Object> entry : parameters.entrySet()) { if(entry.getKey().toLowerCase().indexOf("file") > -1 && !entry.getKey().equals("attachFiles")) { parameters.put(entry.getKey(), uploadReq.getFile(entry.getKey())); } } } else { parameters = new HashMap<String, Object> (request.getParameterMap()); } Set<String> toValidate = new java.util.HashSet<String>(parameters.keySet()); //Enhancing the ignored parameters not to be send in the email String ignoredParameters = (String) EmailFactory.getMapValue("ignore", parameters); if(ignoredParameters == null) { ignoredParameters = ""; } ignoredParameters += ":useCaptcha:captcha:invalidCaptchaReturnUrl:return:returnUrl:errorURL:ignore:to:from:cc:bcc:dispatch:order:prettyOrder:autoReplyTo:autoReplyFrom:autoReplyText:autoReplySubject:"; parameters.put("ignore", ignoredParameters); // getting categories from inodes // getting parent category name and child categories name // and replacing the "categories" parameter String categories = ""; String[] categoriesArray = request.getParameterValues("categories"); if (categoriesArray != null) { HashMap hashCategories = new HashMap<String, String>(); for (int i = 0; i < categoriesArray.length; i++) { Category node = (Category) InodeFactory.getInode(categoriesArray[i], Category.class); Category parent = (Category) InodeFactory.getParentOfClass(node, Category.class); String parentCategoryName = parent.getCategoryName(); if (hashCategories.containsKey(parentCategoryName)) { String childCategoryName = (String) hashCategories.get(parentCategoryName); if (UtilMethods.isSet(childCategoryName)) { childCategoryName += ", "; } childCategoryName += node.getCategoryName(); hashCategories.put(parentCategoryName, childCategoryName); } else { hashCategories.put(parentCategoryName, node.getCategoryName()); } } Set<String> keySet = hashCategories.keySet(); for (String stringKey: keySet) { if (UtilMethods.isSet(categories)) { categories += "; "; } categories += stringKey + " : " + (String) hashCategories.get(stringKey); parameters.put(stringKey, (String) hashCategories.get(stringKey)); } parameters.remove("categories"); } WebForm webForm = new WebForm(); try { /*validation parameter should ignore the returnUrl and erroURL field in the spam check*/ String[] removeParams = ignoredParameters.split(":"); for(String param : removeParams){ toValidate.remove(param); } parameters.put("request", request); parameters.put("response", response); //Sending the email webForm = EmailFactory.sendParameterizedEmail(parameters, toValidate, currentHost, currentUser); webForm.setCategories(categories); if(UtilMethods.isSet(request.getParameter("createAccount")) && request.getParameter("createAccount").equals("true")) { //if we create account set to true we create a user account and add user comments. createAccount(webForm, request); try{ String userInode = webForm.getUserInode(); String customFields = webForm.getCustomFields(); customFields += " User Inode = " + String.valueOf(userInode) + " | "; webForm.setCustomFields(customFields); } catch(Exception e){ } } if(UtilMethods.isSet(webForm.getFormType())){ HibernateUtil.saveOrUpdate(webForm); } if (request.getParameter("return") != null) { ActionForward af = new ActionForward(SecurityUtils.stripReferer(request, request.getParameter("return"))); af.setRedirect(true); return af; } else if (request.getParameter("returnUrl") != null) { ActionForward af = new ActionForward(SecurityUtils.stripReferer(request, request.getParameter("returnUrl"))); af.setRedirect(true); return af; } else { return rMapping.findForward("thankYouPage"); } } catch (DotRuntimeException e) { errors.add(Globals.ERROR_KEY, new ActionMessage("error.processing.your.email")); request.getSession().setAttribute(Globals.ERROR_KEY, errors); String queryString = request.getQueryString(); if (queryString == null) { java.util.Enumeration<String> parameterNames = request.getParameterNames(); queryString = ""; String parameterName; for (; parameterNames.hasMoreElements();) { parameterName = parameterNames.nextElement(); if (0 < queryString.length()) { queryString = queryString + "&" + parameterName + "=" + UtilMethods.encodeURL(request.getParameter(parameterName)); } else { queryString = parameterName + "=" + UtilMethods.encodeURL(request.getParameter(parameterName)); } } } ActionForward af; if (UtilMethods.isSet(queryString)) { af = new ActionForward(SecurityUtils.stripReferer(request, errorURL + "?" + queryString)); } else { af = new ActionForward(SecurityUtils.stripReferer(request, errorURL)); } af.setRedirect(true); return af; } }
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
unspecified
src/com/dotmarketing/cms/webforms/action/SubmitWebFormAction.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
1
Analyze the following code function for security vulnerabilities
@Override public <A extends Output<E>, E extends Exception> void append(A a, char c) throws E { switch (c) { case '&' -> { a.append(AMP); } case '<' -> { a.append(LT); } case '>' -> { a.append(GT); } case '"' -> { a.append(QUOT); } default -> { a.append(c); } } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-33962 - Severity: MEDIUM - CVSS Score: 6.1 Description: Fix #157 add more aggressive html5 escaping Function: append File: api/jstachio/src/main/java/io/jstach/jstachio/escapers/HtmlEscaper.java Repository: jstachio Fixed Code: @Override public <A extends Output<E>, E extends Exception> void append(A a, char c) throws E { switch (c) { case '"' -> { a.append(QUOT); } case '&' -> { a.append(AMP); } case '\'' -> { a.append(APOS); } case '<' -> { a.append(LT); } case '=' -> { a.append(EQUAL); } case '>' -> { a.append(GT); } case '`' -> { a.append(BACK_TICK); } default -> { a.append(c); } } }
[ "CWE-79" ]
CVE-2023-33962
MEDIUM
6.1
jstachio
append
api/jstachio/src/main/java/io/jstach/jstachio/escapers/HtmlEscaper.java
7b2f78377d1284df14c580be762a25af5f8dcd66
1
Analyze the following code function for security vulnerabilities
public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) { if (sender != null && !(sender instanceof PendingIntentRecord)) { return; } final PendingIntentRecord rec = (PendingIntentRecord)sender; final BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics(); synchronized (stats) { if (mBatteryStatsService.isOnBattery()) { mBatteryStatsService.enforceCallingPermission(); int MY_UID = Binder.getCallingUid(); final int uid; if (sender == null) { uid = sourceUid; } else { uid = rec.uid == MY_UID ? Process.SYSTEM_UID : rec.uid; } BatteryStatsImpl.Uid.Pkg pkg = stats.getPackageStatsLocked(sourceUid >= 0 ? sourceUid : uid, sourcePkg != null ? sourcePkg : rec.key.packageName); pkg.noteWakeupAlarmLocked(tag); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteWakeupAlarm 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
noteWakeupAlarm
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@Deprecated public int getHintScreenTimeout() { return mHintScreenTimeout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHintScreenTimeout File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getHintScreenTimeout
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public boolean isVolume() { return volume; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isVolume File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
isVolume
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
@Override public boolean shouldExtendLifetime(NotificationEntry entry) { return entry != null &&(mNotificationGutsExposed != null && entry.getGuts() != null && mNotificationGutsExposed == entry.getGuts() && !mNotificationGutsExposed.isLeavebehind()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldExtendLifetime File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
shouldExtendLifetime
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
public void cleanup() { dismissDialogAndNotification(); unregisterCertificateNotificationReceiver(); clearInternalData(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanup File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
cleanup
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public boolean handlePinMmi(String dialString, String callingPackage) { try { Log.startSession("TSI.hPM", Log.getPackageAbbreviation(callingPackage)); enforcePermissionOrPrivilegedDialer(MODIFY_PHONE_STATE, callingPackage); // Switch identity so that TelephonyManager checks Telecom's permissions // instead. long token = Binder.clearCallingIdentity(); boolean retval = false; try { retval = getTelephonyManager( SubscriptionManager.getDefaultVoiceSubscriptionId()) .handlePinMmi(dialString); } finally { Binder.restoreCallingIdentity(token); } return retval; }finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handlePinMmi File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
handlePinMmi
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public Rectangle getBoxSize(PdfDictionary page, PdfName boxName) { PdfArray box = (PdfArray)getPdfObjectRelease(page.get(boxName)); return getNormalizedRectangle(box); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBoxSize 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
getBoxSize
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@Override public void setPackageAskScreenCompat(String packageName, boolean ask) { enforceCallingPermission(android.Manifest.permission.SET_SCREEN_COMPATIBILITY, "setPackageAskScreenCompat"); synchronized (this) { mCompatModePackages.setPackageAskCompatModeLocked(packageName, ask); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPackageAskScreenCompat 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
setPackageAskScreenCompat
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public int engineGetOutputSize(int inputLen) { int len1, len2, len3; if (key == null) { throw new IllegalStateException("cipher not initialised"); } len1 = engine.getMac().getMacSize(); if (otherKeyParameter == null) { len2 = 1 + 2 * (((DHKeyParameters)key).getParameters().getP().bitLength() + 7) / 8; } else { len2 = 0; } if (engine.getCipher() == null) { len3 = inputLen; } else if (state == Cipher.ENCRYPT_MODE || state == Cipher.WRAP_MODE) { len3 = engine.getCipher().getOutputSize(inputLen); } else if (state == Cipher.DECRYPT_MODE || state == Cipher.UNWRAP_MODE) { len3 = engine.getCipher().getOutputSize(inputLen - len1 - len2); } else { throw new IllegalStateException("cipher not initialised"); } if (state == Cipher.ENCRYPT_MODE || state == Cipher.WRAP_MODE) { return buffer.size() + len1 + len2 + len3; } else if (state == Cipher.DECRYPT_MODE || state == Cipher.UNWRAP_MODE) { return buffer.size() - len1 - len2 + len3; } else { throw new IllegalStateException("IESCipher not initialised"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineGetOutputSize File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineGetOutputSize
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
public static Manifest getManifest(Class<?> type) { final URL classLocation = classLocation(type); Manifest manifest = new Manifest(); URL manifestLocation = manifestLocation(classLocation.toString()); if (manifestLocation != null) { try { try (InputStream content = manifestLocation.openStream()) { manifest.read(content); } } catch (IOException ignore) { } } if (manifest.getMainAttributes().isEmpty()) { // must be running in IDE String name = type.getName(); if (name.startsWith("org.geotools") || name.startsWith("org.opengis") || name.startsWith("net.opengis")) { String generated = "Manifest-Version: 1.0\n" + "Project-Version: " + getVersion() + "\n"; try { manifest.read(new ByteArrayInputStream(generated.getBytes())); } catch (IOException e) { } } } return manifest; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getManifest 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
getManifest
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
@Override public Path getStoragePath() { Path worldFolder = getWorld().getWorldFolder().toPath(); switch (getWorld().getEnvironment()) { case NETHER: return worldFolder.resolve("DIM-1"); case THE_END: return worldFolder.resolve("DIM1"); case NORMAL: default: return worldFolder; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStoragePath File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
getStoragePath
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
public static Object deserialize(byte[] data) throws IOException, ClassNotFoundException { ByteArrayInputStream in = new ByteArrayInputStream(data); ObjectInputStream is = new ObjectInputStream(in); return is.readObject(); }
Vulnerability Classification: - CWE: CWE-470 - CVE: CVE-2018-1000613 - Severity: HIGH - CVSS Score: 7.5 Description: added additional checking to XMSS BDS tree parsing. Failures now mostly cause IOException Function: deserialize File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java Repository: bcgit/bc-java Fixed Code: public static Object deserialize(byte[] data, Class clazz) throws IOException, ClassNotFoundException { ByteArrayInputStream in = new ByteArrayInputStream(data); ObjectInputStream is = new ObjectInputStream(in); Object obj = is.readObject(); if (is.available() != 0) { throw new IOException("unexpected data found at end of ObjectInputStream"); } if (clazz.isInstance(obj)) { return obj; } else { throw new IOException("unexpected class found in ObjectInputStream"); } }
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
deserialize
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
1
Analyze the following code function for security vulnerabilities
protected Object _coerceIntegral(JsonParser p, DeserializationContext ctxt) throws IOException { if (ctxt.isEnabled(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS)) { return p.getBigIntegerValue(); } if (ctxt.isEnabled(DeserializationFeature.USE_LONG_FOR_INTS)) { return p.getLongValue(); } return p.getNumberValue(); // should be optimal, whatever it is }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _coerceIntegral File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_coerceIntegral
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
@Test public void testExtractNanosecondDecimal02() { BigDecimal value = new BigDecimal("15.000000072"); long seconds = value.longValue(); assertEquals("The second part is not correct.", 15L, seconds); int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); assertEquals("The nanosecond part is not correct.", 72, nanoseconds); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2018-1000873 - Severity: MEDIUM - CVSS Score: 4.3 Description: Refactor TestDecimalUtils to reduce repetition. Function: testExtractNanosecondDecimal02 File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDecimalUtils.java Repository: FasterXML/jackson-modules-java8 Fixed Code: @Test public void testExtractNanosecondDecimal02() { BigDecimal value = new BigDecimal("15.000000072"); checkExtractNanos(15L, 72, value); }
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testExtractNanosecondDecimal02
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDecimalUtils.java
103f5678fe104cd6934f07f1158fe92a1e2393a7
1
Analyze the following code function for security vulnerabilities
public static Result verify( DataSource apk, ApkUtils.ZipSections apkSections, Map<Integer, String> supportedApkSigSchemeNames, Set<Integer> foundApkSigSchemeIds, int minSdkVersion, int maxSdkVersion) throws IOException, ApkFormatException, NoSuchAlgorithmException { if (minSdkVersion > maxSdkVersion) { throw new IllegalArgumentException( "minSdkVersion (" + minSdkVersion + ") > maxSdkVersion (" + maxSdkVersion + ")"); } Result result = new Result(); // Parse the ZIP Central Directory and check that there are no entries with duplicate names. List<CentralDirectoryRecord> cdRecords = parseZipCentralDirectory(apk, apkSections); Set<String> cdEntryNames = checkForDuplicateEntries(cdRecords, result); if (result.containsErrors()) { return result; } // Verify JAR signature(s). Signers.verify( apk, apkSections.getZipCentralDirectoryOffset(), cdRecords, cdEntryNames, supportedApkSigSchemeNames, foundApkSigSchemeIds, minSdkVersion, maxSdkVersion, result); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verify File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
verify
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
default Argument<?> getErrorType(MediaType mediaType) { if (mediaType.equals(MediaType.APPLICATION_JSON_TYPE)) { return Argument.of(JsonError.class); } else if (mediaType.equals(MediaType.APPLICATION_VND_ERROR_TYPE)) { return Argument.of(VndError.class); } else { return Argument.of(String.class); } }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2022-21700 - Severity: MEDIUM - CVSS Score: 5.0 Description: Use ConversionContext constants where possible instead of class (#2356) Changes ------- * Added ArgumentConversionContext constants in ConversionContext * Replaced Argument.of and use of argument classes with ConversionContext constants where possible * Added getFirst method in ConvertibleMultiValues that accepts ArgumentConversionContent parameter Partially addresses issue #2355 Function: getErrorType File: http-client/src/main/java/io/micronaut/http/client/exceptions/HttpClientErrorDecoder.java Repository: micronaut-projects/micronaut-core Fixed Code: default Argument<?> getErrorType(MediaType mediaType) { if (mediaType.equals(MediaType.APPLICATION_JSON_TYPE)) { return Argument.of(JsonError.class); } else if (mediaType.equals(MediaType.APPLICATION_VND_ERROR_TYPE)) { return Argument.of(VndError.class); } else { return Argument.STRING; } }
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
getErrorType
http-client/src/main/java/io/micronaut/http/client/exceptions/HttpClientErrorDecoder.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
1
Analyze the following code function for security vulnerabilities
public Map toMap() { return Collections.unmodifiableMap(myHashMap); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toMap 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
toMap
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public void resizeTask(int taskId, Rect bounds) { enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS, "resizeTask()"); long ident = Binder.clearCallingIdentity(); try { synchronized (this) { TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId); if (task == null) { Slog.w(TAG, "resizeTask: taskId=" + taskId + " not found"); return; } mStackSupervisor.resizeTaskLocked(task, bounds); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizeTask 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
resizeTask
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public void abort(NettyResponseFuture<?> future, Throwable t) { Channel channel = future.channel(); if (channel != null && openChannels.contains(channel)) { closeChannel(channel); openChannels.remove(channel); } if (!future.isCancelled() && !future.isDone()) { LOGGER.debug("Aborting Future {}\n", future); LOGGER.debug(t.getMessage(), t); } future.abort(t); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: abort File: providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
abort
providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@Pure public byte getByte(String columnName) throws SQLException { return getByte(findColumn(columnName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getByte 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
getByte
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
int getNextTaskId() { do { mCurTaskId++; if (mCurTaskId <= 0) { mCurTaskId = 1; } } while (anyTaskForIdLocked(mCurTaskId, false) != null); return mCurTaskId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNextTaskId File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
getNextTaskId
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public int getPackageProcessState(String packageName, String callingPackage) { if (!hasUsageStatsPermission(callingPackage)) { enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS, "getPackageProcessState"); } final int[] procState = {PROCESS_STATE_NONEXISTENT}; synchronized (mProcLock) { mProcessList.forEachLruProcessesLOSP(false, proc -> { if (procState[0] > proc.mState.getSetProcState()) { if (proc.getPkgList().containsKey(packageName) || (proc.getPkgDeps() != null && proc.getPkgDeps().contains(packageName))) { procState[0] = proc.mState.getSetProcState(); } } }); } return procState[0]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageProcessState File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
getPackageProcessState
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public final Alignment getAlignment() { return mAlignment; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAlignment File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getAlignment
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
public static boolean defaultUseRelativeURIsWithSSLProxies() { return getBoolean(ASYNC_CLIENT + "useRelativeURIsWithSSLProxies", true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultUseRelativeURIsWithSSLProxies File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7398
MEDIUM
4.3
AsyncHttpClient/async-http-client
defaultUseRelativeURIsWithSSLProxies
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
public void aliasAttribute(String alias, String attributeName) { if (attributeAliasingMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + AttributeAliasingMapper.class.getName() + " available"); } attributeAliasingMapper.addAliasFor(attributeName, alias); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: aliasAttribute File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
aliasAttribute
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public String[] getContentTypePars() { return contentTypePars; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentTypePars File: src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java Repository: Bedework/bw-webdav The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20000
MEDIUM
5
Bedework/bw-webdav
getContentTypePars
src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java
67283fb8b9609acdb1a8d2e7fefe195b4a261062
0
Analyze the following code function for security vulnerabilities
private void updateMediaPackageID(MediaPackage mp, InputStream is) throws IOException { DublinCoreCatalog dc = DublinCores.read(is); EName en = new EName(DublinCore.TERMS_NS_URI, "identifier"); String id = dc.getFirst(en); if (id != null) { mp.setIdentifier(new IdImpl(id)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateMediaPackageID File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java Repository: opencast The code follows secure coding practices.
[ "CWE-74" ]
CVE-2020-5230
MEDIUM
5
opencast
updateMediaPackageID
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
bbb473f34ab95497d6c432c81285efb0c739f317
0
Analyze the following code function for security vulnerabilities
@Override protected Integer exec() { if (!entity.containsField(EntityHelper.QuickCode)) { throw new IllegalArgumentException("No QuickCode field found : " + entity); } Field nameFiled = entity.getNameField(); String sql = String.format("select %s,%s,quickCode from %s order by createdOn", entity.getPrimaryField().getName(), nameFiled.getName(), entity.getName()); int pageNo = 1; while (true) { List<Record> records = Application.createQueryNoFilter(sql) .setLimit(PAGE_SIZE, pageNo * PAGE_SIZE - PAGE_SIZE) .list(); pageNo++; this.setTotal(records.size() + this.getTotal() + 1); for (Record o : records) { if (this.isInterrupt()) { this.setInterrupted(); break; } try { String quickCodeNew = generateQuickCode(o); if (quickCodeNew == null) continue; if (quickCodeNew.equals(o.getString(EntityHelper.QuickCode))) continue; Record record = EntityHelper.forUpdate(o.getPrimary(), UserService.SYSTEM_USER, Boolean.FALSE); if (StringUtils.isBlank(quickCodeNew)) { record.setNull(EntityHelper.QuickCode); } else { record.setString(EntityHelper.QuickCode, quickCodeNew); } Application.getCommonsService().update(record, Boolean.FALSE); this.addSucceeded(); } finally { this.addCompleted(); } } if (records.size() < PAGE_SIZE || this.isInterrupted()) break; } this.setTotal(this.getTotal() - 1); return this.getSucceeded(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exec File: src/main/java/com/rebuild/core/service/general/QuickCodeReindexTask.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
exec
src/main/java/com/rebuild/core/service/general/QuickCodeReindexTask.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0