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
void dumpProvidersLocked(FileDescriptor fd, PrintWriter pw, String[] args, int opti, boolean dumpAll, String dumpPackage) { boolean needSep; boolean printedAnything = false; ItemMatcher matcher = new ItemMatcher(); matcher.build(args, opti); pw.println("ACTIVITY MANAGER CONTENT PROVIDERS (dumpsys activity providers)"); needSep = mProviderMap.dumpProvidersLocked(pw, dumpAll, dumpPackage); printedAnything |= needSep; if (mLaunchingProviders.size() > 0) { boolean printed = false; for (int i=mLaunchingProviders.size()-1; i>=0; i--) { ContentProviderRecord r = mLaunchingProviders.get(i); if (dumpPackage != null && !dumpPackage.equals(r.name.getPackageName())) { continue; } if (!printed) { if (needSep) pw.println(); needSep = true; pw.println(" Launching content providers:"); printed = true; printedAnything = true; } pw.print(" Launching #"); pw.print(i); pw.print(": "); pw.println(r); } } if (mGrantedUriPermissions.size() > 0) { boolean printed = false; int dumpUid = -2; if (dumpPackage != null) { try { dumpUid = mContext.getPackageManager().getPackageUid(dumpPackage, 0); } catch (NameNotFoundException e) { dumpUid = -1; } } for (int i=0; i<mGrantedUriPermissions.size(); i++) { int uid = mGrantedUriPermissions.keyAt(i); if (dumpUid >= -1 && UserHandle.getAppId(uid) != dumpUid) { continue; } final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.valueAt(i); if (!printed) { if (needSep) pw.println(); needSep = true; pw.println(" Granted Uri Permissions:"); printed = true; printedAnything = true; } pw.print(" * UID "); pw.print(uid); pw.println(" holds:"); for (UriPermission perm : perms.values()) { pw.print(" "); pw.println(perm); if (dumpAll) { perm.dump(pw, " "); } } } } if (!printedAnything) { pw.println(" (nothing)"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpProvidersLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
dumpProvidersLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
protected byte[] engineUpdate( byte[] input, int inputOffset, int inputLen) { bOut.write(input, inputOffset, inputLen); if (cipher instanceof RSABlindedEngine) { if (bOut.size() > cipher.getInputBlockSize() + 1) { throw new ArrayIndexOutOfBoundsException("too much data for RSA block"); } } else { if (bOut.size() > cipher.getInputBlockSize()) { throw new ArrayIndexOutOfBoundsException("too much data for RSA block"); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineUpdate File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineUpdate
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
@Override public boolean willActivityBeVisible(IBinder token) { synchronized(this) { ActivityStack stack = ActivityRecord.getStackLocked(token); if (stack != null) { return stack.willActivityBeVisibleLocked(token); } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: willActivityBeVisible 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
willActivityBeVisible
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS, conditional = true) public boolean setAutoRevokeExempted(@NonNull String packageName, boolean exempted) { try { return mPermissionManager.setAutoRevokeExempted(packageName, exempted, mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAutoRevokeExempted File: core/java/android/permission/PermissionManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
setAutoRevokeExempted
core/java/android/permission/PermissionManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public void setDownloadDelegate(ContentViewDownloadDelegate delegate) { mDownloadDelegate = delegate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDownloadDelegate File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
setDownloadDelegate
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void applyZenModeLocked(NotificationRecord record) { record.setIntercepted(mZenModeHelper.shouldIntercept(record)); if (record.isIntercepted()) { int suppressed = (mZenModeHelper.shouldSuppressWhenScreenOff() ? SUPPRESSED_EFFECT_SCREEN_OFF : 0) | (mZenModeHelper.shouldSuppressWhenScreenOn() ? SUPPRESSED_EFFECT_SCREEN_ON : 0); record.setSuppressedVisualEffects(suppressed); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyZenModeLocked 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
applyZenModeLocked
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public Map<String, String> getMetaDataMap(Contentlet con, File binFile) { return new TikaUtils().getMetaDataMap(con.getInode(),binFile,false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaDataMap File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
getMetaDataMap
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { return "P4MaterialConfig{" + "serverAndPort='" + serverAndPort + '\'' + ", userName='" + userName + '\'' + ", view=" + view.getValue() + '}'; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
toString
config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
@Override public void setPriority(String pkg, int uid, int priority) { checkCallerIsSystem(); mRankingHelper.setPriority(pkg, uid, priority); savePolicyFile(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPriority 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
setPriority
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public static Map<String, CliOption> getOptions(String language) { CodegenConfig config; try { config = CodegenConfigLoader.forName(language); } catch (Exception e) { throw new ResponseStatusException(HttpStatus.NOT_FOUND, String.format(Locale.ROOT,"Unsupported target %s supplied. %s", language, e)); } Map<String, CliOption> map = new LinkedHashMap<>(); for (CliOption option : config.cliOptions()) { map.put(option.getOpt(), option); } return map; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOptions File: modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21428
MEDIUM
4.4
OpenAPITools/openapi-generator
getOptions
modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java
be64b6f1b3d4d7b6cfdce12c0f3953be6a1ff195
0
Analyze the following code function for security vulnerabilities
@TestApi public @NonNull Set<String> getDisallowedSystemApps(@NonNull ComponentName admin, @UserIdInt int userId, @NonNull String provisioningAction) { try { return new ArraySet<>( mService.getDisallowedSystemApps(admin, userId, provisioningAction)); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisallowedSystemApps 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
getDisallowedSystemApps
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void removeStacksInWindowingModes(int[] windowingModes) { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "removeStacksInWindowingModes()"); synchronized (this) { final long ident = Binder.clearCallingIdentity(); try { mStackSupervisor.removeStacksInWindowingModes(windowingModes); } finally { Binder.restoreCallingIdentity(ident); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeStacksInWindowingModes 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
removeStacksInWindowingModes
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private int readNewHandle() throws IOException { return input.readInt(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readNewHandle File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readNewHandle
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public SysUser getUserByPhone(String phone) { return userMapper.getUserByPhone(phone); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserByPhone File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
getUserByPhone
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0
Analyze the following code function for security vulnerabilities
public static boolean isCorsPreflightRequest(com.linecorp.armeria.common.HttpRequest request) { requireNonNull(request, "request"); return request.method() == HttpMethod.OPTIONS && request.headers().contains(HttpHeaderNames.ORIGIN) && request.headers().contains(HttpHeaderNames.ACCESS_CONTROL_REQUEST_METHOD); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCorsPreflightRequest File: core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
isCorsPreflightRequest
core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
@Override public InputStream getBinaryStream() throws SQLException { return super.getBinaryStream(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBinaryStream File: h2/src/main/org/h2/jdbc/JdbcSQLXML.java Repository: h2database The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-23463
MEDIUM
6.4
h2database
getBinaryStream
h2/src/main/org/h2/jdbc/JdbcSQLXML.java
d83285fd2e48fb075780ee95badee6f5a15ea7f8
0
Analyze the following code function for security vulnerabilities
public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setReadTimeout File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setReadTimeout
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void handlePreAllocate(long totalLength, String path) throws IOException, IllegalAccessException { FileDownloadOutputStream outputStream = null; try { if (totalLength != TOTAL_VALUE_IN_CHUNKED_RESOURCE) { outputStream = FileDownloadUtils.createOutputStream(model.getTempFilePath()); final long breakpointBytes = new File(path).length(); final long requiredSpaceBytes = totalLength - breakpointBytes; final long freeSpaceBytes = FileDownloadUtils.getFreeSpaceBytes(path); if (freeSpaceBytes < requiredSpaceBytes) { // throw a out of space exception. throw new FileDownloadOutOfSpaceException(freeSpaceBytes, requiredSpaceBytes, breakpointBytes); } else if (!FileDownloadProperties.getImpl().fileNonPreAllocation) { // pre allocate. outputStream.setLength(totalLength); } } } finally { if (outputStream != null) outputStream.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handlePreAllocate File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
handlePreAllocate
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
public static List<Structure> getNoSystemStructuresWithReadPermissions(User user, boolean respectFrontendRoles) throws DotDataException { String orderBy = "structuretype,upper(name)"; int limit = -1; List<Structure> all = getStructures(orderBy,limit); List<Structure> retList = new ArrayList<Structure> (); for (Structure st : all) { if (permissionAPI.doesUserHavePermission(st, PERMISSION_READ, user, respectFrontendRoles) && !st.isSystem()) { retList.add(st); } } return retList; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNoSystemStructuresWithReadPermissions File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getNoSystemStructuresWithReadPermissions
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
private void debugAction(ActionType actionType, ActionParametersBase params) { log.debug("Action type '{}', Parameters '{}'", actionType, params); //$NON-NLS-1$ }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: debugAction File: frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java Repository: oVirt/ovirt-engine The code follows secure coding practices.
[ "CWE-287" ]
CVE-2024-0822
HIGH
7.5
oVirt/ovirt-engine
debugAction
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
036f617316f6d7077cd213eb613eb4816e33d1fc
0
Analyze the following code function for security vulnerabilities
public int getPhase2Method() { String phase2Method = removeDoubleQuotes(mFields.get(PHASE2_KEY)); // Remove auth= prefix if (phase2Method.startsWith(Phase2.PREFIX)) { phase2Method = phase2Method.substring(Phase2.PREFIX.length()); } return getStringIndex(Phase2.strings, phase2Method, Phase2.NONE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPhase2Method File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
getPhase2Method
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
static Config args(final String[] args) { if (args == null || args.length == 0) { return ConfigFactory.empty(); } Map<String, String> conf = new HashMap<>(); for (String arg : args) { String[] values = arg.split("="); String name; String value; if (values.length == 2) { name = values[0]; value = values[1]; } else { name = "application.env"; value = values[0]; } if (name.indexOf(".") == -1) { conf.put("application." + name, value); } conf.put(name, value); } return ConfigFactory.parseMap(conf, "args"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: args 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
args
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public void notifyActivityDrawn(IBinder token) { if (DEBUG_VISBILITY) Slog.d(TAG, "notifyActivityDrawn: token=" + token); synchronized (this) { ActivityRecord r= mStackSupervisor.isInAnyStackLocked(token); if (r != null) { r.task.stack.notifyActivityDrawnLocked(r); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyActivityDrawn File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
notifyActivityDrawn
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public boolean queryPasspointIcon(long bssid, String fileName) { return mPasspointEventHandler.requestIcon(bssid, fileName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryPasspointIcon File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
queryPasspointIcon
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element accountElement = toDOM(document); document.appendChild(accountElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: toXML File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraint.java Repository: dogtagpki/pki Fixed Code: public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element accountElement = toDOM(document); document.appendChild(accountElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toXML
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraint.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
@Override public void grantUriPermissionFromOwner(IBinder token, int fromUid, String targetPkg, Uri uri, final int modeFlags, int sourceUserId, int targetUserId) { targetUserId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), targetUserId, false, ALLOW_FULL_ONLY, "grantUriPermissionFromOwner", null); synchronized(this) { UriPermissionOwner owner = UriPermissionOwner.fromExternalToken(token); if (owner == null) { throw new IllegalArgumentException("Unknown owner: " + token); } if (fromUid != Binder.getCallingUid()) { if (Binder.getCallingUid() != myUid()) { // Only system code can grant URI permissions on behalf // of other users. throw new SecurityException("nice try"); } } if (targetPkg == null) { throw new IllegalArgumentException("null target"); } if (uri == null) { throw new IllegalArgumentException("null uri"); } grantUriPermissionLocked(fromUid, targetPkg, new GrantUri(sourceUserId, uri, false), modeFlags, owner, targetUserId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grantUriPermissionFromOwner 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
grantUriPermissionFromOwner
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected void registerStatelessCommands(final OServerNetworkListener iListener) { cmdManager = new OHttpNetworkCommandManager(server, null); cmdManager.registerCommand(new OServerCommandGetConnect()); cmdManager.registerCommand(new OServerCommandGetDisconnect()); cmdManager.registerCommand(new OServerCommandGetClass()); cmdManager.registerCommand(new OServerCommandGetCluster()); cmdManager.registerCommand(new OServerCommandGetDatabase()); cmdManager.registerCommand(new OServerCommandGetDictionary()); cmdManager.registerCommand(new OServerCommandGetDocument()); cmdManager.registerCommand(new OServerCommandGetDocumentByClass()); cmdManager.registerCommand(new OServerCommandGetQuery()); cmdManager.registerCommand(new OServerCommandGetServer()); cmdManager.registerCommand(new OServerCommandGetConnections()); cmdManager.registerCommand(new OServerCommandGetStorageAllocation()); cmdManager.registerCommand(new OServerCommandGetFileDownload()); cmdManager.registerCommand(new OServerCommandGetIndex()); cmdManager.registerCommand(new OServerCommandGetListDatabases()); cmdManager.registerCommand(new OServerCommandGetExportDatabase()); cmdManager.registerCommand(new OServerCommandPatchDocument()); cmdManager.registerCommand(new OServerCommandPostBatch()); cmdManager.registerCommand(new OServerCommandPostClass()); cmdManager.registerCommand(new OServerCommandPostCommand()); cmdManager.registerCommand(new OServerCommandPostDatabase()); cmdManager.registerCommand(new OServerCommandPostInstallDatabase()); cmdManager.registerCommand(new OServerCommandPostDocument()); cmdManager.registerCommand(new OServerCommandPostImportRecords()); cmdManager.registerCommand(new OServerCommandPostProperty()); cmdManager.registerCommand(new OServerCommandPostConnection()); cmdManager.registerCommand(new OServerCommandPostServer()); cmdManager.registerCommand(new OServerCommandPostStudio()); cmdManager.registerCommand(new OServerCommandPutDocument()); cmdManager.registerCommand(new OServerCommandPutIndex()); cmdManager.registerCommand(new OServerCommandDeleteClass()); cmdManager.registerCommand(new OServerCommandDeleteDatabase()); cmdManager.registerCommand(new OServerCommandDeleteDocument()); cmdManager.registerCommand(new OServerCommandDeleteProperty()); cmdManager.registerCommand(new OServerCommandDeleteIndex()); cmdManager.registerCommand(new OServerCommandOptions()); cmdManager.registerCommand(new OServerCommandFunction()); cmdManager.registerCommand(new OServerCommandAction()); cmdManager.registerCommand(new OServerCommandPostKillDbConnection()); cmdManager.registerCommand(new OServerCommandGetSupportedLanguages()); cmdManager.registerCommand(new OServerCommandPostAuthToken()); for (OServerCommandConfiguration c : iListener.getStatefulCommands()) try { cmdManager.registerCommand(OServerNetworkListener.createCommand(server, c)); } catch (Exception e) { OLogManager.instance().error(this, "Error on creating stateful command '%s'", e, c.implementation); } for (OServerCommand c : iListener.getStatelessCommands()) cmdManager.registerCommand(c); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerStatelessCommands File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
registerStatelessCommands
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
@Override public void handoverFailed(String callId, ConnectionRequest request, int error, Session.Info sessionInfo) {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handoverFailed 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
handoverFailed
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
protected void addHttp2StreamSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("h2_metrics_inbound", http2MetricsChannelHandlers.inbound()); pipeline.addLast("h2_metrics_outbound", http2MetricsChannelHandlers.outbound()); pipeline.addLast("h2_max_requests_per_conn", connectionExpiryHandler); pipeline.addLast("h2_conn_close", connectionCloseHandler); pipeline.addLast(http2ResetFrameHandler); pipeline.addLast("h2_downgrader", new Http2StreamFrameToHttpObjectCodec(true)); pipeline.addLast(http2StreamErrorHandler); pipeline.addLast(http2StreamHeaderCleaner); }
Vulnerability Classification: - CWE: CWE-444 - CVE: CVE-2021-21295 - Severity: LOW - CVSS Score: 2.6 Description: Tyr out chunked encoding enforcer Function: addHttp2StreamSpecificHandlers File: zuul-core/src/main/java/com/netflix/zuul/netty/server/http2/Http2StreamInitializer.java Repository: Netflix/zuul Fixed Code: protected void addHttp2StreamSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("h2_metrics_inbound", http2MetricsChannelHandlers.inbound()); pipeline.addLast("h2_metrics_outbound", http2MetricsChannelHandlers.outbound()); pipeline.addLast("h2_max_requests_per_conn", connectionExpiryHandler); pipeline.addLast("h2_conn_close", connectionCloseHandler); pipeline.addLast(http2ResetFrameHandler); pipeline.addLast("h2_downgrader", new Http2StreamFrameToHttpObjectCodec(true)); pipeline.addLast(http2StreamErrorHandler); pipeline.addLast(http2StreamHeaderCleaner); pipeline.addLast(new Http2ContentLengthEnforcingHandler()); }
[ "CWE-444" ]
CVE-2021-21295
LOW
2.6
Netflix/zuul
addHttp2StreamSpecificHandlers
zuul-core/src/main/java/com/netflix/zuul/netty/server/http2/Http2StreamInitializer.java
033d3c2de354e249f6d775bde8b67b0997888958
1
Analyze the following code function for security vulnerabilities
protected void setZenMode(int mode) { // start old BaseStatusBar.setZenMode(). if (isDeviceProvisioned()) { mZenMode = mode; updateNotifications(); } // end old BaseStatusBar.setZenMode(). }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setZenMode 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
setZenMode
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") final void appDiedLocked(ProcessRecord app, String reason) { appDiedLocked(app, app.getPid(), app.getThread(), false, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appDiedLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
appDiedLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public void addCallback(@NonNull Callback callback) { mCallbacks.add(callback); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addCallback 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
addCallback
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void writeMessageBegin(TMessage message) throws TException { writeByteDirect(PROTOCOL_ID); writeByteDirect((VERSION & VERSION_MASK) | ((message.type << TYPE_SHIFT_AMOUNT) & TYPE_MASK)); writeVarint32(message.seqid); writeString(message.name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeMessageBegin File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
writeMessageBegin
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
@Override public boolean isRecentsComponentHomeActivity(int userId) { return getRecentTasks().isRecentsComponentHomeActivity(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRecentsComponentHomeActivity 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
isRecentsComponentHomeActivity
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder2 cdata(String data) { super.cdataImpl(data); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cdata File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
cdata
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
@Override public void finalizeWorkProfileProvisioning(UserHandle managedProfileUser, Account migratedAccount) { Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS)); if (!isManagedProfile(managedProfileUser.getIdentifier())) { throw new IllegalStateException("Given user is not a managed profile"); } ComponentName profileOwnerComponent = mOwners.getProfileOwnerComponent(managedProfileUser.getIdentifier()); if (profileOwnerComponent == null) { throw new IllegalStateException("There is no profile owner on the given profile"); } Intent primaryProfileSuccessIntent = new Intent(ACTION_MANAGED_PROFILE_PROVISIONED); primaryProfileSuccessIntent.setPackage(profileOwnerComponent.getPackageName()); primaryProfileSuccessIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES | Intent.FLAG_RECEIVER_FOREGROUND); primaryProfileSuccessIntent.putExtra(Intent.EXTRA_USER, managedProfileUser); if (migratedAccount != null) { primaryProfileSuccessIntent.putExtra(EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE, migratedAccount); } mContext.sendBroadcastAsUser(primaryProfileSuccessIntent, UserHandle.of(getProfileParentId(managedProfileUser.getIdentifier()))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finalizeWorkProfileProvisioning 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
finalizeWorkProfileProvisioning
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private static boolean isViewIntent(final Intent i) { return i != null && (Intent.ACTION_VIEW.equals(i.getAction()) || Intent.ACTION_SENDTO.equals(i.getAction()) || i.hasExtra(WelcomeActivity.EXTRA_INVITE_URI)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isViewIntent File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
isViewIntent
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private List<String> populatePhaseClientIds(PredefinedPostbackParameter parameterName) { String param = parameterName.getValue(ctx); if (param == null) { return new ArrayList<>(); } else { Map<String, Object> appMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap(); String[] pcs = Util.split(appMap, param, "[ \t]+"); return ((pcs != null && pcs.length != 0) ? new ArrayList<>(Arrays.asList(pcs)) : new ArrayList<>()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: populatePhaseClientIds File: impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-17091
MEDIUM
4.3
eclipse-ee4j/mojarra
populatePhaseClientIds
impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
a3fa9573789ed5e867c43ea38374f4dbd5a8f81f
0
Analyze the following code function for security vulnerabilities
private Map<String, PasspointProvider> getPasspointProviderWithPackage( @NonNull String packageName) { return mProviders.entrySet().stream().filter( entry -> TextUtils.equals(packageName, entry.getValue().getPackageName())).collect( Collectors.toMap(entry -> entry.getKey(), entry -> entry.getValue())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasspointProviderWithPackage File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
getPasspointProviderWithPackage
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private HttpHandler handleDevelopmentModePersistentSessions(HttpHandler next, final DeploymentInfo deploymentInfo, final SessionManager sessionManager, final ServletContextImpl servletContext) { final SessionPersistenceManager sessionPersistenceManager = deploymentInfo.getSessionPersistenceManager(); if (sessionPersistenceManager != null) { SessionRestoringHandler handler = new SessionRestoringHandler(deployment.getDeploymentInfo().getDeploymentName(), sessionManager, servletContext, next, sessionPersistenceManager); deployment.addLifecycleObjects(handler); return handler; } return next; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleDevelopmentModePersistentSessions File: servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
handleDevelopmentModePersistentSessions
servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
static String getAsecPackageName(String packageCid) { int idx = packageCid.lastIndexOf("-"); if (idx == -1) { return packageCid; } return packageCid.substring(0, idx); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAsecPackageName 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
getAsecPackageName
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public boolean isAutoCreate() { return autoCreate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAutoCreate File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
isAutoCreate
src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
private void cancelHandshakeTimeout() { if (handshakeTimeout != null) { // cancel the task as we will fail the handshake future now handshakeTimeout.cancel(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelHandshakeTimeout File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-119" ]
CVE-2014-3488
MEDIUM
5
netty
cancelHandshakeTimeout
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2fa9400a59d0563a66908aba55c41e7285a04994
0
Analyze the following code function for security vulnerabilities
@Override public VFSLeaf createChildLeaf(String name) { File fNewFile = new File(getBasefile(), name); try { if(!fNewFile.getParentFile().exists()) { fNewFile.getParentFile().mkdirs(); } if (!fNewFile.createNewFile()) { log.warn("Could not create a new leaf::" + name + " in container::" + getBasefile().getAbsolutePath() + " - file alreay exists"); return null; } } catch (Exception e) { log.error("Error while creating child leaf::" + name + " in container::" + getBasefile().getAbsolutePath(), e); return null; } return new LocalFileImpl(fNewFile, this); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-41242 - Severity: HIGH - CVSS Score: 7.9 Description: OO-5819: container can only create file in its own path Function: createChildLeaf File: src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java Repository: OpenOLAT Fixed Code: @Override public VFSLeaf createChildLeaf(String name) { File fNewFile = new File(getBasefile(), name); try { if(!isInPath(name)) { log.warn("Could not create a new leaf::{} in container::{} - file out of parent directory", name, getBasefile().getAbsolutePath()); return null; } if(!fNewFile.getParentFile().exists()) { fNewFile.getParentFile().mkdirs(); } if (!fNewFile.createNewFile()) { log.warn("Could not create a new leaf::{} in container::{} - file alreay exists", name, getBasefile().getAbsolutePath()); return null; } } catch (Exception e) { log.error("Error while creating child leaf::{} in container::{}", name, getBasefile().getAbsolutePath(), e); return null; } return new LocalFileImpl(fNewFile, this); }
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
createChildLeaf
src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
1
Analyze the following code function for security vulnerabilities
@NonNull private Account[] getAccountsAsUserForPackage( String type, int userId, String callingPackage, int packageUid, String opPackageName, boolean includeUserManagedNotVisible) { int callingUid = Binder.getCallingUid(); // Only allow the system process to read accounts of other users if (userId != UserHandle.getCallingUserId() && callingUid != Process.SYSTEM_UID && mContext.checkCallingOrSelfPermission( android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("User " + UserHandle.getCallingUserId() + " trying to get account for " + userId); } if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "getAccounts: accountType " + type + ", caller's uid " + Binder.getCallingUid() + ", pid " + Binder.getCallingPid()); } // If the original calling app was using account choosing activity // provided by the framework or authenticator we'll passing in // the original caller's uid here, which is what should be used for filtering. List<String> managedTypes = getTypesManagedByCaller(callingUid, UserHandle.getUserId(callingUid)); if (packageUid != -1 && ((UserHandle.isSameApp(callingUid, Process.SYSTEM_UID) || (type != null && managedTypes.contains(type))))) { callingUid = packageUid; opPackageName = callingPackage; } List<String> visibleAccountTypes = getTypesVisibleToCaller(callingUid, userId, opPackageName); if (visibleAccountTypes.isEmpty() || (type != null && !visibleAccountTypes.contains(type))) { return EMPTY_ACCOUNT_ARRAY; } else if (visibleAccountTypes.contains(type)) { // Prune the list down to just the requested type. visibleAccountTypes = new ArrayList<>(); visibleAccountTypes.add(type); } // else aggregate all the visible accounts (it won't matter if the // list is empty). final long identityToken = clearCallingIdentity(); try { UserAccounts accounts = getUserAccounts(userId); return getAccountsInternal( accounts, callingUid, opPackageName, visibleAccountTypes, includeUserManagedNotVisible); } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAccountsAsUserForPackage 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
getAccountsAsUserForPackage
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public void setMaxTimeFrameValue(Integer maxTimeFrameValue) { this.maxTimeFrameValue = maxTimeFrameValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxTimeFrameValue File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4727
MEDIUM
6.1
openmrs/openmrs-module-appointmentscheduling
setMaxTimeFrameValue
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
public String getIsimChallengeResponse(String nonce) throws RemoteException { PhoneSubInfoProxy phoneSubInfoProxy = getPhoneSubInfoProxy(getDefaultSubscription()); return phoneSubInfoProxy.getIsimChallengeResponse(nonce); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIsimChallengeResponse File: src/java/com/android/internal/telephony/PhoneSubInfoController.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-0831
MEDIUM
4.3
android
getIsimChallengeResponse
src/java/com/android/internal/telephony/PhoneSubInfoController.java
79eecef63f3ea99688333c19e22813f54d4a31b1
0
Analyze the following code function for security vulnerabilities
private boolean shouldBeVisible(boolean behindOccludedContainer, boolean ignoringKeyguard) { updateVisibilityIgnoringKeyguard(behindOccludedContainer); if (ignoringKeyguard) { return visibleIgnoringKeyguard; } return shouldBeVisibleUnchecked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldBeVisible File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
shouldBeVisible
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private void enforceModifyPermission() { enforcePermission(MODIFY_PHONE_STATE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceModifyPermission File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
enforceModifyPermission
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
private boolean shouldUseSolidColorSplashScreen(ActivityRecord sourceRecord, boolean startActivity, ActivityOptions options, int resolvedTheme) { if (sourceRecord == null && !startActivity) { // Use simple style if this activity is not top activity. This could happen when adding // a splash screen window to the warm start activity which is re-create because top is // finishing. final ActivityRecord above = task.getActivityAbove(this); if (above != null) { return true; } } // setSplashScreenStyle decide in priority of windowSplashScreenBehavior. if (options != null) { final int optionsStyle = options.getSplashScreenStyle(); if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR) { return true; } else if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_ICON || isIconStylePreferred(resolvedTheme)) { return false; } // Choose the default behavior for Launcher and SystemUI when the SplashScreen style is // not specified in the ActivityOptions. if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME || launchedFromUid == Process.SHELL_UID) { return false; } else if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEMUI) { return true; } } else if (isIconStylePreferred(resolvedTheme)) { return false; } if (sourceRecord == null) { sourceRecord = searchCandidateLaunchingActivity(); } if (sourceRecord != null && !sourceRecord.isActivityTypeHome()) { return sourceRecord.mSplashScreenStyleSolidColor; } // If this activity was launched from Launcher or System for first start, never use a // solid color splash screen. // Need to check sourceRecord before in case this activity is launched from service. return !startActivity || !(mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEM || mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME || launchedFromUid == Process.SHELL_UID); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldUseSolidColorSplashScreen File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
shouldUseSolidColorSplashScreen
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public Item getItem(String pathName, ItemGroup context) { if (context==null) context = this; if (pathName==null) return null; if (pathName.startsWith("/")) // absolute return getItemByFullName(pathName); Object/*Item|ItemGroup*/ ctx = context; StringTokenizer tokens = new StringTokenizer(pathName,"/"); while (tokens.hasMoreTokens()) { String s = tokens.nextToken(); if (s.equals("..")) { if (ctx instanceof Item) { ctx = ((Item)ctx).getParent(); continue; } ctx=null; // can't go up further break; } if (s.equals(".")) { continue; } if (ctx instanceof ItemGroup) { ItemGroup g = (ItemGroup) ctx; Item i = g.getItem(s); if (i==null || !i.hasPermission(Item.READ)) { // XXX consider DISCOVER ctx=null; // can't go up further break; } ctx=i; } else { return null; } } if (ctx instanceof Item) return (Item)ctx; // fall back to the classic interpretation return getItemByFullName(pathName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getItem File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getItem
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private void setSyncableStateForEndPoint(EndPoint target, int syncable) { AuthorityInfo aInfo; synchronized (mAuthorities) { aInfo = getOrCreateAuthorityLocked(target, -1, false); if (syncable > 1) { syncable = 1; } else if (syncable < -1) { syncable = -1; } if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.d(TAG, "setIsSyncable: " + aInfo.toString() + " -> " + syncable); } if (aInfo.syncable == syncable) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.d(TAG, "setIsSyncable: already set to " + syncable + ", doing nothing"); } return; } aInfo.syncable = syncable; writeAccountInfoLocked(); } if (syncable > 0) { requestSync(aInfo, SyncOperation.REASON_IS_SYNCABLE, new Bundle()); } reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSyncableStateForEndPoint File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
setSyncableStateForEndPoint
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@Override public void cleanup() { debug("JSSEngine: cleanup()"); if (!is_inbound_closed) { debug("JSSEngine: cleanup() - closing opened inbound socket"); closeInbound(); } if (!is_outbound_closed) { debug("JSSEngine: cleanup() - closing opened outbound socket"); closeOutbound(); } // First cleanup any debugging ports, if any. cleanupLoggingSocket(); // Then clean up the NSS state. cleanupSSLFD(); // Clean up the session. if (session != null) { session.close(); session = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanup File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java Repository: dogtagpki/jss The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
cleanup
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
@Override public long getRateLimitResetTime(String packageName, @UserIdInt int userId) { verifyCaller(packageName, userId); synchronized (mLock) { throwIfUserLockedL(userId); return getNextResetTimeLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRateLimitResetTime File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
getRateLimitResetTime
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override protected void onSubmit() { super.onSubmit(); parentPage.refresh(); }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2013-7251 - Severity: MEDIUM - CVSS Score: 6.8 Description: CSRF protection. Function: onSubmit File: src/main/java/org/projectforge/web/task/TaskTreeForm.java Repository: micromata/projectforge-webapp Fixed Code: @Override protected void onSubmit() { super.onSubmit(); csrfTokenHandler.onSubmit(); parentPage.refresh(); }
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
onSubmit
src/main/java/org/projectforge/web/task/TaskTreeForm.java
422de35e3c3141e418a73bfb39b430d5fd74077e
1
Analyze the following code function for security vulnerabilities
@Override // for ValueInstantiator.Gettable public ValueInstantiator getValueInstantiator() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValueInstantiator 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
getValueInstantiator
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
public String getCalendarDomain() { return calendarDomain; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCalendarDomain File: src/main/java/org/projectforge/web/admin/SetupForm.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
getCalendarDomain
src/main/java/org/projectforge/web/admin/SetupForm.java
422de35e3c3141e418a73bfb39b430d5fd74077e
0
Analyze the following code function for security vulnerabilities
@Override public boolean isResetValues() { Object value = PARTIAL_RESET_VALUES_PARAM.getValue(ctx); return (null != value && "true".equals(value)) ? true : false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isResetValues File: impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-17091
MEDIUM
4.3
eclipse-ee4j/mojarra
isResetValues
impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
a3fa9573789ed5e867c43ea38374f4dbd5a8f81f
0
Analyze the following code function for security vulnerabilities
@Override public CommandData getCommandData() { return new CommandDataImpl("import", "Import data from another Bot.").addOption(OptionType.STRING, "bot", "The Bot you want to import data from.", true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCommandData File: src/main/java/de/presti/ree6/commands/impl/mod/Import.java Repository: Ree6-Applications/Ree6 The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
getCommandData
src/main/java/de/presti/ree6/commands/impl/mod/Import.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
0
Analyze the following code function for security vulnerabilities
WindowState getImeInputTarget() { final InputTarget target = mDisplayContent.getImeInputTarget(); return target != null ? target.getWindowState() : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getImeInputTarget 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
getImeInputTarget
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public void setLongSupportMessage(@NonNull ComponentName who, CharSequence message) { if (!mHasFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); synchronized (getLockObject()) { ActiveAdmin admin = getActiveAdminForUidLocked(who, caller.getUid()); if (!TextUtils.equals(admin.longSupportMessage, message)) { admin.longSupportMessage = message; saveSettingsLocked(caller.getUserId()); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_LONG_SUPPORT_MESSAGE) .setAdmin(who) .write(); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2023-21284 - Severity: MEDIUM - CVSS Score: 5.5 Description: Ensure policy has no absurdly long strings The following APIs now enforce limits and throw IllegalArgumentException when limits are violated: * DPM.setTrustAgentConfiguration() limits agent packgage name, component name, and strings within configuration bundle. * DPM.setPermittedAccessibilityServices() limits package names. * DPM.setPermittedInputMethods() limits package names. * DPM.setAccountManagementDisabled() limits account name. * DPM.setLockTaskPackages() limits package names. * DPM.setAffiliationIds() limits id. * DPM.transferOwnership() limits strings inside the bundle. Package names are limited at 223, because they become directory names and it is a filesystem restriction, see FrameworkParsingPackageUtils. All other strings are limited at 65535, because longer ones break binary XML serializer. The following APIs silently truncate strings that are long beyond reason: * DPM.setShortSupportMessage() truncates message at 200. * DPM.setLongSupportMessage() truncates message at 20000. * DPM.setOrganizationName() truncates org name at 200. Bug: 260729089 Test: atest com.android.server.devicepolicy (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5dd3e81347e3c841510094fb5effd51fc0fa995b) Merged-In: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Change-Id: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Function: setLongSupportMessage File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android Fixed Code: @Override public void setLongSupportMessage(@NonNull ComponentName who, CharSequence message) { if (!mHasFeature) { return; } message = truncateIfLonger(message, MAX_LONG_SUPPORT_MESSAGE_LENGTH); Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); synchronized (getLockObject()) { ActiveAdmin admin = getActiveAdminForUidLocked(who, caller.getUid()); if (!TextUtils.equals(admin.longSupportMessage, message)) { admin.longSupportMessage = message; saveSettingsLocked(caller.getUserId()); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_LONG_SUPPORT_MESSAGE) .setAdmin(who) .write(); }
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
setLongSupportMessage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
1
Analyze the following code function for security vulnerabilities
public List<String> getRevisions(RevisionCriteria criteria) throws XWikiException { return this.doc.getRevisions(criteria, this.context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRevisions 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
getRevisions
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
@Override public ParceledListSlice<UriPermission> getPersistedUriPermissions( String packageName, boolean incoming) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(packageName); data.writeInt(incoming ? 1 : 0); mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); reply.readException(); final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( reply); data.recycle(); reply.recycle(); return perms; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPersistedUriPermissions File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getPersistedUriPermissions
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private void updateDeviceIndex() { DeviceIndexFeatureProvider indexProvider = FeatureFactory.getFactory( this).getDeviceIndexFeatureProvider(); ThreadUtils.postOnBackgroundThread( () -> indexProvider.updateIndex(SettingsActivity.this, false /* force */)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDeviceIndex File: src/com/android/settings/SettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
updateDeviceIndex
src/com/android/settings/SettingsActivity.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
private String protocolDescription(String raw, ListPreference protocol) { String uRaw = checkNull(raw).toUpperCase(); uRaw = uRaw.equals("IPV4") ? "IP" : uRaw; final int protocolIndex = protocol.findIndexOfValue(uRaw); if (protocolIndex == -1) { return null; } else { final String[] values = getResources().getStringArray(R.array.apn_protocol_entries); try { return values[protocolIndex]; } catch (ArrayIndexOutOfBoundsException e) { return null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: protocolDescription File: src/com/android/settings/network/apn/ApnEditor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40125
HIGH
7.8
android
protocolDescription
src/com/android/settings/network/apn/ApnEditor.java
63d464c3fa5c7b9900448fef3844790756e557eb
0
Analyze the following code function for security vulnerabilities
private Bundle packageValuesForCallResult(HashMap<String, String> keyValues, boolean trackingGeneration) { Bundle result = new Bundle(); result.putSerializable(Settings.NameValueTable.VALUE, keyValues); if (trackingGeneration) { synchronized (mLock) { mSettingsRegistry.mGenerationRegistry.addGenerationData(result, mSettingsRegistry.getSettingsLocked( SETTINGS_TYPE_CONFIG, UserHandle.USER_SYSTEM).mKey); } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: packageValuesForCallResult File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
packageValuesForCallResult
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
protected String getItemCVOIDsSql(String crfVersionIds) { return "select cv.crf_id, cv.crf_version_id, item.item_id, cv.oc_oid as cv_oid, item.oc_oid as item_oid" + " from crf_version cv, versioning_map vm, item" + " where vm.crf_version_id in (" + crfVersionIds + ")" + " and vm.crf_version_id = cv.crf_version_id and vm.item_id = item.item_id" + " order by cv.crf_id, cv.crf_version_id desc, item.item_id"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getItemCVOIDsSql 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
getItemCVOIDsSql
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
@Override public CharSequence getOrganizationNameForUser(int userHandle) { if (!mHasFeature) { return null; } Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); Preconditions.checkCallAuthorization(canManageUsers(caller)); Preconditions.checkCallAuthorization(isManagedProfile(userHandle), "You can not get organization name outside a managed profile, userId = %d", userHandle); synchronized (getLockObject()) { ActiveAdmin profileOwner = getProfileOwnerAdminLocked(userHandle); return (profileOwner != null) ? profileOwner.organizationName : null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOrganizationNameForUser 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
getOrganizationNameForUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public boolean accept(File f) { return f.getName().endsWith("." + format) || f.isDirectory(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: accept File: umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java Repository: umlet The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000548
MEDIUM
6.8
umlet
accept
umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java
e1c4cc6ae692cc8d1c367460dbf79343e996f9bd
0
Analyze the following code function for security vulnerabilities
public JSONArray put(int index, Map value) throws JSONException { put(index, new JSONObject(value)); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
put
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
private void validateCertificateAuthority(final TrustAnchor trustAnchor, final Map<URI, RpkiRepository> registeredRepositories, final CertificateRepositoryObjectValidationContext context, final ValidationResult validationResult, final List<Key> validatedObjects) { ValidationLocation certificateLocation = validationResult.getCurrentLocation(); ValidationResult temporary = ValidationResult.withLocation(certificateLocation); try { RpkiRepository rpkiRepository = Bench.mark(trustAnchor.getName(),"registerRepository", () -> storage.writeTx(tx -> registerRepository(tx, trustAnchor, registeredRepositories, context))); temporary.warnIfTrue(rpkiRepository.isPending(), VALIDATOR_RPKI_REPOSITORY_PENDING, rpkiRepository.getLocationUri()); if (rpkiRepository.isPending()) { return; } X509ResourceCertificate certificate = context.getCertificate(); URI manifestUri = certificate.getManifestUri(); temporary.setLocation(new ValidationLocation(manifestUri)); Optional<RpkiObject> manifestObject = Bench.mark(trustAnchor.getName(), "findLatestMftByAKI", () -> storage.readTx(tx -> rpkiObjects.findLatestMftByAKI(tx, certificate.getSubjectKeyIdentifier()))); if (!manifestObject.isPresent()) { if (rpkiRepository.getStatus() == RpkiRepository.Status.FAILED) { temporary.error(ValidationString.VALIDATOR_NO_MANIFEST_REPOSITORY_FAILED, rpkiRepository.getLocationUri()); } else { temporary.error(ValidationString.VALIDATOR_NO_LOCAL_MANIFEST_NO_MANIFEST_IN_REPOSITORY, manifestUri.toString(), rpkiRepository.getLocationUri()); } } final Optional<ManifestCms> maybeManifest = manifestObject.flatMap(x -> x.get(ManifestCms.class, temporary)); temporary.rejectIfTrue(manifestObject.isPresent() && rpkiRepository.getStatus() == RpkiRepository.Status.FAILED && maybeManifest.isPresent() && maybeManifest.get().isPastValidityTime(), ValidationString.VALIDATOR_OLD_LOCAL_MANIFEST_REPOSITORY_FAILED, rpkiRepository.getLocationUri()); if (temporary.hasFailureForCurrentLocation()) { return; } final ManifestCms manifest = maybeManifest.get(); List<Map.Entry<String, byte[]>> crlEntries = manifest.getFiles().entrySet().stream() .filter(entry -> RepositoryObjectType.parse(entry.getKey()) == RepositoryObjectType.Crl) .collect(toList()); temporary.rejectIfFalse(crlEntries.size() == 1, VALIDATOR_MANIFEST_CONTAINS_ONE_CRL_ENTRY, String.valueOf(crlEntries.size())); if (temporary.hasFailureForCurrentLocation()) { return; } Map.Entry<String, byte[]> crlEntry = crlEntries.get(0); URI crlUri = manifestUri.resolve(crlEntry.getKey()); Optional<RpkiObject> crlObject = storage.readTx(tx -> rpkiObjects.findBySha256(tx, crlEntry.getValue())); temporary.rejectIfFalse(crlObject.isPresent(), VALIDATOR_CRL_FOUND, crlUri.toASCIIString()); if (temporary.hasFailureForCurrentLocation()) { return; } temporary.setLocation(new ValidationLocation(crlUri)); final Optional<X509Crl> crl = crlObject.flatMap(x -> x.get(X509Crl.class, temporary)); if (temporary.hasFailureForCurrentLocation()) { return; } final X509Crl x509Crl = crl.get(); x509Crl.validate(crlUri.toASCIIString(), context, null, validationConfig.validationOptions(), temporary); if (temporary.hasFailureForCurrentLocation()) { return; } temporary.setLocation(new ValidationLocation(manifestUri)); manifest.validate(manifestUri.toASCIIString(), context, x509Crl, manifest.getCrlUri(), validationConfig.validationOptions(), temporary); if (temporary.hasFailureForCurrentLocation()) { return; } validatedObjects.add(manifestObject.get().key()); manifest.getFiles().entrySet() .parallelStream() .flatMap(entry -> getManifestEntry(manifestUri, entry)) .flatMap(tuple -> getCertificateRepositoryObjectValidationContext(trustAnchor, context, validatedObjects, crlUri, x509Crl, tuple)) .map(tuple -> { final ValidationResult vr = tuple.v2(); validateCertificateAuthority(trustAnchor, registeredRepositories, tuple.v1(), vr, validatedObjects); return vr; }) .forEachOrdered(temporary::addAll); } catch (Exception e) { validationResult.error(ErrorCodes.UNHANDLED_EXCEPTION, e.toString(), ExceptionUtils.getStackTrace(e)); } finally { validationResult.addAll(temporary); } }
Vulnerability Classification: - CWE: CWE-295 - CVE: CVE-2020-16162 - Severity: MEDIUM - CVSS Score: 5.0 Description: More test for manifest entry not found. Rename strict exception to manifest entry exception to short circuit. Handle this exception. Function: validateCertificateAuthority File: rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java Repository: RIPE-NCC/rpki-validator-3 Fixed Code: private void validateCertificateAuthority(final TrustAnchor trustAnchor, final Map<URI, RpkiRepository> registeredRepositories, final CertificateRepositoryObjectValidationContext context, final ValidationResult validationResult, final List<Key> validatedObjects) { ValidationLocation certificateLocation = validationResult.getCurrentLocation(); ValidationResult temporary = ValidationResult.withLocation(certificateLocation); try { RpkiRepository rpkiRepository = Bench.mark(trustAnchor.getName(),"registerRepository", () -> storage.writeTx(tx -> registerRepository(tx, trustAnchor, registeredRepositories, context))); temporary.warnIfTrue(rpkiRepository.isPending(), VALIDATOR_RPKI_REPOSITORY_PENDING, rpkiRepository.getLocationUri()); if (rpkiRepository.isPending()) { return; } X509ResourceCertificate certificate = context.getCertificate(); URI manifestUri = certificate.getManifestUri(); temporary.setLocation(new ValidationLocation(manifestUri)); Optional<RpkiObject> manifestObject = Bench.mark(trustAnchor.getName(), "findLatestMftByAKI", () -> storage.readTx(tx -> rpkiObjects.findLatestMftByAKI(tx, certificate.getSubjectKeyIdentifier()))); if (!manifestObject.isPresent()) { if (rpkiRepository.getStatus() == RpkiRepository.Status.FAILED) { temporary.error(ValidationString.VALIDATOR_NO_MANIFEST_REPOSITORY_FAILED, rpkiRepository.getLocationUri()); } else { temporary.error(ValidationString.VALIDATOR_NO_LOCAL_MANIFEST_NO_MANIFEST_IN_REPOSITORY, manifestUri.toString(), rpkiRepository.getLocationUri()); } } final Optional<ManifestCms> maybeManifest = manifestObject.flatMap(x -> x.get(ManifestCms.class, temporary)); temporary.rejectIfTrue(manifestObject.isPresent() && rpkiRepository.getStatus() == RpkiRepository.Status.FAILED && maybeManifest.isPresent() && maybeManifest.get().isPastValidityTime(), ValidationString.VALIDATOR_OLD_LOCAL_MANIFEST_REPOSITORY_FAILED, rpkiRepository.getLocationUri()); if (temporary.hasFailureForCurrentLocation()) { return; } final ManifestCms manifest = maybeManifest.get(); List<Map.Entry<String, byte[]>> crlEntries = manifest.getFiles().entrySet().stream() .filter(entry -> RepositoryObjectType.parse(entry.getKey()) == RepositoryObjectType.Crl) .collect(toList()); temporary.rejectIfFalse(crlEntries.size() == 1, VALIDATOR_MANIFEST_CONTAINS_ONE_CRL_ENTRY, String.valueOf(crlEntries.size())); if (temporary.hasFailureForCurrentLocation()) { return; } Map.Entry<String, byte[]> crlEntry = crlEntries.get(0); URI crlUri = manifestUri.resolve(crlEntry.getKey()); Optional<RpkiObject> crlObject = storage.readTx(tx -> rpkiObjects.findBySha256(tx, crlEntry.getValue())); temporary.rejectIfFalse(crlObject.isPresent(), VALIDATOR_CRL_FOUND, crlUri.toASCIIString()); if (temporary.hasFailureForCurrentLocation()) { return; } temporary.setLocation(new ValidationLocation(crlUri)); final Optional<X509Crl> crl = crlObject.flatMap(x -> x.get(X509Crl.class, temporary)); if (temporary.hasFailureForCurrentLocation()) { return; } final X509Crl x509Crl = crl.get(); x509Crl.validate(crlUri.toASCIIString(), context, null, validationConfig.validationOptions(), temporary); if (temporary.hasFailureForCurrentLocation()) { return; } temporary.setLocation(new ValidationLocation(manifestUri)); manifest.validate(manifestUri.toASCIIString(), context, x509Crl, manifest.getCrlUri(), validationConfig.validationOptions(), temporary); if (temporary.hasFailureForCurrentLocation()) { return; } validatedObjects.add(manifestObject.get().key()); manifest.getFiles().entrySet() .parallelStream() .flatMap(entry -> getManifestEntry(manifestUri, entry)) .flatMap(tuple -> getCertificateRepositoryObjectValidationContext(trustAnchor, context, validatedObjects, crlUri, x509Crl, tuple)) .map(tuple -> { final ValidationResult vr = tuple.v2(); validateCertificateAuthority(trustAnchor, registeredRepositories, tuple.v1(), vr, validatedObjects); return vr; }) .forEachOrdered(temporary::addAll); } catch (ManifestEntryException e){ temporary.addAll(e.getVr()); } catch (Exception e) { validationResult.error(ErrorCodes.UNHANDLED_EXCEPTION, e.toString(), ExceptionUtils.getStackTrace(e)); } finally { validationResult.addAll(temporary); } }
[ "CWE-295" ]
CVE-2020-16162
MEDIUM
5
RIPE-NCC/rpki-validator-3
validateCertificateAuthority
rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java
3cbf34fed7c0ca00574644a5b5b06f1b54a3f5dc
1
Analyze the following code function for security vulnerabilities
public boolean showViewAction(XWikiContext context) { String bl = getXWikiPreference("showviewaction", "", context); if ("1".equals(bl)) { return true; } else if ("0".equals(bl)) { return false; } return "1".equals(getConfiguration().getProperty("xwiki.showviewaction", "1")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showViewAction File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
showViewAction
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private static String chooseExtensionFromFilename(String mimeType, int destination, String filename, int lastDotIndex) { String extension = null; if (mimeType != null) { // Compare the last segment of the extension against the mime type. // If there's a mismatch, discard the entire extension. String typeFromExt = MimeTypeMap.getSingleton().getMimeTypeFromExtension( filename.substring(lastDotIndex + 1)); if (typeFromExt == null || !typeFromExt.equalsIgnoreCase(mimeType)) { extension = chooseExtensionFromMimeType(mimeType, false); if (extension != null) { if (Constants.LOGVV) { Log.v(Constants.TAG, "substituting extension from type"); } } else { if (Constants.LOGVV) { Log.v(Constants.TAG, "couldn't find extension for " + mimeType); } } } } if (extension == null) { if (Constants.LOGVV) { Log.v(Constants.TAG, "keeping extension"); } extension = filename.substring(lastDotIndex); } return extension; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: chooseExtensionFromFilename File: src/com/android/providers/downloads/Helpers.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
chooseExtensionFromFilename
src/com/android/providers/downloads/Helpers.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
public String display(String fieldname, String type, BaseObject obj, XWikiContext context) { return display(fieldname, type, obj, true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: display File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
display
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public int getMaxRecursiveSpaceChecks(XWikiContext context) { int max = getXWikiPreferenceAsInt("rights_maxrecursivespacechecks", -1, context); if (max == -1) { return getConfiguration().getProperty("xwiki.rights.maxrecursivespacechecks", 0); } else { return max; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxRecursiveSpaceChecks File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getMaxRecursiveSpaceChecks
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public KBTemplate findByGroupId_Last(long groupId, OrderByComparator<KBTemplate> orderByComparator) throws NoSuchTemplateException { KBTemplate kbTemplate = fetchByGroupId_Last(groupId, orderByComparator); if (kbTemplate != null) { return kbTemplate; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("groupId="); msg.append(groupId); msg.append(StringPool.CLOSE_CURLY_BRACE); throw new NoSuchTemplateException(msg.toString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findByGroupId_Last File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
findByGroupId_Last
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
public String getIssuedOnTo() { return issuedOnTo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIssuedOnTo File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getIssuedOnTo
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public boolean isSecure(int userId) { return mLockPatternUtils.isSecure(userId) || mUpdateMonitor.isSimPinSecure(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSecure 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
isSecure
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
String getDeDatabaseName(int userId) { File databaseFile = new File(Environment.getDataSystemDeDirectory(userId), AccountsDb.DE_DATABASE_NAME); return databaseFile.getPath(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeDatabaseName 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
getDeDatabaseName
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public void activitySlept(IBinder token) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(token); mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: activitySlept File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
activitySlept
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public String toString() { StringBuffer str = new StringBuffer(); str.append(fBeginLineNumber); str.append(':'); str.append(fBeginColumnNumber); str.append(':'); str.append(fBeginCharacterOffset); str.append(':'); str.append(fEndLineNumber); str.append(':'); str.append(fEndColumnNumber); str.append(':'); str.append(fEndCharacterOffset); return str.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
toString
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@Override public T add(Headers<? extends K, ? extends V, ?> headers) { if (headers == this) { throw new IllegalArgumentException("can't add to itself."); } addImpl(headers); return thisT(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: add File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
add
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public Map<String, String> getServerVariables() { return serverVariables; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServerVariables File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getServerVariables
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public static void copyToDir(Directory in, Directory out, String fileName) throws DirectoryException { copyToDir(in, out, fileName, fileName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyToDir File: brut.j.dir/src/main/java/brut/directory/DirUtil.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
copyToDir
brut.j.dir/src/main/java/brut/directory/DirUtil.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
final void clear() { Arrays.fill(entries, null); firstNonPseudo = head.before = head.after = head; size = 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clear File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
clear
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
private void clearCompiledObjects() { // TODO if necessary }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearCompiledObjects File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java Repository: geosolutions-it/jai-ext The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-24816
HIGH
7.5
geosolutions-it/jai-ext
clearCompiledObjects
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
cb1d6565d38954676b0a366da4f965fef38da1cb
0
Analyze the following code function for security vulnerabilities
@Override public boolean isRoaming() { return getCurrentState() == mRoamingState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRoaming File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
isRoaming
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public int startActivityAsCaller(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int flags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityAsCaller File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startActivityAsCaller
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public ViewItem getItem(int position) { return mFilteredItems.get(position); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getItem File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
getItem
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
private boolean canonicalizeNumber(int start, int end) { elide(start, start); int sanStart = sanitizedJson.length(); normalizeNumber(start, end); // Ensure that the number is on the output buffer. Since this method is // only called when we are quoting a number that appears where a property // name is expected, we can force the sanitized form to contain it without // affecting the fast-track for already valid inputs. elide(end, end); int sanEnd = sanitizedJson.length(); return canonicalizeNumber(sanitizedJson, sanStart, sanEnd); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canonicalizeNumber File: src/main/java/com/google/json/JsonSanitizer.java Repository: OWASP/json-sanitizer The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-13973
MEDIUM
4.3
OWASP/json-sanitizer
canonicalizeNumber
src/main/java/com/google/json/JsonSanitizer.java
53ceaac3e0a10e86d512ce96a0056578f2d1978f
0
Analyze the following code function for security vulnerabilities
@Override // Binder call public void cancelAuthentication(final IBinder token, final String opPackageName) { final int uid = Binder.getCallingUid(); final int pid = Binder.getCallingPid(); mHandler.post(new Runnable() { @Override public void run() { if (!canUseFingerprint(opPackageName, true /* foregroundOnly */, uid, pid)) { if (DEBUG) Slog.v(TAG, "cancelAuthentication(): reject " + opPackageName); } else { ClientMonitor client = mCurrentClient; if (client instanceof AuthenticationClient) { if (client.getToken() == token) { if (DEBUG) Slog.v(TAG, "stop client " + client.getOwnerString()); client.stop(client.getToken() == token); } else { if (DEBUG) Slog.v(TAG, "can't stop client " + client.getOwnerString() + " since tokens don't match"); } } else if (client != null) { if (DEBUG) Slog.v(TAG, "can't cancel non-authenticating client " + client.getOwnerString()); } } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelAuthentication File: services/core/java/com/android/server/fingerprint/FingerprintService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
cancelAuthentication
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override protected void cleanIdentifierHostField(String structureInode) throws DotDataException, DotMappingException, DotStateException, DotSecurityException { StringBuffer sql = new StringBuffer("update identifier set parent_path='/', host_inode=? "); sql.append(" where id in (select identifier from contentlet where structure_inode = ?)"); DotConnect dc = new DotConnect(); dc.setSQL(sql.toString()); dc.addParam(APILocator.getHostAPI().findSystemHost().getIdentifier()); dc.addParam(structureInode); dc.loadResults(); //we could do a select here to figure out exactly which guys to evict cc.clearCache(); CacheLocator.getIdentifierCache().clearCache(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanIdentifierHostField File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
cleanIdentifierHostField
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
private void fillNullValuesForColumn(SQLiteDatabase db, ContentValues values) { String column = values.valueSet().iterator().next().getKey(); db.update(DB_TABLE, values, column + " is null", null); values.clear(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fillNullValuesForColumn File: src/com/android/providers/downloads/DownloadProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
fillNullValuesForColumn
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
@Override public void forceDexOpt(String packageName) { enforceSystemOrRoot("forceDexOpt"); PackageParser.Package pkg; synchronized (mPackages) { pkg = mPackages.get(packageName); if (pkg == null) { throw new IllegalArgumentException("Missing package: " + packageName); } } synchronized (mInstallLock) { final String[] instructionSets = new String[] { getPrimaryInstructionSet(pkg.applicationInfo) }; final int res = mPackageDexOptimizer.performDexOpt(pkg, instructionSets, true /*forceDex*/, false /* defer */, true /* inclDependencies */, true /* boot complete */); if (res != PackageDexOptimizer.DEX_OPT_PERFORMED) { throw new IllegalStateException("Failed to dexopt: " + res); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceDexOpt 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
forceDexOpt
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
protected IoWriteFuture doWritePacket(Buffer buffer) throws IOException { // Synchronize all write requests as needed by the encoding algorithm // and also queue the write request in this synchronized block to ensure // packets are sent in the correct order synchronized (encodeLock) { Buffer packet = resolveOutputPacket(buffer); IoSession networkSession = getIoSession(); IoWriteFuture future = networkSession.writeBuffer(packet); return future; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doWritePacket 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
doWritePacket
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
private boolean reInit(final Conversation conversation, final boolean hasExtras) { if (conversation == null) { return false; } this.conversation = conversation; //once we set the conversation all is good and it will automatically do the right thing in onStart() if (this.activity == null || this.binding == null) { return false; } if (!activity.xmppConnectionService.isConversationStillOpen(this.conversation)) { activity.onConversationArchived(this.conversation); return false; } stopScrolling(); Log.d(Config.LOGTAG, "reInit(hasExtras=" + Boolean.toString(hasExtras) + ")"); if (this.conversation.isRead() && hasExtras) { Log.d(Config.LOGTAG, "trimming conversation"); this.conversation.trim(); } setupIme(); final boolean scrolledToBottomAndNoPending = this.scrolledToBottom() && pendingScrollState.peek() == null; this.binding.textSendButton.setContentDescription(activity.getString(R.string.send_message_to_x, conversation.getName())); this.binding.textinput.setKeyboardListener(null); this.binding.textinput.setText(""); final boolean participating = conversation.getMode() == Conversational.MODE_SINGLE || conversation.getMucOptions().participating(); if (participating) { this.binding.textinput.append(this.conversation.getNextMessage()); } this.binding.textinput.setKeyboardListener(this); messageListAdapter.updatePreferences(); refresh(false); this.conversation.messagesLoaded.set(true); Log.d(Config.LOGTAG, "scrolledToBottomAndNoPending=" + Boolean.toString(scrolledToBottomAndNoPending)); if (hasExtras || scrolledToBottomAndNoPending) { resetUnreadMessagesCount(); synchronized (this.messageList) { Log.d(Config.LOGTAG, "jump to first unread message"); final Message first = conversation.getFirstUnreadMessage(); final int bottom = Math.max(0, this.messageList.size() - 1); final int pos; final boolean jumpToBottom; if (first == null) { pos = bottom; jumpToBottom = true; } else { int i = getIndexOf(first.getUuid(), this.messageList); pos = i < 0 ? bottom : i; jumpToBottom = false; } setSelection(pos, jumpToBottom); } } this.binding.messagesView.post(this::fireReadEvent); //TODO if we only do this when this fragment is running on main it won't *bing* in tablet layout which might be unnecessary since we can *see* it activity.xmppConnectionService.getNotificationService().setOpenConversation(this.conversation); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reInit File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
reInit
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private Map<String,File> indexRecordings(List<File> recs) { Map<String,File> indexedRecs = new HashMap<>(); Iterator<File> iterator = recs.iterator(); while (iterator.hasNext()) { File rec = iterator.next(); indexedRecs.put(rec.getName(), rec); } return indexedRecs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: indexRecordings File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
indexRecordings
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
public Locale getRealLocale() { return this.doc.getRealLocale(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRealLocale 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
getRealLocale
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
public void restoreAndPostInstall( int userId, PackageInstalledInfo res, @Nullable PostInstallData data) { if (DEBUG_INSTALL) { Log.v(TAG, "restoreAndPostInstall userId=" + userId + " package=" + res.mPkg); } // A restore should be requested at this point if (a) the install // succeeded, (b) the operation is not an update. final boolean update = res.mRemovedInfo != null && res.mRemovedInfo.mRemovedPackage != null; boolean doRestore = !update && res.mPkg != null; // Set up the post-install work request bookkeeping. This will be used // and cleaned up by the post-install event handling regardless of whether // there's a restore pass performed. Token values are >= 1. int token; if (mPm.mNextInstallToken < 0) mPm.mNextInstallToken = 1; token = mPm.mNextInstallToken++; if (data != null) { mPm.mRunningInstalls.put(token, data); } else if (DEBUG_INSTALL) { Log.v(TAG, "No post-install required for " + token); } if (DEBUG_INSTALL) Log.v(TAG, "+ starting restore round-trip " + token); if (res.mReturnCode == PackageManager.INSTALL_SUCCEEDED && doRestore) { // Pass responsibility to the Backup Manager. It will perform a // restore if appropriate, then pass responsibility back to the // Package Manager to run the post-install observer callbacks // and broadcasts. if (res.mFreezer != null) { res.mFreezer.close(); } doRestore = performBackupManagerRestore(userId, token, res); } // If this is an update to a package that might be potentially downgraded, then we // need to check with the rollback manager whether there's any userdata that might // need to be snapshotted or restored for the package. // // TODO(narayan): Get this working for cases where userId == UserHandle.USER_ALL. if (res.mReturnCode == PackageManager.INSTALL_SUCCEEDED && !doRestore && update) { doRestore = performRollbackManagerRestore(userId, token, res, data); } if (!doRestore) { // No restore possible, or the Backup Manager was mysteriously not // available -- just fire the post-install work request directly. if (DEBUG_INSTALL) Log.v(TAG, "No restore - queue post-install for " + token); Trace.asyncTraceBegin(TRACE_TAG_PACKAGE_MANAGER, "postInstall", token); Message msg = mPm.mHandler.obtainMessage(POST_INSTALL, token, 0); mPm.mHandler.sendMessage(msg); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restoreAndPostInstall File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
restoreAndPostInstall
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element pdElement = toDOM(document, "profileOutput"); document.appendChild(pdElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: toXML File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java Repository: dogtagpki/pki Fixed Code: public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element pdElement = toDOM(document, "profileOutput"); document.appendChild(pdElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toXML
base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
16deffdf7548e305507982e246eb9fd1eac414fd
1