instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private native int nativeLoadUrl(long nativeTabAndroid, String url, String extraHeaders, byte[] postData, int transition, String referrerUrl, int referrerPolicy);
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2014-3159 - Severity: MEDIUM - CVSS Score: 6.4 Description: Use LoadURLWithParams in ChromeWebContentsDelegateAndroid Build a LoadURLParams object from the OpenURLParams and properly set all parameters on that object when calling into NavigationController. This makes sure we set the correct state for the load. BUG=352083 Review URL: https://codereview.chromium.org/267253007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273865 0039d316-1c4b-4281-b951-d872f2087c98 Function: nativeLoadUrl File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium Fixed Code: private native int nativeLoadUrl(long nativeTabAndroid, String url, String extraHeaders, byte[] postData, int transition, String referrerUrl, int referrerPolicy, boolean isRendererInitiated);
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
nativeLoadUrl
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
1
Analyze the following code function for security vulnerabilities
private void scheduleTransferSplashScreenTimeout() { mAtmService.mH.postDelayed(mTransferSplashScreenTimeoutRunnable, TRANSFER_SPLASH_SCREEN_TIMEOUT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleTransferSplashScreenTimeout File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
scheduleTransferSplashScreenTimeout
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void updateDeviceOwner(String packageName) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDeviceOwner File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
updateDeviceOwner
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
float nextTab(float h) { int ns = this.mNumStops; if (ns > 0) { int[] stops = this.mStops; for (int i = 0; i < ns; ++i) { int stop = stops[i]; if (stop > h) { return stop; } } } return nextDefaultStop(h, mIncrement); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nextTab File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
nextTab
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
public void setVisiblePasswordEnabled(boolean enabled, int userId) { // Update for crypto if owner if (userId != UserHandle.USER_SYSTEM) { return; } IBinder service = ServiceManager.getService("mount"); if (service == null) { Log.e(TAG, "Could not find the mount service to update the user info"); return; } IMountService mountService = IMountService.Stub.asInterface(service); try { mountService.setField(StorageManager.PASSWORD_VISIBLE_KEY, enabled ? "1" : "0"); } catch (RemoteException e) { Log.e(TAG, "Error changing password visible state", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVisiblePasswordEnabled File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
setVisiblePasswordEnabled
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
private String extractBody(BaseMessage message) { return message.getMessageContent(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractBody File: notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java Repository: opendistro-for-elasticsearch/alerting The code follows secure coding practices.
[ "CWE-918" ]
CVE-2021-31828
MEDIUM
5.5
opendistro-for-elasticsearch/alerting
extractBody
notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java
49cc584dd6bd38ca26129eeaca5cd04e40a27f25
0
Analyze the following code function for security vulnerabilities
public abstract float get(String name, float defaultValue) throws IOException, IllegalArgumentException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
get
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override @Deprecated public boolean isRequestedSessionIdFromUrl() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRequestedSessionIdFromUrl File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
isRequestedSessionIdFromUrl
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public void undeploy() { try { deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Void, Object>() { @Override public Void call(HttpServerExchange exchange, Object ignore) throws ServletException { for(ServletContextListener listener : deployment.getDeploymentInfo().getDeploymentCompleteListeners()) { try { listener.contextDestroyed(new ServletContextEvent(deployment.getServletContext())); } catch (Throwable t) { UndertowServletLogger.REQUEST_LOGGER.failedToDestroy(listener, t); } } deployment.destroy(); deployment = null; state = State.UNDEPLOYED; return null; } }).call(null, null); } catch (Exception e) { throw new RuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: undeploy File: servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
undeploy
servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
@Override public SessionData decode(String data) { byte[] bytes = Base64.getDecoder().decode(data); try (ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes); FilteringObjectInputStream objectInputStream = new FilteringObjectInputStream(inputStream)) { return (SessionData) objectInputStream.readObject(); } catch (IOException | ClassNotFoundException e) { throw new PippoRuntimeException(e, "Cannot deserialize session. A new one will be created."); } }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2018-18628 - Severity: HIGH - CVSS Score: 10.0 Description: More fixes. Function: decode File: pippo-session-parent/pippo-session/src/main/java/ro/pippo/session/SerializationSessionDataTranscoder.java Repository: pippo-java/pippo Fixed Code: @Override public SessionData decode(String data) { byte[] bytes = Base64.getDecoder().decode(data); try (ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes); WhitelistObjectInputStream objectInputStream = new WhitelistObjectInputStream(inputStream)) { return (SessionData) objectInputStream.readObject(); } catch (IOException | ClassNotFoundException e) { throw new PippoRuntimeException(e, "Cannot deserialize session. A new one will be created."); } }
[ "CWE-502" ]
CVE-2018-18628
HIGH
10
pippo-java/pippo
decode
pippo-session-parent/pippo-session/src/main/java/ro/pippo/session/SerializationSessionDataTranscoder.java
6e7176a2924fb6f900f10482de696497b55656fa
1
Analyze the following code function for security vulnerabilities
public void updateMetrics() { int numProviders = mProviders.size(); int numConnectedProviders = 0; for (Map.Entry<String, PasspointProvider> entry : mProviders.entrySet()) { if (entry.getValue().getHasEverConnected()) { numConnectedProviders++; } } mWifiMetrics.updateSavedPasspointProfilesInfo(mProviders); mWifiMetrics.updateSavedPasspointProfiles(numProviders, numConnectedProviders); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateMetrics File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
updateMetrics
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
@Override public int prepareAddWindowLw(WindowState win, WindowManager.LayoutParams attrs) { switch (attrs.type) { case TYPE_STATUS_BAR: mContext.enforceCallingOrSelfPermission( android.Manifest.permission.STATUS_BAR_SERVICE, "PhoneWindowManager"); if (mStatusBar != null) { if (mStatusBar.isAlive()) { return WindowManagerGlobal.ADD_MULTIPLE_SINGLETON; } } mStatusBar = win; mStatusBarController.setWindow(win); break; case TYPE_NAVIGATION_BAR: mContext.enforceCallingOrSelfPermission( android.Manifest.permission.STATUS_BAR_SERVICE, "PhoneWindowManager"); if (mNavigationBar != null) { if (mNavigationBar.isAlive()) { return WindowManagerGlobal.ADD_MULTIPLE_SINGLETON; } } mNavigationBar = win; mNavigationBarController.setWindow(win); if (DEBUG_LAYOUT) Slog.i(TAG, "NAVIGATION BAR: " + mNavigationBar); break; case TYPE_NAVIGATION_BAR_PANEL: mContext.enforceCallingOrSelfPermission( android.Manifest.permission.STATUS_BAR_SERVICE, "PhoneWindowManager"); break; case TYPE_STATUS_BAR_PANEL: mContext.enforceCallingOrSelfPermission( android.Manifest.permission.STATUS_BAR_SERVICE, "PhoneWindowManager"); break; case TYPE_STATUS_BAR_SUB_PANEL: mContext.enforceCallingOrSelfPermission( android.Manifest.permission.STATUS_BAR_SERVICE, "PhoneWindowManager"); break; case TYPE_KEYGUARD_SCRIM: if (mKeyguardScrim != null) { return WindowManagerGlobal.ADD_MULTIPLE_SINGLETON; } mKeyguardScrim = win; break; } return WindowManagerGlobal.ADD_OKAY; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepareAddWindowLw 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
prepareAddWindowLw
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override protected boolean canRestoreAnyVersion() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canRestoreAnyVersion File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
canRestoreAnyVersion
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
public static Object[][] queryListOfConfig(String sql, String belongEntity, String q) { if (StringUtils.isNotBlank(belongEntity) && !"$ALL$".equalsIgnoreCase(belongEntity)) { sql = sql.replace("(1=1)", "belongEntity = '" + StringEscapeUtils.escapeSql(belongEntity) + "'"); } if (StringUtils.isNotBlank(q)) { sql = sql.replace("(2=2)", "name like '%" + StringEscapeUtils.escapeSql(q) + "%'"); } Object[][] array = Application.createQuery(sql).setLimit(500).array(); for (Object[] o : array) { o[2] = EasyMetaFactory.getLabel(MetadataHelper.getEntity((String) o[2])); o[5] = I18nUtils.formatDate((Date) o[5]); } return array; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2023-1495 - Severity: MEDIUM - CVSS Score: 6.5 Description: H5 sync2 (#595) * style: 目录样式gh * style: J_new * feat: advListFilterTabs * feat: nav-copyto * enh: 助记码全拼 * enh: 地图搜索选点 * enh: topnav * list pn * .form-line.v33 * open TAG * KVS addShutdownHook * fix: #594 --------- Co-authored-by: devezhao <zhaofang123@gmail.com> Function: queryListOfConfig File: src/main/java/com/rebuild/web/admin/ConfigCommons.java Repository: getrebuild/rebuild Fixed Code: public static Object[][] queryListOfConfig(String sql, String belongEntity, String q) { if (StringUtils.isNotBlank(belongEntity) && !"$ALL$".equalsIgnoreCase(belongEntity)) { sql = sql.replace("(1=1)", "belongEntity = '" + CommonsUtils.escapeSql(belongEntity) + "'"); } if (StringUtils.isNotBlank(q)) { sql = sql.replace("(2=2)", "name like '%" + CommonsUtils.escapeSql(q) + "%'"); } Object[][] array = Application.createQuery(sql).setLimit(500).array(); for (Object[] o : array) { o[2] = EasyMetaFactory.getLabel(MetadataHelper.getEntity((String) o[2])); o[5] = I18nUtils.formatDate((Date) o[5]); } return array; }
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
queryListOfConfig
src/main/java/com/rebuild/web/admin/ConfigCommons.java
c9474f84e5f376dd2ade2078e3039961a9425da7
1
Analyze the following code function for security vulnerabilities
private synchronized ServerSockets getServerSockets() { if (serverSockets == null) { serverSockets = new ServerSockets(); } return serverSockets; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServerSockets 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
getServerSockets
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void setNodeSelector(List<NodeSelectorEntry> nodeSelector) { this.nodeSelector = nodeSelector; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNodeSelector File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
setNodeSelector
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
0
Analyze the following code function for security vulnerabilities
private String base64(byte [] source) { return Base64.getEncoder().encodeToString(source); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: base64 File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
base64
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private static String fixProcessName(String defProcessName, String processName, int uid) { if (processName == null) { return defProcessName; } return processName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fixProcessName 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
fixProcessName
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
void resetThrottlingInner(@UserIdInt int userId) { synchronized (mLock) { if (!isUserUnlockedL(userId)) { Log.w(TAG, "User " + userId + " is locked or not running"); return; } getUserShortcutsLocked(userId).resetThrottling(); } scheduleSaveUser(userId); Slog.i(TAG, "ShortcutManager: throttling counter reset for user " + userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetThrottlingInner 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
resetThrottlingInner
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
ActiveAdmin getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked(int userId) { ensureLocked(); ActiveAdmin admin = getDeviceOwnerAdminLocked(); if (admin == null) { admin = getProfileOwnerOfOrganizationOwnedDeviceLocked(userId); } return admin; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked 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
getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private List<PluginPackageResourceFiles> parseAllPluginPackageResourceFile(PluginPackages pluginPackageEntity, String sourceZipFile, String sourceZipFileName) throws IOException { List<PluginPackageResourceFiles> pluginPackageResourceFilesEntities = new ArrayList<>(); try (ZipFile zipFile = new ZipFile(sourceZipFile)) { Enumeration<?> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = (ZipEntry) entries.nextElement(); if (!entry.isDirectory()) { String zipEntryName = entry.getName(); PluginPackageResourceFiles pluginPackageResourceFilesEntity = new PluginPackageResourceFiles(); pluginPackageResourceFilesEntity.setId(LocalIdGenerator.generateId()); pluginPackageResourceFilesEntity.setPackageName(pluginPackageEntity.getName()); pluginPackageResourceFilesEntity.setPackageVersion(pluginPackageEntity.getVersion()); pluginPackageResourceFilesEntity.setPluginPackageId(pluginPackageEntity.getId()); String relatedPath = "/ui-resources/" + pluginPackageEntity.getName() + File.separator + pluginPackageEntity.getVersion() + File.separator + zipEntryName; pluginPackageResourceFilesEntity.setRelatedPath(relatedPath); pluginPackageResourceFilesEntity.setSource(sourceZipFileName); log.info("File in ui package [{}] : {}", sourceZipFileName, zipEntryName); pluginPackageResourceFilesEntities.add(pluginPackageResourceFilesEntity); } } } return pluginPackageResourceFilesEntities; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseAllPluginPackageResourceFile File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java Repository: WeBankPartners/wecube-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-45746
MEDIUM
5
WeBankPartners/wecube-platform
parseAllPluginPackageResourceFile
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
0
Analyze the following code function for security vulnerabilities
private boolean updateProvidersForPackageLocked(String packageName, int userId, Set<ProviderId> removedProviders) { boolean providersUpdated = false; HashSet<ProviderId> keep = new HashSet<>(); Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE); intent.setPackage(packageName); List<ResolveInfo> broadcastReceivers = queryIntentReceivers(intent, userId); // add the missing ones and collect which ones to keep int N = broadcastReceivers == null ? 0 : broadcastReceivers.size(); for (int i = 0; i < N; i++) { ResolveInfo ri = broadcastReceivers.get(i); ActivityInfo ai = ri.activityInfo; if ((ai.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) { continue; } if (packageName.equals(ai.packageName)) { ProviderId providerId = new ProviderId(ai.applicationInfo.uid, new ComponentName(ai.packageName, ai.name)); Provider provider = lookupProviderLocked(providerId); if (provider == null) { if (addProviderLocked(ri)) { keep.add(providerId); providersUpdated = true; } } else { Provider parsed = parseProviderInfoXml(providerId, ri); if (parsed != null) { keep.add(providerId); // Use the new AppWidgetProviderInfo. provider.info = parsed.info; // If it's enabled final int M = provider.widgets.size(); if (M > 0) { int[] appWidgetIds = getWidgetIds(provider.widgets); // Reschedule for the new updatePeriodMillis (don't worry about handling // it specially if updatePeriodMillis didn't change because we just sent // an update, and the next one will be updatePeriodMillis from now). cancelBroadcasts(provider); registerForBroadcastsLocked(provider, appWidgetIds); // If it's currently showing, call back with the new // AppWidgetProviderInfo. for (int j = 0; j < M; j++) { Widget widget = provider.widgets.get(j); widget.views = null; scheduleNotifyProviderChangedLocked(widget); } // Now that we've told the host, push out an update. sendUpdateIntentLocked(provider, appWidgetIds); providersUpdated = true; } } } } } // prune the ones we don't want to keep N = mProviders.size(); for (int i = N - 1; i >= 0; i--) { Provider provider = mProviders.get(i); if (packageName.equals(provider.info.provider.getPackageName()) && provider.getUserId() == userId && !keep.contains(provider.id)) { if (removedProviders != null) { removedProviders.add(provider.id); } deleteProviderLocked(provider); providersUpdated = true; } } return providersUpdated; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateProvidersForPackageLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
updateProvidersForPackageLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setReadTimeout File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setReadTimeout
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@GetMapping("related-list-config") public RespBody getDataListConfig(HttpServletRequest req, @EntityParam Entity listEntity) { JSON config = DataListManager.instance.getListFields( listEntity.getName(), getRequestUser(req), DataListManager.SYS_RELATED); return RespBody.ok(config); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDataListConfig File: src/main/java/com/rebuild/web/general/RelatedListController.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
getDataListConfig
src/main/java/com/rebuild/web/general/RelatedListController.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
public Compression getCompression() { return compression; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCompression 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
getCompression
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@Override public WifiInfo syncRequestConnectionInfo() { return mWifiThreadRunner.call(() -> new WifiInfo(mWifiInfo), new WifiInfo()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: syncRequestConnectionInfo File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
syncRequestConnectionInfo
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public boolean checkListElements(Object value, Class<?> elementClass) { if (value instanceof List) { for (Object element: (List<?>)value) { if (element == null || element.getClass() != elementClass) return false; } return true; } else { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkListElements File: server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-94" ]
CVE-2021-21248
MEDIUM
6.5
theonedev/onedev
checkListElements
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
public Map getMetaData() { return this.metaData; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaData File: drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java Repository: apache/incubator-kie-drools The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2014-8125
HIGH
7.5
apache/incubator-kie-drools
getMetaData
drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
c48464c3b246e6ef0d4cd0dbf67e83ccd532c6d3
0
Analyze the following code function for security vulnerabilities
private void updateBasePath() { if (serverIndex != null) { setBasePath(servers.get(serverIndex).URL(serverVariables)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBasePath File: samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
updateBasePath
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public String getName() { return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: core/src/main/java/io/micronaut/core/type/DefaultArgument.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
getName
core/src/main/java/io/micronaut/core/type/DefaultArgument.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public static void disableDefault() throws DotHibernateException { Structure defaultStructure = getDefaultStructure(); if (InodeUtils.isSet(defaultStructure.getInode())) { defaultStructure.setDefaultStructure(false); saveStructure(defaultStructure); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disableDefault File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
disableDefault
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
private void resetGestureDetection() { if (mNativeContentViewCore == 0) return; nativeResetGestureDetection(mNativeContentViewCore); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetGestureDetection 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
resetGestureDetection
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public int getDefaultResponseTimeout() { return Integer.parseInt(prop.getProperty(TS_DEFAULT_RESPONSE_TIMEOUT, "120")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultResponseTimeout File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getDefaultResponseTimeout
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
public void modifyIndexHtmlResponse(IndexHtmlResponse response) { indexHtmlRequestListeners.forEach( listener -> listener.modifyIndexHtmlResponse(response)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: modifyIndexHtmlResponse File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
modifyIndexHtmlResponse
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
protected void handleSimSubscriptionInfoChanged() { if (DEBUG_SIM_STATES) { Log.v(TAG, "onSubscriptionInfoChanged()"); List<SubscriptionInfo> sil = mSubscriptionManager.getActiveSubscriptionInfoList(); if (sil != null) { for (SubscriptionInfo subInfo : sil) { Log.v(TAG, "SubInfo:" + subInfo); } } else { Log.v(TAG, "onSubscriptionInfoChanged: list is null"); } } List<SubscriptionInfo> subscriptionInfos = getSubscriptionInfo(true /* forceReload */); // Hack level over 9000: Because the subscription id is not yet valid when we see the // first update in handleSimStateChange, we need to force refresh all all SIM states // so the subscription id for them is consistent. ArrayList<SubscriptionInfo> changedSubscriptions = new ArrayList<>(); for (int i = 0; i < subscriptionInfos.size(); i++) { SubscriptionInfo info = subscriptionInfos.get(i); boolean changed = refreshSimState(info.getSubscriptionId(), info.getSimSlotIndex()); if (changed) { changedSubscriptions.add(info); } } for (int i = 0; i < changedSubscriptions.size(); i++) { SimData data = mSimDatas.get(changedSubscriptions.get(i).getSubscriptionId()); for (int j = 0; j < mCallbacks.size(); j++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get(); if (cb != null) { cb.onSimStateChanged(data.subId, data.slotId, data.simState); } } } for (int j = 0; j < mCallbacks.size(); j++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get(); if (cb != null) { cb.onRefreshCarrierInfo(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleSimSubscriptionInfoChanged File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
handleSimSubscriptionInfoChanged
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public int hashCode() { return (key == null ? 0 : key.hashCode()) ^ (value == null ? 0 : value.hashCode()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCode File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
hashCode
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override public void showGlobalActions() { mHandler.removeMessages(MSG_DISPATCH_SHOW_GLOBAL_ACTIONS); mHandler.sendEmptyMessage(MSG_DISPATCH_SHOW_GLOBAL_ACTIONS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showGlobalActions 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
showGlobalActions
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
boolean dumpProcessesToGc(FileDescriptor fd, PrintWriter pw, String[] args, int opti, boolean needSep, boolean dumpAll, String dumpPackage) { if (mProcessesToGc.size() > 0) { boolean printed = false; long now = SystemClock.uptimeMillis(); for (int i=0; i<mProcessesToGc.size(); i++) { ProcessRecord proc = mProcessesToGc.get(i); if (dumpPackage != null && !dumpPackage.equals(proc.info.packageName)) { continue; } if (!printed) { if (needSep) pw.println(); needSep = true; pw.println(" Processes that are waiting to GC:"); printed = true; } pw.print(" Process "); pw.println(proc); pw.print(" lowMem="); pw.print(proc.reportLowMemory); pw.print(", last gced="); pw.print(now-proc.lastRequestedGc); pw.print(" ms ago, last lowMem="); pw.print(now-proc.lastLowMemory); pw.println(" ms ago"); } } return needSep; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpProcessesToGc 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
dumpProcessesToGc
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public static long getInputDispatchingTimeoutLocked(ProcessRecord r) { if (r != null && (r.instr != null || r.usingWrapper)) { return INSTRUMENTATION_KEY_DISPATCHING_TIMEOUT; } return KEY_DISPATCHING_TIMEOUT; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInputDispatchingTimeoutLocked 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
getInputDispatchingTimeoutLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public void onAuthenticated(final long deviceId, final int fingerId, final int groupId) { mHandler.post(new Runnable() { @Override public void run() { handleAuthenticated(deviceId, fingerId, groupId); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAuthenticated File: services/core/java/com/android/server/fingerprint/FingerprintService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onAuthenticated
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public String post(PageModel model, @MethodParam("getAccount") @BindParams Account account, @BindParams User user, @BindParams OtherAccountData otherAccountData, @SpringBean("userService") UserService userService, @SpringBean("messageSourceService") MessageSourceService messageSourceService, @SpringBean("adminAccountService") AccountService accountService, @SpringBean("adminService") AdministrationService administrationService, @SpringBean("adminUiAccountValidator") AdminUiAccountValidator accountValidator, @SpringBean("providerManagementService") ProviderManagementService providerManagementService, @SpringBean("appFrameworkService") AppFrameworkService appFrameworkService, HttpServletRequest request, UiUtils uu) throws IOException { Errors errors = new BeanPropertyBindingResult(account, "account"); List<Extension> customUserPropertyEditFragments = appFrameworkService.getExtensionsForCurrentUser("userAccount.userPropertyEditFragment"); Map<String, String[]> parameterMap = request.getParameterMap(); for(Extension ext : customUserPropertyEditFragments) { if (StringUtils.equals(ext.getExtensionParams().get("type").toString(), "userProperty")) { String userPropertyName = ext.getExtensionParams().get("userPropertyName").toString(); String[] parameterValues = parameterMap.get(userPropertyName); if (parameterValues != null && parameterValues.length > 0) { String parameterValue; if (userPropertyName == "locationUuid") { parameterValue = String.join(",", parameterValues); } else { if (parameterValues.length > 1) { log.warn("Multiple userProperty for a single user type not supported, ignoring extra values"); } parameterValue = parameterValues[0]; } if (userPropertyName != null && parameterValue != null) { user.setUserProperty(userPropertyName, parameterValue); } } } } List<Extension> customPersonAttributeEditFragments = appFrameworkService.getExtensionsForCurrentUser("userAccount.personAttributeEditFragment"); for(Extension ext : customPersonAttributeEditFragments) { if (StringUtils.equals(ext.getExtensionParams().get("type").toString(), "personAttribute")) { String formFiledName = ext.getExtensionParams().get("formFieldName").toString(); String personAttributeTypeUuid = ext.getExtensionParams().get("uuid").toString(); String[] parameterValues = parameterMap.get(formFiledName); if (parameterValues != null && parameterValues.length > 0) { if (parameterValues.length > 1) { log.warn("Multiple values for a single person attribute type not supported, ignoring extra values"); } String parameterValue = parameterValues[0]; if (parameterValue != null) { PersonAttributeType personAttributeByUuid = Context.getPersonService() .getPersonAttributeTypeByUuid(personAttributeTypeUuid); if (personAttributeByUuid != null) { PersonAttribute attribute = new PersonAttribute(personAttributeByUuid, parameterValue); account.getPerson().addAttribute(attribute); } } } } } if (otherAccountData.getAddUserAccount()) { //The StringToRoleConverter emrapi for some reason is taking precedence over the //one in uiframework module and it doesn't get role by uuid, so we have to do this user.addRole(userService.getRoleByUuid(request.getParameter("privilegeLevel"))); String[] uuids = request.getParameterValues("capabilities"); if (uuids != null) { for (String uuid : uuids) { user.addRole(userService.getRoleByUuid(uuid)); } } String forcePassword = otherAccountData.getForceChangePassword() ? "true" : "false"; user.setUserProperty(OpenmrsConstants.USER_PROPERTY_CHANGE_PASSWORD, forcePassword); account.addUserAccount(user); } if (otherAccountData.getAddProviderAccount()) { Provider provider = new Provider(); provider.setIdentifier(request.getParameter("identifier")); provider.setProviderRole(providerManagementService.getProviderRoleByUuid(request.getParameter("providerRole"))); account.addProviderAccount(provider); } accountValidator.validate(account, errors); if (!errors.hasErrors()) { try { account.setPassword(user, otherAccountData.getPassword()); accountService.saveAccount(account); InfoErrorMessageUtil.flashInfoMessage(request.getSession(), "adminui.account.saved"); return "redirect:/adminui/systemadmin/accounts/manageAccounts.page"; } catch (Exception e) { errors.reject("adminui.account.error.save.fail"); //If the person, provider or user account had been flushed we need to unset the ids because //they actually don't exist in the DB otherwise the logic in the GSP will see the ids and //think we are editing and things will break account.getPerson().setId(null); if (otherAccountData.getAddProviderAccount()) { account.getProviderAccounts().get(0).setProviderId(null); } if (otherAccountData.getAddUserAccount()) { account.getUserAccounts().get(0).setUserId(null); } } } setModelAttributes(model, account, otherAccountData, accountService, administrationService, providerManagementService, uu, appFrameworkService); sendErrorMessage(errors, model, messageSourceService, request); if (account.getPerson().getPersonId() == null) { setJsonFormData(model, account, otherAccountData); } return "systemadmin/accounts/account"; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-36636 - Severity: MEDIUM - CVSS Score: 6.1 Description: RA-1865: Fix possible xss in account setup (#57) Function: post File: omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java Repository: openmrs/openmrs-module-adminui Fixed Code: public String post(PageModel model, @MethodParam("getAccount") @BindParams Account account, @BindParams User user, @BindParams OtherAccountData otherAccountData, @SpringBean("userService") UserService userService, @SpringBean("messageSourceService") MessageSourceService messageSourceService, @SpringBean("adminAccountService") AccountService accountService, @SpringBean("adminService") AdministrationService administrationService, @SpringBean("adminUiAccountValidator") AdminUiAccountValidator accountValidator, @SpringBean("providerManagementService") ProviderManagementService providerManagementService, @SpringBean("appFrameworkService") AppFrameworkService appFrameworkService, HttpServletRequest request, UiUtils uu) throws IOException { Errors errors = new BeanPropertyBindingResult(account, "account"); List<Extension> customUserPropertyEditFragments = appFrameworkService.getExtensionsForCurrentUser("userAccount.userPropertyEditFragment"); Map<String, String[]> parameterMap = request.getParameterMap(); for(Extension ext : customUserPropertyEditFragments) { if (StringUtils.equals(ext.getExtensionParams().get("type").toString(), "userProperty")) { String userPropertyName = ext.getExtensionParams().get("userPropertyName").toString(); String[] parameterValues = parameterMap.get(userPropertyName); if (parameterValues != null && parameterValues.length > 0) { String parameterValue; if (userPropertyName == "locationUuid") { parameterValue = String.join(",", parameterValues); } else { if (parameterValues.length > 1) { log.warn("Multiple userProperty for a single user type not supported, ignoring extra values"); } parameterValue = parameterValues[0]; } if (userPropertyName != null && parameterValue != null) { user.setUserProperty(userPropertyName, parameterValue); } } } } List<Extension> customPersonAttributeEditFragments = appFrameworkService.getExtensionsForCurrentUser("userAccount.personAttributeEditFragment"); for(Extension ext : customPersonAttributeEditFragments) { if (StringUtils.equals(ext.getExtensionParams().get("type").toString(), "personAttribute")) { String formFiledName = ext.getExtensionParams().get("formFieldName").toString(); String personAttributeTypeUuid = ext.getExtensionParams().get("uuid").toString(); String[] parameterValues = parameterMap.get(formFiledName); if (parameterValues != null && parameterValues.length > 0) { if (parameterValues.length > 1) { log.warn("Multiple values for a single person attribute type not supported, ignoring extra values"); } String parameterValue = parameterValues[0]; if (parameterValue != null) { PersonAttributeType personAttributeByUuid = Context.getPersonService() .getPersonAttributeTypeByUuid(personAttributeTypeUuid); if (personAttributeByUuid != null) { PersonAttribute attribute = new PersonAttribute(personAttributeByUuid, parameterValue); account.getPerson().addAttribute(attribute); } } } } } if (otherAccountData.getAddUserAccount()) { //The StringToRoleConverter emrapi for some reason is taking precedence over the //one in uiframework module and it doesn't get role by uuid, so we have to do this user.addRole(userService.getRoleByUuid(request.getParameter("privilegeLevel"))); String[] uuids = request.getParameterValues("capabilities"); if (uuids != null) { for (String uuid : uuids) { user.addRole(userService.getRoleByUuid(uuid)); } } String forcePassword = otherAccountData.getForceChangePassword() ? "true" : "false"; user.setUserProperty(OpenmrsConstants.USER_PROPERTY_CHANGE_PASSWORD, forcePassword); account.addUserAccount(user); } if (otherAccountData.getAddProviderAccount()) { Provider provider = new Provider(); provider.setIdentifier(request.getParameter("identifier")); provider.setProviderRole(providerManagementService.getProviderRoleByUuid(request.getParameter("providerRole"))); account.addProviderAccount(provider); } accountValidator.validate(account, errors); if (!errors.hasErrors()) { try { account.setPassword(user, otherAccountData.getPassword()); accountService.saveAccount(account); InfoErrorMessageUtil.flashInfoMessage(request.getSession(), "adminui.account.saved"); return "redirect:/adminui/systemadmin/accounts/manageAccounts.page"; } catch (Exception e) { errors.reject("adminui.account.error.save.fail"); //If the person, provider or user account had been flushed we need to unset the ids because //they actually don't exist in the DB otherwise the logic in the GSP will see the ids and //think we are editing and things will break account.getPerson().setId(null); if (otherAccountData.getAddProviderAccount()) { account.getProviderAccounts().get(0).setProviderId(null); } if (otherAccountData.getAddUserAccount()) { account.getUserAccounts().get(0).setUserId(null); } } } setModelAttributes(model, account, otherAccountData, accountService, administrationService, providerManagementService, uu, appFrameworkService); sendErrorMessage(errors, model, messageSourceService, request); if (account.getPerson().getPersonId() == null) { setJsonFormData(model, account, otherAccountData, uu); } return "systemadmin/accounts/account"; }
[ "CWE-79" ]
CVE-2020-36636
MEDIUM
6.1
openmrs/openmrs-module-adminui
post
omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java
702fbfdac7c4418f23bb5f6452482b4a88020061
1
Analyze the following code function for security vulnerabilities
@Override public ServerBuilder tls( File keyCertChainFile, File keyFile, @Nullable String keyPassword) { virtualHostTemplate.tls(keyCertChainFile, keyFile, keyPassword); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tls File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
tls
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public void removeDatatransferProgressListener( OnDatatransferProgressListener listener, User user, OCFile file ) { if (user == null || file == null || listener == null) { return; } String targetKey = buildRemoteName(user.getAccountName(), file.getRemotePath()); if (mBoundListeners.get(targetKey) == listener) { mBoundListeners.remove(targetKey); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeDatatransferProgressListener File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39210
MEDIUM
5.5
nextcloud/android
removeDatatransferProgressListener
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
private void enterSplit() { // Do not notify menu visibility when hiding the menu, the controller will do this when it // handles the message hideMenu(mController::onEnterSplit, false /* notifyMenuVisibility */, true /* resize */, ANIM_TYPE_HIDE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enterSplit File: libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40123
MEDIUM
5.5
android
enterSplit
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
7212a4bec2d2f1a74fa54a12a04255d6a183baa9
0
Analyze the following code function for security vulnerabilities
protected void populateCollection(HierarchicalStreamReader reader, UnmarshallingContext context, Collection collection) { populateCollection(reader, context, collection, collection); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: populateCollection File: xstream/src/java/com/thoughtworks/xstream/converters/collections/CollectionConverter.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
populateCollection
xstream/src/java/com/thoughtworks/xstream/converters/collections/CollectionConverter.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting static boolean isExternalMediaDirectory(@NonNull String path, String crossUserRoot) { final String relativePath = extractRelativePath(path); if (relativePath == null) { return false; } if (StringUtils.startsWithIgnoreCase(relativePath, "Android/media")) { return true; } if (!TextUtils.isEmpty(crossUserRoot)) { return StringUtils.startsWithIgnoreCase(relativePath, crossUserRoot + "/Android/media"); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isExternalMediaDirectory 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
isExternalMediaDirectory
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
public boolean isPluggedIn() { return plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB || plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPluggedIn File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
isPluggedIn
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
void addWarning(Issue msg, Object... parameters) { mWarnings.add(new IssueWithParams(msg, parameters)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addWarning File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
addWarning
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
public static void copyToDir(Directory in, File out) throws DirectoryException { for (String fileName : in.getFiles(true)) { copyToDir(in, out, fileName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyToDir File: brut.j.dir/src/main/java/brut/directory/DirUtil.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
copyToDir
brut.j.dir/src/main/java/brut/directory/DirUtil.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
private <T> T runAsAuthenticated( Callable<T> runnable ) { final AuthenticationInfo authInfo = AuthenticationInfo.create().principals( RoleKeys.AUTHENTICATED ).user( User.ANONYMOUS ).build(); return ContextBuilder.from( this.context.get() ). authInfo( authInfo ). repositoryId( SystemConstants.SYSTEM_REPO_ID ). branch( SecurityConstants.BRANCH_SECURITY ).build(). callWith( runnable ); }
Vulnerability Classification: - CWE: CWE-384 - CVE: CVE-2024-23679 - Severity: CRITICAL - CVSS Score: 9.8 Description: Invalidate old session after login #9253 (cherry picked from commit 0189975691e9e6407a9fee87006f730e84f734ff) Function: runAsAuthenticated File: modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java Repository: enonic/xp Fixed Code: private <T> T runAsAuthenticated( Callable<T> runnable ) { final AuthenticationInfo authInfo = AuthenticationInfo.create().principals( RoleKeys.AUTHENTICATED ).user( User.ANONYMOUS ).build(); return ContextBuilder.from( this.context.get() ) .authInfo( authInfo ) .repositoryId( SystemConstants.SYSTEM_REPO_ID ) .branch( SecurityConstants.BRANCH_SECURITY ) .build() .callWith( runnable ); }
[ "CWE-384" ]
CVE-2024-23679
CRITICAL
9.8
enonic/xp
runAsAuthenticated
modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
2abac31cec8679074debc4f1fb69c25930e40842
1
Analyze the following code function for security vulnerabilities
private void renderState(FacesContext context) throws IOException { // Get the view state and write it to the response.. PartialViewContext pvc = context.getPartialViewContext(); PartialResponseWriter writer = pvc.getPartialResponseWriter(); String viewStateId = Util.getViewStateId(context); writer.startUpdate(viewStateId); String state = context.getApplication().getStateManager().getViewState(context); writer.write(state); writer.endUpdate(); ClientWindow window = context.getExternalContext().getClientWindow(); if (null != window) { String clientWindowId = Util.getClientWindowId(context); writer.startUpdate(clientWindowId); writer.write(window.getId()); writer.endUpdate(); } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2019-17091 - Severity: MEDIUM - CVSS Score: 4.3 Description: Fixes #4556 : HIGH-LEVEL VULNERABILITY WITHIN MOJARRA JSF V2.2 Function: renderState File: impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java Repository: eclipse-ee4j/mojarra Fixed Code: private void renderState(FacesContext context) throws IOException { // Get the view state and write it to the response.. PartialViewContext pvc = context.getPartialViewContext(); PartialResponseWriter writer = pvc.getPartialResponseWriter(); String viewStateId = Util.getViewStateId(context); writer.startUpdate(viewStateId); String state = context.getApplication().getStateManager().getViewState(context); writer.write(state); writer.endUpdate(); ClientWindow window = context.getExternalContext().getClientWindow(); if (null != window) { String clientWindowId = Util.getClientWindowId(context); writer.startUpdate(clientWindowId); writer.writeText(window.getId(), null); writer.endUpdate(); } }
[ "CWE-79" ]
CVE-2019-17091
MEDIUM
4.3
eclipse-ee4j/mojarra
renderState
impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
a3fa9573789ed5e867c43ea38374f4dbd5a8f81f
1
Analyze the following code function for security vulnerabilities
final void rebuildAppWindowListLocked() { rebuildAppWindowListLocked(getDefaultDisplayContentLocked()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rebuildAppWindowListLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
rebuildAppWindowListLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private Map<String, String> cleanAttributes(String elementName, Map<String, String> attributes) { Map<String, String> cleanAttributes; if (this.htmlElementSanitizer == null || attributes == null) { cleanAttributes = attributes; } else { cleanAttributes = new LinkedHashMap<>(); for (Map.Entry<String, String> e : attributes.entrySet()) { if (this.htmlElementSanitizer.isAttributeAllowed(elementName, e.getKey(), e.getValue())) { cleanAttributes.put(e.getKey(), e.getValue()); } else { cleanAttributes.put(TRANSLATED_ATTRIBUTE_PREFIX + e.getKey(), e.getValue()); } } } return cleanAttributes; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-37908 - Severity: CRITICAL - CVSS Score: 9.6 Description: XRENDERING-697: XHTMLWikiPrinter doesn't validate generated data attributes * Strip invalid characters and make sure the data attribute is allowed. * Add tests. Function: cleanAttributes File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java Repository: xwiki/xwiki-rendering Fixed Code: private Map<String, String> cleanAttributes(String elementName, Map<String, String> attributes) { Map<String, String> cleanAttributes; if (this.htmlElementSanitizer == null || attributes == null) { cleanAttributes = attributes; } else { cleanAttributes = new LinkedHashMap<>(); for (Map.Entry<String, String> e : attributes.entrySet()) { if (this.htmlElementSanitizer.isAttributeAllowed(elementName, e.getKey(), e.getValue())) { cleanAttributes.put(e.getKey(), e.getValue()); } else { // Keep but clean invalid attributes with a prefix (removed during parsing) to avoid loosing them // through WYSIWYG editing. String translatedName = TRANSLATED_ATTRIBUTE_PREFIX + removeInvalidDataAttributeCharacters(e.getKey()); if (this.htmlElementSanitizer.isAttributeAllowed(elementName, translatedName, e.getValue())) { cleanAttributes.put(translatedName, e.getValue()); } } } } return cleanAttributes; }
[ "CWE-79" ]
CVE-2023-37908
CRITICAL
9.6
xwiki/xwiki-rendering
cleanAttributes
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
f4d5acac451dccaf276e69f0b49b72221eef5d2f
1
Analyze the following code function for security vulnerabilities
private static ClientAuthenticationMethod getPreferredAuthenticationMethod(OidcConfiguration config) { final ClientAuthenticationMethod configurationMethod = config.getClientAuthenticationMethod(); if (configurationMethod == null) { return null; } if (!SUPPORTED_METHODS.contains(configurationMethod)) { throw new TechnicalException("Configured authentication method (" + configurationMethod + ") is not supported."); } return configurationMethod; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPreferredAuthenticationMethod File: datahub-frontend/app/auth/sso/oidc/custom/CustomOidcAuthenticator.java Repository: datahub-project/datahub The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-25558
HIGH
8.8
datahub-project/datahub
getPreferredAuthenticationMethod
datahub-frontend/app/auth/sso/oidc/custom/CustomOidcAuthenticator.java
2a182f484677d056730d6b4e9f0143e67368359f
0
Analyze the following code function for security vulnerabilities
@Override public boolean isAsyncEditMode() { return asyncEditMode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAsyncEditMode 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
isAsyncEditMode
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public boolean getStrictErrorChecking() { return doc.getStrictErrorChecking(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStrictErrorChecking File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
getStrictErrorChecking
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Override public BigInteger bigIntegerValue() { BigDecimal bd = bigDecimalValue(); if (Math.abs(bd.scale()) <= bigIntegerScaleLimit) { return bd.toBigInteger(); } throw new UnsupportedOperationException( String.format(SCALE_LIMIT_EXCEPTION_MESSAGE, bd.scale(), bigIntegerScaleLimit)); }
Vulnerability Classification: - CWE: CWE-834 - CVE: CVE-2023-4043 - Severity: HIGH - CVSS Score: 7.5 Description: Exception message moved to messages bundle. Signed-off-by: Tomáš Kraus <tomas.kraus@oracle.com> Function: bigIntegerValue File: impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java Repository: eclipse-ee4j/parsson Fixed Code: @Override public BigInteger bigIntegerValue() { BigDecimal bd = bigDecimalValue(); if (Math.abs(bd.scale()) <= bigIntegerScaleLimit) { return bd.toBigInteger(); } throw new UnsupportedOperationException( JsonMessages.NUMBER_SCALE_LIMIT_EXCEPTION(bd.scale(), bigIntegerScaleLimit)); }
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
bigIntegerValue
impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
84764ffbe3d0376da242b27a9a526138d0dfb8e6
1
Analyze the following code function for security vulnerabilities
boolean isSerializable() { resolveProperties(); return isSerializable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSerializable File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
isSerializable
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public Node cloneNode(boolean deep) { return doc.cloneNode(deep); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cloneNode File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
cloneNode
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Override public void onPackageAdded(String name, boolean replacing) { synchronized (mGlobalLock) { mCompatModePackages.handlePackageAddedLocked(name, replacing); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPackageAdded 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
onPackageAdded
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Test public void gexpBadExpression() throws Exception { final DataPoints[] datapoints = new DataPoints[1]; datapoints[0] = new MockDataPoints().getMock(); when(query_result.runAsync()).thenReturn( Deferred.fromResult(datapoints)); final HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query/gexp?start=1h-ago&exp=scale(sum:sys.cpu.user,notanumber)"); rpc.execute(tsdb, query); assertEquals(query.response().getStatus(), HttpResponseStatus.BAD_REQUEST); final String json = query.response().getContent().toString(Charset.forName("UTF-8")); assertTrue(json.contains("factor")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gexpBadExpression File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
gexpBadExpression
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
public List<WifiConfiguration> getConfiguredNetworks() { return getConfiguredNetworks(false, true, Process.WIFI_UID); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguredNetworks File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
getConfiguredNetworks
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void recacheSecretTokenWhenOnRegisterPage() { try { WebElement tokenInput = getDriver().findElement(By.xpath("//input[@name='form_token']")); this.secretToken = tokenInput.getAttribute("value"); } catch (NoSuchElementException exception) { // Something is really wrong if this happens. System.out.println("Warning: Failed to cache anti-CSRF secret token, some tests might fail!"); exception.printStackTrace(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: recacheSecretTokenWhenOnRegisterPage File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
recacheSecretTokenWhenOnRegisterPage
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public boolean onJobRenamed(String oldName, String newName) { // quick test if(!childProjects.contains(oldName)) return false; boolean changed = false; // we need to do this per string, since old Project object is already gone. String[] projects = childProjects.split(","); for( int i=0; i<projects.length; i++ ) { if(projects[i].trim().equals(oldName)) { projects[i] = newName; changed = true; } } if(changed) { StringBuilder b = new StringBuilder(); for (String p : projects) { if(b.length()>0) b.append(','); b.append(p); } childProjects = b.toString(); } return changed; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onJobRenamed File: core/src/main/java/hudson/tasks/BuildTrigger.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
onJobRenamed
core/src/main/java/hudson/tasks/BuildTrigger.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public void execute(final TSDB tsdb, final HttpQuery query) { if (!query.hasQueryStringParam("json") && !query.hasQueryStringParam("png") && !query.hasQueryStringParam("ascii")) { String uri = query.request().getUri(); if (uri.length() < 4) { // Shouldn't happen... uri = "/"; // But just in case, redirect. } else { uri = "/#" + uri.substring(3); // Remove "/q?" } query.redirect(uri); return; } try { doGraph(tsdb, query); } catch (IOException e) { query.internalError(e); } catch (IllegalArgumentException e) { query.badRequest(e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execute File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
execute
src/tsd/GraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
protected abstract byte getDigitPos(int position);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDigitPos File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
getDigitPos
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
void openStream() throws SmackException, InterruptedException { // If possible, provide the receiving entity of the stream open tag, i.e. the server, as much information as // possible. The 'to' attribute is *always* available. The 'from' attribute if set by the user and no external // mechanism is used to determine the local entity (user). And the 'id' attribute is available after the first // response from the server (see e.g. RFC 6120 § 9.1.1 Step 2.) CharSequence to = getXMPPServiceDomain(); CharSequence from = null; CharSequence localpart = config.getUsername(); if (localpart != null) { from = XmppStringUtils.completeJidFrom(localpart, to); } String id = getStreamId(); sendNonza(new StreamOpen(to, from, id)); try { packetReader.parser = PacketParserUtils.newXmppParser(reader); } catch (XmlPullParserException e) { throw new SmackException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openStream File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
openStream
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public boolean readBool() throws TException { if (boolValue_ != null) { boolean result = boolValue_.booleanValue(); boolValue_ = null; return result; } return readByte() == Types.BOOLEAN_TRUE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readBool File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
readBool
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
@Override public void createApplicationTemplateFromSP(ServiceProvider serviceProvider, SpTemplate spTemplate, String tenantDomain) throws IdentityApplicationManagementException { if (serviceProvider != null) { try { validateSPTemplateExists(spTemplate, tenantDomain); ServiceProvider updatedSP = removeUnsupportedTemplateConfigs(serviceProvider); applicationValidatorManager.validateSPConfigurations(updatedSP, tenantDomain, CarbonContext.getThreadLocalCarbonContext().getUsername()); Collection<ApplicationMgtListener> listeners = getApplicationMgtListeners(); for (ApplicationMgtListener listener : listeners) { if (listener.isEnable()) { listener.doPreCreateApplicationTemplate(serviceProvider, tenantDomain); } } String serviceProviderTemplateXml = marshalSPTemplate(updatedSP, tenantDomain); spTemplate.setContent(serviceProviderTemplateXml); doAddApplicationTemplate(spTemplate, tenantDomain); } catch (IdentityApplicationManagementValidationException e) { log.error("Validation error when creating the application template:" + spTemplate.getName() + "from service provider: " + serviceProvider.getApplicationName() + " in:" + tenantDomain); logValidationErrorMessages(e); throw new IdentityApplicationManagementClientException(e.getValidationMsg()); } catch (IdentityApplicationManagementException e) { String errorMsg = String.format("Error when creating the application template: %s from " + "service provider: %s in: ", spTemplate.getName(), serviceProvider.getApplicationName(), tenantDomain); throw new IdentityApplicationManagementException(errorMsg, e); } } else { createApplicationTemplate(spTemplate, tenantDomain); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createApplicationTemplateFromSP File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
createApplicationTemplateFromSP
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
private static HashMap extractPropertiesFromLevel(Element elem) { // System.err.println( "extractPropertiesFromLevel()" ); HashMap out = new HashMap(); try { NodeList nl = DomParseUtils.immediateChildElementsByTagName(elem, "property"); int len = nl.getLength(); for (int i = 0; i < len; ++i) { Element propertyElem = (Element) nl.item(i); String propName = propertyElem.getAttribute("name"); if (propName != null && propName.length() > 0) { String propVal = DomParseUtils.allTextFromElement(propertyElem, true); out.put( propName, propVal ); //System.err.println( propName + " -> " + propVal ); } else logger.warning("Configuration XML contained property element without name attribute: " + LINESEP + propertyElem); } } catch (Exception e) { logger.log( MLevel.WARNING, "An exception occurred while reading config XML. " + "Some configuration information has probably been ignored.", e ); } return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractPropertiesFromLevel File: src/java/com/mchange/v2/c3p0/cfg/C3P0ConfigXmlUtils.java Repository: zhutougg/c3p0 The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20433
HIGH
7.5
zhutougg/c3p0
extractPropertiesFromLevel
src/java/com/mchange/v2/c3p0/cfg/C3P0ConfigXmlUtils.java
2eb0ea97f745740b18dd45e4a909112d4685f87b
0
Analyze the following code function for security vulnerabilities
public static List<Descriptor<Builder>> getBuilderDescriptors(AbstractProject<?,?> project) { return BuildStepDescriptor.filter(Builder.all(), project.getClass()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBuilderDescriptors File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
getBuilderDescriptors
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public String getDoc() { return doc != null ? doc : ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDoc File: varexport/src/main/java/com/indeed/util/varexport/Variable.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
getDoc
varexport/src/main/java/com/indeed/util/varexport/Variable.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
protected abstract void doUpdate() throws IOException, FileNotFoundException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doUpdate File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
doUpdate
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
@Override public String unzip(String sourcedir, String zipfilename) throws IOException { File zipfile = new File(sourcedir + File.separator + zipfilename); return unzip(zipfile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unzip File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
unzip
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
@Override public void paintComponentBackground(Object graphics, int x, int y, int width, int height, Style s) { if((!asyncView) || compatPaintMode ) { super.paintComponentBackground(graphics, x, y, width, height, s); return; } ((AndroidGraphics) graphics).paintComponentBackground(x, y, width, height, s); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: paintComponentBackground 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
paintComponentBackground
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void updateToggleActions(int selectedAction, boolean userTriggered) { if (userTriggered) { TransitionSet transition = new TransitionSet(); transition.setOrdering(TransitionSet.ORDERING_TOGETHER); transition.addTransition(new Fade(Fade.OUT)) .addTransition(new ChangeBounds()) .addTransition( new Fade(Fade.IN) .setStartDelay(150) .setDuration(200) .setInterpolator(FAST_OUT_SLOW_IN)); transition.setDuration(350); transition.setInterpolator(FAST_OUT_SLOW_IN); TransitionManager.beginDelayedTransition(this, transition); } View priority = findViewById(R.id.priority); View defaultBehavior = findViewById(R.id.default_behavior); View silence = findViewById(R.id.silence); switch (selectedAction) { case ACTION_FAVORITE: mPriorityDescriptionView.setVisibility(VISIBLE); mDefaultDescriptionView.setVisibility(GONE); mSilentDescriptionView.setVisibility(GONE); post(() -> { priority.setSelected(true); defaultBehavior.setSelected(false); silence.setSelected(false); }); break; case ACTION_MUTE: mSilentDescriptionView.setVisibility(VISIBLE); mDefaultDescriptionView.setVisibility(GONE); mPriorityDescriptionView.setVisibility(GONE); post(() -> { priority.setSelected(false); defaultBehavior.setSelected(false); silence.setSelected(true); }); break; case ACTION_DEFAULT: mDefaultDescriptionView.setVisibility(VISIBLE); mSilentDescriptionView.setVisibility(GONE); mPriorityDescriptionView.setVisibility(GONE); post(() -> { priority.setSelected(false); defaultBehavior.setSelected(true); silence.setSelected(false); }); break; default: throw new IllegalArgumentException("Unrecognized behavior: " + mSelectedAction); } boolean isAChange = getPriority() != selectedAction; TextView done = findViewById(R.id.done); done.setText(isAChange ? R.string.inline_ok_button : R.string.inline_done_button); // update icon in case importance has changed bindIcon(selectedAction == ACTION_FAVORITE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateToggleActions File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
updateToggleActions
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
private void revisitNodeNames(Definitions def) { List<RootElement> rootElements = def.getRootElements(); for(RootElement root : rootElements) { if(root instanceof Process) { Process process = (Process) root; List<FlowElement> flowElements = process.getFlowElements(); for(FlowElement fe : flowElements) { if(fe.getName() != null && fe.getId().equals(fe.getName())) { // change the name so they are not the same fe.setName("_" + fe.getName()); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revisitNodeNames File: jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/TransformerServlet.java Repository: kiegroup/jbpm-designer The code follows secure coding practices.
[ "CWE-611" ]
CVE-2017-7545
MEDIUM
4
kiegroup/jbpm-designer
revisitNodeNames
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/TransformerServlet.java
a143f3b92a6a5a527d929d68c02a0c5d914ab81d
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Void> internalRemovePersistence() { return getTopicPoliciesAsyncWithRetry(topicName) .thenCompose(op -> { if (!op.isPresent()) { return CompletableFuture.completedFuture(null); } op.get().setPersistence(null); return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, op.get()); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalRemovePersistence File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalRemovePersistence
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public Execable<String, ExecWatch> usingListener(ExecListener execListener) { return new PodOperationsImpl(getContext().withExecListener(execListener)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: usingListener File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
usingListener
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
@Override public void sendStanzaWithResponseCallback(Stanza stanza, final StanzaFilter replyFilter, final StanzaListener callback, final ExceptionCallback exceptionCallback, long timeout) throws NotConnectedException, InterruptedException { Objects.requireNonNull(stanza, "stanza must not be null"); // While Smack allows to add PacketListeners with a PacketFilter value of 'null', we // disallow it here in the async API as it makes no sense Objects.requireNonNull(replyFilter, "replyFilter must not be null"); Objects.requireNonNull(callback, "callback must not be null"); final StanzaListener packetListener = new StanzaListener() { @Override public void processPacket(Stanza packet) throws NotConnectedException, InterruptedException { try { XMPPErrorException.ifHasErrorThenThrow(packet); callback.processPacket(packet); } catch (XMPPErrorException e) { if (exceptionCallback != null) { exceptionCallback.processException(e); } } finally { removeAsyncStanzaListener(this); } } }; removeCallbacksService.schedule(new Runnable() { @Override public void run() { boolean removed = removeAsyncStanzaListener(packetListener); // If the packetListener got removed, then it was never run and // we never received a response, inform the exception callback if (removed && exceptionCallback != null) { Exception exception; if (!isConnected()) { // If the connection is no longer connected, throw a not connected exception. exception = new NotConnectedException(AbstractXMPPConnection.this, replyFilter); } else { exception = NoResponseException.newWith(AbstractXMPPConnection.this, replyFilter); } exceptionCallback.processException(exception); } } }, timeout, TimeUnit.MILLISECONDS); addAsyncStanzaListener(packetListener, replyFilter); sendStanza(stanza); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendStanzaWithResponseCallback File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
sendStanzaWithResponseCallback
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public boolean isWaitingForPermissionResult() { return waitingForPermissionResult; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isWaitingForPermissionResult File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
isWaitingForPermissionResult
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public String getAppHomePath() { return addFile(getContext().getFilesDir().getAbsolutePath() + "/"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppHomePath 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
getAppHomePath
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public List<Delta> getContentDiff(String fromRev, String toRev, XWikiContext context) throws XWikiException, DifferentiationFailedException { XWikiDocument fromDoc = context.getWiki().getDocument(this, fromRev, context); XWikiDocument toDoc = context.getWiki().getDocument(this, toRev, context); if (fromDoc == null) { throw new XWikiException(XWikiException.MODULE_XWIKI_DIFF, XWikiException.ERROR_XWIKI_DIFF_CONTENT_ERROR, String.format("The revision [%s] cannot be found in [%s] for making diff.", fromRev, this.getDocumentReference())); } if (toRev == null) { throw new XWikiException(XWikiException.MODULE_XWIKI_DIFF, XWikiException.ERROR_XWIKI_DIFF_CONTENT_ERROR, String.format("The revision [%s] cannot be found in [%s] for making diff.", toRev, this.getDocumentReference())); } return getContentDiff(fromDoc, toDoc, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentDiff 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
getContentDiff
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
@Override public final int startActivityFromRecents(int taskId, Bundle bOptions) { enforceCallerIsRecentsOrHasPermission(START_TASKS_FROM_RECENTS, "startActivityFromRecents()"); final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); final SafeActivityOptions safeOptions = SafeActivityOptions.fromBundle(bOptions); final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { return mStackSupervisor.startActivityFromRecents(callingPid, callingUid, taskId, safeOptions); } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityFromRecents 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
startActivityFromRecents
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void parseTerritories(final List<Element> territories) { final GameMap map = data.getMap(); for (final Element current : territories) { final boolean water = current.getAttribute("water").trim().equalsIgnoreCase("true"); final String name = current.getAttribute("name"); final Territory newTerritory = new Territory(name, water, data); map.addTerritory(newTerritory); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseTerritories File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseTerritories
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
public void updateNString(String columnName, @Nullable String nString) throws SQLException { updateNString(findColumn(columnName), nString); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNString 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
updateNString
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasNext() { return nextNode_ != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasNext File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
hasNext
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
protected Object[] mapArrayToArray(JsonParser p, DeserializationContext ctxt) throws IOException { ObjectBuffer buffer = ctxt.leaseObjectBuffer(); Object[] values = buffer.resetAndStart(); int ptr = 0; do { Object value = deserialize(p, ctxt); if (ptr >= values.length) { values = buffer.appendCompletedChunk(values); ptr = 0; } values[ptr++] = value; } while (p.nextToken() != JsonToken.END_ARRAY); Object[] result = buffer.completeAndClearBuffer(values, ptr); ctxt.returnObjectBuffer(buffer); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mapArrayToArray File: src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-787" ]
CVE-2020-36518
MEDIUM
5
FasterXML/jackson-databind
mapArrayToArray
src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java
8238ab41d0350fb915797c89d46777b4496b74fd
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unused") @CalledByNative private void onSelectionChanged(String text) { mLastSelectedText = text; if (mContextualSearchClient != null) { mContextualSearchClient.onSelectionChanged(text); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSelectionChanged File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
onSelectionChanged
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
private String getCompressAndParseHtml(String inputBody) throws IOException { String currentBody = inputBody; //不显示none标签 if (currentBody.endsWith(endFlag)) { currentBody = currentBody.substring(0, currentBody.length() - endFlag.length()); } HtmlCleaner htmlCleaner = new HtmlCleaner(); htmlCleaner.getProperties().setCharset(charset); htmlCleaner.getProperties().setUseCdataForScriptAndStyle(false); TagNode tagNode = htmlCleaner.clean(currentBody); TagNode[] tagNodes = tagNode.getAllElements(true); Map<String, String> plugin = new HashMap<>(); for (TagNode tag : tagNodes) { if (tag != null) { String tagName = tag.getName(); addStaticResourceFlag(tag, tagName); parseCustomHtmlTag(htmlCleaner, plugin, tag, tagName); } } SimpleHtmlSerializer serializer = new SimpleHtmlSerializer(htmlCleaner.getProperties()); StringWriter stringWriter = new StringWriter(); tagNode.serialize(serializer, stringWriter); currentBody = stringWriter.toString(); if (tagNode.getDocType() != null) { currentBody = tagNode.getDocType() + currentBody; } for (Map.Entry<String, String> entry : plugin.entrySet()) { currentBody = currentBody.replace(entry.getKey(), entry.getValue()); } currentBody = currentBody + "<!--" + (System.currentTimeMillis() - startTime) + "ms-->"; return currentBody; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCompressAndParseHtml File: web/src/main/java/com/zrlog/web/handler/ResponseRenderPrintWriter.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
getCompressAndParseHtml
web/src/main/java/com/zrlog/web/handler/ResponseRenderPrintWriter.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
public JSONObject getJSONObject(String key) throws JSONException { Object object = this.get(key); if (object instanceof JSONObject) { return (JSONObject) object; } throw wrongValueFormatException(key, "JSONObject", object, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJSONObject File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
getJSONObject
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public void onVoiceAssistHintStarted() { mFalsingManager.onLeftAffordanceHintStarted(); mKeyguardIndicationController.showTransientIndication(R.string.voice_hint); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onVoiceAssistHintStarted 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
onVoiceAssistHintStarted
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
RecentTasks getRecentTasks() { return mRecentTasks; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRecentTasks 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
getRecentTasks
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting void launchSettingFragment(String initialFragmentName, boolean isSubSettings, Intent intent) { if (!mIsShowingDashboard && initialFragmentName != null) { setTitleFromIntent(intent); Bundle initialArguments = intent.getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS); switchToFragment(initialFragmentName, initialArguments, true, false, mInitialTitleResId, mInitialTitle, false); } else { // Show search icon as up affordance if we are displaying the main Dashboard mInitialTitleResId = R.string.dashboard_title; switchToFragment(DashboardSummary.class.getName(), null /* args */, false, false, mInitialTitleResId, mInitialTitle, false); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: launchSettingFragment File: src/com/android/settings/SettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
launchSettingFragment
src/com/android/settings/SettingsActivity.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
private static String getLinkPropertiesSummary(LinkProperties lp) { List<String> attributes = new ArrayList<>(6); if (lp.hasIpv4Address()) { attributes.add("v4"); } if (lp.hasIpv4DefaultRoute()) { attributes.add("v4r"); } if (lp.hasIpv4DnsServer()) { attributes.add("v4dns"); } if (lp.hasGlobalIpv6Address()) { attributes.add("v6"); } if (lp.hasIpv6DefaultRoute()) { attributes.add("v6r"); } if (lp.hasIpv6DnsServer()) { attributes.add("v6dns"); } return TextUtils.join(" ", attributes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLinkPropertiesSummary File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
getLinkPropertiesSummary
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public Object decode(ByteBuf buf, State state) throws IOException { try { //set thread context class loader to be the classLoader variable as there could be reflection //done while reading from input stream which reflection will use thread class loader to load classes on demand ClassLoader currentThreadClassLoader = Thread.currentThread().getContextClassLoader(); try { ByteBufInputStream in = new ByteBufInputStream(buf); ObjectInputStream inputStream; if (classLoader != null) { Thread.currentThread().setContextClassLoader(classLoader); inputStream = new CustomObjectInputStream(classLoader, in); } else { inputStream = new ObjectInputStream(in); } return inputStream.readObject(); } finally { Thread.currentThread().setContextClassLoader(currentThreadClassLoader); } } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e); } }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2023-42809 - Severity: HIGH - CVSS Score: 8.8 Description: Feature - allowedClasses setting added to SerializationCodec https://github.com/redisson/redisson/security/code-scanning/4 Function: decode File: redisson/src/main/java/org/redisson/codec/SerializationCodec.java Repository: redisson Fixed Code: @Override public Object decode(ByteBuf buf, State state) throws IOException { try { //set thread context class loader to be the classLoader variable as there could be reflection //done while reading from input stream which reflection will use thread class loader to load classes on demand ClassLoader currentThreadClassLoader = Thread.currentThread().getContextClassLoader(); try { ByteBufInputStream in = new ByteBufInputStream(buf); ObjectInputStream inputStream; if (classLoader != null) { Thread.currentThread().setContextClassLoader(classLoader); inputStream = new CustomObjectInputStream(classLoader, in, allowedClasses); } else { inputStream = new ObjectInputStream(in); } return inputStream.readObject(); } finally { Thread.currentThread().setContextClassLoader(currentThreadClassLoader); } } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e); } }
[ "CWE-502" ]
CVE-2023-42809
HIGH
8.8
redisson
decode
redisson/src/main/java/org/redisson/codec/SerializationCodec.java
fe6a2571801656ff1599ef87bdee20f519a5d1fe
1
Analyze the following code function for security vulnerabilities
@Override public void onDisplayRemoved(int displayId) { if (DEBUG_STACK) Slog.v(TAG, "Display removed displayId=" + displayId); mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_REMOVED, displayId, 0)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDisplayRemoved File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
onDisplayRemoved
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
ContentProviderConnection incProviderCountLocked(ProcessRecord r, final ContentProviderRecord cpr, IBinder externalProcessToken, boolean stable) { if (r != null) { for (int i=0; i<r.conProviders.size(); i++) { ContentProviderConnection conn = r.conProviders.get(i); if (conn.provider == cpr) { if (DEBUG_PROVIDER) Slog.v(TAG, "Adding provider requested by " + r.processName + " from process " + cpr.info.processName + ": " + cpr.name.flattenToShortString() + " scnt=" + conn.stableCount + " uscnt=" + conn.unstableCount); if (stable) { conn.stableCount++; conn.numStableIncs++; } else { conn.unstableCount++; conn.numUnstableIncs++; } return conn; } } ContentProviderConnection conn = new ContentProviderConnection(cpr, r); if (stable) { conn.stableCount = 1; conn.numStableIncs = 1; } else { conn.unstableCount = 1; conn.numUnstableIncs = 1; } cpr.connections.add(conn); r.conProviders.add(conn); startAssociationLocked(r.uid, r.processName, cpr.uid, cpr.name, cpr.info.processName); return conn; } cpr.addExternalProcessHandleLocked(externalProcessToken); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incProviderCountLocked 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
incProviderCountLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private int updateSystemUiVisibilityLw() { // If there is no window focused, there will be nobody to handle the events // anyway, so just hang on in whatever state we're in until things settle down. final WindowState win = mFocusedWindow != null ? mFocusedWindow : mTopFullscreenOpaqueWindowState; if (win == null) { return 0; } if ((win.getAttrs().privateFlags & PRIVATE_FLAG_KEYGUARD) != 0 && mHideLockScreen == true) { // We are updating at a point where the keyguard has gotten // focus, but we were last in a state where the top window is // hiding it. This is probably because the keyguard as been // shown while the top window was displayed, so we want to ignore // it here because this is just a very transient change and it // will quickly lose focus once it correctly gets hidden. return 0; } int tmpVisibility = PolicyControl.getSystemUiVisibility(win, null) & ~mResettingSystemUiFlags & ~mForceClearedSystemUiFlags; if (mForcingShowNavBar && win.getSurfaceLayer() < mForcingShowNavBarLayer) { tmpVisibility &= ~PolicyControl.adjustClearableFlags(win, View.SYSTEM_UI_CLEARABLE_FLAGS); } final int visibility = updateSystemBarsLw(win, mLastSystemUiFlags, tmpVisibility); final int diff = visibility ^ mLastSystemUiFlags; final boolean needsMenu = win.getNeedsMenuLw(mTopFullscreenOpaqueWindowState); if (diff == 0 && mLastFocusNeedsMenu == needsMenu && mFocusedApp == win.getAppToken()) { return 0; } mLastSystemUiFlags = visibility; mLastFocusNeedsMenu = needsMenu; mFocusedApp = win.getAppToken(); mHandler.post(new Runnable() { @Override public void run() { try { IStatusBarService statusbar = getStatusBarService(); if (statusbar != null) { statusbar.setSystemUiVisibility(visibility, 0xffffffff, win.toString()); statusbar.topAppWindowChanged(needsMenu); } } catch (RemoteException e) { // re-acquire status bar service next time it is needed. mStatusBarService = null; } } }); return diff; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSystemUiVisibilityLw 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
updateSystemUiVisibilityLw
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@POST @ApiOperation(value = "Create a new session", notes = "This request creates a new session for a user or reactivates an existing session: the equivalent of logging in.", response = SessionResponse.class) @NoAuditEvent("dispatches audit events in the method body") public Response newSession(@Context ContainerRequestContext requestContext, @ApiParam(name = "Login request", value = "Credentials. The default " + "implementation requires presence of two properties: 'username' and " + "'password'. However a plugin may customize which kind of credentials " + "are accepted and therefore expect different properties.", required = true) @NotNull JsonNode createRequest) { rejectServiceAccount(createRequest); final SecurityContext securityContext = requestContext.getSecurityContext(); if (!(securityContext instanceof ShiroSecurityContext)) { throw new InternalServerErrorException("Unsupported SecurityContext class, this is a bug!"); } final ShiroSecurityContext shiroSecurityContext = (ShiroSecurityContext) securityContext; final ActorAwareAuthenticationToken authToken; try { authToken = tokenFactory.forRequestBody(createRequest); } catch (IllegalArgumentException e) { throw new BadRequestException(e.getMessage()); } // we treat the BASIC auth username as the sessionid final String sessionId = shiroSecurityContext.getUsername(); final String host = RestTools.getRemoteAddrFromRequest(grizzlyRequest, trustedSubnets); try { Optional<Session> session = sessionCreator.login(sessionId, host, authToken); if (session.isPresent()) { final SessionResponse token = sessionResponseFactory.forSession(session.get()); return Response.ok() .entity(token) .cookie(cookieFactory.createAuthenticationCookie(token, requestContext)) .build(); } else { throw new NotAuthorizedException("Invalid credentials.", "Basic realm=\"Graylog Server session\""); } } catch (AuthenticationServiceUnavailableException e) { throw new ServiceUnavailableException("Authentication service unavailable"); } }
Vulnerability Classification: - CWE: CWE-384 - CVE: CVE-2024-24823 - Severity: MEDIUM - CVSS Score: 4.4 Description: Merge pull request from GHSA-3xf8-g8gr-g7rh Always create a brand-new session for an authentication attempt by ignoring any previous session ID. This avoids a potential session fixation attack. Refs https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-3xf8-g8gr-g7rh Function: newSession File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java Repository: Graylog2/graylog2-server Fixed Code: @POST @ApiOperation(value = "Create a new session", notes = "This request creates a new session for a user or reactivates an existing session: the equivalent of logging in.", response = SessionResponse.class) @NoAuditEvent("dispatches audit events in the method body") public Response newSession(@Context ContainerRequestContext requestContext, @ApiParam(name = "Login request", value = "Credentials. The default " + "implementation requires presence of two properties: 'username' and " + "'password'. However a plugin may customize which kind of credentials " + "are accepted and therefore expect different properties.", required = true) @NotNull JsonNode createRequest) { rejectServiceAccount(createRequest); final ActorAwareAuthenticationToken authToken; try { authToken = tokenFactory.forRequestBody(createRequest); } catch (IllegalArgumentException e) { throw new BadRequestException(e.getMessage()); } final String host = RestTools.getRemoteAddrFromRequest(grizzlyRequest, trustedSubnets); try { // Always create a brand-new session for an authentication attempt by ignoring any previous session ID. // This avoids a potential session fixation attack. (GHSA-3xf8-g8gr-g7rh) Optional<Session> session = sessionCreator.login(null, host, authToken); if (session.isPresent()) { final SessionResponse token = sessionResponseFactory.forSession(session.get()); return Response.ok() .entity(token) .cookie(cookieFactory.createAuthenticationCookie(token, requestContext)) .build(); } else { throw new NotAuthorizedException("Invalid credentials.", "Basic realm=\"Graylog Server session\""); } } catch (AuthenticationServiceUnavailableException e) { throw new ServiceUnavailableException("Authentication service unavailable"); } }
[ "CWE-384" ]
CVE-2024-24823
MEDIUM
4.4
Graylog2/graylog2-server
newSession
graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java
1596b749db86368ba476662f23a0f0c5ec2b5097
1