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
@SuppressWarnings("unchecked") private static <E extends Throwable> void throwException0(Throwable t) throws E { throw (E) t; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: throwException0 File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
throwException0
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
public static boolean hasIpChanged(WifiConfiguration existingConfig, WifiConfiguration newConfig) { if (existingConfig.getIpAssignment() != newConfig.getIpAssignment()) { return true; } if (newConfig.getIpAssignment() == IpConfiguration.IpAssignment.STATIC) { return !Objects.equals(existingConfig.getStaticIpConfiguration(), newConfig.getStaticIpConfiguration()); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasIpChanged File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
hasIpChanged
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
0
Analyze the following code function for security vulnerabilities
public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentProviderExternal File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getContentProviderExternal
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public FilePath getModuleRoot() { AbstractBuild b = getBuildForDeprecatedMethods(); return b != null ? b.getModuleRoot() : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getModuleRoot File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getModuleRoot
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public void clearArgs() { arguments.removeAllElements(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearArgs File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
clearArgs
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
private void handleFingerprintAuthFailed() { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onFingerprintAuthFailed(); } } handleFingerprintHelp(-1, mContext.getString(R.string.fingerprint_not_recognized)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleFingerprintAuthFailed 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
handleFingerprintAuthFailed
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public boolean containsHeader(String name) { for (int n = 0; n < this.headers.size(); n++) if (((String) this.headers.get(n)).startsWith(name)) return true; return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsHeader File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
containsHeader
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
private PostgresClient createTable(TestContext context, String tenant, String table, String tableDefinition) { String schema = PostgresClient.convertToPsqlStandard(tenant); execute(context, "CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public;"); execute(context, "CREATE OR REPLACE FUNCTION f_unaccent(text) RETURNS text AS " + "$$ SELECT public.unaccent('public.unaccent', $1) $$ LANGUAGE sql IMMUTABLE;"); execute(context, "DROP SCHEMA IF EXISTS " + schema + " CASCADE;"); executeIgnore(context, "CREATE ROLE " + schema + " PASSWORD '" + tenant + "' NOSUPERUSER NOCREATEDB INHERIT LOGIN;"); execute(context, "CREATE SCHEMA " + schema + " AUTHORIZATION " + schema); execute(context, "GRANT ALL PRIVILEGES ON SCHEMA " + schema + " TO " + schema); execute(context, "CREATE TABLE " + schema + "." + table + " (" + tableDefinition + ");"); execute(context, "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA " + schema + " TO " + schema); return postgresClient(tenant); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createTable 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
createTable
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public void setUserRestriction( ComponentName who, String callerPackage, String key, boolean enabledFromThisOwner, boolean parent) { CallerIdentity caller; if (isPolicyEngineForFinanceFlagEnabled()) { caller = getCallerIdentity(who, callerPackage); } else { caller = getCallerIdentity(who); } int userId = caller.getUserId(); int affectedUserId = parent ? getProfileParentId(userId) : userId; checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_USER_RESTRICTION); if (isPolicyEngineForFinanceFlagEnabled()) { if (!isDeviceOwner(caller) && !isProfileOwner(caller)) { EnforcingAdmin admin = enforcePermissionForUserRestriction( who, key, caller.getPackageName(), affectedUserId); if (!mInjector.isChangeEnabled(ENABLE_COEXISTENCE_CHANGE, callerPackage, userId)) { throw new IllegalStateException("Calling package is not targeting Android U."); } if (!UserRestrictionsUtils.isValidRestriction(key)) { throw new IllegalArgumentException("Invalid restriction key: " + key); } PolicyDefinition<Boolean> policyDefinition = PolicyDefinition.getPolicyDefinitionForUserRestriction(key); if (enabledFromThisOwner) { setLocalUserRestrictionInternal( admin, key, /* enabled= */ true, affectedUserId); } else { // Remove any local and global policy that was set by the admin if (!policyDefinition.isLocalOnlyPolicy()) { setGlobalUserRestrictionInternal(admin, key, /* enabled= */ false); } if (!policyDefinition.isGlobalOnlyPolicy()) { setLocalUserRestrictionInternal(admin, key, /* enabled= */ false, userId); int parentUserId = getProfileParentId(userId); if (parentUserId != userId) { setLocalUserRestrictionInternal( admin, key, /* enabled= */ false, parentUserId); } } } } else { if (!UserRestrictionsUtils.isValidRestriction(key)) { return; } Objects.requireNonNull(who, "ComponentName is null"); EnforcingAdmin admin = getEnforcingAdminForCaller(who, callerPackage); checkAdminCanSetRestriction(caller, parent, key); setBackwardCompatibleUserRestriction( caller, admin, key, enabledFromThisOwner, parent); } } else { if (!UserRestrictionsUtils.isValidRestriction(key)) { return; } Objects.requireNonNull(who, "ComponentName is null"); checkAdminCanSetRestriction(caller, parent, key); synchronized (getLockObject()) { final ActiveAdmin activeAdmin = getParentOfAdminIfRequired( getProfileOwnerOrDeviceOwnerLocked(userId), parent); // Save the restriction to ActiveAdmin. final Bundle restrictions = activeAdmin.ensureUserRestrictions(); if (enabledFromThisOwner) { restrictions.putBoolean(key, true); } else { restrictions.remove(key); } saveUserRestrictionsLocked(userId); } } logUserRestrictionCall(key, enabledFromThisOwner, parent, caller); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserRestriction File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setUserRestriction
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public int getKeyLength() { return 32; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyLength File: src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
getKeyLength
src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
public String getDiscoveryURI() { return discoveryURI; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDiscoveryURI File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
getDiscoveryURI
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
void observe() { // Observe all users' changes ContentResolver resolver = mContext.getContentResolver(); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.END_BUTTON_BEHAVIOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.WAKE_GESTURE_ENABLED), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.ACCELEROMETER_ROTATION), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.USER_ROTATION), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.SCREEN_OFF_TIMEOUT), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.POINTER_LOCATION), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.DEFAULT_INPUT_METHOD), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Global.getUriFor( Settings.Global.POLICY_CONTROL), false, this, UserHandle.USER_ALL); updateSettings(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: observe 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
observe
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public void containerItemSetChange(ItemSetChangeEvent event) { cancelEditor(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containerItemSetChange File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
containerItemSetChange
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public boolean isConnected() { return getCurrentState() == mL3ConnectedState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isConnected 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
isConnected
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void initLog(File logFilePath) throws IOException { RedwoodConfiguration.empty() .handlers(RedwoodConfiguration.Handlers.chain( RedwoodConfiguration.Handlers.showAllChannels(), RedwoodConfiguration.Handlers.stderr), RedwoodConfiguration.Handlers.file(logFilePath.toString()) ).apply(); // fh.setFormatter(new NewlineLogFormatter()); System.out.println("Starting Ssurgeon log, at "+logFilePath.getAbsolutePath()+" date=" + DateFormat.getDateInstance(DateFormat.FULL).format(new Date())); log.info("Starting Ssurgeon log, date=" + DateFormat.getDateInstance(DateFormat.FULL).format(new Date())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initLog File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
initLog
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
public User getUser(XWikiContext context) { return getUser(context.getUserReference(), context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUser File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getUser
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public void add(final DataPoints datapoints, final String options) { // Technically, we could check the number of data points in the // datapoints argument in order to do something when there are none, but // this is potentially expensive with a SpanGroup since it requires // iterating through the entire SpanGroup. We'll check this later // when we're trying to use the data, in order to avoid multiple passes // through the entire data. this.datapoints.add(datapoints); this.options.add(options); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: add File: src/graph/Plot.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2020-35476
HIGH
7.5
OpenTSDB/opentsdb
add
src/graph/Plot.java
b762338664c3ee6e3f773bc04da2a8af24a5c486
0
Analyze the following code function for security vulnerabilities
private ServiceProvider unmarshalSPTemplate(String spTemplateXml) throws IdentityApplicationManagementValidationException { if (StringUtils.isEmpty(spTemplateXml)) { throw new IdentityApplicationManagementValidationException(new String[]{"Empty SP template configuration" + " is provided."}); } try { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setXIncludeAware(false); try { spf.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE, false); spf.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE, false); spf.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE, false); spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (SAXException | ParserConfigurationException e) { log.error("Failed to load XML Processor Feature " + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE + " or " + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE + " or " + Constants.LOAD_EXTERNAL_DTD_FEATURE + " or secure-processing."); } JAXBContext jc = JAXBContext.newInstance(ServiceProvider.class); UnmarshallerHandler unmarshallerHandler = jc.createUnmarshaller().getUnmarshallerHandler(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); xr.setContentHandler(unmarshallerHandler); ByteArrayInputStream inputStream = new ByteArrayInputStream(spTemplateXml.getBytes(StandardCharsets.UTF_8)); InputSource inputSource = new InputSource(inputStream); xr.parse(inputSource); inputStream.close(); return (ServiceProvider) unmarshallerHandler.getResult(); } catch (JAXBException | SAXException | ParserConfigurationException | IOException e) { String msg = "Error in reading Service Provider template configuration."; log.error(msg, e); throw new IdentityApplicationManagementValidationException(new String[]{msg}); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unmarshalSPTemplate 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
unmarshalSPTemplate
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
public void updateChannelGroup(String pkg, int uid, NotificationChannelGroup group) { try { sINM.updateNotificationChannelGroupForPackage(pkg, uid, group); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateChannelGroup File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
updateChannelGroup
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doGet File: src/SearchContact.java Repository: ChrisMcMStone/gmail-servlet The code follows secure coding practices.
[ "CWE-89" ]
CVE-2014-125075
MEDIUM
5.2
ChrisMcMStone/gmail-servlet
doGet
src/SearchContact.java
5d72753c2e95bb373aa86824939397dc25f679ea
0
Analyze the following code function for security vulnerabilities
public static Path getResource(File file, String filename) throws IOException { if(!StringHelper.containsNonWhitespace(filename)) { filename = file.getName(); } Path fPath = null; if(file.isDirectory()) { fPath = file.toPath(); } else if(filename != null && filename.toLowerCase().endsWith(".zip")) { //perhaps find root folder and return it fPath = FileSystems.newFileSystem(file.toPath(), null).getPath("/"); RootSearcher rootSearcher = searchRootDirectory(fPath); if(rootSearcher.foundRoot()) { Path rootPath = rootSearcher.getRoot(); fPath = fPath.resolve(rootPath); } } else { fPath = file.toPath(); } return fPath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResource File: src/main/java/org/olat/fileresource/types/FileResource.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
getResource
src/main/java/org/olat/fileresource/types/FileResource.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
ActivityManagerInternal getActivityManagerInternal() { return LocalServices.getService(ActivityManagerInternal.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActivityManagerInternal 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
getActivityManagerInternal
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected Object createMessage(InstanceEvent event, Instance instance) { Map<String, Object> messageJson = new HashMap<>(); messageJson.put("msgtype", "text"); Map<String, Object> content = new HashMap<>(); content.put("content", getText(event, instance)); messageJson.put("text", content); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); return new HttpEntity<>(messageJson, headers); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createMessage File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
createMessage
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@Override public Intent getReplacementIntent(ActivityInfo aInfo, Intent defIntent) { Intent result = defIntent; if (mReplacementExtras != null) { final Bundle replExtras = mReplacementExtras.getBundle(aInfo.packageName); if (replExtras != null) { result = new Intent(defIntent); result.putExtras(replExtras); } } if (aInfo.name.equals(IntentForwarderActivity.FORWARD_INTENT_TO_USER_OWNER) || aInfo.name.equals(IntentForwarderActivity.FORWARD_INTENT_TO_MANAGED_PROFILE)) { result = Intent.createChooser(result, getIntent().getCharSequenceExtra(Intent.EXTRA_TITLE)); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReplacementIntent File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
getReplacementIntent
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
private static void appendCloseNode(StringBuilder xml, String name) { xml.append("</").append(name).append('>'); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendCloseNode File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-522" ]
CVE-2023-33264
MEDIUM
4.3
hazelcast
appendCloseNode
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
public boolean enableNoAutoConnect() { return enable (true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enableNoAutoConnect File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
enableNoAutoConnect
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
private void computeSizeRangesAndScreenLayout(DisplayInfo displayInfo, boolean rotated, int dw, int dh, float density, Configuration outConfig) { // TODO: Multidisplay: for now only use with default display. // We need to determine the smallest width that will occur under normal // operation. To this, start with the base screen size and compute the // width under the different possible rotations. We need to un-rotate // the current screen dimensions before doing this. int unrotDw, unrotDh; if (rotated) { unrotDw = dh; unrotDh = dw; } else { unrotDw = dw; unrotDh = dh; } displayInfo.smallestNominalAppWidth = 1<<30; displayInfo.smallestNominalAppHeight = 1<<30; displayInfo.largestNominalAppWidth = 0; displayInfo.largestNominalAppHeight = 0; adjustDisplaySizeRanges(displayInfo, Surface.ROTATION_0, unrotDw, unrotDh); adjustDisplaySizeRanges(displayInfo, Surface.ROTATION_90, unrotDh, unrotDw); adjustDisplaySizeRanges(displayInfo, Surface.ROTATION_180, unrotDw, unrotDh); adjustDisplaySizeRanges(displayInfo, Surface.ROTATION_270, unrotDh, unrotDw); int sl = Configuration.resetScreenLayout(outConfig.screenLayout); sl = reduceConfigLayout(sl, Surface.ROTATION_0, density, unrotDw, unrotDh); sl = reduceConfigLayout(sl, Surface.ROTATION_90, density, unrotDh, unrotDw); sl = reduceConfigLayout(sl, Surface.ROTATION_180, density, unrotDw, unrotDh); sl = reduceConfigLayout(sl, Surface.ROTATION_270, density, unrotDh, unrotDw); outConfig.smallestScreenWidthDp = (int)(displayInfo.smallestNominalAppWidth / density); outConfig.screenLayout = sl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: computeSizeRangesAndScreenLayout 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
computeSizeRangesAndScreenLayout
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void signalPersistentProcesses(final int sig) throws RemoteException { if (sig != SIGNAL_USR1) { throw new SecurityException("Only SIGNAL_USR1 is allowed"); } if (checkCallingPermission(android.Manifest.permission.SIGNAL_PERSISTENT_PROCESSES) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.SIGNAL_PERSISTENT_PROCESSES); } synchronized (mProcLock) { mProcessList.forEachLruProcessesLOSP(false, app -> { if (app.getThread() != null && app.isPersistent()) { sendSignal(app.getPid(), sig); } }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: signalPersistentProcesses File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
signalPersistentProcesses
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException { try { byte[] encoded = engineDoFinal(wrappedKey, 0, wrappedKey.length); if (wrappedKeyType == Cipher.PUBLIC_KEY) { KeyFactory keyFactory = KeyFactory.getInstance(wrappedKeyAlgorithm); return keyFactory.generatePublic(new X509EncodedKeySpec(encoded)); } else if (wrappedKeyType == Cipher.PRIVATE_KEY) { KeyFactory keyFactory = KeyFactory.getInstance(wrappedKeyAlgorithm); return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(encoded)); } else if (wrappedKeyType == Cipher.SECRET_KEY) { return new SecretKeySpec(encoded, wrappedKeyAlgorithm); } else { throw new UnsupportedOperationException("wrappedKeyType == " + wrappedKeyType); } } catch (IllegalBlockSizeException e) { throw new InvalidKeyException(e); } catch (BadPaddingException e) { throw new InvalidKeyException(e); } catch (InvalidKeySpecException e) { throw new InvalidKeyException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineUnwrap File: src/main/java/org/conscrypt/OpenSSLCipher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2461
HIGH
7.6
android
engineUnwrap
src/main/java/org/conscrypt/OpenSSLCipher.java
1638945d4ed9403790962ec7abed1b7a232a9ff8
0
Analyze the following code function for security vulnerabilities
@Procedure(deprecatedBy = "apoc.load.xml") @Deprecated @Description("apoc.load.xmlSimple('http://example.com/test.xml') YIELD value as doc CREATE (p:Person) SET p.name = doc.name load from XML URL (e.g. web-api) to import XML as single nested map with attributes and _type, _text and _children fields. This method does intentionally not work with XML mixed content.") public Stream<MapResult> xmlSimple(@Name("url") String url) throws Exception { return xmlToMapResult(url, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: xmlSimple File: src/main/java/apoc/load/Xml.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000820
HIGH
7.5
neo4j-contrib/neo4j-apoc-procedures
xmlSimple
src/main/java/apoc/load/Xml.java
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
0
Analyze the following code function for security vulnerabilities
public LogRecorderManager getLog() { checkPermission(ADMINISTER); return log; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLog File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getLog
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private List<SyncInfo> getCurrentSyncs(int userId) { synchronized (mAuthorities) { return getCurrentSyncsLocked(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentSyncs File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
getCurrentSyncs
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@Override public void resetDefaultCrossProfileIntentFilters(@UserIdInt int userId) { Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS)); mInjector.binderWithCleanCallingIdentity(() -> { try { final List<UserInfo> profiles = mUserManager.getProfiles(userId); final int numOfProfiles = profiles.size(); if (numOfProfiles <= 1) { return; } final String managedProvisioningPackageName = getManagedProvisioningPackage( mContext); // Removes cross profile intent filters from the parent to all the profiles. mIPackageManager.clearCrossProfileIntentFilters( userId, mContext.getOpPackageName()); // Setting and resetting default cross profile intent filters was previously handled // by Managed Provisioning. For backwards compatibility, clear any intent filters // that were set by ManagedProvisioning. mIPackageManager.clearCrossProfileIntentFilters( userId, managedProvisioningPackageName); // For each profile reset cross profile intent filters for (int i = 0; i < numOfProfiles; i++) { UserInfo profile = profiles.get(i); mIPackageManager.clearCrossProfileIntentFilters( profile.id, mContext.getOpPackageName()); // Clear any intent filters that were set by ManagedProvisioning. mIPackageManager.clearCrossProfileIntentFilters( profile.id, managedProvisioningPackageName); mUserManagerInternal.setDefaultCrossProfileIntentFilters(userId, profile.id); } } catch (RemoteException e) { // Shouldn't happen. } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetDefaultCrossProfileIntentFilters 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
resetDefaultCrossProfileIntentFilters
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void setListening(boolean listening) { if (listening) { UserInfo info = mContext.getSystemService(UserManager.class).getUserInfo( UserHandle.myUserId()); mSummaryLoader.setSummary(this, mContext.getString(R.string.user_summary, info.name)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setListening File: src/com/android/settings/users/UserSettings.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
setListening
src/com/android/settings/users/UserSettings.java
bd5d5176c74021e8cf4970f93f273ba3023c3d72
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { return "{\"" + mTag + "\", acquire at " + TimeUtils.formatUptime(mAcquireTime) + "}"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
toString
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public HashMap<String, Integer> getBadgesMap() { HashMap<String, Integer> badgeMap = new HashMap<String, Integer>(0); if (StringUtils.isBlank(badges)) { return badgeMap; } for (String badge : badges.split(",")) { Integer val = badgeMap.get(badge); int count = (val == null) ? 0 : val.intValue(); badgeMap.put(badge, ++count); } badgeMap.remove(""); return badgeMap; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBadgesMap File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getBadgesMap
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Beta public Builder setCredentialDataStore(DataStore<StoredCredential> credentialDataStore) { Preconditions.checkArgument(credentialStore == null); this.credentialDataStore = credentialDataStore; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCredentialDataStore File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java Repository: googleapis/google-oauth-java-client The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-7692
MEDIUM
6.4
googleapis/google-oauth-java-client
setCredentialDataStore
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
13433cd7dd06267fc261f0b1d4764f8e3432c824
0
Analyze the following code function for security vulnerabilities
protected boolean shouldPeek(Entry entry, StatusBarNotification sbn) { if (!mUseHeadsUp || isDeviceInVrMode()) { if (DEBUG) Log.d(TAG, "No peeking: no huns or vr mode"); return false; } if (mNotificationData.shouldFilterOut(sbn)) { if (DEBUG) Log.d(TAG, "No peeking: filtered notification: " + sbn.getKey()); return false; } boolean inUse = mPowerManager.isScreenOn() && !mSystemServicesProxy.isDreaming(); if (!inUse && !isDozing()) { if (DEBUG) { Log.d(TAG, "No peeking: not in use: " + sbn.getKey()); } return false; } if (mNotificationData.shouldSuppressScreenOn(sbn.getKey())) { if (DEBUG) Log.d(TAG, "No peeking: suppressed by DND: " + sbn.getKey()); return false; } if (entry.hasJustLaunchedFullScreenIntent()) { if (DEBUG) Log.d(TAG, "No peeking: recent fullscreen: " + sbn.getKey()); return false; } if (isSnoozedPackage(sbn)) { if (DEBUG) Log.d(TAG, "No peeking: snoozed package: " + sbn.getKey()); return false; } // Allow peeking for DEFAULT notifications only if we're on Ambient Display. int importanceLevel = isDozing() ? NotificationManager.IMPORTANCE_DEFAULT : NotificationManager.IMPORTANCE_HIGH; if (mNotificationData.getImportance(sbn.getKey()) < importanceLevel) { if (DEBUG) Log.d(TAG, "No peeking: unimportant notification: " + sbn.getKey()); return false; } if (sbn.getNotification().fullScreenIntent != null) { if (mAccessibilityManager.isTouchExplorationEnabled()) { if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); return false; } else { // we only allow head-up on the lockscreen if it doesn't have a fullscreen intent return !mStatusBarKeyguardViewManager.isShowing() || mStatusBarKeyguardViewManager.isOccluded(); } } // Don't peek notifications that are suppressed due to group alert behavior if (sbn.isGroup() && sbn.getNotification().suppressAlertingDueToGrouping()) { if (DEBUG) Log.d(TAG, "No peeking: suppressed due to group alert behavior"); return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldPeek 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
shouldPeek
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void setProperty(String key, String value) { prop.setProperty(key, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProperty 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
setProperty
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
public Registration addColumnResizeListener(ColumnResizeListener listener) { return addListener(ColumnResizeEvent.class, listener, COLUMN_RESIZE_METHOD); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addColumnResizeListener File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
addColumnResizeListener
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Beta public static MappedByteBuffer map(File file, MapMode mode, long size) throws IOException { checkArgument(size >= 0, "size (%s) may not be negative", size); return mapInternal(file, mode, size); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: map File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-8908
LOW
2.1
google/guava
map
android/guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
public BaseClass getPrefsClass(XWikiContext context) throws XWikiException { return getMandatoryClass(context, getPreferencesDocumentReference(context)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPrefsClass File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getPrefsClass
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public TagMatcher getAllowedEmptyTags() { return allowedEmptyTagsMatcher; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllowedEmptyTags File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
getAllowedEmptyTags
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { String ID = ""; String filter = ""; String callerUrl = request.getParameter("callerUrl"); if (request.getParameter("ID") != null) { ID = request.getParameter("ID"); } if (request.getParameter("filter") != null) { filter = request.getParameter("filter"); } request.getSession() .setAttribute("controlledvocabulary.filter", filter); request.getSession().setAttribute("controlledvocabulary.ID", ID); response.sendRedirect(callerUrl); }
Vulnerability Classification: - CWE: CWE-601 - CVE: CVE-2022-31193 - Severity: MEDIUM - CVSS Score: 6.1 Description: [DS-4133] Improve URL handling in Controlled Vocab JSPUI servlet Function: doDSGet File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/ControlledVocabularyServlet.java Repository: DSpace Fixed Code: protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { String ID = ""; String filter = ""; String callerUrl = request.getParameter("callerUrl"); // callerUrl must starts with URL outside DSpace request context path if(!callerUrl.startsWith(request.getContextPath())) { log.error("Controlled vocabulary caller URL would result in redirect outside DSpace web app: " + callerUrl + ". Rejecting request with 400 Bad Request."); response.sendError(400, "The caller URL must be within the DSpace base URL of " + request.getContextPath()); return; } if (request.getParameter("ID") != null) { ID = request.getParameter("ID"); } if (request.getParameter("filter") != null) { filter = request.getParameter("filter"); } request.getSession() .setAttribute("controlledvocabulary.filter", filter); request.getSession().setAttribute("controlledvocabulary.ID", ID); response.sendRedirect(callerUrl); }
[ "CWE-601" ]
CVE-2022-31193
MEDIUM
6.1
DSpace
doDSGet
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/ControlledVocabularyServlet.java
5f72424a478f59061dcc516b866dcc687bc3f9de
1
Analyze the following code function for security vulnerabilities
private void evictThis() { try { if (Utils.isNullOrEmpty(getNamespace())) { throw new KubernetesClientException("Namespace not specified, but operation requires it."); } if (Utils.isNullOrEmpty(getName())) { throw new KubernetesClientException("Name not specified, but operation requires it."); } handleEvict(getResourceUrl(), getNamespace(), getName()); } catch (Exception e) { throw KubernetesClientException.launderThrowable(forOperationType("evict"), e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: evictThis 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
evictThis
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
private static String generateAvailableFilenameLocked( File[] parents, String prefix, String suffix) throws IOException { String name = prefix + suffix; if (isFilenameAvailableLocked(parents, name)) { return name; } /* * This number is used to generate partially randomized filenames to avoid * collisions. * It starts at 1. * The next 9 iterations increment it by 1 at a time (up to 10). * The next 9 iterations increment it by 1 to 10 (random) at a time. * The next 9 iterations increment it by 1 to 100 (random) at a time. * ... Up to the point where it increases by 100000000 at a time. * (the maximum value that can be reached is 1000000000) * As soon as a number is reached that generates a filename that doesn't exist, * that filename is used. * If the filename coming in is [base].[ext], the generated filenames are * [base]-[sequence].[ext]. */ int sequence = 1; for (int magnitude = 1; magnitude < 1000000000; magnitude *= 10) { for (int iteration = 0; iteration < 9; ++iteration) { name = prefix + Constants.FILENAME_SEQUENCE_SEPARATOR + sequence + suffix; if (isFilenameAvailableLocked(parents, name)) { return name; } sequence += sRandom.nextInt(magnitude) + 1; } } throw new IOException("Failed to generate an available filename"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateAvailableFilenameLocked File: src/com/android/providers/downloads/Helpers.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
generateAvailableFilenameLocked
src/com/android/providers/downloads/Helpers.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
public static String documentToString(Document document) { StringOutputStream s = new StringOutputStream(); printNode(s, document, true, true); return s.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: documentToString File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3869
MEDIUM
5
stanfordnlp/CoreNLP
documentToString
src/edu/stanford/nlp/util/XMLUtils.java
5d83f1e8482ca304db8be726cad89554c88f136a
0
Analyze the following code function for security vulnerabilities
private int deleteCodeCacheDirsLI(String volumeUuid, String packageName) { int[] users = sUserManager.getUserIds(); int res = 0; for (int user : users) { int resInner = mInstaller.deleteCodeCacheFiles(volumeUuid, packageName, user); if (resInner < 0) { res = resInner; } } return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteCodeCacheDirsLI 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
deleteCodeCacheDirsLI
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public JsonLocation getTokenLocation() { // token location is correctly managed... return new JsonLocation(_ioContext.getSourceReference(), _tokenInputTotal, // bytes -1, -1, (int) _tokenInputTotal); // char offset, line, column }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTokenLocation File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
getTokenLocation
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public void onOverdrawBottomHeightChanged(int overdrawHeightPix) { if (mOverdrawBottomHeightPix == overdrawHeightPix) return; mOverdrawBottomHeightPix = overdrawHeightPix; if (mNativeContentViewCore != 0) { nativeWasResized(mNativeContentViewCore); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onOverdrawBottomHeightChanged 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
onOverdrawBottomHeightChanged
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@GET @Path("/generatesql/{sourceKey}/{id}") @Produces(MediaType.TEXT_PLAIN) public String GenerateFeaturesSql(@PathParam("sourceKey") String sourceKey, @PathParam("id") String cohortId) { Source source = getSourceRepository().findBySourceKey(sourceKey); String tableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.CDM); String resultsTableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.Results); FeatureExtraction.init(null); String settings = FeatureExtraction.getDefaultPrespecAnalyses(); String sqlJson = FeatureExtraction.createSql(settings, true, resultsTableQualifier + ".cohort", "subject_id", Integer.parseInt(cohortId), tableQualifier); JSONObject jsonObject = new JSONObject(sqlJson); String insertStr = "insert into @resultsDatabaseSchema.{0} \r\n {1};"; String cohortWrapper = "select {0} as cohort_definition_id, {1} from ({2})"; String columns = ""; StringJoiner joiner = new StringJoiner("\r\n ---- \r\n"); // String clearSql = "delete from @resultsDatabaseSchema.{0} where cohort_definition_id = {1};"; // String[] tables = new String[] { "cohort_features", "cohort_features_dist", "cohort_features_ref", "cohort_features_analysis_ref" }; // // for (String table : tables) // joiner.add(MessageFormat.format(clearSql, table, cohortId)); joiner.add(jsonObject.getString("sqlConstruction")); columns = "cohort_definition_id, covariate_id, sum_value, average_value"; joiner.add(MessageFormat.format(insertStr, "cohort_features", MessageFormat.format(cohortWrapper, cohortId, columns, StringUtils.stripEnd(jsonObject.getString("sqlQueryFeatures"), ";")))); columns = "covariate_id, count_value, min_value, max_value, average_value, " + "standard_deviation, median_value, p10_value, p25_value, p75_value, p90_value"; joiner.add(MessageFormat.format(insertStr, "cohort_features_dist", MessageFormat.format(cohortWrapper, cohortId, columns, StringUtils.stripEnd(jsonObject.getString("sqlQueryContinuousFeatures"), ";")))); columns = "covariate_id, covariate_name, analysis_id, concept_id"; joiner.add(MessageFormat.format(insertStr, "cohort_features_ref", MessageFormat.format(cohortWrapper, cohortId, columns, StringUtils.stripEnd(jsonObject.getString("sqlQueryFeatureRef"), ";")))); columns = "analysis_id, analysis_name, domain_id, start_day, end_day, is_binary, missing_means_zero"; joiner.add(MessageFormat.format(insertStr, "cohort_features_analysis_ref", MessageFormat.format(cohortWrapper, cohortId, columns, StringUtils.stripEnd(jsonObject.getString("sqlQueryAnalysisRef"), ";")))); joiner.add(jsonObject.getString("sqlCleanup")); String fullSql = SqlRender.renderSql(joiner.toString(), new String[]{"resultsDatabaseSchema"}, new String[]{resultsTableQualifier}); fullSql = SqlTranslate.translateSql(fullSql, source.getSourceDialect()); return fullSql; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: GenerateFeaturesSql File: src/main/java/org/ohdsi/webapi/service/FeatureExtractionService.java Repository: OHDSI/WebAPI The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15563
HIGH
7.5
OHDSI/WebAPI
GenerateFeaturesSql
src/main/java/org/ohdsi/webapi/service/FeatureExtractionService.java
b3944074a1976c95d500239cbbf0741917ed75ca
0
Analyze the following code function for security vulnerabilities
public int getIntValue(String fieldName) { BaseObject object = getFirstObject(fieldName, null); if (object == null) { return 0; } else { return object.getIntValue(fieldName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntValue 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
getIntValue
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public boolean isValid() { return manifestFile; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValid File: src/main/java/org/olat/fileresource/types/ImsQTI21Resource.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
isValid
src/main/java/org/olat/fileresource/types/ImsQTI21Resource.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
public double optDouble(int index) { return optDouble(index, Double.NaN); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optDouble File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
optDouble
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public @Nullable Array getArray(String colName) throws SQLException { return getArray(findColumn(colName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getArray 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
getArray
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void overridePendingTransition(IBinder token, String packageName, int enterAnim, int exitAnim) { synchronized(this) { ActivityRecord self = ActivityRecord.isInStackLocked(token); if (self == null) { return; } final long origId = Binder.clearCallingIdentity(); if (self.isState(ActivityState.RESUMED, ActivityState.PAUSING)) { mWindowManager.overridePendingAppTransition(packageName, enterAnim, exitAnim, null); } Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: overridePendingTransition 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
overridePendingTransition
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
void onCopySplashScreenFinish(SplashScreenViewParcelable parcelable) { removeTransferSplashScreenTimeout(); // unable to copy from shell, maybe it's not a splash screen. or something went wrong. // either way, abort and reset the sequence. if (parcelable == null || mTransferringSplashScreenState != TRANSFER_SPLASH_SCREEN_COPYING || mStartingWindow == null || finishing) { if (parcelable != null) { parcelable.clearIfNeeded(); } mTransferringSplashScreenState = TRANSFER_SPLASH_SCREEN_FINISH; removeStartingWindow(); return; } // schedule attach splashScreen to client final SurfaceControl windowAnimationLeash = TaskOrganizerController .applyStartingWindowAnimation(mStartingWindow); try { mTransferringSplashScreenState = TRANSFER_SPLASH_SCREEN_ATTACH_TO_CLIENT; mAtmService.getLifecycleManager().scheduleTransaction(app.getThread(), token, TransferSplashScreenViewStateItem.obtain(parcelable, windowAnimationLeash)); scheduleTransferSplashScreenTimeout(); } catch (Exception e) { Slog.w(TAG, "onCopySplashScreenComplete fail: " + this); mStartingWindow.cancelAnimation(); parcelable.clearIfNeeded(); mTransferringSplashScreenState = TRANSFER_SPLASH_SCREEN_FINISH; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCopySplashScreenFinish 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
onCopySplashScreenFinish
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public void setColorFilter(ColorFilter colorFilter) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setColorFilter 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
setColorFilter
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static String issueJwt(String subject, Long period, Map<String, Object> customClaimMap){ String id = UUID.randomUUID().toString(); String issuer = "sureness-token-server"; return issueJwt(id, subject, issuer, period, null, customClaimMap); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: issueJwt File: core/src/main/java/com/usthe/sureness/util/JsonWebTokenUtil.java Repository: dromara/sureness The code follows secure coding practices.
[ "CWE-798" ]
CVE-2023-31581
CRITICAL
9.8
dromara/sureness
issueJwt
core/src/main/java/com/usthe/sureness/util/JsonWebTokenUtil.java
4f5fefaf673168d74820020a191fab2904629742
0
Analyze the following code function for security vulnerabilities
@Override public void removeRecentTasksByPackageName(String packageName, int userId) { synchronized (mGlobalLock) { mRecentTasks.removeTasksByPackageName(packageName, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeRecentTasksByPackageName 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
removeRecentTasksByPackageName
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public void channelClosed(final ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { // Move the fail of the writes to the IO-Thread to prevent possible deadlock // See https://github.com/netty/netty/issues/989 ctx.getPipeline().execute(new Runnable() { public void run() { if (!pendingUnencryptedWritesLock.tryLock()) { return; } Throwable cause = null; try { for (;;) { PendingWrite pw = pendingUnencryptedWrites.poll(); if (pw == null) { break; } if (cause == null) { cause = new ClosedChannelException(); } pw.future.setFailure(cause); } for (;;) { MessageEvent ev = pendingEncryptedWrites.poll(); if (ev == null) { break; } if (cause == null) { cause = new ClosedChannelException(); } ev.getFuture().setFailure(cause); } } finally { pendingUnencryptedWritesLock.unlock(); } if (cause != null) { fireExceptionCaught(ctx, cause); } } }); super.channelClosed(ctx, e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: channelClosed File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-119" ]
CVE-2014-3488
MEDIUM
5
netty
channelClosed
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2fa9400a59d0563a66908aba55c41e7285a04994
0
Analyze the following code function for security vulnerabilities
@Override public void onCreateContextMenu(final ContextMenu menu, final View v, final ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); final StartConversationActivity activity = (StartConversationActivity) getActivity(); if (activity == null) { return; } activity.getMenuInflater().inflate(mResContextMenu, menu); final AdapterView.AdapterContextMenuInfo acmi = (AdapterContextMenuInfo) menuInfo; if (mResContextMenu == R.menu.conference_context) { activity.conference_context_id = acmi.position; } else if (mResContextMenu == R.menu.contact_context) { activity.contact_context_id = acmi.position; final Contact contact = (Contact) activity.contacts.get(acmi.position); final MenuItem blockUnblockItem = menu.findItem(R.id.context_contact_block_unblock); final MenuItem showContactDetailsItem = menu.findItem(R.id.context_contact_details); final MenuItem deleteContactMenuItem = menu.findItem(R.id.context_delete_contact); if (contact.isSelf()) { showContactDetailsItem.setVisible(false); } deleteContactMenuItem.setVisible(contact.showInRoster()); XmppConnection xmpp = contact.getAccount().getXmppConnection(); if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) { if (contact.isBlocked()) { blockUnblockItem.setTitle(R.string.unblock_contact); } else { blockUnblockItem.setTitle(R.string.block_contact); } } else { blockUnblockItem.setVisible(false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreateContextMenu File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onCreateContextMenu
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private IBaseResource loadAndAddConfR5(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) { CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); org.hl7.fhir.r5.model.CapabilityStatement capabilityStatement = new org.hl7.fhir.r5.model.CapabilityStatement(); try { capabilityStatement = client.fetchConformance().ofType(org.hl7.fhir.r5.model.CapabilityStatement.class).execute(); } catch (Exception ex) { ourLog.warn("Failed to load conformance statement, error was: {}", ex.toString()); theModel.put("errorMsg", toDisplayError("Failed to load conformance statement, error was: " + ex.toString(), ex)); } theModel.put("jsonEncodedConf", getContext(theRequest).newJsonParser().encodeResourceToString(capabilityStatement)); Map<String, Number> resourceCounts = new HashMap<String, Number>(); long total = 0; for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent nextRest : capabilityStatement.getRest()) { for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent nextResource : nextRest.getResource()) { List<org.hl7.fhir.r5.model.Extension> exts = nextResource.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (exts != null && exts.size() > 0) { Number nextCount = ((org.hl7.fhir.r5.model.DecimalType) (exts.get(0).getValue())).getValueAsNumber(); resourceCounts.put(nextResource.getTypeElement().getValue(), nextCount); total += nextCount.longValue(); } } } theModel.put("resourceCounts", resourceCounts); if (total > 0) { for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent nextRest : capabilityStatement.getRest()) { Collections.sort(nextRest.getResource(), new Comparator<org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent>() { @Override public int compare(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent theO1, org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent theO2) { org.hl7.fhir.r5.model.DecimalType count1 = new org.hl7.fhir.r5.model.DecimalType(); List<org.hl7.fhir.r5.model.Extension> count1exts = theO1.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count1exts != null && count1exts.size() > 0) { count1 = (org.hl7.fhir.r5.model.DecimalType) count1exts.get(0).getValue(); } org.hl7.fhir.r5.model.DecimalType count2 = new org.hl7.fhir.r5.model.DecimalType(); List<org.hl7.fhir.r5.model.Extension> count2exts = theO2.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count2exts != null && count2exts.size() > 0) { count2 = (org.hl7.fhir.r5.model.DecimalType) count2exts.get(0).getValue(); } int retVal = count2.compareTo(count1); if (retVal == 0) { retVal = theO1.getTypeElement().getValue().compareTo(theO2.getTypeElement().getValue()); } return retVal; } }); } } theModel.put("requiredParamExtension", ExtensionConstants.PARAM_IS_REQUIRED); theModel.put("conf", capabilityStatement); return capabilityStatement; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-24301 - Severity: MEDIUM - CVSS Score: 4.3 Description: Resolve XSS vulnerability Function: loadAndAddConfR5 File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java Repository: hapifhir/hapi-fhir Fixed Code: private IBaseResource loadAndAddConfR5(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) { CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); org.hl7.fhir.r5.model.CapabilityStatement capabilityStatement = new org.hl7.fhir.r5.model.CapabilityStatement(); try { capabilityStatement = client.fetchConformance().ofType(org.hl7.fhir.r5.model.CapabilityStatement.class).execute(); } catch (Exception ex) { ourLog.warn("Failed to load conformance statement, error was: {}", ex.toString()); theModel.put("errorMsg", toDisplayError("Failed to load conformance statement, error was: " + ex.toString(), ex)); } theModel.put("jsonEncodedConf", getContext(theRequest).newJsonParser().encodeResourceToString(capabilityStatement)); Map<String, Number> resourceCounts = new HashMap<>(); long total = 0; for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent nextRest : capabilityStatement.getRest()) { for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent nextResource : nextRest.getResource()) { List<org.hl7.fhir.r5.model.Extension> exts = nextResource.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (exts != null && exts.size() > 0) { Number nextCount = ((org.hl7.fhir.r5.model.DecimalType) (exts.get(0).getValue())).getValueAsNumber(); resourceCounts.put(nextResource.getTypeElement().getValue(), nextCount); total += nextCount.longValue(); } } } theModel.put("resourceCounts", resourceCounts); if (total > 0) { for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent nextRest : capabilityStatement.getRest()) { Collections.sort(nextRest.getResource(), new Comparator<org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent>() { @Override public int compare(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent theO1, org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent theO2) { org.hl7.fhir.r5.model.DecimalType count1 = new org.hl7.fhir.r5.model.DecimalType(); List<org.hl7.fhir.r5.model.Extension> count1exts = theO1.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count1exts != null && count1exts.size() > 0) { count1 = (org.hl7.fhir.r5.model.DecimalType) count1exts.get(0).getValue(); } org.hl7.fhir.r5.model.DecimalType count2 = new org.hl7.fhir.r5.model.DecimalType(); List<org.hl7.fhir.r5.model.Extension> count2exts = theO2.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count2exts != null && count2exts.size() > 0) { count2 = (org.hl7.fhir.r5.model.DecimalType) count2exts.get(0).getValue(); } int retVal = count2.compareTo(count1); if (retVal == 0) { retVal = theO1.getTypeElement().getValue().compareTo(theO2.getTypeElement().getValue()); } return retVal; } }); } } theModel.put("requiredParamExtension", ExtensionConstants.PARAM_IS_REQUIRED); theModel.put("conf", capabilityStatement); return capabilityStatement; }
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
loadAndAddConfR5
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
1
Analyze the following code function for security vulnerabilities
public Builder setScheduledExecutorService(ScheduledExecutorService reaper) { this.reaper = reaper; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setScheduledExecutorService File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setScheduledExecutorService
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public void getOCMetadata(int parentStudyId, int studyId, MetaDataVersionBean metadata, String odmVersion) { this.getODMMetadata(parentStudyId, studyId, metadata, odmVersion); String cvIds = metadata.getCvIds(); if (odmVersion.startsWith("oc")) { // add CRFVersions that itemDef belong to HashMap<String, String> itDefCVs = new HashMap<String, String>(); this.setItemCVOIDsTypesExpected(); ArrayList al = this.select(this.getItemCVOIDsSql(cvIds)); Iterator iter = al.iterator(); while (iter.hasNext()) { HashMap row = (HashMap) iter.next(); Integer cId = (Integer) row.get("crf_id"); Integer cvId = (Integer) row.get("crf_version_id"); Integer itId = (Integer) row.get("item_id"); String cvOID = (String) row.get("cv_oid"); String itOID = (String) row.get("item_oid"); if (itDefCVs.containsKey(itOID)) { String cvs = itDefCVs.get(itOID); if (!cvs.contains(cvOID + ",")) { cvs += cvOID + ","; } itDefCVs.put(itOID, cvs); } else { itDefCVs.put(itOID, cvOID + ","); } } for (ItemDefBean itdef : metadata.getItemDefs()) { String key = itdef.getOid(); if (itDefCVs.containsKey(key)) { String cvs = itDefCVs.get(key); itdef.setFormOIDs(cvs.substring(0, cvs.length() - 1)); } } // add StudyGroupClassList this.setStudyGroupClassTypesExpected(); logger.debug("Begin to execute GetStudyGroupClassSql"); logger.debug("getStudyGroupClassSql=" + getStudyGroupClassSql(parentStudyId)); ArrayList rows = select(this.getStudyGroupClassSql(parentStudyId)); Iterator it = rows.iterator(); ArrayList<StudyGroupClassListBean> sgcLists = (ArrayList<StudyGroupClassListBean>) metadata.getStudyGroupClassLists(); String sgcprev = ""; while (it.hasNext()) { HashMap row = (HashMap) it.next(); Integer sgcid = (Integer) row.get("study_group_class_id"); String sgcname = (String) row.get("sgc_name"); String sgctype = (String) row.get("sgc_type"); Integer statusid = (Integer) row.get("status_id"); String subassign = (String) row.get("subject_assignment"); String sgname = (String) row.get("sg_name"); String des = (String) row.get("description"); if (sgcprev.equals(sgcid + "")) { StudyGroupItemBean sg = new StudyGroupItemBean(); sg.setName(sgname); sg.setDescription(des); StudyGroupClassListBean sgc = sgcLists.get(sgcLists.size() - 1); sgc.getStudyGroupItems().add(sg); } else { sgcprev = sgcid + ""; StudyGroupClassListBean sgc = new StudyGroupClassListBean(); sgc.setID("SGC_" + sgcid); sgc.setName(sgcname); sgc.setType(sgctype); sgc.setStatus(Status.get(statusid).getName()); sgc.setSubjectAssignment(subassign); StudyGroupItemBean sg = new StudyGroupItemBean(); sg.setName(sgname); sg.setDescription(des); sgc.getStudyGroupItems().add(sg); sgcLists.add(sgc); } } } // return nullClSet; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOCMetadata File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getOCMetadata
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public boolean isFullySigned() { if (isTriviallySigned()) return true; boolean fullySigned = appVerifier.isFullySigned(certs, jarSignableEntries); LOG.debug("App already has trusted publisher: {}", fullySigned); return fullySigned; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFullySigned File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
isFullySigned
core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java
2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99
0
Analyze the following code function for security vulnerabilities
void updatePackageCache() { PackageManager pm = mContext.getPackageManager(); List<PackageInfo> packages = pm.getInstalledPackages(0, UserHandle.USER_OWNER); synchronized (this) { mInstalledPackages = packages; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePackageCache File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
updatePackageCache
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
public void addUserRestriction(@NonNull ComponentName admin, @UserManager.UserRestrictionKey String key) { if (mService != null) { try { mService.setUserRestriction( admin, mContext.getPackageName(), key, true, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addUserRestriction File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
addUserRestriction
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private URI createFinalUriWithQueryParams(String url, List<Property> queryParams, Boolean encodeParamsToggle) throws URISyntaxException { UriComponentsBuilder uriBuilder = UriComponentsBuilder.newInstance(); uriBuilder.uri(new URI(url)); if (queryParams != null) { for (Property queryParam : queryParams) { String key = queryParam.getKey(); if (StringUtils.isNotEmpty(key)) { if (encodeParamsToggle == true) { uriBuilder.queryParam( URLEncoder.encode(key, StandardCharsets.UTF_8), URLEncoder.encode((String) queryParam.getValue(), StandardCharsets.UTF_8) ); } else { uriBuilder.queryParam( key, queryParam.getValue() ); } } } } return uriBuilder.build(true).toUri(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createFinalUriWithQueryParams File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-38298
HIGH
8.8
appsmithorg/appsmith
createFinalUriWithQueryParams
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
0
Analyze the following code function for security vulnerabilities
public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setPassword(password); return this; } } throw new RuntimeException("No HTTP basic authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPassword File: samples/client/petstore/java/retrofit2-play26/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
setPassword
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override // Binder call public List<Fingerprint> getEnrolledFingerprints(int userId, String opPackageName) { if (!canUseFingerprint(opPackageName, false /* foregroundOnly */, Binder.getCallingUid(), Binder.getCallingPid())) { return Collections.emptyList(); } if (!isCurrentUserOrProfile(userId)) { return Collections.emptyList(); } return FingerprintService.this.getEnrolledFingerprints(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnrolledFingerprints 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
getEnrolledFingerprints
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
boolean needsRelativeLayeringToIme() { // We use the relative layering when IME isn't attached to the app. Such as part of // elevating the IME and windows above it's target above the docked divider in // split-screen, or make the popupMenu to be above the IME when the parent window is the // IME layering target in bubble/freeform mode. if (mDisplayContent.shouldImeAttachedToApp()) { return false; } // We don't need to set the window to be relatively above IME if the IME is not visible. // In case seeing the window is animating above the app transition layer because its // relative layer is above the IME container on the display area but actually not necessary. if (!getDisplayContent().getImeContainer().isVisible()) { return false; } if (isChildWindow()) { // If we are a child of the input method target we need this promotion. if (getParentWindow().isImeLayeringTarget()) { return true; } } else if (mActivityRecord != null) { // Likewise if we share a token with the Input method target and are ordered // above it but not necessarily a child (e.g. a Dialog) then we also need // this promotion. final WindowState imeTarget = getImeLayeringTarget(); boolean inTokenWithAndAboveImeTarget = imeTarget != null && imeTarget != this && imeTarget.mToken == mToken && mAttrs.type != TYPE_APPLICATION_STARTING && getParent() != null && imeTarget.compareTo(this) <= 0; return inTokenWithAndAboveImeTarget; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: needsRelativeLayeringToIme File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
needsRelativeLayeringToIme
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
void setConstructor(long newConstructor) { constructor = newConstructor; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConstructor 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
setConstructor
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private IntentFilterVerificationState createDomainVerificationState(int verifierUid, int userId, int verificationId, String packageName) { IntentFilterVerificationState ivs = new IntentFilterVerificationState( verifierUid, userId, packageName); ivs.setPendingState(); synchronized (mPackages) { mIntentFilterVerificationStates.append(verificationId, ivs); mCurrentIntentFilterVerifications.add(verificationId); } return ivs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createDomainVerificationState 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
createDomainVerificationState
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public void moveTaskToStack(int taskId, int stackId, boolean toTop) { enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS, "moveTaskToStack()"); if (stackId == HOME_STACK_ID) { Slog.e(TAG, "moveTaskToStack: Attempt to move task " + taskId + " to home stack", new RuntimeException("here").fillInStackTrace()); } synchronized (this) { long ident = Binder.clearCallingIdentity(); try { if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToStack: moving task=" + taskId + " to stackId=" + stackId + " toTop=" + toTop); mStackSupervisor.moveTaskToStackLocked(taskId, stackId, toTop); } finally { Binder.restoreCallingIdentity(ident); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveTaskToStack File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
moveTaskToStack
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@Override public void unregisterFocusObserver(IWindowFocusObserver observer) { final WindowState outer = mOuter.get(); if (outer != null) { outer.unregisterFocusObserver(observer); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterFocusObserver File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
unregisterFocusObserver
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
protected PrivateKey engineGeneratePrivate( KeySpec keySpec) throws InvalidKeySpecException { if (keySpec instanceof DHPrivateKeySpec) { return new BCDHPrivateKey((DHPrivateKeySpec)keySpec); } return super.engineGeneratePrivate(keySpec); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineGeneratePrivate File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyFactorySpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
engineGeneratePrivate
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyFactorySpi.java
413b42f4d770456508585c830cfcde95f9b0e93b
0
Analyze the following code function for security vulnerabilities
private int checkPermission(String pkgName, String permName, @UserIdInt int userId) { // Not using Objects.requireNonNull() here for compatibility reasons. if (pkgName == null || permName == null) { return PackageManager.PERMISSION_DENIED; } final CheckPermissionDelegate checkPermissionDelegate; synchronized (mLock) { checkPermissionDelegate = mCheckPermissionDelegate; } if (checkPermissionDelegate == null) { return mPermissionManagerServiceImpl.checkPermission(pkgName, permName, userId); } return checkPermissionDelegate.checkPermission(pkgName, permName, userId, mPermissionManagerServiceImpl::checkPermission); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermission File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
checkPermission
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override protected void pointerReleased(final int x, final int y) { super.pointerReleased(x, y); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pointerReleased 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
pointerReleased
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public boolean isFinish() { return finish; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFinish File: web/src/main/java/com/zrlog/web/plugin/WarUpdateVersionThread.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
isFinish
web/src/main/java/com/zrlog/web/plugin/WarUpdateVersionThread.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@Override public void addAccount(final IAccountManagerResponse response, final String accountType, final String authTokenType, final String[] requiredFeatures, final boolean expectActivityLaunch, final Bundle optionsIn) { Bundle.setDefusable(optionsIn, true); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "addAccount: accountType " + accountType + ", response " + response + ", authTokenType " + authTokenType + ", requiredFeatures " + Arrays.toString(requiredFeatures) + ", expectActivityLaunch " + expectActivityLaunch + ", caller's uid " + Binder.getCallingUid() + ", pid " + Binder.getCallingPid()); } if (response == null) throw new IllegalArgumentException("response is null"); if (accountType == null) throw new IllegalArgumentException("accountType is null"); // Is user disallowed from modifying accounts? final int uid = Binder.getCallingUid(); final int userId = UserHandle.getUserId(uid); if (!canUserModifyAccounts(userId, uid)) { try { response.onError(AccountManager.ERROR_CODE_USER_RESTRICTED, "User is not allowed to add an account!"); } catch (RemoteException re) { } showCantAddAccount(AccountManager.ERROR_CODE_USER_RESTRICTED, userId); return; } if (!canUserModifyAccountsForType(userId, accountType, uid)) { try { response.onError(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE, "User cannot modify accounts of this type (policy)."); } catch (RemoteException re) { } showCantAddAccount(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE, userId); return; } addAccountAndLogMetrics(response, accountType, authTokenType, requiredFeatures, expectActivityLaunch, optionsIn, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAccount File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
addAccount
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private static boolean isInstalled(@Nullable ActivityInfo ai) { return (ai != null) && isInstalled(ai.applicationInfo); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInstalled 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
isInstalled
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public String getId() { return userId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getId File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getId
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
protected JavaType resolveMemberAndTypeAnnotations(DeserializationContext ctxt, AnnotatedMember member, JavaType type) throws JsonMappingException { AnnotationIntrospector intr = ctxt.getAnnotationIntrospector(); if (intr == null) { return type; } // First things first: see if we can find annotations on declared // type if (type.isMapLikeType()) { JavaType keyType = type.getKeyType(); if (keyType != null) { Object kdDef = intr.findKeyDeserializer(member); KeyDeserializer kd = ctxt.keyDeserializerInstance(member, kdDef); if (kd != null) { type = ((MapLikeType) type).withKeyValueHandler(kd); keyType = type.getKeyType(); // just in case it's used below } } } if (type.hasContentType()) { // that is, is either container- or reference-type Object cdDef = intr.findContentDeserializer(member); JsonDeserializer<?> cd = ctxt.deserializerInstance(member, cdDef); if (cd != null) { type = type.withContentValueHandler(cd); } TypeDeserializer contentTypeDeser = findPropertyContentTypeDeserializer( ctxt.getConfig(), type, (AnnotatedMember) member); if (contentTypeDeser != null) { type = type.withContentTypeHandler(contentTypeDeser); } } TypeDeserializer valueTypeDeser = findPropertyTypeDeserializer(ctxt.getConfig(), type, (AnnotatedMember) member); if (valueTypeDeser != null) { type = type.withTypeHandler(valueTypeDeser); } // Second part: find actual type-override annotations on member, if any // 18-Jun-2016, tatu: Should we re-do checks for annotations on refined // subtypes as well? Code pre-2.8 did not do this, but if we get bug // reports may need to consider type = intr.refineDeserializationType(ctxt.getConfig(), member, type); return type; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveMemberAndTypeAnnotations File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
resolveMemberAndTypeAnnotations
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public static Cookie deleteCookie(String name, String path) { return new Cookie(name, path, "", 0, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteCookie File: src/gribbit/auth/Cookie.java Repository: lukehutch/gribbit The code follows secure coding practices.
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
deleteCookie
src/gribbit/auth/Cookie.java
620418df247aebda3dd4be1dda10fe229ea505dd
0
Analyze the following code function for security vulnerabilities
@Override @VisibleForTesting void updateSurfacePosition(Transaction t) { if (mSurfaceControl == null) { return; } if ((mWmService.mWindowPlacerLocked.isLayoutDeferred() || isGoneForLayout()) && !mSurfacePlacementNeeded) { // Since this relies on mWindowFrames, changes made while layout is deferred are // likely to be invalid. Similarly, if it's goneForLayout, mWindowFrames may not be // up-to-date and thus can't be relied on. return; } mSurfacePlacementNeeded = false; transformFrameToSurfacePosition(mWindowFrames.mFrame.left, mWindowFrames.mFrame.top, mSurfacePosition); if (mWallpaperScale != 1f) { final Rect bounds = getLastReportedBounds(); Matrix matrix = mTmpMatrix; matrix.setTranslate(mXOffset, mYOffset); matrix.postScale(mWallpaperScale, mWallpaperScale, bounds.exactCenterX(), bounds.exactCenterY()); matrix.getValues(mTmpMatrixArray); mSurfacePosition.offset(Math.round(mTmpMatrixArray[Matrix.MTRANS_X]), Math.round(mTmpMatrixArray[Matrix.MTRANS_Y])); } else { mSurfacePosition.offset(mXOffset, mYOffset); } // Freeze position while we're unrotated, so the surface remains at the position it was // prior to the rotation. if (!mSurfaceAnimator.hasLeash() && mPendingSeamlessRotate == null && !mLastSurfacePosition.equals(mSurfacePosition)) { final boolean frameSizeChanged = mWindowFrames.isFrameSizeChangeReported(); final boolean surfaceInsetsChanged = surfaceInsetsChanging(); final boolean surfaceSizeChanged = frameSizeChanged || surfaceInsetsChanged; mLastSurfacePosition.set(mSurfacePosition.x, mSurfacePosition.y); if (surfaceInsetsChanged) { mLastSurfaceInsets.set(mAttrs.surfaceInsets); } if (surfaceSizeChanged && mWinAnimator.getShown() && !canPlayMoveAnimation() && okToDisplay()) { applyWithNextDraw(mSetSurfacePositionConsumer); } else { mSetSurfacePositionConsumer.accept(t); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSurfacePosition File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
updateSurfacePosition
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override float getSizeCompatScale() { return hasSizeCompatBounds() ? mSizeCompatScale : super.getSizeCompatScale(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSizeCompatScale 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
getSizeCompatScale
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void setBleTurningOff(boolean isBleTurningOff) { mIsBleTurningOff = isBleTurningOff; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBleTurningOff File: src/com/android/bluetooth/btservice/AdapterState.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
setBleTurningOff
src/com/android/bluetooth/btservice/AdapterState.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public String lookupPrefix(String namespaceURI) { return doc.lookupPrefix(namespaceURI); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookupPrefix 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
lookupPrefix
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 onDownloadMmsComplete(int result) { Rlog.e(TAG, "Unexpected onDownloadMmsComplete call with result: " + result); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDownloadMmsComplete File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
onDownloadMmsComplete
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
protected void processDispatch(Command command) throws IOException { MessageDispatch messageDispatch = (MessageDispatch) (command.isMessageDispatch() ? command : null); try { if (!stopping.get()) { if (messageDispatch != null) { broker.preProcessDispatch(messageDispatch); } dispatch(command); } } catch (IOException e) { if (messageDispatch != null) { TransmitCallback sub = messageDispatch.getTransmitCallback(); broker.postProcessDispatch(messageDispatch); if (sub != null) { sub.onFailure(); } messageDispatch = null; throw e; } } finally { if (messageDispatch != null) { TransmitCallback sub = messageDispatch.getTransmitCallback(); broker.postProcessDispatch(messageDispatch); if (sub != null) { sub.onSuccess(); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processDispatch File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
processDispatch
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
@Override public synchronized void requestConnectionState(ConnectionState new_state, final boolean create_account) { Log.d(TAG, "requestConnState: " + mState + " -> " + new_state + (create_account ? " create_account!" : "")); mRequestedState = new_state; if (new_state == mState) return; switch (new_state) { case ONLINE: switch (mState) { case RECONNECT_DELAYED: // TODO: cancel timer case RECONNECT_NETWORK: case DISCONNECTED: case OFFLINE: // update state before starting thread to prevent race conditions updateConnectionState(ConnectionState.CONNECTING); // register ping (connection) timeout handler: 2*PACKET_TIMEOUT(30s) + 3s registerPongTimeout(2*PACKET_TIMEOUT + 3000, "connection"); new Thread() { @Override public void run() { updateConnectingThread(this); try { doConnect(create_account); } catch (IllegalArgumentException e) { // this might happen when DNS resolution in ConnectionConfiguration fails onDisconnected(e); } catch (IllegalStateException e) {//TODO: work around old smack onDisconnected(e); } catch (YaximXMPPException e) { onDisconnected(e); } finally { mAlarmManager.cancel(mPongTimeoutAlarmPendIntent); finishConnectingThread(); } } }.start(); break; case CONNECTING: case LOADING: case DISCONNECTING: // ignore all other cases break; } break; case DISCONNECTED: // spawn thread to do disconnect if (mState == ConnectionState.ONLINE) { // update state before starting thread to prevent race conditions updateConnectionState(ConnectionState.DISCONNECTING); // register ping (connection) timeout handler: PACKET_TIMEOUT(30s) registerPongTimeout(PACKET_TIMEOUT, "forced disconnect"); new Thread() { public void run() { updateConnectingThread(this); mStreamHandler.quickShutdown(); onDisconnected("forced disconnect completed"); finishConnectingThread(); //updateConnectionState(ConnectionState.OFFLINE); } }.start(); } break; case OFFLINE: switch (mState) { case CONNECTING: case LOADING: case ONLINE: // update state before starting thread to prevent race conditions updateConnectionState(ConnectionState.DISCONNECTING); // register ping (connection) timeout handler: PACKET_TIMEOUT(30s) registerPongTimeout(PACKET_TIMEOUT, "manual disconnect"); // spawn thread to do disconnect new Thread() { public void run() { updateConnectingThread(this); mXMPPConnection.shutdown(); mStreamHandler.close(); mAlarmManager.cancel(mPongTimeoutAlarmPendIntent); // we should reset XMPPConnection the next time mConfig.reconnect_required = true; finishConnectingThread(); // reconnect if it was requested in the meantime if (mRequestedState == ConnectionState.ONLINE) requestConnectionState(ConnectionState.ONLINE); } }.start(); break; case DISCONNECTING: break; case DISCONNECTED: case RECONNECT_DELAYED: // TODO: clear timer case RECONNECT_NETWORK: updateConnectionState(ConnectionState.OFFLINE); } break; case RECONNECT_NETWORK: case RECONNECT_DELAYED: switch (mState) { case DISCONNECTED: case RECONNECT_NETWORK: case RECONNECT_DELAYED: updateConnectionState(new_state); break; default: throw new IllegalArgumentException("Can not go from " + mState + " to " + new_state); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestConnectionState File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
requestConnectionState
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public void onFailed(Context context, int error, int errorCode) { if (mAnyPartFailed != null) { mAnyPartFailed.set(true); } // is single part or last part of multipart message boolean isSinglePartOrLastPart = true; if (mUnsentPartCount != null) { isSinglePartOrLastPart = mUnsentPartCount.decrementAndGet() == 0; } if (isSinglePartOrLastPart) { persistOrUpdateMessage(context, Sms.MESSAGE_TYPE_FAILED, errorCode); } if (mSentIntent != null) { try { // Extra information to send with the sent intent Intent fillIn = new Intent(); if (mMessageUri != null) { // Pass this to SMS apps so that they know where it is stored fillIn.putExtra("uri", mMessageUri.toString()); } if (errorCode != 0) { fillIn.putExtra("errorCode", errorCode); } if (mUnsentPartCount != null && isSinglePartOrLastPart) { // Is multipart and last part fillIn.putExtra(SEND_NEXT_MSG_EXTRA, true); } mSentIntent.send(context, error, fillIn); } catch (CanceledException ex) { Rlog.e(TAG, "Failed to send result"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onFailed File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
onFailed
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
static JsonNumber getJsonNumber(long num, int bigIntegerScaleLimit) { return new JsonLongNumber(num, bigIntegerScaleLimit); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJsonNumber File: impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java Repository: eclipse-ee4j/parsson The code follows secure coding practices.
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
getJsonNumber
impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
84764ffbe3d0376da242b27a9a526138d0dfb8e6
0
Analyze the following code function for security vulnerabilities
private Bundle readApplicationRestrictionsLocked(String packageName, int userId) { AtomicFile restrictionsFile = new AtomicFile(new File(Environment.getUserSystemDirectory(userId), packageToRestrictionsFileName(packageName))); return readApplicationRestrictionsLocked(restrictionsFile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readApplicationRestrictionsLocked File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
readApplicationRestrictionsLocked
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
private long doGetLong(String key, Object o) throws JSONException { return o instanceof String ? Long.parseLong(((String)o)) : o instanceof Number ? ((Number)o).longValue() : (long)getDouble(key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doGetLong File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
doGetLong
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
protected List<IssuesWithBLOBs> getIssuesByPlatformIds(List<String> platformIds) { IssuesService issuesService = CommonBeanFactory.getBean(IssuesService.class); return issuesService.getIssuesByPlatformIds(platformIds, projectId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIssuesByPlatformIds File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getIssuesByPlatformIds
test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public static User createFederatedLoginUser(String email, Response response) throws UnauthorizedException { return create(email, FEDERATED_LOGIN_PASSWORD_HASH_PLACEHOLDER, /* validateEmail = */true, response); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createFederatedLoginUser File: src/gribbit/auth/User.java Repository: lukehutch/gribbit The code follows secure coding practices.
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
createFederatedLoginUser
src/gribbit/auth/User.java
620418df247aebda3dd4be1dda10fe229ea505dd
0
Analyze the following code function for security vulnerabilities
private void reportConnectionAttemptStart( WifiConfiguration config, String targetBSSID, int roamType) { int overlapWithLastConnectionMs = mWifiMetrics.startConnectionEvent(mInterfaceName, config, targetBSSID, roamType); if (mDeviceConfigFacade.isOverlappingConnectionBugreportEnabled() && overlapWithLastConnectionMs > mDeviceConfigFacade.getOverlappingConnectionDurationThresholdMs()) { String bugTitle = "Wi-Fi BugReport"; String bugDetail = "Detect abnormal overlapping connection"; mWifiDiagnostics.takeBugReport(bugTitle, bugDetail); } mWifiDiagnostics.reportConnectionEvent(WifiDiagnostics.CONNECTION_EVENT_STARTED, mClientModeManager); if (isPrimary()) { mWrongPasswordNotifier.onNewConnectionAttempt(); } removeMessages(CMD_DIAGS_CONNECT_TIMEOUT); sendMessageDelayed(CMD_DIAGS_CONNECT_TIMEOUT, DIAGS_CONNECT_TIMEOUT_MILLIS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportConnectionAttemptStart 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
reportConnectionAttemptStart
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public Result<?> checkUserIsEffective(SysUser sysUser) { Result<?> result = new Result<Object>(); //情况1:根据用户信息查询,该用户不存在 if (sysUser == null) { result.error500("该用户不存在,请注册"); baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null); return result; } //情况2:根据用户信息查询,该用户已注销 //update-begin---author:王帅 Date:20200601 for:if条件永远为falsebug------------ if (CommonConstant.DEL_FLAG_1.equals(sysUser.getDelFlag())) { //update-end---author:王帅 Date:20200601 for:if条件永远为falsebug------------ baseCommonService.addLog("用户登录失败,用户名:" + sysUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null); result.error500("该用户已注销"); return result; } //情况3:根据用户信息查询,该用户已冻结 if (CommonConstant.USER_FREEZE.equals(sysUser.getStatus())) { baseCommonService.addLog("用户登录失败,用户名:" + sysUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null); result.error500("该用户已冻结"); return result; } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkUserIsEffective File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
checkUserIsEffective
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0