instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private String jsonbFunction( String functionName, String... params ) { return String.join( "", functionName, "(", String.join( ",", "inner_query_alias.sharing", Arrays.stream( params ) .map( this::withQuotes ) .collect( joining( "," ) ) ), ")" ); }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2022-24848 - Severity: MEDIUM - CVSS Score: 6.5 Description: Merge pull request from GHSA-52vp-f7hj-cj92 * fix: Add validation for programs org unit associations [DHIS2-13056] * fix compilation failure in test class * Fix one more compilation failure in another test class Co-authored-by: Lars Helge Øverland <lars@dhis2.org> Co-authored-by: Ameen <ameen@dhis2.org> Function: jsonbFunction File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java Repository: dhis2/dhis2-core Fixed Code: private String jsonbFunction( String functionName, String... params ) { return String.join( "", functionName, "(", String.join( ",", "inner_query_alias.sharing", Arrays.stream( params ) .map( SqlUtils::singleQuote ) .collect( joining( "," ) ) ), ")" ); }
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
jsonbFunction
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
1
Analyze the following code function for security vulnerabilities
private static void bindArgs(@NonNull SQLiteStatement st, @Nullable Object[] bindArgs) { if (bindArgs == null) return; for (int i = 0; i < bindArgs.length; i++) { final Object bindArg = bindArgs[i]; switch (getTypeOfObject(bindArg)) { case Cursor.FIELD_TYPE_NULL: st.bindNull(i + 1); break; case Cursor.FIELD_TYPE_INTEGER: st.bindLong(i + 1, ((Number) bindArg).longValue()); break; case Cursor.FIELD_TYPE_FLOAT: st.bindDouble(i + 1, ((Number) bindArg).doubleValue()); break; case Cursor.FIELD_TYPE_BLOB: st.bindBlob(i + 1, (byte[]) bindArg); break; case Cursor.FIELD_TYPE_STRING: default: if (bindArg instanceof Boolean) { // Provide compatibility with legacy // applications which may pass Boolean values in // bind args. st.bindLong(i + 1, ((Boolean) bindArg).booleanValue() ? 1 : 0); } else { st.bindString(i + 1, bindArg.toString()); } break; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindArgs File: src/com/android/providers/media/util/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-35683
MEDIUM
5.5
android
bindArgs
src/com/android/providers/media/util/DatabaseUtils.java
23d156ed1bed6d2c2b325f0be540d0afca510c49
0
Analyze the following code function for security vulnerabilities
@Override public boolean isAutoRevokeExempted(@NonNull String packageName, int userId) { Objects.requireNonNull(packageName); final AndroidPackage pkg = mPackageManagerInt.getPackage(packageName); final int callingUid = Binder.getCallingUid(); if (mPackageManagerInt.filterAppAccess(packageName, callingUid, userId)) { return false; } if (!checkAutoRevokeAccess(pkg, callingUid)) { return false; } final int packageUid = UserHandle.getUid(userId, pkg.getUid()); final long identity = Binder.clearCallingIdentity(); try { return mAppOpsManager.checkOpNoThrow( AppOpsManager.OP_AUTO_REVOKE_PERMISSIONS_IF_UNUSED, packageUid, packageName) == MODE_IGNORED; } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAutoRevokeExempted File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
isAutoRevokeExempted
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public static void updateIndicatorExemptedPackages(@NonNull Context context) { long now = SystemClock.elapsedRealtime(); if (sLastIndicatorUpdateTime == -1 || (now - sLastIndicatorUpdateTime) > EXEMPTED_INDICATOR_ROLE_UPDATE_FREQUENCY_MS) { sLastIndicatorUpdateTime = now; for (int i = 0; i < EXEMPTED_ROLES.length; i++) { INDICATOR_EXEMPTED_PACKAGES[i] = context.getString(EXEMPTED_ROLES[i]); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateIndicatorExemptedPackages File: core/java/android/permission/PermissionManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
updateIndicatorExemptedPackages
core/java/android/permission/PermissionManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
void markCallAsDisconnected(Call call, DisconnectCause disconnectCause) { call.setDisconnectCause(disconnectCause); setCallState(call, CallState.DISCONNECTED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: markCallAsDisconnected File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
markCallAsDisconnected
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
@Override public boolean isPackageSuspended(ComponentName who, String callerPackage, String packageName) { final CallerIdentity caller = getCallerIdentity(who, callerPackage); if (isUnicornFlagEnabled()) { enforcePermission( MANAGE_DEVICE_POLICY_PACKAGE_STATE, caller.getPackageName(), caller.getUserId()); } else { Preconditions.checkCallAuthorization((caller.hasAdminComponent() && (isProfileOwner(caller) || isDefaultDeviceOwner(caller))) || (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_PACKAGE_ACCESS))); } synchronized (getLockObject()) { long id = mInjector.binderClearCallingIdentity(); try { return mIPackageManager.isPackageSuspendedForUser(packageName, caller.getUserId()); } catch (RemoteException re) { // Shouldn't happen. Slogf.e(LOG_TAG, "Failed talking to the package manager", re); } finally { mInjector.binderRestoreCallingIdentity(id); } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPackageSuspended 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
isPackageSuspended
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private String addHttpToUrlWhenPrefixNotPresent(String url) { if (url == null || url.toLowerCase().startsWith("http") || url.contains("://")) { return url; } return "http://" + url; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addHttpToUrlWhenPrefixNotPresent File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-38298
HIGH
8.8
appsmithorg/appsmith
addHttpToUrlWhenPrefixNotPresent
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
0
Analyze the following code function for security vulnerabilities
@Override public boolean glob() { return route.glob(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: glob File: jooby/src/main/java/org/jooby/internal/RouteImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
glob
jooby/src/main/java/org/jooby/internal/RouteImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
public Object toRestObject(URI baseUri, Document doc, BaseObject xwikiObject, boolean useVersion, Boolean withPrettyNames) { Object object = this.objectFactory.createObject(); fillObjectSummary(object, doc, xwikiObject, withPrettyNames); XWikiContext xwikiContext = this.xcontextProvider.get(); BaseClass xwikiClass = xwikiObject.getXClass(xwikiContext); for (java.lang.Object propertyClassObject : xwikiClass.getProperties()) { com.xpn.xwiki.objects.classes.PropertyClass propertyClass = (com.xpn.xwiki.objects.classes.PropertyClass) propertyClassObject; Property property = this.objectFactory.createProperty(); for (java.lang.Object o : propertyClass.getProperties()) { BaseProperty baseProperty = (BaseProperty) o; Attribute attribute = this.objectFactory.createAttribute(); attribute.setName(baseProperty.getName()); /* Check for null values in order to prevent NPEs */ if (baseProperty.getValue() != null) { attribute.setValue(baseProperty.getValue().toString()); } else { attribute.setValue(""); } property.getAttributes().add(attribute); } if (propertyClass instanceof ListClass) { ListClass listClass = (ListClass) propertyClass; List allowedValueList = listClass.getList(xwikiContext); if (!allowedValueList.isEmpty()) { Formatter f = new Formatter(); for (int i = 0; i < allowedValueList.size(); i++) { if (i != allowedValueList.size() - 1) { f.format("%s,", allowedValueList.get(i).toString()); } else { f.format("%s", allowedValueList.get(i).toString()); } } Attribute attribute = this.objectFactory.createAttribute(); attribute.setName(Constants.ALLOWED_VALUES_ATTRIBUTE_NAME); attribute.setValue(f.toString()); property.getAttributes().add(attribute); } } property.setName(propertyClass.getName()); property.setType(propertyClass.getClassType()); if (hasAccess(property)) { try { property.setValue( serializePropertyValue(xwikiObject.get(propertyClass.getName()), propertyClass, xwikiContext)); } catch (XWikiException e) { // Should never happen logger.error("Unexpected exception when accessing property [{}]", propertyClass.getName(), e); } } String propertyUri; if (useVersion) { propertyUri = Utils .createURI(baseUri, ObjectPropertyAtPageVersionResource.class, doc.getWiki(), Utils.getSpacesFromSpaceId(doc.getSpace()), doc.getDocumentReference().getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName()) .toString(); } else { propertyUri = Utils.createURI(baseUri, ObjectPropertyResource.class, doc.getWiki(), Utils.getSpacesFromSpaceId(doc.getSpace()), doc.getDocumentReference().getName(), xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName()).toString(); } Link propertyLink = this.objectFactory.createLink(); propertyLink.setHref(propertyUri); propertyLink.setRel(Relations.SELF); property.getLinks().add(propertyLink); object.getProperties().add(property); } Link objectLink = getObjectLink(this.objectFactory, baseUri, doc, xwikiObject, useVersion, Relations.SELF); object.getLinks().add(objectLink); return object; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toRestObject File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-35151
HIGH
7.5
xwiki/xwiki-platform
toRestObject
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
824cd742ecf5439971247da11bfe7e0ad2b10ede
0
Analyze the following code function for security vulnerabilities
public String htmlStart(String helpUrl, String title) { return pageHtml(HTML_START, helpUrl, title); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: htmlStart File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
htmlStart
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private static String maybeAddRequestId(final String ref, final HttpServletRequest request) { final Optional<String> headerName = REQUEST_ID_HEADERS.stream().filter(h -> request.getHeader(h) != null).findFirst(); return headerName.map(s -> ref + "@" + request.getHeader(s).replaceAll("[^a-zA-Z0-9._:-]", "_") ).orElse(ref); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-15231 - Severity: MEDIUM - CVSS Score: 4.3 Description: Remove JSONP support See: https://github.com/mapfish/mapfish-print/security/code-scanning/5?query=ref%3Arefs%2Fheads%2Fmaster Function: maybeAddRequestId File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java Repository: mapfish/mapfish-print Fixed Code: private static String maybeAddRequestId(final String ref, final HttpServletRequest request) { final Optional<String> headerName = REQUEST_ID_HEADERS.stream().filter(h -> request.getHeader(h) != null).findFirst(); return headerName.map( s -> ref + "@" + request.getHeader(s).replaceAll("[^a-zA-Z0-9._:-]", "_") ).orElse(ref); }
[ "CWE-79" ]
CVE-2020-15231
MEDIUM
4.3
mapfish/mapfish-print
maybeAddRequestId
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
89155f2506b9cee822e15ce60ccae390a1419d5e
1
Analyze the following code function for security vulnerabilities
public Double optDoubleObject(String key) { return this.optDoubleObject(key, Double.NaN); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optDoubleObject File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
optDoubleObject
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
protected void renderTemplate(String templateName, Map<String, Object> referenceMap, HttpServletResponse httpResponse) throws IOException { // first we should get velocity tools context for current client request (within // his http session) and merge that tools context with basic velocity context if (referenceMap == null) { return; } Object locale = referenceMap.get(FilterUtil.LOCALE_ATTRIBUTE); ToolContext velocityToolContext = getToolContext( locale != null ? locale.toString() : Context.getLocale().toString()); VelocityContext velocityContext = new VelocityContext(velocityToolContext); for (Map.Entry<String, Object> entry : referenceMap.entrySet()) { velocityContext.put(entry.getKey(), entry.getValue()); } Object model = getUpdateFilterModel(); // put each of the private varibles into the template for convenience for (Field field : model.getClass().getDeclaredFields()) { try { field.setAccessible(true); velocityContext.put(field.getName(), field.get(model)); } catch (IllegalArgumentException | IllegalAccessException e) { log.error("Error generated while getting field value: " + field.getName(), e); } } String fullTemplatePath = getTemplatePrefix() + templateName; InputStream templateInputStream = getClass().getClassLoader().getResourceAsStream(fullTemplatePath); if (templateInputStream == null) { throw new IOException("Unable to find " + fullTemplatePath); } velocityContext.put("errors", errors); velocityContext.put("msgs", msgs); // explicitly set the content type for the response because some servlet containers are assuming text/plain httpResponse.setContentType("text/html"); try { velocityEngine.evaluate(velocityContext, httpResponse.getWriter(), this.getClass().getName(), new InputStreamReader(templateInputStream, StandardCharsets.UTF_8)); } catch (Exception e) { throw new APIException("Unable to process template: " + fullTemplatePath, e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renderTemplate File: web/src/main/java/org/openmrs/web/filter/StartupFilter.java Repository: openmrs/openmrs-core The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23612
MEDIUM
5
openmrs/openmrs-core
renderTemplate
web/src/main/java/org/openmrs/web/filter/StartupFilter.java
db8454bf19a092a78d53ee4dba2af628b730a6e7
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection use(final String path, final Class<?> routeClass) { requireNonNull(routeClass, "Route class is required."); requireNonNull(path, "Path is required"); MvcClass mvc = new MvcClass(routeClass, path, prefix); bag.add(mvc); return new Route.Collection(mvc); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: use 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
use
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public void setConfigAttrs(List<ProfileAttribute> configAttrs) { this.configAttrs = configAttrs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConfigAttrs 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
setConfigAttrs
base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private static int convertScanModeToHal(int mode) { switch (mode) { case BluetoothAdapter.SCAN_MODE_NONE: return AbstractionLayer.BT_SCAN_MODE_NONE; case BluetoothAdapter.SCAN_MODE_CONNECTABLE: return AbstractionLayer.BT_SCAN_MODE_CONNECTABLE; case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE: return AbstractionLayer.BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE; } // errorLog("Incorrect scan mode in convertScanModeToHal"); return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertScanModeToHal File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
convertScanModeToHal
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public static String sanitizeInput(String string) { return string .replaceAll("(?i)<script.*?>.*?</script.*?>", "") // case 1 - Open and close .replaceAll("(?i)<script.*?/>", "") // case 1 - Open / close .replaceAll("(?i)<script.*?>", "") // case 1 - Open and !close .replaceAll("(?i)<.*?javascript:.*?>.*?</.*?>", "") // case 2 - Open and close .replaceAll("(?i)<.*?javascript:.*?/>", "") // case 2 - Open / close .replaceAll("(?i)<.*?javascript:.*?>", "") // case 2 - Open and !close .replaceAll("(?i)<.*?\\s+on.*?>.*?</.*?>", "") // case 3 - Open and close .replaceAll("(?i)<.*?\\s+on.*?/>", "") // case 3 - Open / close .replaceAll("(?i)<.*?\\s+on.*?>", ""); // case 3 - Open and !close }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2022-40317 - Severity: MEDIUM - CVSS Score: 5.4 Description: Reported XSS vulnerability Fix #333 Function: sanitizeInput File: src/main/java/com/openkm/util/FormatUtil.java Repository: openkm/document-management-system Fixed Code: public static String sanitizeInput(String string) { return string .replaceAll("(?i)<script.*?>.*?</script.*?>", "") // case 1 - Open and close .replaceAll("(?i)<script.*?/>", "") // case 1 - Open / close .replaceAll("(?i)<script.*?>", "") // case 1 - Open and !close .replaceAll("(?i)<.*?javascript:.*?>.*?</.*?>", "") // case 2 - Open and close .replaceAll("(?i)<.*?javascript:.*?/>", "") // case 2 - Open / close .replaceAll("(?i)<.*?javascript:.*?>", "") // case 2 - Open and !close .replaceAll("(?i)<.*?javascript&colon;.*?>.*?</.*?>", "") // case 2.5 - Open and close .replaceAll("(?i)<.*?javascript&colon;.*?/>", "") // case 2.5 - Open / close .replaceAll("(?i)<.*?javascript&colon;.*?>", "") // case 2.5 - Open and !close .replaceAll("(?i)<.*?\\s+on.*?>.*?</.*?>", "") // case 3 - Open and close .replaceAll("(?i)<.*?\\s+on.*?/>", "") // case 3 - Open / close .replaceAll("(?i)<.*?\\s+on.*?>", ""); // case 3 - Open and !close }
[ "CWE-79" ]
CVE-2022-40317
MEDIUM
5.4
openkm/document-management-system
sanitizeInput
src/main/java/com/openkm/util/FormatUtil.java
870d518f7de349c3fa4c7b9883789fdca4590c4e
1
Analyze the following code function for security vulnerabilities
private void enforceUserUnlocked(int userId) { // Since we're doing this operation on behalf of an app, we only // want to use the actual "unlocked" state. Preconditions.checkState(mUserManager.isUserUnlocked(userId), "User must be running and unlocked"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceUserUnlocked 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
enforceUserUnlocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static String applySorting(String query, Sort sort, String alias) { Assert.hasText(query); if (null == sort || !sort.iterator().hasNext()) { return query; } StringBuilder builder = new StringBuilder(query); if (!ORDER_BY.matcher(query).matches()) { builder.append(" order by "); } else { builder.append(", "); } Set<String> aliases = getOuterJoinAliases(query); for (Order order : sort) { builder.append(getOrderClause(aliases, alias, order)).append(", "); } builder.delete(builder.length() - 2, builder.length()); return builder.toString(); }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2016-6652 - Severity: MEDIUM - CVSS Score: 6.8 Description: DATAJPA-965 - Fix potential blind SQL injection in Sort when used in combination with @Query. We now decline sort expressions that contain functions such as ORDER BY LENGTH(name) when used with repository having a String query defined via the @Query annotation. Think of a query method as follows: @Query("select p from Person p where LOWER(p.lastname) = LOWER(:lastname)") List<Person> findByLastname(@Param("lastname") String lastname, Sort sort); Calls to findByLastname("lannister", new Sort("LENGTH(firstname)")) from now on throw an Exception indicating function calls are not allowed within the _ORDER BY_ clause. However you still can use JpaSort.unsafe("LENGTH(firstname)") to restore the behavior. Kudos to Niklas Särökaari, Joona Immonen, Arto Santala, Antti Virtanen, Michael Holopainen and Antti Ahola who brought this to our attention. Function: applySorting File: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java Repository: spring-projects/spring-data-jpa Fixed Code: public static String applySorting(String query, Sort sort, String alias) { Assert.hasText(query); if (null == sort || !sort.iterator().hasNext()) { return query; } StringBuilder builder = new StringBuilder(query); if (!ORDER_BY.matcher(query).matches()) { builder.append(" order by "); } else { builder.append(", "); } Set<String> aliases = getOuterJoinAliases(query); Set<String> functionAliases = getFunctionAliases(query); for (Order order : sort) { builder.append(getOrderClause(aliases, functionAliases, alias, order)).append(", "); } builder.delete(builder.length() - 2, builder.length()); return builder.toString(); }
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
applySorting
src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
b8e7fe
1
Analyze the following code function for security vulnerabilities
@Override public Bundle getApplicationRestrictionsForUser(String packageName, int userId) { if (UserHandle.getCallingUserId() != userId || !UserHandle.isSameApp(Binder.getCallingUid(), getUidForPackage(packageName))) { checkManageUsersPermission("Only system can get restrictions for other users/apps"); } synchronized (mPackagesLock) { // Read the restrictions from XML return readApplicationRestrictionsLocked(packageName, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApplicationRestrictionsForUser 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
getApplicationRestrictionsForUser
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
private UserGroupPermissionDTO getUserGroupPermission(String userId) { UserGroupPermissionDTO permissionDTO = new UserGroupPermissionDTO(); List<GroupResourceDTO> list = new ArrayList<>(); UserGroupExample userGroupExample = new UserGroupExample(); userGroupExample.createCriteria().andUserIdEqualTo(userId); List<UserGroup> userGroups = userGroupMapper.selectByExample(userGroupExample); if (CollectionUtils.isEmpty(userGroups)) { return permissionDTO; } permissionDTO.setUserGroups(userGroups); List<String> groupList = userGroups.stream().map(UserGroup::getGroupId).collect(Collectors.toList()); GroupExample groupExample = new GroupExample(); groupExample.createCriteria().andIdIn(groupList); List<Group> groups = groupMapper.selectByExample(groupExample); permissionDTO.setGroups(groups); for (Group gp : groups) { GroupResourceDTO dto = new GroupResourceDTO(); dto.setGroup(gp); UserGroupPermissionExample userGroupPermissionExample = new UserGroupPermissionExample(); userGroupPermissionExample.createCriteria().andGroupIdEqualTo(gp.getId()); List<UserGroupPermission> userGroupPermissions = userGroupPermissionMapper.selectByExample(userGroupPermissionExample); dto.setUserGroupPermissions(userGroupPermissions); list.add(dto); } permissionDTO.setList(list); return permissionDTO; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserGroupPermission File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-32699
MEDIUM
6.5
metersphere
getUserGroupPermission
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
c59e381d368990214813085a1a4877c5ef865411
0
Analyze the following code function for security vulnerabilities
@Override public String getContentType() { return this.response.getContentType(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentType File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-601" ]
CVE-2022-23618
MEDIUM
5.8
xwiki/xwiki-platform
getContentType
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
5251c02080466bf9fb55288f04a37671108f8096
0
Analyze the following code function for security vulnerabilities
protected void loadDimens() { final Resources res = mContext.getResources(); int oldBarHeight = mNaturalBarHeight; mNaturalBarHeight = res.getDimensionPixelSize( com.android.internal.R.dimen.status_bar_height); if (mStatusBarWindowManager != null && mNaturalBarHeight != oldBarHeight) { mStatusBarWindowManager.setBarHeight(mNaturalBarHeight); } mMaxAllowedKeyguardNotifications = res.getInteger( R.integer.keyguard_max_notification_count); if (DEBUG) Log.v(TAG, "defineSlots"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadDimens File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
loadDimens
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void handleListenerInterruptionFilterChanged(int interruptionFilter) { synchronized (mNotificationList) { mListeners.notifyInterruptionFilterChanged(interruptionFilter); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleListenerInterruptionFilterChanged File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
handleListenerInterruptionFilterChanged
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@Override public List<ProcessMemoryState> getMemoryStateForProcesses() { List<ProcessMemoryState> processMemoryStates = new ArrayList<>(); synchronized (mPidsSelfLocked) { for (int i = 0, size = mPidsSelfLocked.size(); i < size; i++) { final ProcessRecord r = mPidsSelfLocked.valueAt(i); final int pid = r.pid; final int uid = r.uid; final MemoryStat memoryStat = readMemoryStatFromFilesystem(uid, pid); if (memoryStat == null) { continue; } ProcessMemoryState processMemoryState = new ProcessMemoryState(uid, r.processName, r.maxAdj, memoryStat.pgfault, memoryStat.pgmajfault, memoryStat.rssInBytes, memoryStat.cacheInBytes, memoryStat.swapInBytes); processMemoryStates.add(processMemoryState); } } return processMemoryStates; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMemoryStateForProcesses File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
getMemoryStateForProcesses
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public int getPort() { return port; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPort 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
getPort
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
protected void validateMaterialUrl(UrlArgument url) { if (url == null || isBlank(url.forDisplay())) { errors().add(URL, "URL cannot be blank"); return; } }
Vulnerability Classification: - CWE: CWE-77 - CVE: CVE-2021-43286 - Severity: MEDIUM - CVSS Score: 6.5 Description: #000 - Validate URLs provided - Disallow URLs which are obviously not URLs. Function: validateMaterialUrl File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java Repository: gocd Fixed Code: protected void validateMaterialUrl(UrlArgument url) { if (url == null || isBlank(url.forDisplay())) { errors().add(URL, "URL cannot be blank"); return; } if (System.getProperty("gocd.verify.url.correctness", "y").equalsIgnoreCase("y") && !url.isValidURLOrLocalPath()) { errors().add(URL, "URL does not seem to be valid."); } }
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
validateMaterialUrl
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
1
Analyze the following code function for security vulnerabilities
private void verifyShortcutInfoPackage(String callerPackage, ShortcutInfo si) { if (si == null) { return; } if (!Objects.equals(callerPackage, si.getPackage())) { android.util.EventLog.writeEvent(0x534e4554, "109824443", -1, ""); throw new SecurityException("Shortcut package name mismatch"); } }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-40092 - Severity: MEDIUM - CVSS Score: 5.5 Description: Validate userId when publishing shortcuts Bug: 288110451 Test: manual (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:01bfd04ff445db6290ae430d44ea1bf1a115fe3c) Merged-In: Idbde676f871db83825155730e3714f3727e25762 Change-Id: Idbde676f871db83825155730e3714f3727e25762 Function: verifyShortcutInfoPackage File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android Fixed Code: private void verifyShortcutInfoPackage(String callerPackage, ShortcutInfo si) { if (si == null) { return; } if (!Objects.equals(callerPackage, si.getPackage())) { android.util.EventLog.writeEvent(0x534e4554, "109824443", -1, ""); throw new SecurityException("Shortcut package name mismatch"); } final int callingUid = injectBinderCallingUid(); if (UserHandle.getUserId(callingUid) != si.getUserId()) { throw new SecurityException("User-ID in shortcut doesn't match the caller"); } }
[ "CWE-Other" ]
CVE-2023-40092
MEDIUM
5.5
android
verifyShortcutInfoPackage
services/core/java/com/android/server/pm/ShortcutService.java
a5e55363e69b3c84d3f4011c7b428edb1a25752c
1
Analyze the following code function for security vulnerabilities
@GuardedBy("getLockObject()") private List<ActiveAdmin> getActiveAdminsForUserAndItsManagedProfilesInclPermissionBasedAdminLocked(int userHandle, Predicate<UserInfo> shouldIncludeProfileAdmins) { ArrayList<ActiveAdmin> admins = new ArrayList<>(); mInjector.binderWithCleanCallingIdentity(() -> { for (UserInfo userInfo : mUserManager.getProfiles(userHandle)) { DevicePolicyData policy = getUserDataUnchecked(userInfo.id); if (userInfo.id == userHandle) { admins.addAll(policy.mAdminList); if (policy.mPermissionBasedAdmin != null) { admins.add(policy.mPermissionBasedAdmin); } } else if (userInfo.isManagedProfile()) { for (int i = 0; i < policy.mAdminList.size(); i++) { ActiveAdmin admin = policy.mAdminList.get(i); if (admin.hasParentActiveAdmin()) { admins.add(admin.getParentActiveAdmin()); } if (shouldIncludeProfileAdmins.test(userInfo)) { admins.add(admin); } } if (policy.mPermissionBasedAdmin != null && shouldIncludeProfileAdmins.test(userInfo)) { admins.add(policy.mPermissionBasedAdmin); } } } }); return admins; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveAdminsForUserAndItsManagedProfilesInclPermissionBasedAdminLocked 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
getActiveAdminsForUserAndItsManagedProfilesInclPermissionBasedAdminLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public static List<String> tokenize(String schema) { List<String> ret=new ArrayList<String>(); if (schema!=null) { QueryTokenizer tokenizer=new QueryTokenizer(";","--",true); QueryTokenizer extraTokenizer=null; if (DbConnectionFactory.isMsSql()) { //";","--",true IQueryTokenizerPreferenceBean prefs = new MSSQLPreferenceBean(); //prefs.setStatementSeparator("GO"); extraTokenizer=new MSSQLQueryTokenizer(prefs); }else if(DbConnectionFactory.isOracle()){ IQueryTokenizerPreferenceBean prefs = new OraclePreferenceBean(); tokenizer=new OracleQueryTokenizer(prefs); }else if(DbConnectionFactory.isMySql()){ IQueryTokenizerPreferenceBean prefs = new BaseQueryTokenizerPreferenceBean(); prefs.setProcedureSeparator("#"); tokenizer=new MysqlQueryTokenizer(prefs); } tokenizer.setScriptToTokenize(schema.toString()); while (tokenizer.hasQuery() ) { String querySql = tokenizer.nextQuery(); if (querySql != null) { if (extraTokenizer !=null) { extraTokenizer.setScriptToTokenize(querySql); if (extraTokenizer.hasQuery()) { while (extraTokenizer.hasQuery()) { String innerSql = extraTokenizer.nextQuery(); if (innerSql!=null) { ret.add(innerSql); } } } else { ret.add(querySql); } } else { ret.add(querySql); } } } } return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tokenize File: src/com/dotmarketing/common/util/SQLUtil.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
tokenize
src/com/dotmarketing/common/util/SQLUtil.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
@Override public ServerHttpResponse serverResponse() { return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serverResponse File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
serverResponse
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
@Override public void disconnect(String callId, Session.Info info) throws RemoteException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disconnect File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
disconnect
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private boolean isGuessOK(KexParameters cpar, KexParameters spar) { if (cpar == null || spar == null) throw new IllegalArgumentException(); if (!compareFirstOfNameList(cpar.kex_algorithms, spar.kex_algorithms)) { return false; } return compareFirstOfNameList(cpar.server_host_key_algorithms, spar.server_host_key_algorithms); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isGuessOK File: src/main/java/com/trilead/ssh2/transport/KexManager.java Repository: connectbot/sshlib The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
connectbot/sshlib
isGuessOK
src/main/java/com/trilead/ssh2/transport/KexManager.java
5c8b534f6e97db7ac0e0e579331213aa25c173ab
0
Analyze the following code function for security vulnerabilities
private void configureDisplayPolicyLocked(DisplayContent displayContent) { mPolicy.setInitialDisplaySize(displayContent.getDisplay(), displayContent.mBaseDisplayWidth, displayContent.mBaseDisplayHeight, displayContent.mBaseDisplayDensity); DisplayInfo displayInfo = displayContent.getDisplayInfo(); mPolicy.setDisplayOverscan(displayContent.getDisplay(), displayInfo.overscanLeft, displayInfo.overscanTop, displayInfo.overscanRight, displayInfo.overscanBottom); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: configureDisplayPolicyLocked 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
configureDisplayPolicyLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private boolean useTrustOnFirstUse() { return mIsTrustOnFirstUseSupported && mCurrentTofuConfig.enterpriseConfig.isTrustOnFirstUseEnabled(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: useTrustOnFirstUse File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
useTrustOnFirstUse
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
protected Map<String, Object> getMetaData(RoutingContext ctx) { // Add some context to dfe Map<String, Object> metaData = new ConcurrentHashMap<>(); metaData.put("runBlocking", runBlocking); metaData.put("httpHeaders", getHeaders(ctx)); return metaData; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaData File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-444" ]
CVE-2022-2466
CRITICAL
9.8
quarkusio/quarkus
getMetaData
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java
08e5c3106ce4bfb18b24a38514eeba6464668b07
0
Analyze the following code function for security vulnerabilities
public String getDirective(String name) { return directives.get(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDirective File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
getDirective
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
@Pure public @Nullable Timestamp getTimestamp(String columnName) throws SQLException { return getTimestamp(findColumn(columnName), null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTimestamp File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getTimestamp
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public RevisionInfo getRevisionInfo(String version) throws XWikiException { return new RevisionInfo(this.doc.getRevisionInfo(version, getXWikiContext()), getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRevisionInfo 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
getRevisionInfo
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 protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in) throws Exception { super.decodeLast(ctx, in); if (resetRequested) { // If a reset was requested by decodeLast() we need to do it now otherwise we may produce a // LastHttpContent while there was already one. resetNow(); } // Handle the last unfinished message. if (message != null) { boolean chunked = HttpUtil.isTransferEncodingChunked(message); if (currentState == State.READ_VARIABLE_LENGTH_CONTENT && !in.isReadable() && !chunked) { // End of connection. ctx.fireChannelRead(LastHttpContent.EMPTY_LAST_CONTENT); resetNow(); return; } if (currentState == State.READ_HEADER) { // If we are still in the state of reading headers we need to create a new invalid message that // signals that the connection was closed before we received the headers. ctx.fireChannelRead(invalidMessage(Unpooled.EMPTY_BUFFER, new PrematureChannelClosureException("Connection closed before received headers"))); resetNow(); return; } // Check if the closure of the connection signifies the end of the content. boolean prematureClosure; if (isDecodingRequest() || chunked) { // The last request did not wait for a response. prematureClosure = true; } else { // Compare the length of the received content and the 'Content-Length' header. // If the 'Content-Length' header is absent, the length of the content is determined by the end of the // connection, so it is perfectly fine. prematureClosure = contentLength() > 0; } if (!prematureClosure) { ctx.fireChannelRead(LastHttpContent.EMPTY_LAST_CONTENT); } resetNow(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decodeLast File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2019-20445
MEDIUM
6.4
netty
decodeLast
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
f7fa9fce72dd423200af1131adf6f089b311128d
0
Analyze the following code function for security vulnerabilities
@Override public boolean updateOverrideApn(@NonNull ComponentName who, int apnId, @NonNull ApnSetting apnSetting) { if (!mHasFeature || !mHasTelephonyFeature) { return false; } Objects.requireNonNull(who, "ComponentName is null"); Objects.requireNonNull(apnSetting, "ApnSetting is null in updateOverrideApn"); final CallerIdentity caller = getCallerIdentity(who); ApnSetting apn = getApnSetting(apnId); if (apn != null && apn.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE && apnSetting.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE) { Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller) || isManagedProfileOwner(caller)); } else { Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); } if (apnId < 0) { return false; } TelephonyManager tm = mContext.getSystemService(TelephonyManager.class); if (tm != null) { return mInjector.binderWithCleanCallingIdentity( () -> tm.modifyDevicePolicyOverrideApn(mContext, apnId, apnSetting)); } else { Slogf.w(LOG_TAG, "TelephonyManager is null when trying to modify override apn"); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateOverrideApn 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
updateOverrideApn
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void setSoftKeyboardCallbackEnabled(boolean enabled) { final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getInstance().getConnection( mService.mConnectionId); if (connection != null) { try { connection.setSoftKeyboardCallbackEnabled(enabled); } catch (RemoteException re) { throw new RuntimeException(re); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSoftKeyboardCallbackEnabled File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
setSoftKeyboardCallbackEnabled
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
@Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_UPDATE_METADATA: pushMetadataUpdate(); break; case MSG_UPDATE_PLAYBACK_STATE: pushPlaybackStateUpdate(); break; case MSG_UPDATE_QUEUE: pushQueueUpdate(); break; case MSG_UPDATE_QUEUE_TITLE: pushQueueTitleUpdate(); break; case MSG_UPDATE_EXTRAS: pushExtrasUpdate(); break; case MSG_SEND_EVENT: pushEvent((String) msg.obj, msg.getData()); break; case MSG_UPDATE_SESSION_STATE: // TODO add session state break; case MSG_UPDATE_VOLUME: pushVolumeUpdate(); break; case MSG_DESTROYED: pushSessionDestroyed(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleMessage File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
handleMessage
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
protected void quickPasswordEdit(String previousValue, OnValueEdited callback) { quickEdit(previousValue, callback, R.string.password, true, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: quickPasswordEdit File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
quickPasswordEdit
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
protected void setNotificationsShown(String[] keys) { try { mNotificationListener.setNotificationsShown(keys); } catch (RuntimeException e) { Log.d(TAG, "failed setNotificationsShown: ", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNotificationsShown File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
setNotificationsShown
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public Account[] getSharedAccountsAsUser(int userId) { userId = handleIncomingUser(userId); UserAccounts accounts = getUserAccounts(userId); synchronized (accounts.dbLock) { List<Account> accountList = accounts.accountsDb.getSharedAccounts(); Account[] accountArray = new Account[accountList.size()]; accountList.toArray(accountArray); return accountArray; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSharedAccountsAsUser 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
getSharedAccountsAsUser
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override @Deprecated public void setStatus(int i, String s) { this.response.setStatus(i, s); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStatus File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-601" ]
CVE-2022-23618
MEDIUM
5.8
xwiki/xwiki-platform
setStatus
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
5251c02080466bf9fb55288f04a37671108f8096
0
Analyze the following code function for security vulnerabilities
@Override @NotNull public Set<String> getGroups(Object principal) { Set<String> groups = new HashSet<>(); groups.add(SecurityLogic.getAllGroup(portofinoConfiguration)); if (principal == null) { groups.add(SecurityLogic.getAnonymousGroup(portofinoConfiguration)); } else if (principal instanceof Serializable) { groups.add(SecurityLogic.getRegisteredGroup(portofinoConfiguration)); groups.addAll(loadAuthorizationInfo((Serializable) principal)); } else { throw new AuthorizationException("Invalid principal: " + principal); } return groups; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGroups 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
getGroups
portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
0
Analyze the following code function for security vulnerabilities
@RequiresNonNull({"thisRow"}) protected @Nullable Object internalGetObject(@Positive int columnIndex, Field field) throws SQLException { castNonNull(thisRow, "thisRow"); switch (getSQLType(columnIndex)) { case Types.BOOLEAN: case Types.BIT: if (field.getOID() == Oid.BOOL) { return getBoolean(columnIndex); } if (field.getOID() == Oid.BIT) { // Let's peek at the data - I tried to use the field.getLength() but it returns 65535 and // it doesn't reflect the real length of the field, which is odd. // If we have 1 byte, it's a bit(1) and return a boolean to preserve the backwards // compatibility. If the value is null, it doesn't really matter byte[] data = getRawValue(columnIndex); if (data == null || data.length == 1) { return getBoolean(columnIndex); } } // Returning null here will lead to another value processing path for the bit field // which will return a PGobject return null; case Types.SQLXML: return getSQLXML(columnIndex); case Types.TINYINT: case Types.SMALLINT: case Types.INTEGER: return getInt(columnIndex); case Types.BIGINT: return getLong(columnIndex); case Types.NUMERIC: case Types.DECIMAL: return getNumeric(columnIndex, (field.getMod() == -1) ? -1 : ((field.getMod() - 4) & 0xffff), true); case Types.REAL: return getFloat(columnIndex); case Types.FLOAT: case Types.DOUBLE: return getDouble(columnIndex); case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: return getString(columnIndex); case Types.DATE: return getDate(columnIndex); case Types.TIME: return getTime(columnIndex); case Types.TIMESTAMP: return getTimestamp(columnIndex, null); case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: return getBytes(columnIndex); case Types.ARRAY: return getArray(columnIndex); case Types.CLOB: return getClob(columnIndex); case Types.BLOB: return getBlob(columnIndex); default: String type = getPGType(columnIndex); // if the backend doesn't know the type then coerce to String if (type.equals("unknown")) { return getString(columnIndex); } if (type.equals("uuid")) { if (isBinary(columnIndex)) { return getUUID(castNonNull(thisRow.get(columnIndex - 1))); } return getUUID(castNonNull(getString(columnIndex))); } // Specialized support for ref cursors is neater. if (type.equals("refcursor")) { // Fetch all results. String cursorName = castNonNull(getString(columnIndex)); StringBuilder sb = new StringBuilder("FETCH ALL IN "); Utils.escapeIdentifier(sb, cursorName); // nb: no BEGIN triggered here. This is fine. If someone // committed, and the cursor was not holdable (closing the // cursor), we avoid starting a new xact and promptly causing // it to fail. If the cursor *was* holdable, we don't want a // new xact anyway since holdable cursor state isn't affected // by xact boundaries. If our caller didn't commit at all, or // autocommit was on, then we wouldn't issue a BEGIN anyway. // // We take the scrollability from the statement, but until // we have updatable cursors it must be readonly. ResultSet rs = connection.execSQLQuery(sb.toString(), resultsettype, ResultSet.CONCUR_READ_ONLY); ((PgResultSet) rs).setRefCursor(cursorName); // In long-running transactions these backend cursors take up memory space // we could close in rs.close(), but if the transaction is closed before the result set, // then // the cursor no longer exists ((PgResultSet) rs).closeRefCursor(); return rs; } if ("hstore".equals(type)) { if (isBinary(columnIndex)) { return HStoreConverter.fromBytes(castNonNull(thisRow.get(columnIndex - 1)), connection.getEncoding()); } return HStoreConverter.fromString(castNonNull(getString(columnIndex))); } // Caller determines what to do (JDBC3 overrides in this case) return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalGetObject File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
internalGetObject
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
protected String getOCSubjectEventFormSqlSS(String studyIds, String sedIds, String itemIds, String dateConstraint, int datasetItemStatusId, String studySubjectIds) { return "select ss.oc_oid as study_subject_oid, ss.label, ss.unique_identifier, ss.secondary_label, ss.gender, ss.date_of_birth," + " ss.status_id, ss.sgc_id, ss.sgc_name, ss.sg_name, sed.ordinal as definition_order, sed.oc_oid as definition_oid, sed.repeating as definition_repeating," + " se.sample_ordinal as sample_ordinal, se.se_location, se.date_start, se.date_end, se.start_time_flag," + " se.end_time_flag, se.subject_event_status_id as event_status_id, edc.ordinal as crf_order," + " cv.oc_oid as crf_version_oid, cv.name as crf_version, cv.status_id as cv_status_id, ec.status_id as ec_status_id, ec.event_crf_id, ec.date_interviewed," + " ec.interviewer_name, ec.validator_id from (select study_event_id, study_event_definition_id, study_subject_id, location as se_location," + " sample_ordinal, date_start, date_end, subject_event_status_id, start_time_flag, end_time_flag from study_event " + " where study_event_definition_id in " + sedIds + " and study_subject_id in (" + studySubjectIds + ")) se, ( select st_sub.oc_oid, st_sub.study_subject_id, st_sub.label," + " st_sub.secondary_label, st_sub.subject_id, st_sub.unique_identifier, st_sub.gender, st_sub.date_of_birth, st_sub.status_id," + " sb_g.sgc_id, sb_g.sgc_name, sb_g.sg_id, sb_g.sg_name from (select ss.oc_oid, ss.study_subject_id, ss.label, ss.secondary_label, ss.subject_id," + " s.unique_identifier, s.gender, s.date_of_birth, s.status_id from study_subject ss, subject s where ss.study_subject_id in (" + studySubjectIds + ") " + " and ss.subject_id = s.subject_id)st_sub left join (select sgm.study_subject_id, sgc.study_group_class_id as sgc_id, sgc.name as sgc_name," + " sg.study_group_id as sg_id, sg.name as sg_name from subject_group_map sgm, study_group_class sgc, study_group sg where sgc.study_id in (" + studyIds + ") and sgm.study_group_class_id = sgc.study_group_class_id and sgc.study_group_class_id = sg.study_group_class_id" + " and sgm.study_group_id = sg.study_group_id) sb_g on st_sub.study_subject_id = sb_g.study_subject_id) ss, " + " study_event_definition sed, event_definition_crf edc," + " (select event_crf_id, crf_version_id, study_event_id, status_id, date_interviewed, interviewer_name, validator_id from event_crf where event_crf_id in (" + getEventCrfIdsByItemDataSqlSS(studyIds, sedIds, itemIds, dateConstraint, datasetItemStatusId, studySubjectIds) + ")) ec, crf_version cv" + " where sed.study_event_definition_id in " + sedIds + " and sed.study_event_definition_id = se.study_event_definition_id and se.study_subject_id = ss.study_subject_id" + " and sed.study_event_definition_id = edc.study_event_definition_id and se.study_event_id = ec.study_event_id" + " and edc.crf_id = cv.crf_id and ec.crf_version_id = cv.crf_version_id order by ss.oc_oid, sed.ordinal, se.sample_ordinal, edc.ordinal, ss.sgc_id"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOCSubjectEventFormSqlSS 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
getOCSubjectEventFormSqlSS
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
private boolean isSystemUid(CallerIdentity caller) { return UserHandle.isSameApp(caller.getUid(), Process.SYSTEM_UID); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSystemUid 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
isSystemUid
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void showLocationSettingsEnabledNotification(UserHandle user) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS) .addFlags(FLAG_ACTIVITY_NEW_TASK); // Fill the component explicitly to prevent the PendingIntent from being intercepted // and fired with crafted target. b/155183624 ActivityInfo targetInfo = intent.resolveActivityInfo( mInjector.getPackageManager(user.getIdentifier()), PackageManager.MATCH_SYSTEM_ONLY); if (targetInfo != null) { intent.setComponent(targetInfo.getComponentName()); } else { Slogf.wtf(LOG_TAG, "Failed to resolve intent for location settings"); } // Simple notification clicks are immutable PendingIntent locationSettingsIntent = mInjector.pendingIntentGetActivityAsUser(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE, null, user); Notification notification = new Notification.Builder(mContext, SystemNotificationChannels.DEVICE_ADMIN) .setSmallIcon(R.drawable.ic_info_outline) .setContentTitle(getLocationChangedTitle()) .setContentText(getLocationChangedText()) .setColor(mContext.getColor(R.color.system_notification_accent_color)) .setShowWhen(true) .setContentIntent(locationSettingsIntent) .setAutoCancel(true) .build(); mHandler.post(() -> mInjector.getNotificationManager().notify( SystemMessage.NOTE_LOCATION_CHANGED, notification)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showLocationSettingsEnabledNotification 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
showLocationSettingsEnabledNotification
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("squid:S2068") // Suppress "Credentials should not be hard-coded" // "'password' detected in this expression". // False positive: Password is configurable, here we remove it from the log. private void logPostgresConfig() { if (! log.isInfoEnabled()) { return; } JsonObject passwordRedacted = postgreSQLClientConfig.copy(); passwordRedacted.put(_PASSWORD, "..."); log.info("postgreSQLClientConfig = " + passwordRedacted.encode()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logPostgresConfig File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
logPostgresConfig
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public JSONArray put(Map value) { put(new JSONObject(value)); return this; }
Vulnerability Classification: - CWE: CWE-674, CWE-787 - CVE: CVE-2022-45693 - Severity: HIGH - CVSS Score: 7.5 Description: Fixing StackOverflow error Function: put File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison Fixed Code: public JSONArray put(Map value) throws JSONException { put(new JSONObject(value)); return this; }
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
put
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
1
Analyze the following code function for security vulnerabilities
public static NativeArray jsFunction_getRecentlyAddedAPIs(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException, APIManagementException { NativeArray apiArray = new NativeArray(0); if (args != null && args.length != 0) { String limitArg = args[0].toString(); int limit = Integer.parseInt(limitArg); String requestedTenantDomain = (String) args[1]; Set<API> apiSet; APIConsumer apiConsumer = getAPIConsumer(thisObj); boolean isTenantFlowStarted = false; if (requestedTenantDomain == null){ requestedTenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME; } try { if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(requestedTenantDomain)) { isTenantFlowStarted = true; PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(requestedTenantDomain, true); } apiSet = apiConsumer.getRecentlyAddedAPIs(limit, requestedTenantDomain); } catch (APIManagementException e) { log.error("Error from Registry API while getting Recently Added APIs Information", e); return apiArray; } catch (Exception e) { log.error("Error while getting Recently Added APIs Information", e); return apiArray; } finally { if (isTenantFlowStarted) { PrivilegedCarbonContext.endTenantFlow(); } } Iterator it = apiSet.iterator(); int i = 0; while (it.hasNext()) { NativeObject currentApi = new NativeObject(); Object apiObject = it.next(); API api = (API) apiObject; APIIdentifier apiIdentifier = api.getId(); currentApi.put("name", currentApi, apiIdentifier.getApiName()); currentApi.put("provider", currentApi, APIUtil.replaceEmailDomainBack(apiIdentifier.getProviderName())); currentApi.put("version", currentApi, apiIdentifier.getVersion()); currentApi.put("description", currentApi, api.getDescription()); currentApi.put("rates", currentApi, api.getRating()); if (api.getThumbnailUrl() == null) { currentApi.put("thumbnailurl", currentApi, "images/api-default.png"); } else { currentApi.put("thumbnailurl", currentApi, APIUtil.prependWebContextRoot(api.getThumbnailUrl())); } currentApi.put("isAdvertiseOnly",currentApi,api.isAdvertiseOnly()); if(api.isAdvertiseOnly()){ currentApi.put("owner",currentApi,APIUtil.replaceEmailDomainBack(api.getApiOwner())); } currentApi.put(APIConstants.API_DATA_BUSINESS_OWNER, currentApi, APIUtil.replaceEmailDomainBack(api.getBusinessOwner())); currentApi.put("visibility", currentApi, api.getVisibility()); currentApi.put("visibleRoles", currentApi, api.getVisibleRoles()); apiArray.put(i, apiArray, currentApi); i++; } }// end of the if return apiArray; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_getRecentlyAddedAPIs File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_getRecentlyAddedAPIs
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
private String packageToRestrictionsFileName(String packageName) { return RESTRICTIONS_FILE_PREFIX + packageName + XML_SUFFIX; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: packageToRestrictionsFileName 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
packageToRestrictionsFileName
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
private void callOrJoinRoomViaWebSocket() { if (hasExternalSignalingServer) { webSocketClient.joinRoomWithRoomTokenAndSession(roomToken, callSession); } else { performCall(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: callOrJoinRoomViaWebSocket 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
callOrJoinRoomViaWebSocket
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
public static boolean hasPermission(Object object, Permission permission) throws IOException, ServletException { if (permission == null) return true; if (object instanceof AccessControlled) return ((AccessControlled)object).hasPermission(permission); else { List<Ancestor> ancs = Stapler.getCurrentRequest().getAncestors(); for(Ancestor anc : Iterators.reverse(ancs)) { Object o = anc.getObject(); if (o instanceof AccessControlled) { return ((AccessControlled)o).hasPermission(permission); } } return Jenkins.getInstance().hasPermission(permission); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasPermission File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
hasPermission
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private void removeUserChoiceFromDisabledNetwork( @NonNull String network, int uid) { for (WifiConfiguration config : getInternalConfiguredNetworks()) { if (TextUtils.equals(config.SSID, network) || TextUtils.equals(config.FQDN, network)) { if (mWifiPermissionsUtil.checkNetworkSettingsPermission(uid)) { mWifiMetrics.logUserActionEvent( UserActionEvent.EVENT_DISCONNECT_WIFI, config.networkId); } removeConnectChoiceFromAllNetworks(config.getProfileKey()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeUserChoiceFromDisabledNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
removeUserChoiceFromDisabledNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private static String serializePropertyValue(PropertyInterface property) { if (property == null) { return ""; } java.lang.Object value = ((BaseProperty) property).getValue(); if (value instanceof List) { return StringUtils.join((List) value, "|"); } else if (value != null) { return value.toString(); } else { return ""; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serializePropertyValue File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-35151
HIGH
7.5
xwiki/xwiki-platform
serializePropertyValue
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
824cd742ecf5439971247da11bfe7e0ad2b10ede
0
Analyze the following code function for security vulnerabilities
boolean isChildWindow() { return mIsChildWindow; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isChildWindow File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
isChildWindow
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private void denyTypeHierarchyDynamically(String className) { Class type = JVM.loadClassForName(className); if (type != null) { denyTypeHierarchy(type); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: denyTypeHierarchyDynamically File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
denyTypeHierarchyDynamically
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
@Deprecated public int setStorageEncryption(@NonNull ComponentName admin, boolean encrypt) { throwIfParentInstance("setStorageEncryption"); if (mService != null) { try { return mService.setStorageEncryption(admin, encrypt); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return ENCRYPTION_STATUS_UNSUPPORTED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStorageEncryption File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setStorageEncryption
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { return toNiceString(this.getClass(), "clientId", clientId, "secret", "[protected]", "discoveryURI", discoveryURI, "scope", scope, "customParams", customParams, "clientAuthenticationMethod", clientAuthenticationMethod, "useNonce", useNonce, "preferredJwsAlgorithm", preferredJwsAlgorithm, "maxAge", maxAge, "maxClockSkew", maxClockSkew, "connectTimeout", connectTimeout, "readTimeout", readTimeout, "resourceRetriever", resourceRetriever, "responseType", responseType, "responseMode", responseMode, "logoutUrl", logoutUrl, "withState", withState, "stateGenerator", stateGenerator, "logoutHandler", logoutHandler, "tokenValidator", tokenValidator, "mappedClaims", mappedClaims); }
Vulnerability Classification: - CWE: CWE-347 - CVE: CVE-2021-44878 - Severity: MEDIUM - CVSS Score: 5.0 Description: reinforce security on OIDC Function: toString File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j Fixed Code: @Override public String toString() { return toNiceString(this.getClass(), "clientId", clientId, "secret", "[protected]", "discoveryURI", discoveryURI, "scope", scope, "customParams", customParams, "clientAuthenticationMethod", clientAuthenticationMethod, "useNonce", useNonce, "preferredJwsAlgorithm", preferredJwsAlgorithm, "maxAge", maxAge, "maxClockSkew", maxClockSkew, "connectTimeout", connectTimeout, "readTimeout", readTimeout, "resourceRetriever", resourceRetriever, "responseType", responseType, "responseMode", responseMode, "logoutUrl", logoutUrl, "withState", withState, "stateGenerator", stateGenerator, "logoutHandler", logoutHandler, "tokenValidator", tokenValidator, "mappedClaims", mappedClaims, "allowUnsignedIdTokens", allowUnsignedIdTokens); }
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
toString
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
1
Analyze the following code function for security vulnerabilities
@TestApi @RequiresPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void calculateHasIncompatibleAccounts() { if (mService != null) { try { mService.calculateHasIncompatibleAccounts(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calculateHasIncompatibleAccounts File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
calculateHasIncompatibleAccounts
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public SubscriptionInfo getSubscriptionInfoForSubId(int subId) { List<SubscriptionInfo> list = getSubscriptionInfo(false /* forceReload */); for (int i = 0; i < list.size(); i++) { SubscriptionInfo info = list.get(i); if (subId == info.getSubscriptionId()) return info; } return null; // not found }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSubscriptionInfoForSubId File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
getSubscriptionInfoForSubId
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public boolean adminOnly() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: adminOnly File: console/src/main/java/org/togglz/console/handlers/edit/EditPageHandler.java Repository: togglz The code follows secure coding practices.
[ "CWE-352" ]
CVE-2020-28191
HIGH
8.8
togglz
adminOnly
console/src/main/java/org/togglz/console/handlers/edit/EditPageHandler.java
ed66e3f584de954297ebaf98ea4a235286784707
0
Analyze the following code function for security vulnerabilities
@Override public void normalizeRevision(String projectName, String repositoryName, Revision revision, AsyncMethodCallback resultHandler) { final com.linecorp.centraldogma.common.Revision normalized = projectManager.get(projectName).repos().get(repositoryName) .normalizeNow(convert(revision)); resultHandler.onComplete(convert(normalized)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: normalizeRevision File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
normalizeRevision
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
public static NativeArray jsFunction_getAllTags(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException, APIManagementException { NativeArray tagArray = new NativeArray(0); Set<Tag> tags; String tenantDomain = null; if (args != null && isStringArray(args)) { tenantDomain = args[0].toString(); } APIConsumer apiConsumer = getAPIConsumer(thisObj); try { tags = apiConsumer.getAllTags(tenantDomain); } catch (APIManagementException e) { log.error("Error from registry while getting API tags.", e); return tagArray; } catch (Exception e) { log.error("Error while getting API tags", e); return tagArray; } if (tags != null) { Iterator tagsI = tags.iterator(); int i = 0; while (tagsI.hasNext()) { NativeObject currentTag = new NativeObject(); Object tagObject = tagsI.next(); Tag tag = (Tag) tagObject; currentTag.put("name", currentTag, tag.getName()); currentTag.put("count", currentTag, tag.getNoOfOccurrences()); tagArray.put(i, tagArray, currentTag); i++; } } return tagArray; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_getAllTags File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_getAllTags
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
private double readDoubleValue(byte[] bytes, int oid, String targetType) throws PSQLException { // currently implemented binary encoded fields switch (oid) { case Oid.INT2: return ByteConverter.int2(bytes, 0); case Oid.INT4: return ByteConverter.int4(bytes, 0); case Oid.INT8: // might not fit but there still should be no overflow checking return ByteConverter.int8(bytes, 0); case Oid.FLOAT4: return ByteConverter.float4(bytes, 0); case Oid.FLOAT8: return ByteConverter.float8(bytes, 0); case Oid.NUMERIC: return ByteConverter.numeric(bytes).doubleValue(); } throw new PSQLException(GT.tr("Cannot convert the column of type {0} to requested type {1}.", Oid.toString(oid), targetType), PSQLState.DATA_TYPE_MISMATCH); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readDoubleValue File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
readDoubleValue
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public String toXML() throws XWikiException { if (hasProgrammingRights()) { return this.doc.toXML(getXWikiContext()); } else { return ""; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toXML 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
toXML
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 Collection getRecognizedFeatures() { if (!validating) { return handleXInclude ? recognizedFeaturesNonValidatingXInclude : recognizedFeaturesNonValidatingNoXInclude; } else { return handleXInclude ? recognizedFeaturesValidatingXInclude : recognizedFeaturesValidatingNoXInclude; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRecognizedFeatures File: src/java/org/orbeon/oxf/xml/xerces/XercesSAXParserFactoryImpl.java Repository: orbeon/orbeon-forms The code follows secure coding practices.
[ "CWE-264" ]
CVE-2010-3260
MEDIUM
6.4
orbeon/orbeon-forms
getRecognizedFeatures
src/java/org/orbeon/oxf/xml/xerces/XercesSAXParserFactoryImpl.java
aba6681660f65af7f1676434da68c10298c30200
0
Analyze the following code function for security vulnerabilities
protected final int _parseIntPrimitive(DeserializationContext ctxt, String text) throws IOException { try { if (text.length() > 9) { long l = NumberInput.parseLong(text); if (_intOverflow(l)) { Number v = (Number) ctxt.handleWeirdStringValue(Integer.TYPE, text, "Overflow: numeric value (%s) out of range of int (%d -%d)", text, Integer.MIN_VALUE, Integer.MAX_VALUE); return _nonNullNumber(v).intValue(); } return (int) l; } return NumberInput.parseInt(text); } catch (IllegalArgumentException iae) { Number v = (Number) ctxt.handleWeirdStringValue(Integer.TYPE, text, "not a valid `int` value"); return _nonNullNumber(v).intValue(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _parseIntPrimitive File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_parseIntPrimitive
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
public ModelConfig getModelConfig() { return myModelConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getModelConfig File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
getModelConfig
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
protected <B extends Buffer> B validateTargetBuffer(int cmd, B buffer) { ValidateUtils.checkNotNull(buffer, "No target buffer to examine for command=%d", cmd); ValidateUtils.checkTrue( buffer != decoderBuffer, "Not allowed to use the internal decoder buffer for command=%d", cmd); ValidateUtils.checkTrue( buffer != uncompressBuffer, "Not allowed to use the internal uncompress buffer for command=%d", cmd); return buffer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateTargetBuffer File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
validateTargetBuffer
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
protected ModuleConfig getModuleConfig (HttpServletRequest request) { ModuleConfig config = (ModuleConfig) request.getAttribute(Globals.MODULE_KEY); if (config == null) { config = (ModuleConfig) getServletContext().getAttribute(Globals.MODULE_KEY); } return (config); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getModuleConfig 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
getModuleConfig
src/share/org/apache/struts/action/ActionServlet.java
eda3a79907ed8fcb0387a0496d0cb14332f250e8
0
Analyze the following code function for security vulnerabilities
public static Program getProgram(String id) { Program program = null; if (id != null) { id = id.trim(); // see if this is parseable int; if so, try looking up by id try {//handle integer: id int programId = Integer.parseInt(id); program = Context.getProgramWorkflowService().getProgram(programId); if (program != null) { return program; } } catch (Exception ex) { //do nothing } //get Program by mapping program = getMetadataByMapping(Program.class, id); if(program != null){ return program; } //handle uuid id: "a3e1302b-74bf-11df-9768-17cfc9833272", if id matches uuid format if (isValidUuidFormat(id)) { program = Context.getProgramWorkflowService().getProgramByUuid(id); if (program != null) { return program; } } else { // if it's neither a uuid or id, try program name // (note that this API method actually checks based on name of the associated concept, not the name of the program itself) program = Context.getProgramWorkflowService().getProgramByName(id); } } return program; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProgram File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
getProgram
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
private static void tpcSocketConfigXmlGenerator(XmlGenerator gen, TpcSocketConfig tpcSocketConfig) { gen.open("tpc-socket") .node("port-range", tpcSocketConfig.getPortRange()) .node("receive-buffer-size-kb", tpcSocketConfig.getReceiveBufferSizeKB()) .node("send-buffer-size-kb", tpcSocketConfig.getSendBufferSizeKB()) .close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tpcSocketConfigXmlGenerator 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
tpcSocketConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
public StatsService getStatsService() { return this.statsService; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatsService File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getStatsService
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public HttpRequest method(final String method) { this.method = method.toUpperCase(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: method 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
method
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
public void setSkipAuth( final boolean skipAuth ) { this.skipAuth = skipAuth; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSkipAuth File: modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java Repository: enonic/xp The code follows secure coding practices.
[ "CWE-384" ]
CVE-2024-23679
CRITICAL
9.8
enonic/xp
setSkipAuth
modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
0189975691e9e6407a9fee87006f730e84f734ff
0
Analyze the following code function for security vulnerabilities
@Override protected AbstractSAXParser createParser() throws SAXException { SAXParser parser = new SAXParser(); try { parser.setProperty( "http://cyberneko.org/html/properties/names/elems", "lower"); parser.setProperty( "http://cyberneko.org/html/properties/names/attrs", "lower"); // NekoHTML should not try to guess the encoding based on the meta // tags or other information in the document. This is already // handled by the EncodingReader. parser.setFeature("http://cyberneko.org/html/features/scanner/ignore-specified-charset", true); return parser; } catch (SAXException ex) { throw new SAXException( "Problem while creating HTML4 SAX Parser: " + ex.toString()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createParser File: ext/java/nokogiri/Html4SaxParserContext.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
createParser
ext/java/nokogiri/Html4SaxParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
0
Analyze the following code function for security vulnerabilities
public void setDescriptionGenerator( DescriptionGenerator<T> descriptionGenerator) { setDescriptionGenerator(descriptionGenerator, ContentMode.PREFORMATTED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDescriptionGenerator 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
setDescriptionGenerator
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public InputStream getInputStream(final FileHeader hd) throws IOException { final PipedInputStream in = new PipedInputStream(32 * 1024); final PipedOutputStream out = new PipedOutputStream(in); // creates a new thread that will write data to the pipe. Data will be // available in another InputStream, connected to the OutputStream. new Thread(() -> { try { extractFile(hd, out); } catch (final RarException e) { } finally { try { out.close(); } catch (final IOException e) { } } }).start(); return in; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInputStream File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2022-23596
MEDIUM
5
junrar
getInputStream
src/main/java/com/github/junrar/Archive.java
7b16b3d90b91445fd6af0adfed22c07413d4fab7
0
Analyze the following code function for security vulnerabilities
@Override public void consultativeTransfer(String callId, String otherCallId, Session.Info info) throws RemoteException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: consultativeTransfer File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
consultativeTransfer
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public void sendResult() { IAccountManagerResponse response = getResponseAndClose(); if (response != null) { try { Account[] accounts = new Account[mAccountsWithFeatures.size()]; for (int i = 0; i < accounts.length; i++) { accounts[i] = mAccountsWithFeatures.get(i); } if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response " + response); } Bundle result = new Bundle(); result.putParcelableArray(AccountManager.KEY_ACCOUNTS, accounts); response.onResult(result); } catch (RemoteException e) { // if the caller is dead then there is no one to care about remote exceptions if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "failure while notifying response", e); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendResult 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
sendResult
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public boolean hasForward() { final Boolean [] retVal = new Boolean[1]; final boolean[] complete = new boolean[1]; act.runOnUiThread(new Runnable() { public void run() { try { retVal[0] = web.canGoForward(); } finally { complete[0] = true; } } }); while (!complete[0]) { Display.getInstance().invokeAndBlock(new Runnable() { @Override public void run() { if (!complete[0]) { try { Thread.sleep(20); } catch (InterruptedException ex) { } } } }); } return retVal[0].booleanValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasForward File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
hasForward
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void writeCacheHeaders(HttpServerRequest request, FileProps props) { MultiMap headers = request.response().headers(); if (cachingEnabled) { // We use cache-control and last-modified // We *do not use* etags and expires (since they do the same thing - redundant) headers.set("cache-control", "public, max-age=" + maxAgeSeconds); headers.set("last-modified", dateTimeFormatter.format(props.lastModifiedTime())); // We send the vary header (for intermediate caches) // (assumes that most will turn on compression when using static handler) if (sendVaryHeader && request.headers().contains("accept-encoding")) { headers.set("vary", "accept-encoding"); } } // date header is mandatory headers.set("date", dateTimeFormatter.format(new Date())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeCacheHeaders 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
writeCacheHeaders
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
private boolean verifyRanksSequential(List<ShortcutInfo> list) { boolean failed = false; for (int i = 0; i < list.size(); i++) { final ShortcutInfo si = list.get(i); if (si.getRank() != i) { failed = true; Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId() + " rank=" + si.getRank() + " but expected to be " + i); } } return failed; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyRanksSequential File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
verifyRanksSequential
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
private void removePackageDataLI(PackageSetting ps, int[] allUserHandles, boolean[] perUserInstalled, PackageRemovedInfo outInfo, int flags, boolean writeSettings) { String packageName = ps.name; if (DEBUG_REMOVE) Slog.d(TAG, "removePackageDataLI: " + ps); removePackageLI(ps, (flags&REMOVE_CHATTY) != 0); // Retrieve object to delete permissions for shared user later on final PackageSetting deletedPs; // reader synchronized (mPackages) { deletedPs = mSettings.mPackages.get(packageName); if (outInfo != null) { outInfo.removedPackage = packageName; outInfo.removedUsers = deletedPs != null ? deletedPs.queryInstalledUsers(sUserManager.getUserIds(), true) : null; } } if ((flags&PackageManager.DELETE_KEEP_DATA) == 0) { removeDataDirsLI(ps.volumeUuid, packageName); schedulePackageCleaning(packageName, UserHandle.USER_ALL, true); } // writer synchronized (mPackages) { if (deletedPs != null) { if ((flags&PackageManager.DELETE_KEEP_DATA) == 0) { clearIntentFilterVerificationsLPw(deletedPs.name, UserHandle.USER_ALL); clearDefaultBrowserIfNeeded(packageName); if (outInfo != null) { mSettings.mKeySetManagerService.removeAppKeySetDataLPw(packageName); outInfo.removedAppId = mSettings.removePackageLPw(packageName); } updatePermissionsLPw(deletedPs.name, null, 0); if (deletedPs.sharedUser != null) { // Remove permissions associated with package. Since runtime // permissions are per user we have to kill the removed package // or packages running under the shared user of the removed // package if revoking the permissions requested only by the removed // package is successful and this causes a change in gids. for (int userId : UserManagerService.getInstance().getUserIds()) { final int userIdToKill = mSettings.updateSharedUserPermsLPw(deletedPs, userId); if (userIdToKill == UserHandle.USER_ALL || userIdToKill >= UserHandle.USER_OWNER) { // If gids changed for this user, kill all affected packages. mHandler.post(new Runnable() { @Override public void run() { // This has to happen with no lock held. killApplication(deletedPs.name, deletedPs.appId, KILL_APP_REASON_GIDS_CHANGED); } }); break; } } } clearPackagePreferredActivitiesLPw(deletedPs.name, UserHandle.USER_ALL); } // make sure to preserve per-user disabled state if this removal was just // a downgrade of a system app to the factory package if (allUserHandles != null && perUserInstalled != null) { if (DEBUG_REMOVE) { Slog.d(TAG, "Propagating install state across downgrade"); } for (int i = 0; i < allUserHandles.length; i++) { if (DEBUG_REMOVE) { Slog.d(TAG, " user " + allUserHandles[i] + " => " + perUserInstalled[i]); } ps.setInstalled(perUserInstalled[i], allUserHandles[i]); } } } // can downgrade to reader if (writeSettings) { // Save settings now mSettings.writeLPr(); } } if (outInfo != null) { // A user ID was deleted here. Go through all users and remove it // from KeyStore. removeKeystoreDataIfNeeded(UserHandle.USER_ALL, outInfo.removedAppId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removePackageDataLI 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
removePackageDataLI
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public org.dom4j.Document toXMLDocument() throws XWikiException { if (hasProgrammingRights()) { return this.doc.toXMLDocument(getXWikiContext()); } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toXMLDocument 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
toXMLDocument
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
protected void stripWhitespaceOnlyTextNodesImpl() throws XPathExpressionException { XPathFactory xpathFactory = XPathFactory.newInstance(); // XPath to find empty text nodes. XPathExpression xpathExp = xpathFactory.newXPath().compile( "//text()[normalize-space(.) = '']"); NodeList emptyTextNodes = (NodeList) xpathExp.evaluate( this.getDocument(), XPathConstants.NODESET); // Remove each empty text node from document. for (int i = 0; i < emptyTextNodes.getLength(); i++) { Node emptyTextNode = emptyTextNodes.item(i); emptyTextNode.getParentNode().removeChild(emptyTextNode); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stripWhitespaceOnlyTextNodesImpl File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
stripWhitespaceOnlyTextNodesImpl
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private static WorkBundle buildWorkBundle(Document jdom) { Element root = jdom.getRootElement(); if (root == null) { logger.error("Document does not have a root element!"); return null; } WorkBundle wb = new WorkBundle(); wb.setBundleId(root.getChildTextTrim("bundleId")); String s = root.getChildTextTrim("outputRoot"); if (s != null && s.length() > 0) { wb.setOutputRoot(s); } else { wb.setOutputRoot(null); } s = root.getChildTextTrim("eatPrefix"); if (s != null && s.length() > 0) { wb.setEatPrefix(s); } else { wb.setEatPrefix(null); } s = root.getChildTextTrim("caseId"); if (s != null && s.length() > 0) { wb.setCaseId(s); } else { wb.setCaseId(null); } s = root.getChildTextTrim("sentTo"); if (s != null && s.length() > 0) { wb.setSentTo(s); } else { wb.setSentTo(null); } wb.setPriority(JDOMUtil.getChildIntValue(root, "priority")); wb.setSimpleMode(JDOMUtil.getChildBooleanValue(root, "simpleMode")); wb.setOldestFileModificationTime(JDOMUtil.getChildLongValue(root, "oldestFileModificationTime")); wb.setYoungestFileModificationTime(JDOMUtil.getChildLongValue(root, "youngestFileModificationTime")); wb.setTotalFileSize(JDOMUtil.getChildLongValue(root, "totalFileSize")); String serr = root.getChildTextTrim("errorCount"); if (serr != null && serr.length() > 0) { wb.setErrorCount(Integer.parseInt(serr)); } for (Element wu : root.getChildren("workUnit")) { String filename = wu.getChildTextTrim("workFileName"); String transactionId = wu.getChildTextTrim("transactionId"); boolean failedToParse = Boolean.valueOf(wu.getChildTextTrim("failedToParse")); boolean failedToProcess = Boolean.valueOf(wu.getChildTextTrim("failedToProcess")); wb.addWorkUnit(new WorkUnit(filename, transactionId, failedToParse, failedToProcess)); } return wb; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildWorkBundle File: src/main/java/emissary/pickup/WorkBundle.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
buildWorkBundle
src/main/java/emissary/pickup/WorkBundle.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
public void hideSurfaceBehindKeyguard() { mSurfaceBehindRemoteAnimationRequested = false; if (mShowing) { setShowingLocked(true, true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hideSurfaceBehindKeyguard File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
hideSurfaceBehindKeyguard
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
private void destroyNativePageInternal(NativePage nativePage) { if (nativePage == null) return; assert nativePage != mNativePage : "Attempting to destroy active page."; nativePage.destroy(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroyNativePageInternal File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
destroyNativePageInternal
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void doCancelOrSave(Context context, HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo, SubmissionStepConfig stepConfig) throws ServletException, IOException, SQLException, AuthorizeException { // If this is a workflow item, we need to return the // user to the "perform task" page if (subInfo.isInWorkflow()) { int result = doSaveCurrentState(context, request, response, subInfo, stepConfig); if (result == AbstractProcessingStep.STATUS_COMPLETE) { request.setAttribute("workflow.item", subInfo.getSubmissionItem()); JSPManager.showJSP(request, response, "/mydspace/perform-task.jsp"); } else { int currStep=stepConfig.getStepNumber(); doStep(context, request, response, subInfo, currStep); } } else { // if no submission has been started, if (subInfo.getSubmissionItem() == null) { // forward them to the 'cancelled' page, // since we haven't created an item yet. JSPManager.showJSP(request, response, "/submit/cancelled-removed.jsp"); } else { //tell the step class to do its processing (to save any inputs) //but, send flag that this is a "cancellation" setCancellationInProgress(request, true); int result = doSaveCurrentState(context, request, response, subInfo, stepConfig); int currStep=stepConfig.getStepNumber(); int currPage=AbstractProcessingStep.getCurrentPage(request); double currStepAndPage = Float.parseFloat(currStep+"."+currPage); double stepAndPageReached = Float.parseFloat(getStepReached(subInfo)+"."+JSPStepManager.getPageReached(subInfo)); if (result != AbstractProcessingStep.STATUS_COMPLETE && currStepAndPage < stepAndPageReached){ setReachedStepAndPage(subInfo, currStep, currPage); } //commit & close context context.complete(); // save changes to submission info & step info for JSP saveSubmissionInfo(request, subInfo); saveCurrentStepConfig(request, stepConfig); // forward to cancellation confirmation JSP showProgressAwareJSP(request, response, subInfo, "/submit/cancel.jsp"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doCancelOrSave File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
doCancelOrSave
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
private void ensureInitialized() throws SQLException { if (!initialized) { throw new PSQLException( GT.tr( "This SQLXML object has not been initialized, so you cannot retrieve data from it."), PSQLState.OBJECT_NOT_IN_STATE); } // Is anyone loading data into us at the moment? if (!active) { return; } if (byteArrayOutputStream != null) { try { data = conn.getEncoding().decode(byteArrayOutputStream.toByteArray()); } catch (IOException ioe) { throw new PSQLException(GT.tr("Failed to convert binary xml data to encoding: {0}.", conn.getEncoding().name()), PSQLState.DATA_ERROR, ioe); } finally { byteArrayOutputStream = null; active = false; } } else if (stringWriter != null) { // This is also handling the work for Stream, SAX, and StAX Results // as they will use the same underlying stringwriter variable. // data = stringWriter.toString(); stringWriter = null; active = false; } else if (domResult != null) { // Copy the content from the result to a source // and use the identify transform to get it into a // friendlier result format. try { TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); DOMSource domSource = new DOMSource(domResult.getNode()); StringWriter stringWriter = new StringWriter(); StreamResult streamResult = new StreamResult(stringWriter); transformer.transform(domSource, streamResult); data = stringWriter.toString(); } catch (TransformerException te) { throw new PSQLException(GT.tr("Unable to convert DOMResult SQLXML data to a string."), PSQLState.DATA_ERROR, te); } finally { domResult = null; active = false; } } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2020-13692 - Severity: MEDIUM - CVSS Score: 6.8 Description: Merge pull request from GHSA-37xm-4h3m-5w3v * refactor: Clean up whitespace in existing PgSQLXMLTest * fix: Fix XXE vulnerability in PgSQLXML by disabling external access and doctypes Fixes XXE vulnerability by defaulting to disabling external access and doc types. The legacy insecure behavior can be restored via the new connection property xmlFactoryFactory with a value of LEGACY_INSECURE. Alternatively, a custom class name can be specified that implements org.postgresql.xml.PGXmlFactoryFactory and takes a no argument constructor. * fix: Add missing getter and setter for XML_FACTORY_FACTORY to BasicDataSource Function: ensureInitialized File: pgjdbc/src/main/java/org/postgresql/jdbc/PgSQLXML.java Repository: pgjdbc Fixed Code: private void ensureInitialized() throws SQLException { if (!initialized) { throw new PSQLException( GT.tr( "This SQLXML object has not been initialized, so you cannot retrieve data from it."), PSQLState.OBJECT_NOT_IN_STATE); } // Is anyone loading data into us at the moment? if (!active) { return; } if (byteArrayOutputStream != null) { try { data = conn.getEncoding().decode(byteArrayOutputStream.toByteArray()); } catch (IOException ioe) { throw new PSQLException(GT.tr("Failed to convert binary xml data to encoding: {0}.", conn.getEncoding().name()), PSQLState.DATA_ERROR, ioe); } finally { byteArrayOutputStream = null; active = false; } } else if (stringWriter != null) { // This is also handling the work for Stream, SAX, and StAX Results // as they will use the same underlying stringwriter variable. // data = stringWriter.toString(); stringWriter = null; active = false; } else if (domResult != null) { // Copy the content from the result to a source // and use the identify transform to get it into a // friendlier result format. try { TransformerFactory factory = getXmlFactoryFactory().newTransformerFactory(); Transformer transformer = factory.newTransformer(); DOMSource domSource = new DOMSource(domResult.getNode()); StringWriter stringWriter = new StringWriter(); StreamResult streamResult = new StreamResult(stringWriter); transformer.transform(domSource, streamResult); data = stringWriter.toString(); } catch (TransformerException te) { throw new PSQLException(GT.tr("Unable to convert DOMResult SQLXML data to a string."), PSQLState.DATA_ERROR, te); } finally { domResult = null; active = false; } } }
[ "CWE-611" ]
CVE-2020-13692
MEDIUM
6.8
pgjdbc
ensureInitialized
pgjdbc/src/main/java/org/postgresql/jdbc/PgSQLXML.java
14b62aca4764d496813f55a43d050b017e01eb65
1
Analyze the following code function for security vulnerabilities
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { ctx.write(msg, promise); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: write File: handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-34462
MEDIUM
6.5
netty
write
handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java
535da17e45201ae4278c0479e6162bb4127d4c32
0
Analyze the following code function for security vulnerabilities
public final int broadcastIntent(IApplicationThread caller, Intent intent, String resolvedType, IIntentReceiver resultTo, int resultCode, String resultData, Bundle resultExtras, String[] requiredPermissions, int appOp, Bundle options, boolean serialized, boolean sticky, int userId) { enforceNotIsolatedCaller("broadcastIntent"); synchronized(this) { intent = verifyBroadcastLocked(intent); final ProcessRecord callerApp = getRecordForAppLocked(caller); final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); int res = broadcastIntentLocked(callerApp, callerApp != null ? callerApp.info.packageName : null, intent, resolvedType, resultTo, resultCode, resultData, resultExtras, requiredPermissions, appOp, null, serialized, sticky, callingPid, callingUid, userId); Binder.restoreCallingIdentity(origId); return res; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastIntent File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
broadcastIntent
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
private void addAccountToLinkedRestrictedUsers(Account account, int parentUserId) { List<UserInfo> users = getUserManager().getUsers(); for (UserInfo user : users) { if (user.isRestricted() && (parentUserId == user.restrictedProfileParentId)) { addSharedAccountAsUser(account, user.id); if (isLocalUnlockedUser(user.id)) { mHandler.sendMessage(mHandler.obtainMessage( MESSAGE_COPY_SHARED_ACCOUNT, parentUserId, user.id, account)); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAccountToLinkedRestrictedUsers 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
addAccountToLinkedRestrictedUsers
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0