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
@Override public void handle(final RoutingContext ctx) { if (currentManagedContext.isActive()) { handleWithIdentity(ctx); } else { currentManagedContext.activate(); ctx.response() .endHandler(currentManagedContextTerminationHandler) .exceptionHandler(currentManagedContextTerminationHandler) .closeHandler(currentManagedContextTerminationHandler); try { handleWithIdentity(ctx); } catch (Throwable t) { currentManagedContext.terminate(); throw t; } } }
Vulnerability Classification: - CWE: CWE-444 - CVE: CVE-2022-2466 - Severity: CRITICAL - CVSS Score: 9.8 Description: GraphQL to terminate the request even if it was active Signed-off-by: Phillip Kruger <phillip.kruger@gmail.com> Function: handle File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java Repository: quarkusio/quarkus Fixed Code: @Override public void handle(final RoutingContext ctx) { ctx.response() .endHandler(currentManagedContextTerminationHandler) .exceptionHandler(currentManagedContextTerminationHandler) .closeHandler(currentManagedContextTerminationHandler); if (!currentManagedContext.isActive()) { currentManagedContext.activate(); } try { handleWithIdentity(ctx); } catch (Throwable t) { currentManagedContext.terminate(); throw t; } }
[ "CWE-444" ]
CVE-2022-2466
CRITICAL
9.8
quarkusio/quarkus
handle
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java
08e5c3106ce4bfb18b24a38514eeba6464668b07
1
Analyze the following code function for security vulnerabilities
@Override boolean isVisible() { // If the activity isn't hidden then it is considered visible and there is no need to check // its children windows to see if they are visible. return mVisible; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isVisible 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
isVisible
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
ProcessRecord getTopApp() { final WindowProcessController wpc = mAtmInternal != null ? mAtmInternal.getTopApp() : null; final ProcessRecord r = wpc != null ? (ProcessRecord) wpc.mOwner : null; String pkg; int uid; if (r != null) { pkg = r.processName; uid = r.info.uid; } else { pkg = null; uid = -1; } // Has the UID or resumed package name changed? synchronized (mCurResumedAppLock) { if (uid != mCurResumedUid || (pkg != mCurResumedPackage && (pkg == null || !pkg.equals(mCurResumedPackage)))) { final long identity = Binder.clearCallingIdentity(); try { if (mCurResumedPackage != null) { mBatteryStatsService.noteEvent(BatteryStats.HistoryItem.EVENT_TOP_FINISH, mCurResumedPackage, mCurResumedUid); } mCurResumedPackage = pkg; mCurResumedUid = uid; if (mCurResumedPackage != null) { mBatteryStatsService.noteEvent(BatteryStats.HistoryItem.EVENT_TOP_START, mCurResumedPackage, mCurResumedUid); } } finally { Binder.restoreCallingIdentity(identity); } } } return r; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTopApp 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
getTopApp
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void setFavtags(List<String> favtags) { this.favtags = favtags; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFavtags 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
setFavtags
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override @Transactional( readOnly = true ) public List<Program> getUserPrograms( User user ) { if ( user == null || user.isSuper() ) { return getAllPrograms(); } return programStore.getDataReadAll( user ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserPrograms File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getUserPrograms
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
public boolean streamWasResumed() { return smResumedSyncPoint.wasSuccessful(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: streamWasResumed File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
streamWasResumed
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public URI createUri(Object resourceUri, Map<String, Object[]> queryParams, Object... elements) { if (resourceUri instanceof URI) { return (URI) resourceUri; } // Create URI builder UriBuilder builder = getUriBuilder(resourceUri, queryParams); // Build URI URI uri; if (elements.length > 0 && elements[0] == ELEMENTS_ENCODED) { uri = builder.buildFromEncoded(Arrays.copyOfRange(elements, 1, elements.length)); } else { uri = builder.build(elements); } return uri; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createUri File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
createUri
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public @Nullable UserHandle createAndManageUser(@NonNull ComponentName admin, @NonNull String name, @NonNull ComponentName profileOwner, @Nullable PersistableBundle adminExtras, @CreateAndManageUserFlags int flags) { throwIfParentInstance("createAndManageUser"); try { return mService.createAndManageUser(admin, name, profileOwner, adminExtras, flags); } catch (ServiceSpecificException e) { throw new UserOperationException(e.getMessage(), e.errorCode); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAndManageUser 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
createAndManageUser
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
void dumpBroadcastStatsCheckinLocked(FileDescriptor fd, PrintWriter pw, String[] args, int opti, boolean fullCheckin, String dumpPackage) { if (mCurBroadcastStats == null) { return; } if (mLastBroadcastStats != null) { mLastBroadcastStats.dumpCheckinStats(pw, dumpPackage); if (fullCheckin) { mLastBroadcastStats = null; return; } } mCurBroadcastStats.dumpCheckinStats(pw, dumpPackage); if (fullCheckin) { mCurBroadcastStats = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpBroadcastStatsCheckinLocked 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
dumpBroadcastStatsCheckinLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public void setOverrideApnsEnabled(@NonNull ComponentName who, boolean enabled) { if (!mHasFeature || !mHasTelephonyFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_OVERRIDE_APNS_ENABLED); setOverrideApnsEnabledUnchecked(enabled); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOverrideApnsEnabled 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
setOverrideApnsEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public CharSequence getDeviceOwnerOrganizationName() { if (!mHasFeature) { return null; } final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller) || canManageUsers(caller) || isFinancedDeviceOwner(caller)); synchronized (getLockObject()) { final ActiveAdmin deviceOwnerAdmin = getDeviceOwnerAdminLocked(); return deviceOwnerAdmin == null ? null : deviceOwnerAdmin.organizationName; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeviceOwnerOrganizationName 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
getDeviceOwnerOrganizationName
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static <T> T convertRequestBody(ServletRequest request, Class<T> clazz) { try { String jsonStr = IOUtil.getStringInputStream(request.getInputStream()); return new Gson().fromJson(jsonStr, clazz); } catch (Exception e) { LOGGER.info("", e); throw new RuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertRequestBody File: common/src/main/java/com/zrlog/util/ZrLogUtil.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
convertRequestBody
common/src/main/java/com/zrlog/util/ZrLogUtil.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
protected String generateAlias(Instance instance) { return instance.getRegistration().getName() + "_" + instance.getId(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateAlias File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
generateAlias
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
public static String getNodeText(Node node, Pattern... nodePath) { List<Node> nodes = getNodes(node, nodePath); if (nodes != null && nodes.size() > 0) { return nodes.get(0).getTextContent(); } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNodeText 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
getNodeText
src/edu/stanford/nlp/util/XMLUtils.java
5d83f1e8482ca304db8be726cad89554c88f136a
0
Analyze the following code function for security vulnerabilities
public Configuration getAdminConfiguration() { return adminConfiguration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAdminConfiguration File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
getAdminConfiguration
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
@Override public void cancelSyncAsUser(Account account, String authority, ComponentName cname, int userId) { if (authority != null && authority.length() == 0) { throw new IllegalArgumentException("Authority must be non-empty"); } enforceCrossUserPermission(userId, "no permission to modify the sync settings for user " + userId); // This makes it so that future permission checks will be in the context of this // process rather than the caller's process. We will restore this before returning. long identityToken = clearCallingIdentity(); try { SyncManager syncManager = getSyncManager(); if (syncManager != null) { SyncStorageEngine.EndPoint info; if (cname == null) { info = new SyncStorageEngine.EndPoint(account, authority, userId); } else { info = new SyncStorageEngine.EndPoint(cname, userId); } syncManager.clearScheduledSyncOperations(info); syncManager.cancelActiveSync(info, null /* all syncs for this adapter */); } } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelSyncAsUser File: services/core/java/com/android/server/content/ContentService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2426
MEDIUM
4.3
android
cancelSyncAsUser
services/core/java/com/android/server/content/ContentService.java
63363af721650e426db5b0bdfb8b2d4fe36abdb0
0
Analyze the following code function for security vulnerabilities
public boolean select(Object itemId) throws IllegalArgumentException, IllegalStateException { if (selectionModel instanceof SelectionModel.Single) { return ((SelectionModel.Single) selectionModel).select(itemId); } else if (selectionModel instanceof SelectionModel.Multi) { return ((SelectionModel.Multi) selectionModel).select(itemId); } else if (selectionModel instanceof SelectionModel.None) { throw new IllegalStateException("Cannot select row '" + itemId + "': Grid selection is disabled " + "(the current selection model is " + selectionModel.getClass().getName() + ")."); } else { throw new IllegalStateException("Cannot select row '" + itemId + "': Grid selection model does not implement " + SelectionModel.Single.class.getName() + " or " + SelectionModel.Multi.class.getName() + "(the current model is " + selectionModel.getClass().getName() + ")."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: select 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
select
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Editable(order=20, description="Optionally specify node selector of the job pods") public List<NodeSelectorEntry> getNodeSelector() { return nodeSelector; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNodeSelector File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
getNodeSelector
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
0
Analyze the following code function for security vulnerabilities
private boolean mutateGlobalSetting(String name, String value, int requestingUserId, int operation, boolean forceNotify) { // Make sure the caller can change the settings - treated as secure. enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS); // Resolve the userId on whose behalf the call is made. final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId); // If this is a setting that is currently restricted for this user, do not allow // unrestricting changes. if (isGlobalOrSecureSettingRestrictedForUser(name, callingUserId, value)) { return false; } // Perform the mutation. synchronized (mLock) { switch (operation) { case MUTATION_OPERATION_INSERT: { return mSettingsRegistry .insertSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name, value, getCallingPackage(), forceNotify); } case MUTATION_OPERATION_DELETE: { return mSettingsRegistry.deleteSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name, forceNotify); } case MUTATION_OPERATION_UPDATE: { return mSettingsRegistry .updateSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name, value, getCallingPackage(), forceNotify); } } } return false; }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3887 - Severity: MEDIUM - CVSS Score: 6.8 Description: Disallow shell to mutate always-on vpn when DISALLOW_CONFIG_VPN user restriction is set Fix: 29899712 Change-Id: I38cc9d0e584c3f2674c9ff1d91f77a11479d8943 (cherry picked from commit 9c7b706cf4332b4aeea39c166abca04b56685280) Function: mutateGlobalSetting File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android Fixed Code: private boolean mutateGlobalSetting(String name, String value, int requestingUserId, int operation, boolean forceNotify) { // Make sure the caller can change the settings - treated as secure. enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS); // Resolve the userId on whose behalf the call is made. final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId); // If this is a setting that is currently restricted for this user, do not allow // unrestricting changes. if (isGlobalOrSecureSettingRestrictedForUser(name, callingUserId, value, Binder.getCallingUid())) { return false; } // Perform the mutation. synchronized (mLock) { switch (operation) { case MUTATION_OPERATION_INSERT: { return mSettingsRegistry .insertSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name, value, getCallingPackage(), forceNotify); } case MUTATION_OPERATION_DELETE: { return mSettingsRegistry.deleteSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name, forceNotify); } case MUTATION_OPERATION_UPDATE: { return mSettingsRegistry .updateSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name, value, getCallingPackage(), forceNotify); } } } return false; }
[ "CWE-264" ]
CVE-2016-3887
MEDIUM
6.8
android
mutateGlobalSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
335702d106797bce8a88044783fa1fc1d5f751d0
1
Analyze the following code function for security vulnerabilities
void removeSleepTimeouts() { mSleepTimeout = false; mHandler.removeMessages(SLEEP_TIMEOUT_MSG); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeSleepTimeouts File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
removeSleepTimeouts
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public static HtmlForm getHtmlFormFromResourceXml(FormService formService, HtmlFormEntryService htmlFormEntryService, String xml) { try { Document doc = HtmlFormEntryUtil.stringToDocument(xml); Node htmlFormNode = HtmlFormEntryUtil.findChild(doc, "htmlform"); String formUuid = getAttributeValue(htmlFormNode, "formUuid"); if (formUuid == null) { throw new IllegalArgumentException("formUuid is required"); } Form form = formService.getFormByUuid(formUuid); boolean needToSaveForm = false; if (form == null) { form = new Form(); form.setUuid(formUuid); needToSaveForm = true; } String formName = getAttributeValue(htmlFormNode, "formName"); if (!OpenmrsUtil.nullSafeEquals(form.getName(), formName)) { form.setName(formName); needToSaveForm = true; } String formDescription = getAttributeValue(htmlFormNode, "formDescription"); if (!OpenmrsUtil.nullSafeEquals(form.getDescription(), formDescription)) { form.setDescription(formDescription); needToSaveForm = true; } String formVersion = getAttributeValue(htmlFormNode, "formVersion"); if (!OpenmrsUtil.nullSafeEquals(form.getVersion(), formVersion)) { form.setVersion(formVersion); needToSaveForm = true; } String formEncounterType = getAttributeValue(htmlFormNode, "formEncounterType"); EncounterType encounterType = formEncounterType == null ? null : HtmlFormEntryUtil.getEncounterType(formEncounterType); if (encounterType != null && !OpenmrsUtil.nullSafeEquals(form.getEncounterType(), encounterType)) { form.setEncounterType(encounterType); needToSaveForm = true; } if (needToSaveForm) { formService.saveForm(form); } HtmlForm htmlForm = htmlFormEntryService.getHtmlFormByForm(form); boolean needToSaveHtmlForm = false; if (htmlForm == null) { htmlForm = new HtmlForm(); htmlForm.setForm(form); needToSaveHtmlForm = true; } // if there is a html form uuid specified, make sure the htmlform uuid is set to that value String htmlformUuid = getAttributeValue(htmlFormNode, "htmlformUuid"); if (StringUtils.isNotBlank(htmlformUuid) && !OpenmrsUtil.nullSafeEquals(htmlformUuid, htmlForm.getUuid())) { htmlForm.setUuid(htmlformUuid); needToSaveHtmlForm = true; } if (!OpenmrsUtil.nullSafeEquals(trim(htmlForm.getXmlData()), trim(xml))) { // trim because if the file ends with a newline the db will have trimmed it htmlForm.setXmlData(xml); needToSaveHtmlForm = true; } if (needToSaveHtmlForm) { htmlFormEntryService.saveHtmlForm(htmlForm); } return htmlForm; } catch (Exception e) { throw new IllegalArgumentException("Failed to parse XML and build Form and HtmlForm", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHtmlFormFromResourceXml File: api/src/main/java/org/openmrs/module/htmlformentryui/HtmlFormUtil.java Repository: openmrs/openmrs-module-htmlformentryui The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-4284
MEDIUM
6.1
openmrs/openmrs-module-htmlformentryui
getHtmlFormFromResourceXml
api/src/main/java/org/openmrs/module/htmlformentryui/HtmlFormUtil.java
811990972ea07649ae33c4b56c61c3b520895f07
0
Analyze the following code function for security vulnerabilities
public String getDisplayName() { return Messages.HudsonPrivateSecurityRealm_DisplayName(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisplayName File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-200" ]
CVE-2014-2064
MEDIUM
5
jenkinsci/jenkins
getDisplayName
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
fbf96734470caba9364f04e0b77b0bae7293a1ec
0
Analyze the following code function for security vulnerabilities
public BigInteger calculateAgreement( CipherParameters pubKey) { DHPublicKeyParameters pub = (DHPublicKeyParameters)pubKey; if (!pub.getParameters().equals(dhParams)) { throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters."); } return pub.getY().modPow(key.getX(), dhParams.getP()); }
Vulnerability Classification: - CWE: CWE-320 - CVE: CVE-2016-1000346 - Severity: MEDIUM - CVSS Score: 4.3 Description: Added TLS validation check for DH keys Added further agreement result checks Function: calculateAgreement File: core/src/main/java/org/bouncycastle/crypto/agreement/DHBasicAgreement.java Repository: bcgit/bc-java Fixed Code: public BigInteger calculateAgreement( CipherParameters pubKey) { DHPublicKeyParameters pub = (DHPublicKeyParameters)pubKey; if (!pub.getParameters().equals(dhParams)) { throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters."); } BigInteger result = pub.getY().modPow(key.getX(), dhParams.getP()); if (result.compareTo(ONE) == 0) { throw new IllegalStateException("Shared key can't be 1"); } return result; }
[ "CWE-320" ]
CVE-2016-1000346
MEDIUM
4.3
bcgit/bc-java
calculateAgreement
core/src/main/java/org/bouncycastle/crypto/agreement/DHBasicAgreement.java
1127131c89021612c6eefa26dbe5714c194e7495
1
Analyze the following code function for security vulnerabilities
public boolean isEnabledGroupProfile(int profileId) { final int parentId = UserHandle.getCallingUserId(); return isParentOrProfile(parentId, profileId) && isProfileEnabled(profileId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEnabledGroupProfile File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
isEnabledGroupProfile
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public void setActivityController(IActivityController controller, boolean imAMonkey) { mAmInternal.enforceCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER, "setActivityController()"); synchronized (mGlobalLock) { mController = controller; mControllerIsAMonkey = imAMonkey; Watchdog.getInstance().setActivityController(controller); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActivityController 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
setActivityController
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private String getCacheKeyForCurrentProject(String systemId) { // check the project boolean project = (m_cms != null) ? m_cms.getRequestContext().getCurrentProject().isOnlineProject() : false; // remove opencms:// prefix if (systemId.startsWith(OPENCMS_SCHEME)) { systemId = systemId.substring(OPENCMS_SCHEME.length() - 1); } return getCacheKey(systemId, project); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCacheKeyForCurrentProject File: src/org/opencms/xml/CmsXmlEntityResolver.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3312
MEDIUM
4
alkacon/opencms-core
getCacheKeyForCurrentProject
src/org/opencms/xml/CmsXmlEntityResolver.java
92e035423aa6967822d343e54392d4291648c0ee
0
Analyze the following code function for security vulnerabilities
public boolean checkScenarioEnv(ApiScenarioWithBLOBs request) { return apiScenarioEnvService.checkScenarioEnv(request, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkScenarioEnv File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
checkScenarioEnv
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
@Override public ServerBuilder decoratorUnder( String prefix, DecoratingHttpServiceFunction decoratingHttpServiceFunction) { virtualHostTemplate.decoratorUnder(prefix, decoratingHttpServiceFunction); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decoratorUnder File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
decoratorUnder
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
private File extractArchive(File tempDir, File exportFile) throws IOException, ImportExtractionException { log.info("Extracting archive to: " + tempDir.getAbsolutePath()); byte[] buf = new byte[1024]; ZipInputStream zipinputstream = new ZipInputStream(new FileInputStream(exportFile)); ZipEntry zipentry = zipinputstream.getNextEntry(); if (zipentry == null) { throw new ImportExtractionException(i18n.tr("The archive {0} is not " + "a properly compressed file or is empty", exportFile.getName())); } while (zipentry != null) { //for each entry to be extracted String entryName = zipentry.getName(); if (log.isDebugEnabled()) { log.debug("entryname " + entryName); } FileOutputStream fileoutputstream; File newFile = new File(entryName); String directory = newFile.getParent(); if (directory != null) { new File(tempDir, directory).mkdirs(); } fileoutputstream = new FileOutputStream(new File(tempDir, entryName)); int n; while ((n = zipinputstream.read(buf, 0, 1024)) > -1) { fileoutputstream.write(buf, 0, n); } fileoutputstream.close(); zipinputstream.closeEntry(); zipentry = zipinputstream.getNextEntry(); } zipinputstream.close(); return new File(tempDir.getAbsolutePath(), "export"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractArchive File: src/main/java/org/candlepin/sync/Importer.java Repository: candlepin The code follows secure coding practices.
[ "CWE-264" ]
CVE-2012-6119
LOW
2.1
candlepin
extractArchive
src/main/java/org/candlepin/sync/Importer.java
f4d93230e58b969c506b4c9778e04482a059b08c
0
Analyze the following code function for security vulnerabilities
public static void run(final Class<? extends Jooby> app, final String... args) { run(() -> Try.apply(() -> app.newInstance()).get(), args); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
run
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
boolean hasPermission(String permission) { return getContext().checkCallingOrSelfPermission(permission) == PackageManager.PERMISSION_GRANTED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasPermission 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
hasPermission
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public org.xwiki.rest.model.jaxb.Object object(EntityReference parentReference, String className) { return object(parentReference, className, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: object File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
object
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public static String detectAlias(String query) { Matcher matcher = ALIAS_MATCH.matcher(query); return matcher.find() ? matcher.group(2) : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: detectAlias File: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
detectAlias
src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
@NonNull @TestApi public static String operationSafetyReasonToString(@OperationSafetyReason int reason) { return DebugUtils.constantToString(DevicePolicyManager.class, PREFIX_OPERATION_SAFETY_REASON, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: operationSafetyReasonToString 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
operationSafetyReasonToString
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private boolean removeNetworkInternal(WifiConfiguration config, int uid) { if (mVerboseLoggingEnabled) { Log.v(TAG, "Removing network " + config.getPrintableSsid()); } // Remove any associated enterprise keys for saved enterprise networks. Passpoint network // will remove the enterprise keys when provider is uninstalled. Suggestion enterprise // networks will remove the enterprise keys when suggestion is removed. if (!config.fromWifiNetworkSuggestion && !config.isPasspoint() && config.isEnterprise()) { mWifiKeyStore.removeKeys(config.enterpriseConfig, false); } // Do not remove the user choice when passpoint or suggestion networks are removed from // WifiConfigManager. Will remove that when profile is deleted from PassointManager or // WifiNetworkSuggestionsManager. if (!config.isPasspoint() && !config.fromWifiNetworkSuggestion) { removeConnectChoiceFromAllNetworks(config.getProfileKey()); } mConfiguredNetworks.remove(config.networkId); mScanDetailCaches.remove(config.networkId); // Stage the backup of the SettingsProvider package which backs this up. mBackupManagerProxy.notifyDataChanged(); mWifiBlocklistMonitor.handleNetworkRemoved(config.SSID); localLog("removeNetworkInternal: removed config." + " netId=" + config.networkId + " configKey=" + config.getProfileKey() + " uid=" + Integer.toString(uid) + " name=" + mContext.getPackageManager().getNameForUid(uid)); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeNetworkInternal File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
removeNetworkInternal
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private int runSetHiddenSetting(boolean state) { int userId = 0; String option = nextOption(); if (option != null && option.equals("--user")) { String optionData = nextOptionData(); if (optionData == null || !isNumber(optionData)) { System.err.println("Error: no USER_ID specified"); showUsage(); return 1; } else { userId = Integer.parseInt(optionData); } } String pkg = nextArg(); if (pkg == null) { System.err.println("Error: no package or component specified"); showUsage(); return 1; } try { mPm.setApplicationHiddenSettingAsUser(pkg, state, userId); System.out.println("Package " + pkg + " new hidden state: " + mPm.getApplicationHiddenSettingAsUser(pkg, userId)); return 0; } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(PM_NOT_RUNNING_ERR); return 1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runSetHiddenSetting File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runSetHiddenSetting
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
@Override public boolean needsFalsingProtection() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: needsFalsingProtection File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
needsFalsingProtection
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
public static void syncDeinitialize() { if (deinitializingEdt){ return; } deinitializingEdt = true; // This will get unset in {@link #deinitialize()} deinitializing = true; Display.getInstance().callSerially(new Runnable() { @Override public void run() { Display.deinitialize(); deinitializingEdt = false; } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: syncDeinitialize 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
syncDeinitialize
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public <V extends Future<V>> V submit(IQueueChunk chunk) { if (lastChunk == chunk) { lastPair = Long.MAX_VALUE; lastChunk = null; } final long index = MathMan.pairInt(chunk.getX(), chunk.getZ()); getChunkLock.lock(); chunks.remove(index, chunk); getChunkLock.unlock(); V future = submitUnchecked(chunk); submissions.add(future); return future; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: submit File: worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
submit
worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
void tearDownPipes() { if (mPipes != null) { try { mPipes[0].close(); mPipes[0] = null; mPipes[1].close(); mPipes[1] = null; } catch (IOException e) { Slog.w(TAG, "Couldn't close agent pipes", e); } mPipes = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tearDownPipes File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
tearDownPipes
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public Certificate getCertificate() { return certificate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertificate File: tls/src/main/java/org/bouncycastle/tls/crypto/impl/jcajce/JceDefaultTlsCredentialedDecryptor.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-203" ]
CVE-2017-13098
MEDIUM
4.3
bcgit/bc-java
getCertificate
tls/src/main/java/org/bouncycastle/tls/crypto/impl/jcajce/JceDefaultTlsCredentialedDecryptor.java
a00b684465b38d722ca9a3543b8af8568e6bad5c
0
Analyze the following code function for security vulnerabilities
public AppRow loadAppRow(Context context, PackageManager pm, ApplicationInfo app) { final AppRow row = new AppRow(); row.pkg = app.packageName; row.uid = app.uid; try { row.label = app.loadLabel(pm); } catch (Throwable t) { Log.e(TAG, "Error loading application label for " + row.pkg, t); row.label = row.pkg; } row.icon = IconDrawableFactory.newInstance(context).getBadgedIcon(app); row.banned = getNotificationsBanned(row.pkg, row.uid); row.showBadge = canShowBadge(row.pkg, row.uid); row.bubblePreference = getBubblePreference(row.pkg, row.uid); row.userId = UserHandle.getUserId(row.uid); row.blockedChannelCount = getBlockedChannelCount(row.pkg, row.uid); row.channelCount = getChannelCount(row.pkg, row.uid); recordAggregatedUsageEvents(context, row); return row; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadAppRow 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
loadAppRow
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
private void closeSession(VaadinSession vaadinSession, WrappedSession session) { if (vaadinSession == null) { return; } if (session != null) { removeSession(session); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeSession File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
closeSession
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
public SortedSet<String> availablePrefixes() { SelectMode prefixMode = ModeFactory.getMode("util_queries", "available_prefixes"); // no params for this query DataResult<Map<String, Object>> dr = prefixMode.execute(new HashMap()); SortedSet<String> ret = new TreeSet<String>(); Iterator<Map<String, Object>> i = dr.iterator(); while (i.hasNext()) { Map<String, Object> row = i.next(); ret.add((String) row.get("prefix")); } return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: availablePrefixes File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java Repository: spacewalkproject/spacewalk The code follows secure coding practices.
[ "CWE-79" ]
CVE-2016-3079
MEDIUM
4.3
spacewalkproject/spacewalk
availablePrefixes
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
7b9ff9ad
0
Analyze the following code function for security vulnerabilities
private LookupResult resolveIPv4AddressForHostname(Object key) { final List<ADnsAnswer> aDnsAnswers; try { aDnsAnswers = dnsClient.resolveIPv4AddressForHostname(key.toString(), false); } catch (UnknownHostException e) { return LookupResult.empty(); // UnknownHostException is a valid case when the DNS record does not exist. Do not log an error. } catch (Exception e) { LOG.error("Could not resolve [{}] records for hostname [{}]. Cause [{}]", A_RECORD_LABEL, key, ExceptionUtils.getRootCauseOrMessage(e)); errorCounter.inc(); return getEmptyResult(); } if (CollectionUtils.isNotEmpty(aDnsAnswers)) { return buildLookupResult(aDnsAnswers); } LOG.debug("Could not resolve [{}] records for hostname [{}].", A_RECORD_LABEL, key); return getEmptyResult(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveIPv4AddressForHostname File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
resolveIPv4AddressForHostname
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element pdElement = toDOM(document); document.appendChild(pdElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: toXML File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyDefault.java Repository: dogtagpki/pki Fixed Code: public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element pdElement = toDOM(document); document.appendChild(pdElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toXML
base/common/src/main/java/com/netscape/certsrv/profile/PolicyDefault.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
@JsonProperty("IssuedOn") public Date getIssuedOn() { return issuedOn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIssuedOn File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getIssuedOn
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public final int startActivity(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions) { return startActivityAsUser(caller, callingPackage, intent, resolvedType, resultTo, resultWho, requestCode, startFlags, profilerInfo, bOptions, UserHandle.getCallingUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivity 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
startActivity
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected void handleAcquired(long deviceId, int acquiredInfo) { ClientMonitor client = mCurrentClient; if (client != null && client.onAcquired(acquiredInfo)) { removeClient(client); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleAcquired 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
handleAcquired
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
boolean getCheckedForSetup() { return mCheckedForSetup; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCheckedForSetup 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
getCheckedForSetup
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected NameValidator<K> nameValidator() { return nameValidator; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nameValidator File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
nameValidator
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override public synchronized StaticHandler setEnableFSTuning(boolean enableFSTuning) { this.tuning = enableFSTuning; if (!tuning) { resetTuning(); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEnableFSTuning File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
setEnableFSTuning
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
private static native ContentViewCore nativeFromWebContentsAndroid(WebContents webContents);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeFromWebContentsAndroid File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
nativeFromWebContentsAndroid
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
private static void parseExpression(Lexer lexer) { for (;;) { // ( expression ) if (lexer.currentToken() == Lexer.TOKEN_OPEN_PAREN) { lexer.advance(); parseExpression(lexer); if (lexer.currentToken() != Lexer.TOKEN_CLOSE_PAREN) { throw new IllegalArgumentException("syntax error, unmatched parenthese"); } lexer.advance(); } else { // statement parseStatement(lexer); } if (lexer.currentToken() != Lexer.TOKEN_AND_OR) { break; } lexer.advance(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseExpression 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
parseExpression
src/com/android/providers/downloads/Helpers.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
public Icon getSmallIcon() { return mSmallIcon; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSmallIcon File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getSmallIcon
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public boolean isCaCertApproved(String alias, int userHandle) { if (mService != null) { try { return mService.isCaCertApproved(alias, userHandle); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCaCertApproved 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
isCaCertApproved
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void setBrowserURL(PeerComponent browserPeer, String url, Map<String, String> headers) { if (url.startsWith("jar:")) { url = url.substring(6); if(url.indexOf("/") != 0) { url = "/"+url; } url = "file:///android_asset"+url; } AndroidImplementation.AndroidBrowserComponent bc = (AndroidImplementation.AndroidBrowserComponent) browserPeer; if(bc.parent.fireBrowserNavigationCallbacks(url)) { bc.setURL(url, headers); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBrowserURL 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
setBrowserURL
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public int read(byte[] b) throws IOException { return read(b, 0, b.length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: read File: src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java Repository: srikanth-lingala/zip4j The code follows secure coding practices.
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
read
src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
0
Analyze the following code function for security vulnerabilities
public boolean hasSpaces() { return !(getSpaces().size() <= 1 && getSpaces().contains(Post.DEFAULT_SPACE)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasSpaces 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
hasSpaces
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public void onPostDhcpAction() { sendMessage(CMD_POST_DHCP_ACTION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPostDhcpAction 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
onPostDhcpAction
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public static String getNodeAttribute(Node node, String attributeName, String defaultVal) { String ret = getNodeAttributes(node).get(attributeName); return (ret == null ? defaultVal : ret); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNodeAttribute File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
getNodeAttribute
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
private static String getJarDigestAttributeName( String jcaDigestAlgorithm, String attrNameSuffix) { if ("SHA-1".equalsIgnoreCase(jcaDigestAlgorithm)) { return "SHA1" + attrNameSuffix; } else { return jcaDigestAlgorithm + attrNameSuffix; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJarDigestAttributeName File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getJarDigestAttributeName
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
public String getWiki() { return this.doc.getDocumentReference().getWikiReference().getName(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWiki File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getWiki
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
private boolean wouldBeVisibleRequestedIfPolicyIgnored() { final WindowState parent = getParentWindow(); final boolean isParentHiddenRequested = parent != null && !parent.isVisibleRequested(); if (isParentHiddenRequested || mAnimatingExit || mDestroying) { return false; } final boolean isWallpaper = mToken.asWallpaperToken() != null; return !isWallpaper || mToken.isVisibleRequested(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wouldBeVisibleRequestedIfPolicyIgnored 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
wouldBeVisibleRequestedIfPolicyIgnored
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public String getNamespaceAndName() { if(Strings.isNullOrEmpty(namespace)) { return name; } return namespace + "-" + name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNamespaceAndName File: varexport/src/main/java/com/indeed/util/varexport/Variable.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
getNamespaceAndName
varexport/src/main/java/com/indeed/util/varexport/Variable.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
private boolean hasNoShortcut() { if (!isAppSearchEnabled()) { return getShortcutCount() == 0; } final boolean[] hasAnyShortcut = new boolean[1]; forEachShortcutStopWhen(si -> { hasAnyShortcut[0] = true; return true; }); return !hasAnyShortcut[0]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasNoShortcut File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
hasNoShortcut
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
public void updateClob(String columnName, @Nullable Reader reader) throws SQLException { updateClob(findColumn(columnName), reader); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateClob 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
updateClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public int size() { // total number of pending broadcast entries across all userIds int num = 0; for (int i = 0; i< mUidMap.size(); i++) { num += mUidMap.valueAt(i).size(); } return num; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: size 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
size
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ProfileOutput other = (ProfileOutput) obj; if (attrs == null) { if (other.attrs != null) return false; } else if (!attrs.equals(other.attrs)) return false; if (classId == null) { if (other.classId != null) return false; } else if (!classId.equals(other.classId)) return false; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (text == null) { if (other.text != null) return false; } else if (!text.equals(other.text)) return false; return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
equals
base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public XWikiPluginManager getPluginManager() { return this.pluginManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPluginManager 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
getPluginManager
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public void updatePermissionFlags(String name, String packageName, int flagMask, int flagValues, int userId) { if (!sUserManager.exists(userId)) { return; } enforceGrantRevokeRuntimePermissionPermissions("updatePermissionFlags"); enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "updatePermissionFlags"); // Only the system can change these flags and nothing else. if (getCallingUid() != Process.SYSTEM_UID) { flagMask &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED; flagValues &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED; flagMask &= ~PackageManager.FLAG_PERMISSION_GRANTED_BY_DEFAULT; flagValues &= ~PackageManager.FLAG_PERMISSION_GRANTED_BY_DEFAULT; } synchronized (mPackages) { final PackageParser.Package pkg = mPackages.get(packageName); if (pkg == null) { throw new IllegalArgumentException("Unknown package: " + packageName); } final BasePermission bp = mSettings.mPermissions.get(name); if (bp == null) { throw new IllegalArgumentException("Unknown permission: " + name); } SettingBase sb = (SettingBase) pkg.mExtras; if (sb == null) { throw new IllegalArgumentException("Unknown package: " + packageName); } PermissionsState permissionsState = sb.getPermissionsState(); // Only the package manager can change flags for system component permissions. final int flags = permissionsState.getPermissionFlags(bp.name, userId); if ((flags & PackageManager.FLAG_PERMISSION_SYSTEM_FIXED) != 0) { return; } boolean hadState = permissionsState.getRuntimePermissionState(name, userId) != null; if (permissionsState.updatePermissionFlags(bp, userId, flagMask, flagValues)) { // Install and runtime permissions are stored in different places, // so figure out what permission changed and persist the change. if (permissionsState.getInstallPermissionState(name) != null) { scheduleWriteSettingsLocked(); } else if (permissionsState.getRuntimePermissionState(name, userId) != null || hadState) { mSettings.writeRuntimePermissionsForUserLPr(userId, false); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePermissionFlags 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
updatePermissionFlags
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public static List<Descriptor<ViewsTabBar>> getViewsTabBarDescriptors() { return ViewsTabBar.all(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getViewsTabBarDescriptors File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
getViewsTabBarDescriptors
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
UndertowSession getSession() { return session; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSession File: websockets-jsr/src/main/java/io/undertow/websockets/jsr/FrameHandler.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-3690
HIGH
7.5
undertow-io/undertow
getSession
websockets-jsr/src/main/java/io/undertow/websockets/jsr/FrameHandler.java
c7e84a0b7efced38506d7d1dfea5902366973877
0
Analyze the following code function for security vulnerabilities
public XWikiExecutor getCurrentExecutor() { return this.executors != null && this.executors.size() > this.currentExecutorIndex ? this.executors.get(this.currentExecutorIndex) : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentExecutor File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getCurrentExecutor
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public boolean getCrossProfileCallerIdDisabledForUser(int userId) { Preconditions.checkArgumentNonnegative(userId, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(hasCrossUsersPermission(caller, userId)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerAdminLocked(userId); return (admin != null) ? admin.disableCallerId : false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCrossProfileCallerIdDisabledForUser 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
getCrossProfileCallerIdDisabledForUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public ExecutionRegistration addBeforeClientResponseEntry( BeforeClientResponseEntry entry) { assert entry != null; if (beforeClientResponseEntries == null) { beforeClientResponseEntries = new ArrayList<>(); } // Effectively final local variable for the lambda List<BeforeClientResponseEntry> localEntries = beforeClientResponseEntries; localEntries.add(entry); return () -> localEntries.remove(entry); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBeforeClientResponseEntry File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
addBeforeClientResponseEntry
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
void applyUpdateVrModeLocked(ActivityRecord r) { // VR apps are expected to run in a main display. If an app is turning on VR for // itself, but isn't on the main display, then move it there before enabling VR Mode. if (r.requestedVrComponent != null && r.getDisplayId() != DEFAULT_DISPLAY) { Slog.i(TAG, "Moving " + r.shortComponentName + " from display " + r.getDisplayId() + " to main display for VR"); mRootWindowContainer.moveRootTaskToDisplay( r.getRootTaskId(), DEFAULT_DISPLAY, true /* toTop */); } mH.post(() -> { if (!mVrController.onVrModeChanged(r)) { return; } synchronized (mGlobalLock) { final boolean disableNonVrUi = mVrController.shouldDisableNonVrUiLocked(); mWindowManager.disableNonVrUi(disableNonVrUi); if (disableNonVrUi) { // If we are in a VR mode where Picture-in-Picture mode is unsupported, // then remove the root pinned task. mRootWindowContainer.removeRootTasksInWindowingModes(WINDOWING_MODE_PINNED); } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyUpdateVrModeLocked 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
applyUpdateVrModeLocked
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
void transferStartingWindowFromHiddenAboveTokenIfNeeded() { task.forAllActivities(fromActivity -> { if (fromActivity == this) return true; return !fromActivity.mVisibleRequested && transferStartingWindow(fromActivity); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: transferStartingWindowFromHiddenAboveTokenIfNeeded 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
transferStartingWindowFromHiddenAboveTokenIfNeeded
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private String getSharingConditions( String access ) { CurrentUserGroupInfo currentUserGroupInfo = currentUserService.getCurrentUserGroupsInfo(); return String.join( " or ", getOwnerCondition( currentUserGroupInfo ), getPublicSharingCondition( access ), getUserGroupAccessCondition( currentUserGroupInfo, access ), getUserAccessCondition( currentUserGroupInfo, access ) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSharingConditions File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getSharingConditions
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
@Test public void getByIdsEmpty(TestContext context) { Async async = context.async(); createFoo(context).getByIdAsString(FOO, new JsonArray(), res -> { assertSuccess(context, res); context.assertTrue(res.result().isEmpty()); async.complete(); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getByIdsEmpty 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
getByIdsEmpty
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private static void appendSecurityPermissions(XmlGenerator gen, String tag, Set<PermissionConfig> cpc, Object... attributes) { final List<PermissionConfig.PermissionType> clusterPermTypes = asList(ALL, CONFIG, TRANSACTION); if (!cpc.isEmpty()) { gen.open(tag, attributes); for (PermissionConfig p : cpc) { if (clusterPermTypes.contains(p.getType())) { gen.open(p.getType().getNodeName(), "principal", p.getPrincipal()); } else { gen.open(p.getType().getNodeName(), "principal", p.getPrincipal(), "name", p.getName()); } if (!p.getEndpoints().isEmpty()) { gen.open("endpoints"); for (String endpoint : p.getEndpoints()) { gen.node("endpoint", endpoint); } gen.close(); } if (!p.getActions().isEmpty()) { gen.open("actions"); for (String action : p.getActions()) { gen.node("action", action); } gen.close(); } gen.close(); } gen.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendSecurityPermissions 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
appendSecurityPermissions
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
@Override public boolean isApplicable(Descriptor descriptor) { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isApplicable 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
isApplicable
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
int appRestrictedInBackgroundLocked(int uid, String packageName, int packageTargetSdk) { // Apps that target O+ are always subject to background check if (packageTargetSdk >= Build.VERSION_CODES.O) { if (DEBUG_BACKGROUND_CHECK) { Slog.i(TAG, "App " + uid + "/" + packageName + " targets O+, restricted"); } return ActivityManager.APP_START_MODE_DELAYED_RIGID; } // ...and legacy apps get an AppOp check int appop = mAppOpsService.noteOperation(AppOpsManager.OP_RUN_IN_BACKGROUND, uid, packageName); if (DEBUG_BACKGROUND_CHECK) { Slog.i(TAG, "Legacy app " + uid + "/" + packageName + " bg appop " + appop); } switch (appop) { case AppOpsManager.MODE_ALLOWED: // If force-background-check is enabled, restrict all apps that aren't whitelisted. if (mForceBackgroundCheck && !UserHandle.isCore(uid) && !isOnDeviceIdleWhitelistLocked(uid, /*allowExceptIdleToo=*/ true)) { if (DEBUG_BACKGROUND_CHECK) { Slog.i(TAG, "Force background check: " + uid + "/" + packageName + " restricted"); } return ActivityManager.APP_START_MODE_DELAYED; } return ActivityManager.APP_START_MODE_NORMAL; case AppOpsManager.MODE_IGNORED: return ActivityManager.APP_START_MODE_DELAYED; default: return ActivityManager.APP_START_MODE_DELAYED_RIGID; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appRestrictedInBackgroundLocked 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
appRestrictedInBackgroundLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected ID findOrCreate(String name, String code, ID parent, int level) { String sql = "select itemId from ClassificationData where dataId = ? and "; if (StringUtils.isNotBlank(code)) { sql += String.format("(code = '%s' or name = '%s')", StringEscapeUtils.escapeSql(code), StringEscapeUtils.escapeSql(name)); } else { sql += String.format("name = '%s'", StringEscapeUtils.escapeSql(name)); } if (parent != null) { sql += String.format(" and parent = '%s'", parent); } Object[] exists = Application.createQueryNoFilter(sql).setParameter(1, dest).unique(); if (exists != null) { return (ID) exists[0]; } Record item = EntityHelper.forNew(EntityHelper.ClassificationData, this.getUser()); item.setString("name", name); item.setInt("level", level); item.setID("dataId", dest); if (StringUtils.isNotBlank(code)) { item.setString("code", code); } if (parent != null) { item.setID("parent", parent); } item = Application.getBean(ClassificationService.class).createOrUpdateItem(item); this.addSucceeded(); return item.getPrimary(); }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2023-1495 - Severity: MEDIUM - CVSS Score: 6.5 Description: H5 sync2 (#595) * style: 目录样式gh * style: J_new * feat: advListFilterTabs * feat: nav-copyto * enh: 助记码全拼 * enh: 地图搜索选点 * enh: topnav * list pn * .form-line.v33 * open TAG * KVS addShutdownHook * fix: #594 --------- Co-authored-by: devezhao <zhaofang123@gmail.com> Function: findOrCreate File: src/main/java/com/rebuild/core/rbstore/ClassificationImporter.java Repository: getrebuild/rebuild Fixed Code: protected ID findOrCreate(String name, String code, ID parent, int level) { String sql = "select itemId from ClassificationData where dataId = ? and "; if (StringUtils.isNotBlank(code)) { sql += String.format("(code = '%s' or name = '%s')", CommonsUtils.escapeSql(code), CommonsUtils.escapeSql(name)); } else { sql += String.format("name = '%s'", CommonsUtils.escapeSql(name)); } if (parent != null) { sql += String.format(" and parent = '%s'", parent); } Object[] exists = Application.createQueryNoFilter(sql).setParameter(1, dest).unique(); if (exists != null) { return (ID) exists[0]; } Record item = EntityHelper.forNew(EntityHelper.ClassificationData, this.getUser()); item.setString("name", name); item.setInt("level", level); item.setID("dataId", dest); if (StringUtils.isNotBlank(code)) { item.setString("code", code); } if (parent != null) { item.setID("parent", parent); } item = Application.getBean(ClassificationService.class).createOrUpdateItem(item); this.addSucceeded(); return item.getPrimary(); }
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
findOrCreate
src/main/java/com/rebuild/core/rbstore/ClassificationImporter.java
c9474f84e5f376dd2ade2078e3039961a9425da7
1
Analyze the following code function for security vulnerabilities
void launchResolver(ArrayList<ApduServiceInfo> services, ComponentName failedComponent, String category) { Intent intent = new Intent(mContext, AppChooserActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); intent.putParcelableArrayListExtra(AppChooserActivity.EXTRA_APDU_SERVICES, services); intent.putExtra(AppChooserActivity.EXTRA_CATEGORY, category); if (failedComponent != null) { intent.putExtra(AppChooserActivity.EXTRA_FAILED_COMPONENT, failedComponent); } mContext.startActivityAsUser(intent, UserHandle.CURRENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: launchResolver File: src/com/android/nfc/cardemulation/HostEmulationManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35671
MEDIUM
5.5
android
launchResolver
src/com/android/nfc/cardemulation/HostEmulationManager.java
745632835f3d97513a9c2a96e56e1dc06c4e4176
0
Analyze the following code function for security vulnerabilities
private int runClear() { int userId = 0; String option = nextOption(); if (option != null && option.equals("--user")) { String optionData = nextOptionData(); if (optionData == null || !isNumber(optionData)) { System.err.println("Error: no USER_ID specified"); showUsage(); return 1; } else { userId = Integer.parseInt(optionData); } } String pkg = nextArg(); if (pkg == null) { System.err.println("Error: no package specified"); showUsage(); return 1; } ClearDataObserver obs = new ClearDataObserver(); try { ActivityManagerNative.getDefault().clearApplicationUserData(pkg, obs, userId); synchronized (obs) { while (!obs.finished) { try { obs.wait(); } catch (InterruptedException e) { } } } if (obs.result) { System.out.println("Success"); return 0; } else { System.err.println("Failed"); return 1; } } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(PM_NOT_RUNNING_ERR); return 1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runClear File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runClear
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
public long getKeyguardFadingAwayDuration() { return mKeyguardFadingAwayDuration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyguardFadingAwayDuration 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
getKeyguardFadingAwayDuration
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
void setSurfaceTranslationY(int translationY) { mSurfaceTranslationY = translationY; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSurfaceTranslationY 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
setSurfaceTranslationY
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public List<PanelShareDto> queryTree(BaseGridRequest request) { CurrentUserDto user = AuthUtils.getUser(); Long userId = user.getUserId(); Long deptId = user.getDeptId(); List<Long> roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList()); Map<String, Object> param = new HashMap<>(); param.put("userId", userId); param.put("deptId", deptId); param.put("roleIds", CollectionUtils.isNotEmpty(roleIds) ? roleIds : null); List<PanelSharePo> data = extPanelShareMapper.query(param); List<PanelShareDto> dtoLists = data.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po)) .collect(Collectors.toList()); return convertTree(dtoLists); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryTree File: backend/src/main/java/io/dataease/service/panel/ShareService.java Repository: dataease The code follows secure coding practices.
[ "CWE-639" ]
CVE-2023-32310
HIGH
8.1
dataease
queryTree
backend/src/main/java/io/dataease/service/panel/ShareService.java
72f428e87b5395c03d2f94ef6185fc247ddbc8dc
0
Analyze the following code function for security vulnerabilities
public boolean disconnectFromSingleController(KieServerInfo serverInfo, KieServerConfig config, String controllerUrl) { String connectAndSyncUrl = null; try { connectAndSyncUrl = controllerUrl + "/server/" + KieServerEnvironment.getServerId()+"/?location="+ URLEncoder.encode(serverInfo.getLocation(), "UTF-8"); String userName = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_USER, "kieserver"); String password = loadPassword(config); String token = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_TOKEN); makeHttpDeleteRequestAndCreateCustomResponse(connectAndSyncUrl, null, userName, password, token); return true; } catch (Exception e) { // let's check all other controllers in case of running in cluster of controllers logger.debug("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getMessage(), e); return false; } }
Vulnerability Classification: - CWE: CWE-260 - CVE: CVE-2016-7043 - Severity: MEDIUM - CVSS Score: 5.0 Description: [RHBMS-4312] Loading pasword from a keystore Function: disconnectFromSingleController File: kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java Repository: kiegroup/droolsjbpm-integration Fixed Code: public boolean disconnectFromSingleController(KieServerInfo serverInfo, KieServerConfig config, String controllerUrl) { String connectAndSyncUrl = null; try { connectAndSyncUrl = controllerUrl + "/server/" + KieServerEnvironment.getServerId()+"/?location="+ URLEncoder.encode(serverInfo.getLocation(), "UTF-8"); String userName = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_USER, "kieserver"); String password = loadControllerPassword(config); String token = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_TOKEN); makeHttpDeleteRequestAndCreateCustomResponse(connectAndSyncUrl, null, userName, password, token); return true; } catch (Exception e) { // let's check all other controllers in case of running in cluster of controllers logger.debug("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getMessage(), e); return false; } }
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
disconnectFromSingleController
kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
1
Analyze the following code function for security vulnerabilities
public String getURLContent(String surl, int timeout, String userAgent) throws IOException { String content; HttpClient client = getHttpClient(timeout, userAgent); GetMethod get = new GetMethod(surl); try { client.executeMethod(get); content = get.getResponseBodyAsString(); } finally { // Release any connection resources used by the method get.releaseConnection(); } return content; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURLContent 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
getURLContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public void reevaluateStatusBarVisibility() { synchronized (mWindowMap) { int visibility = mPolicy.adjustSystemUiVisibilityLw(mLastStatusBarVisibility); updateStatusBarVisibilityLocked(visibility); performLayoutAndPlaceSurfacesLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reevaluateStatusBarVisibility 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
reevaluateStatusBarVisibility
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Deprecated public void modifyBootstrapPage(BootstrapPageResponse response) { bootstrapListeners .forEach(listener -> listener.modifyBootstrapPage(response)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: modifyBootstrapPage File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
modifyBootstrapPage
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
private boolean checkReferer( final HttpServletRequest request, final MapPrinter mapPrinter) { final Configuration config = mapPrinter.getConfiguration(); final UriMatchers allowedReferers = config.getAllowedReferersImpl(); if (allowedReferers == null) { return true; } String referer = request.getHeader("referer"); if (referer == null) { referer = "http://localhost/"; } try { return allowedReferers.matches(new URI(referer), HttpMethod.resolve(request.getMethod())); } catch (SocketException | UnknownHostException | URISyntaxException | MalformedURLException e) { LOGGER.error("Referer {} invalid", referer, e); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkReferer File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java Repository: mapfish/mapfish-print The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-15231
MEDIUM
4.3
mapfish/mapfish-print
checkReferer
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
89155f2506b9cee822e15ce60ccae390a1419d5e
0
Analyze the following code function for security vulnerabilities
IIntentSender getIntentSenderLocked(int type, String packageName, int callingUid, int userId, IBinder token, String resultWho, int requestCode, Intent[] intents, String[] resolvedTypes, int flags, Bundle options) { if (DEBUG_MU) Slog.v(TAG_MU, "getIntentSenderLocked(): uid=" + callingUid); ActivityRecord activity = null; if (type == ActivityManager.INTENT_SENDER_ACTIVITY_RESULT) { activity = ActivityRecord.isInStackLocked(token); if (activity == null) { return null; } if (activity.finishing) { return null; } } final boolean noCreate = (flags&PendingIntent.FLAG_NO_CREATE) != 0; final boolean cancelCurrent = (flags&PendingIntent.FLAG_CANCEL_CURRENT) != 0; final boolean updateCurrent = (flags&PendingIntent.FLAG_UPDATE_CURRENT) != 0; flags &= ~(PendingIntent.FLAG_NO_CREATE|PendingIntent.FLAG_CANCEL_CURRENT |PendingIntent.FLAG_UPDATE_CURRENT); PendingIntentRecord.Key key = new PendingIntentRecord.Key( type, packageName, activity, resultWho, requestCode, intents, resolvedTypes, flags, options, userId); WeakReference<PendingIntentRecord> ref; ref = mIntentSenderRecords.get(key); PendingIntentRecord rec = ref != null ? ref.get() : null; if (rec != null) { if (!cancelCurrent) { if (updateCurrent) { if (rec.key.requestIntent != null) { rec.key.requestIntent.replaceExtras(intents != null ? intents[intents.length - 1] : null); } if (intents != null) { intents[intents.length-1] = rec.key.requestIntent; rec.key.allIntents = intents; rec.key.allResolvedTypes = resolvedTypes; } else { rec.key.allIntents = null; rec.key.allResolvedTypes = null; } } return rec; } rec.canceled = true; mIntentSenderRecords.remove(key); } if (noCreate) { return rec; } rec = new PendingIntentRecord(this, key, callingUid); mIntentSenderRecords.put(key, rec.ref); if (type == ActivityManager.INTENT_SENDER_ACTIVITY_RESULT) { if (activity.pendingResults == null) { activity.pendingResults = new HashSet<WeakReference<PendingIntentRecord>>(); } activity.pendingResults.add(rec.ref); } return rec; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntentSenderLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
getIntentSenderLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private void uninstallOrDisablePackage(String packageName, @UserIdInt int userId) { final ApplicationInfo appInfo; try { appInfo = mIPackageManager.getApplicationInfo( packageName, MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE, userId); } catch (RemoteException e) { // Shouldn't happen. return; } if (appInfo == null) { Slogf.wtf(LOG_TAG, "Failed to get package info for " + packageName); return; } if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { Slogf.i(LOG_TAG, "Package %s is pre-installed, marking disabled until used", packageName); mContext.getPackageManager().setApplicationEnabledSetting(packageName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED, /* flags= */ 0); return; } final IIntentSender.Stub mLocalSender = new IIntentSender.Stub() { @Override public void send(int code, Intent intent, String resolvedType, IBinder allowlistToken, IIntentReceiver finishedReceiver, String requiredPermission, Bundle options) { final int status = intent.getIntExtra( PackageInstaller.EXTRA_STATUS, PackageInstaller.STATUS_FAILURE); if (status == PackageInstaller.STATUS_SUCCESS) { Slogf.i(LOG_TAG, "Package %s uninstalled for user %d", packageName, userId); } else { Slogf.e(LOG_TAG, "Failed to uninstall %s; status: %d", packageName, status); } } }; final PackageInstaller pi = mInjector.getPackageManager(userId).getPackageInstaller(); pi.uninstall(packageName, /* flags= */ 0, new IntentSender((IIntentSender) mLocalSender)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uninstallOrDisablePackage 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
uninstallOrDisablePackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setTags(String tagsStr, XWikiContext context) throws XWikiException { BaseClass tagsClass = context.getWiki().getTagClass(context); StaticListClass tagProp = (StaticListClass) tagsClass.getField(XWikiConstant.TAG_CLASS_PROP_TAGS); BaseObject tags = getObject(XWikiConstant.TAG_CLASS, true, context); tags.safeput(XWikiConstant.TAG_CLASS_PROP_TAGS, tagProp.fromString(tagsStr)); setMetaDataDirty(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTags 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
setTags
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
@VisibleForTesting void injectEnforceCallingPermission( @NonNull String permission, @Nullable String message) { mContext.enforceCallingPermission(permission, message); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectEnforceCallingPermission 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
injectEnforceCallingPermission
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private void processAuthorities(AuthoritiesType xmlAuthoritiesType, PackageType xmlPackage, PluginPackages pluginPackageEntity) { if (xmlAuthoritiesType == null) { return; } List<AuthorityType> xmlAuthorityList = xmlAuthoritiesType.getAuthority(); if (xmlAuthorityList == null || xmlAuthorityList.isEmpty()) { return; } for (AuthorityType xmlAuthortity : xmlAuthorityList) { String xmlSystemRoleName = xmlAuthortity.getSystemRoleName(); List<MenuType> xmlMenuList = xmlAuthortity.getMenu(); if (xmlMenuList == null || xmlMenuList.isEmpty()) { continue; } for (MenuType xmlMenu : xmlMenuList) { PluginPackageAuthorities authEntity = new PluginPackageAuthorities(); authEntity.setId(LocalIdGenerator.generateId()); authEntity.setMenuCode(xmlMenu.getCode()); authEntity.setPluginPackageId(pluginPackageEntity.getId()); authEntity.setPluginPackge(pluginPackageEntity); authEntity.setRoleName(xmlSystemRoleName); pluginPackageAuthoritiesMapper.insert(authEntity); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processAuthorities File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java Repository: WeBankPartners/wecube-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-45746
MEDIUM
5
WeBankPartners/wecube-platform
processAuthorities
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
0
Analyze the following code function for security vulnerabilities
@Override public T addInt(K name, int value) { return add(name, fromInt(name, value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addInt File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
addInt
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0