instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public BaseObject getXObject(EntityReference reference, String key, String value, boolean failover) { if (reference instanceof DocumentReference) { return getXObject((DocumentReference) reference, key, value, failover); } else if (reference.getType() == EntityType.DOCUMENT) { // class reference return getXObject(getCurrentReferenceDocumentReferenceResolver().resolve(reference, getDocumentReference()), key, value, failover); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXObject 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
getXObject
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
void packageShortcutsChanged( @NonNull final ShortcutPackage sp, @Nullable final List<ShortcutInfo> changedShortcuts, @Nullable final List<ShortcutInfo> removedShortcuts) { Objects.requireNonNull(sp); final String packageName = sp.getPackageName(); final int userId = sp.getPackageUserId(); if (DEBUG) { Slog.d(TAG, String.format( "Shortcut changes: package=%s, user=%d", packageName, userId)); } injectPostToHandlerDebounced(sp, notifyListenerRunnable(packageName, userId)); notifyShortcutChangeCallbacks(packageName, userId, changedShortcuts, removedShortcuts); sp.scheduleSave(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: packageShortcutsChanged 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
packageShortcutsChanged
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public int checkUidSignatures(int uid1, int uid2) { // Map to base uids. uid1 = UserHandle.getAppId(uid1); uid2 = UserHandle.getAppId(uid2); // reader synchronized (mPackages) { Signature[] s1; Signature[] s2; Object obj = mSettings.getUserIdLPr(uid1); if (obj != null) { if (obj instanceof SharedUserSetting) { s1 = ((SharedUserSetting)obj).signatures.mSignatures; } else if (obj instanceof PackageSetting) { s1 = ((PackageSetting)obj).signatures.mSignatures; } else { return PackageManager.SIGNATURE_UNKNOWN_PACKAGE; } } else { return PackageManager.SIGNATURE_UNKNOWN_PACKAGE; } obj = mSettings.getUserIdLPr(uid2); if (obj != null) { if (obj instanceof SharedUserSetting) { s2 = ((SharedUserSetting)obj).signatures.mSignatures; } else if (obj instanceof PackageSetting) { s2 = ((PackageSetting)obj).signatures.mSignatures; } else { return PackageManager.SIGNATURE_UNKNOWN_PACKAGE; } } else { return PackageManager.SIGNATURE_UNKNOWN_PACKAGE; } return compareSignatures(s1, s2); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkUidSignatures 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
checkUidSignatures
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public boolean removeSyncStanzaListener(StanzaListener packetListener) { synchronized (syncRecvListeners) { return syncRecvListeners.remove(packetListener) != null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeSyncStanzaListener File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
removeSyncStanzaListener
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
@RequestMapping("/search") public void search(@RequestParam String term, HttpServletResponse response) throws IOException { Path folder = loggingPath(null); List<FileEntry> files = getFileProvider(folder).getFileEntries(folder); List<FileEntry> sortedFiles = sortFiles(files, SortBy.MODIFIED, false); response.setContentType(MediaType.TEXT_PLAIN_VALUE); ServletOutputStream outputStream = response.getOutputStream(); sortedFiles.stream() .filter(file -> file.getFileType().equals(FileType.FILE)) .forEach(file -> searchAndStreamFile(file, term, outputStream)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: search File: lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpoint.java Repository: lukashinsch/spring-boot-actuator-logview The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-21234
MEDIUM
4
lukashinsch/spring-boot-actuator-logview
search
lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpoint.java
760acbb939a8d1f7d1a7dfcd51ca848eea04e772
0
Analyze the following code function for security vulnerabilities
private void sendOwnerChangedBroadcast(String broadcast, int userId) { final Intent intent = new Intent(broadcast) .addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); mContext.sendBroadcastAsUser(intent, UserHandle.of(userId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendOwnerChangedBroadcast 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
sendOwnerChangedBroadcast
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private static int hashCodeAsciiCompute(CharSequence value, int offset, int hash) { if (BIG_ENDIAN_NATIVE_ORDER) { return hash * HASH_CODE_C1 + // Low order int hashCodeAsciiSanitizeInt(value, offset + 4) * HASH_CODE_C2 + // High order int hashCodeAsciiSanitizeInt(value, offset); } return hash * HASH_CODE_C1 + // Low order int hashCodeAsciiSanitizeInt(value, offset) * HASH_CODE_C2 + // High order int hashCodeAsciiSanitizeInt(value, offset + 4); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCodeAsciiCompute File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
hashCodeAsciiCompute
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private EnvironmentInfo adaptEnv2EnvironmentInfo(final Env env) { EnvironmentInfo environmentInfo = new EnvironmentInfo(); String metaServerAddresses = MetaDomainConsts.getMetaServerAddress(env); environmentInfo.setEnv(env); environmentInfo.setActive(portalSettings.isEnvActive(env)); environmentInfo.setMetaServerAddress(metaServerAddresses); String selectedMetaServerAddress = MetaDomainConsts.getDomain(env); try { environmentInfo.setConfigServices(getServerAddress(selectedMetaServerAddress, CONFIG_SERVICE_URL_PATH)); environmentInfo.setAdminServices(getServerAddress(selectedMetaServerAddress, ADMIN_SERVICE_URL_PATH)); } catch (Throwable ex) { String errorMessage = "Loading config/admin services from meta server: " + selectedMetaServerAddress + " failed!"; logger.error(errorMessage, ex); environmentInfo.setErrorMessage(errorMessage + " Exception: " + ex.getMessage()); } return environmentInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: adaptEnv2EnvironmentInfo File: apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SystemInfoController.java Repository: apolloconfig/apollo The code follows secure coding practices.
[ "CWE-918" ]
CVE-2019-10686
HIGH
7.5
apolloconfig/apollo
adaptEnv2EnvironmentInfo
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SystemInfoController.java
70d250458e1baab95415807f0de7d2af10b344ae
0
Analyze the following code function for security vulnerabilities
public ParceledListSlice<ConversationChannelWrapper> getConversations(boolean onlyImportant) { try { return sINM.getConversations(onlyImportant); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return ParceledListSlice.emptyList(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConversations 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
getConversations
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
public void setComments(Long comments) { this.comments = comments; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setComments 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
setComments
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public static Map<String, Object> createUserLogin(DispatchContext ctx, Map<String, ?> context) { Map<String, Object> result = new LinkedHashMap<>(); Delegator delegator = ctx.getDelegator(); LocalDispatcher dispatcher = ctx.getDispatcher(); Security security = ctx.getSecurity(); GenericValue loggedInUserLogin = (GenericValue) context.get("userLogin"); List<String> errorMessageList = new LinkedList<>(); Locale locale = (Locale) context.get("locale"); boolean useEncryption = "true".equals(EntityUtilProperties.getPropertyValue("security", "password.encrypt", delegator)); String userLoginId = (String) context.get("userLoginId"); String partyId = (String) context.get("partyId"); String currentPassword = (String) context.get("currentPassword"); String currentPasswordVerify = (String) context.get("currentPasswordVerify"); String enabled = (String) context.get("enabled"); String passwordHint = (String) context.get("passwordHint"); String requirePasswordChange = (String) context.get("requirePasswordChange"); String externalAuthId = (String) context.get("externalAuthId"); String errMsg = null; String questionEnumId = (String) context.get("securityQuestion"); String securityAnswer = (String) context.get("securityAnswer"); // security: don't create a user login if the specified partyId (if not empty) already exists // unless the logged in user has permission to do so (same partyId or PARTYMGR_CREATE) if (UtilValidate.isNotEmpty(partyId)) { GenericValue party = null; try { party = EntityQuery.use(delegator).from("Party").where("partyId", partyId).queryOne(); } catch (GenericEntityException e) { Debug.logWarning(e, "", module); } if (party != null) { if (loggedInUserLogin != null) { // <b>security check</b>: userLogin partyId must equal partyId, or must have PARTYMGR_CREATE permission if (!partyId.equals(loggedInUserLogin.getString("partyId"))) { if (!security.hasEntityPermission("PARTYMGR", "_CREATE", loggedInUserLogin)) { errMsg = UtilProperties.getMessage(resource,"loginservices.party_with_specified_party_ID_exists_not_have_permission", locale); errorMessageList.add(errMsg); } } } else { errMsg = UtilProperties.getMessage(resource,"loginservices.must_be_logged_in_and_permission_create_login_party_ID_exists", locale); errorMessageList.add(errMsg); } } } GenericValue userLoginToCreate = delegator.makeValue("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); checkNewPassword(userLoginToCreate, null, currentPassword, currentPasswordVerify, passwordHint, errorMessageList, true, locale); userLoginToCreate.set("externalAuthId", externalAuthId); userLoginToCreate.set("passwordHint", passwordHint); userLoginToCreate.set("enabled", enabled); userLoginToCreate.set("requirePasswordChange", requirePasswordChange); userLoginToCreate.set("currentPassword", useEncryption ? HashCrypt.cryptUTF8(getHashType(), null, currentPassword) : currentPassword); try { userLoginToCreate.set("partyId", partyId); } catch (Exception e) { // Will get thrown in framework-only installation Debug.logInfo(e, "Exception thrown while setting UserLogin partyId field: ", module); } try { EntityCondition condition = EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("userLoginId"), EntityOperator.EQUALS, EntityFunction.UPPER(userLoginId)); if (UtilValidate.isNotEmpty(EntityQuery.use(delegator).from("UserLogin").where(condition).queryList())) { Map<String, String> messageMap = UtilMisc.toMap("userLoginId", userLoginId); errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_create_login_user_with_ID_exists", messageMap, locale); errorMessageList.add(errMsg); } } catch (GenericEntityException e) { Debug.logWarning(e, "", module); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_create_login_user_read_failure", messageMap, locale); errorMessageList.add(errMsg); } if (errorMessageList.size() > 0) { return ServiceUtil.returnError(errorMessageList); } try { userLoginToCreate.create(); createUserLoginPasswordHistory(userLoginToCreate); } catch (GenericEntityException e) { Debug.logWarning(e, "", module); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_create_login_user_write_failure", messageMap, locale); return ServiceUtil.returnError(errMsg); } try { if (UtilValidate.isNotEmpty(securityAnswer)) { Map<String, Object> resultMap = dispatcher.runSync("createUserLoginSecurityQuestion", UtilMisc.toMap("userLogin", loggedInUserLogin, "userLoginId", userLoginId, "questionEnumId", questionEnumId, "securityAnswer", securityAnswer)); if (ServiceUtil.isError(resultMap)) { errMsg = ServiceUtil.getErrorMessage(resultMap); errorMessageList.add(errMsg); Debug.logError(errMsg, module); } } } catch (GenericServiceException e1) { errMsg = UtilProperties.getMessage(resource,"loginservices.error_setting_security_question", locale); Debug.logError(e1, errMsg, module); } result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createUserLogin File: framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java Repository: apache/ofbiz-framework The code follows secure coding practices.
[ "CWE-209" ]
CVE-2021-25958
MEDIUM
5
apache/ofbiz-framework
createUserLogin
framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
2f5b8d33e32c4d9a48243cf9e503236acd5aec5c
0
Analyze the following code function for security vulnerabilities
protected String getEventCrfIdsByItemDataSqlSS(String studyIds, String sedIds, String itemIds, String dateConstraint, int datasetItemStatusId, String studySubjectIds) { String ecStatusConstraint = getECStatusConstraint(datasetItemStatusId); String itStatusConstraint = this.getItemDataStatusConstraint(datasetItemStatusId); return "select distinct idata.event_crf_id from item_data idata" + " where idata.item_id in " + itemIds + " and (idata.status_id " + itStatusConstraint + ")" + " and idata.event_crf_id in (select event_crf_id from event_crf where study_subject_id in" + " (select ss.study_subject_id from study_subject ss WHERE ss.study_subject_id in (" + studySubjectIds + ") " + ")" + " and study_event_id in (select study_event_id from study_event where study_event_definition_id in " + sedIds + " and study_subject_id in (select ss.study_subject_id from study_subject ss where ss.study_subject_id in (" + studySubjectIds + ") " + "))" + " and (status_id " + ecStatusConstraint + ")) and length(value) > 0"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEventCrfIdsByItemDataSqlSS File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getEventCrfIdsByItemDataSqlSS
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
private void resetSingleSrcBuffer() { singleSrcBuffer[0] = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetSingleSrcBuffer File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
resetSingleSrcBuffer
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public void setSearchCacheSvcForUnitTest(ISearchCacheSvc theSearchCacheSvc) { mySearchCacheSvc = theSearchCacheSvc; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSearchCacheSvcForUnitTest File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setSearchCacheSvcForUnitTest
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
0
Analyze the following code function for security vulnerabilities
@Override boolean check(WanPublisherConfig c1, WanPublisherConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getGroupName(), c2.getGroupName()) && nullSafeEqual(c1.getQueueCapacity(), c2.getQueueCapacity()) && nullSafeEqual(c1.getQueueFullBehavior(), c2.getQueueFullBehavior()) && new AwsConfigChecker().check(c1.getAwsConfig(), c2.getAwsConfig()) && new DiscoveryConfigChecker().check(c1.getDiscoveryConfig(), c2.getDiscoveryConfig()) && nullSafeEqual(c1.getClassName(), c2.getClassName()) && nullSafeEqual(c1.getImplementation(), c2.getImplementation()) && nullSafeEqual(c1.getProperties(), c2.getProperties()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public static List<Triple<String, Element, String>> getTagElementTriplesFromFileSAXException( File f, String tag) throws SAXException { return getTagElementTriplesFromFileNumBoundedSAXException(f, tag, 2); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTagElementTriplesFromFileSAXException File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-0239
HIGH
7.5
stanfordnlp/CoreNLP
getTagElementTriplesFromFileSAXException
src/edu/stanford/nlp/util/XMLUtils.java
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting int getMaxShortcutsForTest() { return mMaxShortcuts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxShortcutsForTest 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
getMaxShortcutsForTest
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void save() throws XWikiException { save("", false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save 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
save
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 isSystemSecure() { return "1".equals(SystemProperties.get(SYSTEM_SECURE, "1")) && "0".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSystemSecure 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
isSystemSecure
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void setDescription(String description) { this.description = description; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDescription File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setDescription
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@GetMapping("{journalId:\\d+}/comments/tree_view") @ApiOperation("Lists comments with tree view") public Page<BaseCommentVO> listCommentsTree(@PathVariable("journalId") Integer journalId, @RequestParam(name = "page", required = false, defaultValue = "0") int page, @SortDefault(sort = "createTime", direction = DESC) Sort sort) { Page<BaseCommentVO> result = journalCommentService.pageVosBy(journalId, PageRequest.of(page, optionService.getCommentPageSize(), sort)); return journalCommentService.filterIpAddress(result); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listCommentsTree File: src/main/java/run/halo/app/controller/content/api/JournalController.java Repository: halo-dev/halo The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-19007
LOW
3.5
halo-dev/halo
listCommentsTree
src/main/java/run/halo/app/controller/content/api/JournalController.java
d6b3d6cb5d681c7d8d64fd48de6c7c99b696bb8b
0
Analyze the following code function for security vulnerabilities
@Override public int getMetricsCategory() { return SettingsEnums.DIALOG_APN_EDITOR_ERROR; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetricsCategory File: src/com/android/settings/network/apn/ApnEditor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40125
HIGH
7.8
android
getMetricsCategory
src/com/android/settings/network/apn/ApnEditor.java
63d464c3fa5c7b9900448fef3844790756e557eb
0
Analyze the following code function for security vulnerabilities
private DefaultJpaInstanceConfiguration hsqlConfig() { DefaultJpaInstanceConfiguration config = new DefaultJpaInstanceConfiguration(); config.db(JpaDb.HSQLDB) .autoCreate(true) .url("mem:test") .user("sa") .password("") .useLongIntDao() .bind(JpaDao_LongInt.class, DefaultJpaDao_LongInt.class) .ddlGeneration(DefaultJpaInstanceConfiguration.Ddl.DROP_AND_CREATE); return config; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hsqlConfig File: src/test/java/uk/q3c/krail/jpa/persist/TestJpaModule.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
hsqlConfig
src/test/java/uk/q3c/krail/jpa/persist/TestJpaModule.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
private void updateUsbDataSignal() { if (!canUsbDataSignalingBeDisabled()) { return; } final boolean usbEnabled; synchronized (getLockObject()) { usbEnabled = isUsbDataSignalingEnabledInternalLocked(); } if (!mInjector.binderWithCleanCallingIdentity( () -> mInjector.getUsbManager().enableUsbDataSignal(usbEnabled))) { Slogf.w(LOG_TAG, "Failed to set usb data signaling state"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateUsbDataSignal 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
updateUsbDataSignal
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
void removeSetting(String name) { connInfoMap.remove(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeSetting File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
removeSetting
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@SuppressLint("ClickableViewAccessibility") private void initSelfVideoView() { try { binding.selfVideoRenderer.init(rootEglBase.getEglBaseContext(), null); } catch (IllegalStateException e) { Log.d(TAG, "selfVideoRenderer already initialized", e); } binding.selfVideoRenderer.setZOrderMediaOverlay(true); // disabled because it causes some devices to crash binding.selfVideoRenderer.setEnableHardwareScaler(false); binding.selfVideoRenderer.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT); binding.selfVideoRenderer.setOnTouchListener(new SelfVideoTouchListener()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initSelfVideoView File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
initSelfVideoView
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
@Override protected UserDirectoryService getUserDirectoryService() { return userDirectoryService; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserDirectoryService File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
getUserDirectoryService
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
boolean isProcessRunning() { WindowProcessController proc = app; if (proc == null) { proc = mAtmService.mProcessNames.get(processName, info.applicationInfo.uid); } return proc != null && proc.hasThread(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isProcessRunning 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
isProcessRunning
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public boolean isCreateNextWordRelationship() { return createNextWordRelationship; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCreateNextWordRelationship File: src/main/java/apoc/load/Xml.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000820
HIGH
7.5
neo4j-contrib/neo4j-apoc-procedures
isCreateNextWordRelationship
src/main/java/apoc/load/Xml.java
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
0
Analyze the following code function for security vulnerabilities
protected void processContentFileEntry(Context c, Item i, String path, String fileName, String bundleName, boolean primary) throws SQLException, IOException, AuthorizeException { String fullpath = path + File.separatorChar + fileName; // get an input stream BufferedInputStream bis = new BufferedInputStream(new FileInputStream( fullpath)); Bitstream bs = null; String newBundleName = bundleName; if (bundleName == null) { // is it license.txt? if ("license.txt".equals(fileName)) { newBundleName = "LICENSE"; } else { // call it ORIGINAL newBundleName = "ORIGINAL"; } } if (!isTest) { // find the bundle List<Bundle> bundles = itemService.getBundles(i, newBundleName); Bundle targetBundle = null; if (bundles.size() < 1) { // not found, create a new one targetBundle = bundleService.create(c, i, newBundleName); } else { // put bitstreams into first bundle targetBundle = bundles.iterator().next(); } // now add the bitstream bs = bitstreamService.create(c, targetBundle, bis); bs.setName(c, fileName); // Identify the format // FIXME - guessing format guesses license.txt incorrectly as a text // file format! BitstreamFormat bf = bitstreamFormatService.guessFormat(c, bs); bitstreamService.setFormat(c, bs, bf); // Is this a the primary bitstream? if (primary) { targetBundle.setPrimaryBitstreamID(bs); bundleService.update(c, targetBundle); } bitstreamService.update(c, bs); } bis.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processContentFileEntry File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
processContentFileEntry
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
public List<List<ObjectDiff>> getObjectDiff(String fromRev, XWikiContext context) throws XWikiException { XWikiDocument revdoc = context.getWiki().getDocument(this, fromRev, context); return getObjectDiff(revdoc, this, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectDiff 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
getObjectDiff
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
protected String getNullResourceMethodsAllowed( ) { return NULL_RESOURCE_METHODS_ALLOWED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNullResourceMethodsAllowed File: core/src/main/java/org/opencrx/application/uses/net/sf/webdav/methods/WebDavMethod.java Repository: opencrx The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-46502
CRITICAL
9.8
opencrx
getNullResourceMethodsAllowed
core/src/main/java/org/opencrx/application/uses/net/sf/webdav/methods/WebDavMethod.java
ce7a71db0bb34ecbcb0e822d40598e410a48b399
0
Analyze the following code function for security vulnerabilities
@Nullable private ActiveAdmin getActiveAdminWithPolicyForUidLocked(ComponentName who, int reqPolicy, int uid) { ensureLocked(); // Try to find an admin which can use reqPolicy final int userId = UserHandle.getUserId(uid); final DevicePolicyData policy = getUserData(userId); if (who != null) { ActiveAdmin admin = policy.mAdminMap.get(who); if (admin == null || admin.getUid() != uid) { throw new SecurityException( "Admin " + who + " is not active or not owned by uid " + uid); } if (isActiveAdminWithPolicyForUserLocked(admin, reqPolicy, userId)) { return admin; } } else { for (ActiveAdmin admin : policy.mAdminList) { if (admin.getUid() == uid && isActiveAdminWithPolicyForUserLocked(admin, reqPolicy, userId)) { return admin; } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveAdminWithPolicyForUidLocked File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getActiveAdminWithPolicyForUidLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public ClickHouseConfig getConfig() { return this.config; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfig File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
getConfig
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
@NotNull protected Key getJWTKey() { String secret = portofinoConfiguration.getString(JWT_SECRET_PROPERTY); return new SecretKeySpec(Decoders.BASE64.decode(secret), SignatureAlgorithm.HS512.getJcaName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJWTKey File: portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java Repository: ManyDesigns/Portofino The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-29451
MEDIUM
6.4
ManyDesigns/Portofino
getJWTKey
portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
0
Analyze the following code function for security vulnerabilities
protected void internalGetPartitionedStatsInternal(AsyncResponse asyncResponse, boolean authoritative) { if (topicName.isGlobal()) { try { validateGlobalNamespaceOwnership(namespaceName); } catch (Exception e) { log.error("[{}] Failed to get partitioned internal stats for {}", clientAppId(), topicName, e); resumeAsyncResponseExceptionally(asyncResponse, e); return; } } getPartitionedTopicMetadataAsync(topicName, authoritative, false).thenAccept(partitionMetadata -> { if (partitionMetadata.partitions == 0) { asyncResponse.resume(new RestException(Status.NOT_FOUND, "Partitioned Topic not found")); return; } PartitionedTopicInternalStats stats = new PartitionedTopicInternalStats(partitionMetadata); List<CompletableFuture<PersistentTopicInternalStats>> topicStatsFutureList = Lists.newArrayList(); for (int i = 0; i < partitionMetadata.partitions; i++) { try { topicStatsFutureList.add(pulsar().getAdminClient().topics() .getInternalStatsAsync((topicName.getPartition(i).toString()), false)); } catch (PulsarServerException e) { asyncResponse.resume(new RestException(e)); return; } } FutureUtil.waitForAll(topicStatsFutureList).handle((result, exception) -> { CompletableFuture<PersistentTopicInternalStats> statFuture = null; for (int i = 0; i < topicStatsFutureList.size(); i++) { statFuture = topicStatsFutureList.get(i); if (statFuture.isDone() && !statFuture.isCompletedExceptionally()) { try { stats.partitions.put(topicName.getPartition(i).toString(), statFuture.get()); } catch (Exception e) { asyncResponse.resume(new RestException(e)); return null; } } } asyncResponse.resume(!stats.partitions.isEmpty() ? stats : new RestException(Status.NOT_FOUND, "Internal topics have not been generated yet")); return null; }); }).exceptionally(ex -> { log.error("[{}] Failed to get partitioned internal stats for {}", clientAppId(), topicName, ex); resumeAsyncResponseExceptionally(asyncResponse, ex); return null; }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalGetPartitionedStatsInternal File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalGetPartitionedStatsInternal
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public BeanDeserializerBase withBeanProperties(BeanPropertyMap props) { return new BeanDeserializer(this, props); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withBeanProperties File: src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42004
HIGH
7.5
FasterXML/jackson-databind
withBeanProperties
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
063183589218fec19a9293ed2f17ec53ea80ba88
0
Analyze the following code function for security vulnerabilities
@Override public void setAutoTimeZoneEnabled(@Nullable ComponentName who, String callerPackageName, boolean enabled) { if (!mHasFeature) { return; } CallerIdentity caller; if (isUnicornFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); } if (isUnicornFlagEnabled()) { // The effect of this policy is device-wide. EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin( who, SET_TIME_ZONE, caller.getPackageName(), UserHandle.USER_ALL ); mDevicePolicyEngine.setGlobalPolicy( PolicyDefinition.AUTO_TIMEZONE, // TODO(b/260573124): add correct enforcing admin when permission changes are // merged. enforcingAdmin, new BooleanPolicyValue(enabled)); } else { Objects.requireNonNull(who, "ComponentName is null"); Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller) || isDefaultDeviceOwner( caller)); mInjector.binderWithCleanCallingIdentity(() -> mInjector.settingsGlobalPutInt(Global.AUTO_TIME_ZONE, enabled ? 1 : 0)); } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_AUTO_TIME_ZONE) .setAdmin(caller.getPackageName()) .setBoolean(enabled) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAutoTimeZoneEnabled File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setAutoTimeZoneEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void broadcastBssTmHandlingDoneEvent(String iface, BtmFrameData btmFrmData) { sendMessage(iface, MBO_OCE_BSS_TM_HANDLING_DONE, btmFrmData); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastBssTmHandlingDoneEvent File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
broadcastBssTmHandlingDoneEvent
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder2 attr(String name, String value) { return attribute(name, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attr File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
attr
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; // set the request in the threadlocal. this.requestThreadLocal.setRequest(request); final String uri = (request.getAttribute(CMS_FILTER_URI_OVERRIDE) != null) ? (String) request .getAttribute(CMS_FILTER_URI_OVERRIDE) : URLDecoder.decode(request.getRequestURI(), "UTF-8"); String xssRedirect = xssCheck(uri, request.getQueryString()); if (xssRedirect != null) { response.sendRedirect(xssRedirect); return; } IAm iAm = IAm.NOTHING_IN_THE_CMS; LogFactory.getLog(this.getClass()).debug("CMS Filter URI = " + uri); /* * Getting host object form the session */ HostWebAPI hostWebAPI = WebAPILocator.getHostWebAPI(); Host host; try { host = hostWebAPI.getCurrentHost(request); request.setAttribute("host", host); } catch (Exception e) { Logger.error(this, "Unable to retrieve current request host for URI " + uri); throw new ServletException(e.getMessage(), e); } /* * If someone is trying to go right to an asset without going through * the cms, give them a 404 */ if (UtilMethods.isSet(ASSET_PATH) && uri.startsWith(ASSET_PATH)) { response.sendError(403, "Forbidden"); return; } // get the users language long languageId = WebAPILocator.getLanguageWebAPI().getLanguage(request).getId(); if (urlUtil.isFileAsset(uri, host, languageId)) { iAm = IAm.FILE; } else if (urlUtil.isVanityUrl(uri, host, languageId)) { iAm = IAm.VANITY_URL; } else if (urlUtil.isPageAsset(uri, host, languageId)) { iAm = IAm.PAGE; } else if (urlUtil.isFolder(uri, host)) { iAm = IAm.FOLDER; } String vanityURLRewrite = null; String queryString = request.getQueryString(); // if a vanity URL if (iAm == IAm.VANITY_URL) { UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI(); VanityUrlHandler vanityUrlHandler = vanityUrlHandlerResolver.getVanityUrlHandler(); VanityUrlResult vanityUrlResult = vanityUrlHandler .handle(uri, response, host, languageId, userWebAPI.getUser(request)); if (vanityUrlResult.isResult()) { closeDbSilently(); return; } if (vanityUrlResult.getQueryString() != null) { queryString = vanityUrlResult.getQueryString(); } iAm = vanityUrlResult.getiAm(); vanityURLRewrite = vanityUrlResult.getRewrite(); } if (iAm == IAm.FOLDER) { // if we are not rewriting anything, use the uri String urlToUse = UtilMethods.isSet(vanityURLRewrite) ? vanityURLRewrite : uri; if (!urlToUse.endsWith("/")) { if (UtilMethods.isSet(queryString)) { response.setHeader("Location", urlToUse + "/?" + queryString); } else { response.setHeader("Location", urlToUse + "/"); } /* At this point if rewrite is different than null is because a VanityURL set it, and in that case we need to respect the status code set by the VanityURL. */ if (!UtilMethods.isSet(vanityURLRewrite)) { response.setStatus(301); } closeDbSilently(); return; } else { if (UtilMethods.isSet(vanityURLRewrite)) { vanityURLRewrite = vanityURLRewrite + CMS_INDEX_PAGE; } else { vanityURLRewrite = uri + CMS_INDEX_PAGE; } if (urlUtil.isPageAsset(vanityURLRewrite, host, languageId)) { iAm = IAm.PAGE; } } } if (iAm == IAm.PAGE) { countPageVisit(request); countSiteVisit(request, response); } // if we are not rewriting anything, use the uri vanityURLRewrite = (vanityURLRewrite == null) ? uri : vanityURLRewrite; if (iAm == IAm.PAGE) { request.setAttribute(CMSFilter.CMS_FILTER_URI_OVERRIDE, vanityURLRewrite); } // run rules engine for all requests RulesEngine.fireRules(request, response, Rule.FireOn.EVERY_REQUEST); //if we have committed the response, die if (response.isCommitted()) { return; } if (iAm == IAm.FILE) { Identifier ident = null; try { //Serving the file through the /dotAsset servlet StringWriter forward = new StringWriter(); forward.append("/dotAsset/"); ident = APILocator.getIdentifierAPI().find(host, vanityURLRewrite); request.setAttribute(CMS_FILTER_IDENTITY, ident); //If language is in session, set as query string if (UtilMethods.isSet(languageId)) { forward.append('?'); forward.append(WebKeys.HTMLPAGE_LANGUAGE + "=" + languageId); } request.getRequestDispatcher(forward.toString()).forward(request, response); } catch (DotDataException e) { Logger.error(CMSFilter.class, e.getMessage(), e); throw new IOException(e.getMessage()); } return; } if (iAm == IAm.PAGE) { // Serving a page through the velocity servlet StringWriter forward = new StringWriter(); forward.append("/servlets/VelocityServlet"); if (UtilMethods.isSet(queryString)) { if (queryString.indexOf(WebKeys.HTMLPAGE_LANGUAGE) == -1) { queryString = queryString + "&" + WebKeys.HTMLPAGE_LANGUAGE + "=" + languageId; } forward.append('?'); forward.append(queryString); } request.getRequestDispatcher(forward.toString()).forward(request, response); return; } if (vanityURLRewrite.startsWith("/contentAsset/")) { if (response.isCommitted()) { /* Some form of redirect, error, or the request has already been fulfilled in some fashion by one or more of the actionlets. */ return; } } // otherwise, pass chain.doFilter(req, res); }
Vulnerability Classification: - CWE: CWE-434 - CVE: CVE-2017-11466 - Severity: HIGH - CVSS Score: 9.0 Description: #12131 fixes arbitrary upload (#12134) * #12131 fixes arbitrary upload * #12131 fixes jenkins feedback Function: doFilter File: dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java Repository: dotCMS/core Fixed Code: public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; final String uri = (request.getAttribute(CMS_FILTER_URI_OVERRIDE) != null) ? (String) request .getAttribute(CMS_FILTER_URI_OVERRIDE) : URLDecoder.decode(request.getRequestURI(), "UTF-8"); String xssRedirect = xssCheck(uri, request.getQueryString()); if (xssRedirect != null) { response.sendRedirect(xssRedirect); return; } IAm iAm = IAm.NOTHING_IN_THE_CMS; LogFactory.getLog(this.getClass()).debug("CMS Filter URI = " + uri); /* * Getting host object form the session */ HostWebAPI hostWebAPI = WebAPILocator.getHostWebAPI(); Host host; try { host = hostWebAPI.getCurrentHost(request); request.setAttribute("host", host); } catch (Exception e) { Logger.error(this, "Unable to retrieve current request host for URI " + uri); throw new ServletException(e.getMessage(), e); } /* * If someone is trying to go right to an asset without going through * the cms, give them a 404 */ if (UtilMethods.isSet(RELATIVE_ASSET_PATH) && uri.startsWith(RELATIVE_ASSET_PATH)) { response.sendError(403, "Forbidden"); return; } // get the users language long languageId = WebAPILocator.getLanguageWebAPI().getLanguage(request).getId(); if (urlUtil.isFileAsset(uri, host, languageId)) { iAm = IAm.FILE; } else if (urlUtil.isVanityUrl(uri, host, languageId)) { iAm = IAm.VANITY_URL; } else if (urlUtil.isPageAsset(uri, host, languageId)) { iAm = IAm.PAGE; } else if (urlUtil.isFolder(uri, host)) { iAm = IAm.FOLDER; } String vanityURLRewrite = null; String queryString = request.getQueryString(); // if a vanity URL if (iAm == IAm.VANITY_URL) { UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI(); VanityUrlHandler vanityUrlHandler = vanityUrlHandlerResolver.getVanityUrlHandler(); VanityUrlResult vanityUrlResult = vanityUrlHandler .handle(uri, response, host, languageId, userWebAPI.getUser(request)); if (vanityUrlResult.isResult()) { DbConnectionFactory.closeSilently(); return; } if (vanityUrlResult.getQueryString() != null) { queryString = vanityUrlResult.getQueryString(); } iAm = vanityUrlResult.getiAm(); vanityURLRewrite = vanityUrlResult.getRewrite(); } if (iAm == IAm.FOLDER) { // if we are not rewriting anything, use the uri String urlToUse = UtilMethods.isSet(vanityURLRewrite) ? vanityURLRewrite : uri; if (!urlToUse.endsWith("/")) { if (UtilMethods.isSet(queryString)) { response.setHeader("Location", urlToUse + "/?" + queryString); } else { response.setHeader("Location", urlToUse + "/"); } /* At this point if rewrite is different than null is because a VanityURL set it, and in that case we need to respect the status code set by the VanityURL. */ if (!UtilMethods.isSet(vanityURLRewrite)) { response.setStatus(301); } DbConnectionFactory.closeSilently(); return; } else { if (UtilMethods.isSet(vanityURLRewrite)) { vanityURLRewrite = vanityURLRewrite + CMS_INDEX_PAGE; } else { vanityURLRewrite = uri + CMS_INDEX_PAGE; } if (urlUtil.isPageAsset(vanityURLRewrite, host, languageId)) { iAm = IAm.PAGE; } } } if (iAm == IAm.PAGE) { countPageVisit(request); countSiteVisit(request, response); } // if we are not rewriting anything, use the uri vanityURLRewrite = (vanityURLRewrite == null) ? uri : vanityURLRewrite; if (iAm == IAm.PAGE) { request.setAttribute(CMSFilter.CMS_FILTER_URI_OVERRIDE, vanityURLRewrite); } // run rules engine for all requests RulesEngine.fireRules(request, response, Rule.FireOn.EVERY_REQUEST); //if we have committed the response, die if (response.isCommitted()) { return; } if (iAm == IAm.FILE) { Identifier ident = null; try { //Serving the file through the /dotAsset servlet StringWriter forward = new StringWriter(); forward.append("/dotAsset/"); ident = APILocator.getIdentifierAPI().find(host, vanityURLRewrite); request.setAttribute(CMS_FILTER_IDENTITY, ident); //If language is in session, set as query string if (UtilMethods.isSet(languageId)) { forward.append('?'); forward.append(WebKeys.HTMLPAGE_LANGUAGE + "=" + languageId); } request.getRequestDispatcher(forward.toString()).forward(request, response); } catch (DotDataException e) { Logger.error(CMSFilter.class, e.getMessage(), e); throw new IOException(e.getMessage()); } return; } if (iAm == IAm.PAGE) { // Serving a page through the velocity servlet StringWriter forward = new StringWriter(); forward.append("/servlets/VelocityServlet"); if (UtilMethods.isSet(queryString)) { if (queryString.indexOf(WebKeys.HTMLPAGE_LANGUAGE) == -1) { queryString = queryString + "&" + WebKeys.HTMLPAGE_LANGUAGE + "=" + languageId; } forward.append('?'); forward.append(queryString); } request.getRequestDispatcher(forward.toString()).forward(request, response); return; } if (vanityURLRewrite.startsWith("/contentAsset/")) { if (response.isCommitted()) { /* Some form of redirect, error, or the request has already been fulfilled in some fashion by one or more of the actionlets. */ return; } } // otherwise, pass chain.doFilter(req, res); }
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
doFilter
dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
1
Analyze the following code function for security vulnerabilities
@Override public void binderDied() { if (DEBUG_ALL) Slog.v( TAG, "Death received in " + this + " for thread " + mAppThread.asBinder()); synchronized(ActivityManagerService.this) { appDiedLocked(mApp, mPid, mAppThread, true, null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: binderDied 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
binderDied
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private boolean enforceAnswerCallPermission(String packageName, int uid) { try { enforceModifyPermission(); } catch (SecurityException e) { final String permission = Manifest.permission.ANSWER_PHONE_CALLS; enforcePermission(permission); final int opCode = AppOpsManager.permissionToOpCode(permission); if (opCode != AppOpsManager.OP_NONE && mAppOpsManager.checkOp(opCode, uid, packageName) != AppOpsManager.MODE_ALLOWED) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceAnswerCallPermission File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
enforceAnswerCallPermission
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
private IPickUpSpace lookupPlace(final String name) throws NamespaceException { return (IPickUpSpace) lookup(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookupPlace File: src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
lookupPlace
src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
protected ModuleConfig initModuleConfig(String prefix, String paths) throws ServletException { // :FIXME: Document UnavailableException? (Doesn't actually throw anything) if (log.isDebugEnabled()) { log.debug( "Initializing module path '" + prefix + "' configuration from '" + paths + "'"); } // Parse the configuration for this module ModuleConfigFactory factoryObject = ModuleConfigFactory.createFactory(); ModuleConfig config = factoryObject.createModuleConfig(prefix); // Configure the Digester instance we will use Digester digester = initConfigDigester(); // Process each specified resource path while (paths.length() > 0) { digester.push(config); String path = null; int comma = paths.indexOf(','); if (comma >= 0) { path = paths.substring(0, comma).trim(); paths = paths.substring(comma + 1); } else { path = paths.trim(); paths = ""; } if (path.length() < 1) { break; } this.parseModuleConfigFile(digester, path); } getServletContext().setAttribute( Globals.MODULE_KEY + config.getPrefix(), config); // Force creation and registration of DynaActionFormClass instances // for all dynamic form beans we wil be using FormBeanConfig fbs[] = config.findFormBeanConfigs(); for (int i = 0; i < fbs.length; i++) { if (fbs[i].getDynamic()) { fbs[i].getDynaActionFormClass(); } } return config; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initModuleConfig File: src/share/org/apache/struts/action/ActionServlet.java Repository: kawasima/struts1-forever The code follows secure coding practices.
[ "CWE-Other", "CWE-20" ]
CVE-2016-1181
MEDIUM
6.8
kawasima/struts1-forever
initModuleConfig
src/share/org/apache/struts/action/ActionServlet.java
eda3a79907ed8fcb0387a0496d0cb14332f250e8
0
Analyze the following code function for security vulnerabilities
protected UserAccounts getUserAccounts(int userId) { try { return getUserAccountsNotChecked(userId); } catch (RuntimeException e) { if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) { // Let it go... throw e; } // User accounts database is corrupted, we must wipe out the whole user, otherwise the // system will crash indefinitely Slog.wtf(TAG, "Removing user " + userId + " due to exception (" + e + ") reading its " + "account database"); if (userId == ActivityManager.getCurrentUser() && userId != UserHandle.USER_SYSTEM) { Slog.i(TAG, "Switching to system user first"); try { ActivityManager.getService().switchUser(UserHandle.USER_SYSTEM); } catch (RemoteException re) { Slog.e(TAG, "Could not switch to " + UserHandle.USER_SYSTEM + ": " + re); } } if (!getUserManager().removeUserEvenWhenDisallowed(userId)) { Slog.e(TAG, "could not remove user " + userId); } throw e; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserAccounts File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
getUserAccounts
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Unstable public List<Locale> getTranslationLocales() throws XWikiException { return this.doc.getTranslationLocales(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTranslationLocales 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
getTranslationLocales
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
@Override public boolean isUnlimitedAccess() { return unlimitedAccess; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUnlimitedAccess File: src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java Repository: jlangch/venice The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-36007
LOW
3.3
jlangch/venice
isUnlimitedAccess
src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java
c942c73136333bc493050910f171a48e6f575b23
0
Analyze the following code function for security vulnerabilities
private boolean isUnlockMethodSecure(String unlockMethod) { return !(ScreenLockType.SWIPE.preferenceKey.equals(unlockMethod) || ScreenLockType.NONE.preferenceKey.equals(unlockMethod)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUnlockMethodSecure File: src/com/android/settings/password/ChooseLockGeneric.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
isUnlockMethodSecure
src/com/android/settings/password/ChooseLockGeneric.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
public static HttpRequest get(final String destination) { return new HttpRequest() .method(HttpMethod.GET) .set(destination); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
get
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
public static void checkWanConfigs(Map<String, WanReplicationConfig> c1, Map<String, WanReplicationConfig> c2) { if ((c1 != c2 && (c1 == null || c2 == null)) || c1.size() != c2.size()) { throw new HazelcastException(format("Incompatible wan replication config :\n{0}\n vs \n{1}", c1, c2)); } WanReplicationConfigChecker checker = new WanReplicationConfigChecker(); for (Entry<String, WanReplicationConfig> entry : c1.entrySet()) { checkCompatibleConfigs("wan replication", entry.getValue(), c2.get(entry.getKey()), checker); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkWanConfigs File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
checkWanConfigs
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public PermissionInfo getPermissionInfo(String name, int flags) { // reader synchronized (mPackages) { final BasePermission p = mSettings.mPermissions.get(name); if (p != null) { return generatePermissionInfo(p, flags); } return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermissionInfo 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
getPermissionInfo
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public String displayForm(DocumentReference classReference, String header, String format, boolean linebreak, XWikiContext context) { List<BaseObject> objects = getXObjects(classReference); if (format.endsWith("\\n")) { linebreak = true; } BaseObject firstobject = null; Iterator<BaseObject> foit = objects.iterator(); while ((firstobject == null) && foit.hasNext()) { firstobject = foit.next(); } if (firstobject == null) { return ""; } BaseClass bclass = firstobject.getXClass(context); if (bclass.getPropertyList().size() == 0) { return ""; } StringBuilder result = new StringBuilder(); VelocityContext vcontext; try { vcontext = getVelocityContextFactory().createContext(); } catch (XWikiVelocityException e) { LOGGER.error("Failed to create a standard VelocityContext", e); vcontext = new XWikiVelocityContext(); } for (String propertyName : bclass.getPropertyList()) { PropertyClass pclass = (PropertyClass) bclass.getField(propertyName); vcontext.put(pclass.getName(), pclass.getPrettyName()); } result.append(evaluate(header, context.getDoc().getPrefixedFullName(), vcontext, context)); if (linebreak) { result.append("\n"); } // display each line for (int i = 0; i < objects.size(); i++) { vcontext.put("id", Integer.valueOf(i + 1)); BaseObject object = objects.get(i); if (object != null) { for (String name : bclass.getPropertyList()) { vcontext.put(name, display(name, object, context)); } result.append(evaluate(format, context.getDoc().getPrefixedFullName(), vcontext, context)); if (linebreak) { result.append("\n"); } } } return result.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayForm 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
displayForm
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
@Override @SuppressFBWarnings("EI_EXPOSE_REP") public DomNode getPreviousSibling() { if (parent_ == null || this == parent_.firstChild_) { // previous sibling of first child points to last child return null; } return previousSibling_; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPreviousSibling File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
getPreviousSibling
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@POST @Path("blog/{nodeId}") @Operation(summary = "Update an blog building block", description = "Update an blog building block") @ApiResponse(responseCode = "200", description = "The course node metadatas", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or parentNode not found") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response updateBlog(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @FormParam("shortTitle") @DefaultValue("undefined") String shortTitle, @FormParam("longTitle") @DefaultValue("undefined") String longTitle, @FormParam("objectives") @DefaultValue("undefined") String objectives, @FormParam("visibilityExpertRules") String visibilityExpertRules, @FormParam("accessExpertRules") String accessExpertRules, @FormParam("repoEntry") Long blogResourceableId, @Context HttpServletRequest request) { RepositoryEntry blogRepoEntry = null; if(blogResourceableId != null) { RepositoryManager rm = RepositoryManager.getInstance(); blogRepoEntry = rm.lookupRepositoryEntry(blogResourceableId); if(blogRepoEntry == null) { return Response.serverError().status(Status.NOT_FOUND).build(); } } BlogCustomConfig config = new BlogCustomConfig(blogRepoEntry); return update(courseId, nodeId, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBlog File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
updateBlog
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
@Override public Response processWireFormat(WireFormatInfo info) throws Exception { wireFormatInfo = info; protocolVersion.set(info.getVersion()); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processWireFormat File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
processWireFormat
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
public static List<X509Certificate> getCertificateChain( List<X509Certificate> certs, X509Certificate leaf) { List<X509Certificate> unusedCerts = new ArrayList<>(certs); List<X509Certificate> result = new ArrayList<>(1); result.add(leaf); unusedCerts.remove(leaf); X509Certificate root = leaf; while (!root.getSubjectDN().equals(root.getIssuerDN())) { Principal targetDn = root.getIssuerDN(); boolean issuerFound = false; for (int i = 0; i < unusedCerts.size(); i++) { X509Certificate unusedCert = unusedCerts.get(i); if (targetDn.equals(unusedCert.getSubjectDN())) { issuerFound = true; unusedCerts.remove(i); result.add(unusedCert); root = unusedCert; break; } } if (!issuerFound) { break; } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertificateChain 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
getCertificateChain
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
@Override public int countAll() { Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY, this); if (count == null) { Session session = null; try { session = openSession(); Query q = session.createQuery(_SQL_COUNT_KBTEMPLATE); count = (Long)q.uniqueResult(); finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY, count); } catch (Exception e) { finderCache.removeResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY); throw processException(e); } finally { closeSession(session); } } return count.intValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: countAll File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
countAll
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection get(final String path1, final String path2, final String path3, final Route.Handler handler) { return new Route.Collection( new Route.Definition[]{get(path1, handler), get(path2, handler), get(path3, handler)}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get 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
get
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("AndroidFrameworkBinderIdentity") void binderRestoreCallingIdentity(long token) { Binder.restoreCallingIdentity(token); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: binderRestoreCallingIdentity 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
binderRestoreCallingIdentity
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void grantRequestedRuntimePermissions(PackageParser.Package pkg, int userId, String[] grantedPermissions) { if (userId >= UserHandle.USER_OWNER) { grantRequestedRuntimePermissionsForUser(pkg, userId, grantedPermissions); } else if (userId == UserHandle.USER_ALL) { final int[] userIds; synchronized (mPackages) { userIds = UserManagerService.getInstance().getUserIds(); } for (int someUserId : userIds) { grantRequestedRuntimePermissionsForUser(pkg, someUserId, grantedPermissions); } } // We could have touched GID membership, so flush out packages.list synchronized (mPackages) { mSettings.writePackageListLPr(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grantRequestedRuntimePermissions 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
grantRequestedRuntimePermissions
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private ActionGroupResolver reloadActionGroups(SecurityDynamicConfiguration<ActionGroupsV7> actionGroups) { return new ActionGroupResolver() { private Set<String> getGroupMembers(final String groupname) { if (actionGroups == null) { return Collections.emptySet(); } return Collections.unmodifiableSet(resolve(actionGroups, groupname)); } private Set<String> resolve(final SecurityDynamicConfiguration<?> actionGroups, final String entry) { // SG5 format, plain array //List<String> en = actionGroups.getAsList(DotPath.of(entry)); //if (en.isEmpty()) { // try SG6 format including readonly and permissions key // en = actionGroups.getAsList(DotPath.of(entry + "." + ConfigConstants.CONFIGKEY_ACTION_GROUPS_PERMISSIONS)); //} if(!actionGroups.getCEntries().containsKey(entry)) { return Collections.emptySet(); } final Set<String> ret = new HashSet<String>(); final Object actionGroupAsObject = actionGroups.getCEntries().get(entry); if(actionGroupAsObject != null && actionGroupAsObject instanceof List) { for (final String perm: ((List<String>) actionGroupAsObject)) { if (actionGroups.getCEntries().keySet().contains(perm)) { ret.addAll(resolve(actionGroups,perm)); } else { ret.add(perm); } } } else if(actionGroupAsObject != null && actionGroupAsObject instanceof ActionGroupsV7) { for (final String perm: ((ActionGroupsV7) actionGroupAsObject).getAllowed_actions()) { if (actionGroups.getCEntries().keySet().contains(perm)) { ret.addAll(resolve(actionGroups,perm)); } else { ret.add(perm); } } } else { throw new RuntimeException("Unable to handle "+actionGroupAsObject); } return Collections.unmodifiableSet(ret); } @Override public Set<String> resolvedActions(final List<String> actions) { final Set<String> resolvedActions = new HashSet<String>(); for (String string: actions) { final Set<String> groups = getGroupMembers(string); if (groups.isEmpty()) { resolvedActions.add(string); } else { resolvedActions.addAll(groups); } } return Collections.unmodifiableSet(resolvedActions); } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reloadActionGroups File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
reloadActionGroups
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
protected void updateVerticalPanelPosition(float x) { if (mNotificationStackScroller.getWidth() * 1.75f > getWidth()) { resetVerticalPanelPosition(); return; } float leftMost = mPositionMinSideMargin + mNotificationStackScroller.getWidth() / 2; float rightMost = getWidth() - mPositionMinSideMargin - mNotificationStackScroller.getWidth() / 2; if (Math.abs(x - getWidth() / 2) < mNotificationStackScroller.getWidth() / 4) { x = getWidth() / 2; } x = Math.min(rightMost, Math.max(leftMost, x)); setVerticalPanelTranslation(x - (mNotificationStackScroller.getLeft() + mNotificationStackScroller.getWidth() / 2)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateVerticalPanelPosition File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
updateVerticalPanelPosition
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
static boolean printThisActivity(PrintWriter pw, ActivityRecord activity, String dumpPackage, boolean needSep, String prefix) { if (activity != null) { if (dumpPackage == null || dumpPackage.equals(activity.packageName)) { if (needSep) { pw.println(); } pw.print(prefix); pw.println(activity); return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printThisActivity 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
printThisActivity
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws IOException { /* 09-Dec-2014, tatu: As per [databind#622], we need to allow Object Id references * to come in as JSON Objects as well; but for now assume they will * be simple, single-property references, which means that we can * recognize them without having to buffer anything. * Once again, if we must, we can do more complex handling with buffering, * but let's only do that if and when that becomes necessary. */ if ((_objectIdReader != null) && _objectIdReader.maySerializeAsObject()) { if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME) && _objectIdReader.isValidReferencePropertyName(p.currentName(), p)) { return deserializeFromObjectId(p, ctxt); } } if (_nonStandardCreation) { if (_unwrappedPropertyHandler != null) { return deserializeWithUnwrapped(p, ctxt); } if (_externalTypeIdHandler != null) { return deserializeWithExternalTypeId(p, ctxt); } Object bean = deserializeFromObjectUsingNonDefault(p, ctxt); /* 27-May-2014, tatu: I don't think view processing would work * at this point, so commenting it out; but leaving in place * just in case I forgot something fundamental... */ /* if (_needViewProcesing) { Class<?> view = ctxt.getActiveView(); if (view != null) { return deserializeWithView(p, ctxt, bean, view); } } */ return bean; } final Object bean = _valueInstantiator.createUsingDefault(ctxt); // [databind#631]: Assign current value, to be accessible by custom deserializers p.setCurrentValue(bean); if (p.canReadObjectId()) { Object id = p.getObjectId(); if (id != null) { _handleTypedObjectId(p, ctxt, bean, id); } } if (_injectables != null) { injectValues(ctxt, bean); } if (_needViewProcesing) { Class<?> view = ctxt.getActiveView(); if (view != null) { return deserializeWithView(p, ctxt, bean, view); } } if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME)) { String propName = p.currentName(); do { p.nextToken(); SettableBeanProperty prop = _beanProperties.find(propName); if (prop != null) { // normal case try { prop.deserializeAndSet(p, ctxt, bean); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt); } continue; } handleUnknownVanilla(p, ctxt, bean, propName); } while ((propName = p.nextFieldName()) != null); } return bean; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserializeFromObject File: src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42004
HIGH
7.5
FasterXML/jackson-databind
deserializeFromObject
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
063183589218fec19a9293ed2f17ec53ea80ba88
0
Analyze the following code function for security vulnerabilities
@Override public void push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Comment detail, List<Change> changes, AsyncMethodCallback resultHandler) { // TODO(trustin): Change Repository.commit() to return a Commit. handle(executor.execute(Command.push(convert(author), projectName, repositoryName, convert(baseRevision), summary, detail.getContent(), convert(detail.getMarkup()), convert(changes, Converter::convert))) .thenCompose(commitResult -> { final com.linecorp.centraldogma.common.Revision newRev = commitResult.revision(); return projectManager.get(projectName).repos().get(repositoryName) .history(newRev, newRev, "/**"); }) .thenApply(commits -> convert(commits.get(0))), resultHandler); }
Vulnerability Classification: - CWE: CWE-862 - CVE: CVE-2021-38388 - Severity: MEDIUM - CVSS Score: 6.5 Description: Address the comment by @ikhoon Function: push File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma Fixed Code: @Override public void push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Comment detail, List<Change> changes, AsyncMethodCallback resultHandler) { final List<com.linecorp.centraldogma.common.Change<?>> convertedChanges = convert(changes, Converter::convert); try { checkMirrorLocalRepo(repositoryName, convertedChanges); } catch (Exception e) { resultHandler.onError(e); return; } // TODO(trustin): Change Repository.commit() to return a Commit. handle(executor.execute(Command.push(convert(author), projectName, repositoryName, convert(baseRevision), summary, detail.getContent(), convert(detail.getMarkup()), convertedChanges)) .thenCompose(commitResult -> { final com.linecorp.centraldogma.common.Revision newRev = commitResult.revision(); return projectManager.get(projectName).repos().get(repositoryName) .history(newRev, newRev, "/**"); }) .thenApply(commits -> convert(commits.get(0))), resultHandler); }
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
push
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
1
Analyze the following code function for security vulnerabilities
public int bindServiceInstance(IApplicationThread caller, IBinder token, Intent service, String resolvedType, IServiceConnection connection, int flags, String instanceName, String callingPackage, int userId) throws TransactionTooLargeException { return bindServiceInstance(caller, token, service, resolvedType, connection, flags, instanceName, false, 0, null, callingPackage, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindServiceInstance 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
bindServiceInstance
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public File getResource(String resourcePath) { return getResource(null, resourcePath); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResource File: api/src/main/java/org/openmrs/ui/framework/resource/ResourceFactory.java Repository: openmrs/openmrs-module-uiframework The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-24621
MEDIUM
6.5
openmrs/openmrs-module-uiframework
getResource
api/src/main/java/org/openmrs/ui/framework/resource/ResourceFactory.java
0422fa52c7eba3d96cce2936cb92897dca4b680a
0
Analyze the following code function for security vulnerabilities
private AbstractRegistrationPage getRegistrationPage(boolean isModal) { // When testing the modal, we go the the user section of the administration. // Otherwise, we test the guest user registration form. if (isModal) { return RegistrationModal.gotoPage(); } else { return RegistrationPage.gotoPage(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRegistrationPage File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-94" ]
CVE-2024-21650
CRITICAL
9.8
xwiki/xwiki-platform
getRegistrationPage
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
b290bfd573c6f7db6cc15a88dd4111d9fcad0d31
0
Analyze the following code function for security vulnerabilities
public static void closeResource(Closeable closeable) { if (closeable == null) { return; } try { closeable.close(); } catch (IOException e) { Logger.getLogger(IOUtil.class).finest("closeResource failed", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeResource File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
closeResource
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private void sendDirectory(RoutingContext context, String path, String file) { if (directoryListing) { sendDirectoryListing(file, context); } else if (indexPage != null) { // send index page String indexPath; if (path.endsWith("/") && indexPage.startsWith("/")) { indexPath = path + indexPage.substring(1); } else if (!path.endsWith("/") && !indexPage.startsWith("/")) { indexPath = path + "/" + indexPage.substring(1); } else { indexPath = path + indexPage; } // recursive call sendStatic(context, indexPath); } else { // Directory listing denied context.fail(FORBIDDEN.code()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendDirectory 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
sendDirectory
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
private void setLong(String secureSettingKey, long value, int userHandle) { try { getLockSettings().setLong(secureSettingKey, value, userHandle); } catch (RemoteException re) { // What can we do? Log.e(TAG, "Couldn't write long " + secureSettingKey + re); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLong File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
setLong
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public static ApkSigningBlockUtils.Result verify( RunnablesExecutor executor, DataSource apk, ApkUtils.ZipSections zipSections, Map<Integer, String> supportedApkSigSchemeNames, Set<Integer> foundSigSchemeIds, int minSdkVersion, int maxSdkVersion) throws IOException, ApkFormatException, NoSuchAlgorithmException, ApkSigningBlockUtils.SignatureNotFoundException { ApkSigningBlockUtils.Result result = new ApkSigningBlockUtils.Result( ApkSigningBlockUtils.VERSION_APK_SIGNATURE_SCHEME_V2); SignatureInfo signatureInfo = ApkSigningBlockUtils.findSignature(apk, zipSections, V2SchemeConstants.APK_SIGNATURE_SCHEME_V2_BLOCK_ID , result); DataSource beforeApkSigningBlock = apk.slice(0, signatureInfo.apkSigningBlockOffset); DataSource centralDir = apk.slice( signatureInfo.centralDirOffset, signatureInfo.eocdOffset - signatureInfo.centralDirOffset); ByteBuffer eocd = signatureInfo.eocd; verify(executor, beforeApkSigningBlock, signatureInfo.signatureBlock, centralDir, eocd, supportedApkSigSchemeNames, foundSigSchemeIds, minSdkVersion, maxSdkVersion, result); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verify File: src/main/java/com/android/apksig/internal/apk/v2/V2SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
verify
src/main/java/com/android/apksig/internal/apk/v2/V2SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
public String host() { return host; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: host File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
host
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
private CompletableFuture<Command> privateAsyncRpc(Method m) throws IOException, ShutdownSignalException { CompletableFuture<Command> future = new CompletableFuture<>(); asyncRpc(m, future); return future; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: privateAsyncRpc File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
privateAsyncRpc
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
public String getDescription(RowReference row);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescription 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
getDescription
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public boolean isOnLoadPath(final File file) { if (file == null) { throw new IllegalArgumentException("A file must not be null"); } else if (unlimitedAccess) { return true; } else { final File f = canonical(file); final File dir = f.getParentFile(); // check load paths for(File p : paths) { if (p.isDirectory()) { if (dir.equals(p)) return true; } else if (p.isFile()) { if (f.equals(p)) return true; } } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOnLoadPath File: src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java Repository: jlangch/venice The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-36007
LOW
3.3
jlangch/venice
isOnLoadPath
src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java
c942c73136333bc493050910f171a48e6f575b23
0
Analyze the following code function for security vulnerabilities
@JRubyMethod(name = "file", meta = true) public static IRubyObject parse_file(ThreadContext context, IRubyObject klass, IRubyObject data, IRubyObject encoding) { Html4SaxParserContext ctx = Html4SaxParserContext.newInstance(context.runtime, (RubyClass) klass); ctx.setInputSourceFile(context, data); String javaEncoding = findEncodingName(context, encoding); if (javaEncoding != null) { ctx.getInputSource().setEncoding(javaEncoding); } return ctx; }
Vulnerability Classification: - CWE: CWE-241 - CVE: CVE-2022-29181 - Severity: MEDIUM - CVSS Score: 6.4 Description: fix: {HTML4,XML}::SAX::{Parser,ParserContext} check arg types Previously, arguments of the wrong type might cause segfault on CRuby. Function: parse_file File: ext/java/nokogiri/Html4SaxParserContext.java Repository: sparklemotion/nokogiri Fixed Code: @JRubyMethod(name = "file", meta = true) public static IRubyObject parse_file(ThreadContext context, IRubyObject klass, IRubyObject data, IRubyObject encoding) { if (!(data instanceof RubyString)) { throw context.getRuntime().newTypeError("data must be kind_of String"); } if (!(encoding instanceof RubyString)) { throw context.getRuntime().newTypeError("data must be kind_of String"); } Html4SaxParserContext ctx = Html4SaxParserContext.newInstance(context.runtime, (RubyClass) klass); ctx.setInputSourceFile(context, data); String javaEncoding = findEncodingName(context, encoding); if (javaEncoding != null) { ctx.getInputSource().setEncoding(javaEncoding); } return ctx; }
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
parse_file
ext/java/nokogiri/Html4SaxParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
1
Analyze the following code function for security vulnerabilities
public void setDumpDetails(boolean dumpDetails) { mDumpDetails = dumpDetails; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDumpDetails 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
setDumpDetails
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void addShellArg( String arg ) { shellArgs.add( arg ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addShellArg File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
addShellArg
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
private void vaultSecureStoreXmlGenerator(XmlGenerator gen, VaultSecureStoreConfig secureStoreConfig) { gen.open("vault") .node("address", secureStoreConfig.getAddress()) .node("secret-path", secureStoreConfig.getSecretPath()) .node("token", getOrMaskValue(secureStoreConfig.getToken())) .node("polling-interval", secureStoreConfig.getPollingInterval()); sslConfigXmlGenerator(gen, secureStoreConfig.getSSLConfig()); gen.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: vaultSecureStoreXmlGenerator 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
vaultSecureStoreXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
private static Method getEnumCreator(Class clazz, Class enumClass) { Method[] methods = clazz.getMethods(); Method jsonCreatorMethod = null; for (Method method : methods) { if (Modifier.isStatic(method.getModifiers()) && method.getReturnType() == enumClass && method.getParameterTypes().length == 1 ) { JSONCreator jsonCreator = method.getAnnotation(JSONCreator.class); if (jsonCreator != null) { jsonCreatorMethod = method; break; } } } return jsonCreatorMethod; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnumCreator File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
getEnumCreator
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
public void setDescriptor(Descriptor descriptor) { this.descriptor = descriptor; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDescriptor File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setDescriptor
base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public void setUserRestriction(String key, boolean value, int userId) { checkManageUsersPermission("setUserRestriction"); synchronized (mPackagesLock) { if (!SYSTEM_CONTROLLED_RESTRICTIONS.contains(key)) { Bundle restrictions = getUserRestrictions(userId); restrictions.putBoolean(key, value); setUserRestrictionsInternalLocked(restrictions, userId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserRestriction File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
setUserRestriction
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public void killAllBackgroundProcesses() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killAllBackgroundProcesses File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
killAllBackgroundProcesses
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public void removeConfigAttribute(ProfileAttribute configAttr) { configAttrs.remove(configAttr); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeConfigAttribute File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
removeConfigAttribute
base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Nullable private SettingsState peekSettingsStateLocked(int key) { SettingsState settingsState = mSettingsStates.get(key); if (settingsState != null) { return settingsState; } if (!ensureSettingsForUserLocked(getUserIdFromKey(key))) { return null; } return mSettingsStates.get(key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: peekSettingsStateLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
peekSettingsStateLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public boolean isDarkModeEnabled(Profile authUser, HttpServletRequest req) { return (authUser != null && authUser.getDarkmodeEnabled()) || "1".equals(HttpUtils.getCookieValue(req, "dark-mode")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDarkModeEnabled File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
isDarkModeEnabled
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public void onUidIdle(int uid, boolean disabled) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUidIdle File: services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21254
HIGH
7.8
android
onUidIdle
services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java
fa539c85503dc63bfb53c76b6f12b3549f14a709
0
Analyze the following code function for security vulnerabilities
private void addStaticResourceFlag(TagNode tag, String tagName) { if ("script".equals(tagName)) { String src = tag.getAttributeByName("src"); if (src != null) { tag.setForeignMarkup(true); Map<String, String> tmp = new LinkedHashMap<>(tag.getAttributes()); tmp.put("src", tryReplace(src)); tag.setAttributes(tmp); } } if ("link".equals(tagName)) { String src = tag.getAttributeByName("href"); if (src != null) { tag.setForeignMarkup(true); Map<String, String> tmp = new LinkedHashMap<>(tag.getAttributes()); tmp.put("href", tryReplace(src)); tag.setAttributes(tmp); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addStaticResourceFlag File: web/src/main/java/com/zrlog/web/handler/ResponseRenderPrintWriter.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
addStaticResourceFlag
web/src/main/java/com/zrlog/web/handler/ResponseRenderPrintWriter.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
public static boolean isPrefixPath(String firstPath, String secondPath) { firstPath = CmsStringUtil.joinPaths(firstPath, "/"); secondPath = CmsStringUtil.joinPaths(secondPath, "/"); return secondPath.startsWith(firstPath); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPrefixPath File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
isPrefixPath
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public void setChannel(String channel) { this.channel = channel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setChannel File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogLogin.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
setChannel
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogLogin.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
@Override public boolean isKeyPairGrantedToWifiAuth(String callerPackage, String alias) { Preconditions.checkStringNotEmpty(alias, "Alias to check cannot be empty"); final CallerIdentity caller = getCallerIdentity(callerPackage); Preconditions.checkCallAuthorization(canChooseCertificates(caller)); return mInjector.binderWithCleanCallingIdentity(() -> { try (KeyChainConnection keyChainConnection = KeyChain.bindAsUser(mContext, caller.getUserHandle())) { final List<String> result = new ArrayList<>(); final int[] granteeUids = keyChainConnection.getService().getGrants(alias); for (final int uid : granteeUids) { if (uid == Process.WIFI_UID) { return true; } } return false; } catch (RemoteException e) { Slogf.e(LOG_TAG, "Querying grant to wifi auth.", e); return false; } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isKeyPairGrantedToWifiAuth 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
isKeyPairGrantedToWifiAuth
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void reconfigureDisplayLocked(DisplayContent displayContent) { // TODO: Multidisplay: for now only use with default display. if (!mDisplayReady) { return; } configureDisplayPolicyLocked(displayContent); displayContent.layoutNeeded = true; boolean configChanged = updateOrientationFromAppTokensLocked(false); mTempConfiguration.setToDefaults(); mTempConfiguration.fontScale = mCurConfiguration.fontScale; computeScreenConfigurationLocked(mTempConfiguration); configChanged |= mCurConfiguration.diff(mTempConfiguration) != 0; if (configChanged) { mWaitingForConfig = true; startFreezingDisplayLocked(false, 0, 0); mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } performLayoutAndPlaceSurfacesLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reconfigureDisplayLocked 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
reconfigureDisplayLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void setPageExtractor(PageExtractor extractor) { this.pageExtractor = extractor; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPageExtractor File: bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43798
MEDIUM
5.4
bigbluebutton
setPageExtractor
bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
02ba4c6ff8e78a0f4384ad1b7c7367c5a90376e8
0
Analyze the following code function for security vulnerabilities
public void back() { if (this.myIndex > 0) { this.myIndex -= 1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: back File: src/main/java/org/codehaus/jettison/json/JSONTokener.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
back
src/main/java/org/codehaus/jettison/json/JSONTokener.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public void setSchema(Resource schemaResource) { this.schemaResources = new Resource[] {schemaResource}; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSchema File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
setSchema
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
@Exported public final List<AbstractProject> getUpstreamProjects() { return Jenkins.getInstance().getDependencyGraph().getUpstream(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUpstreamProjects 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
getUpstreamProjects
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@JsonProperty("applied_revision") public abstract long appliedRevision();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appliedRevision File: graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-613" ]
CVE-2023-41041
LOW
3.1
Graylog2/graylog2-server
appliedRevision
graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
0
Analyze the following code function for security vulnerabilities
public Integer getServerIndex() { return serverIndex; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServerIndex File: samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getServerIndex
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0