instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
public void setAccountManagementDisabled(ComponentName who, String accountType,
boolean disabled, boolean parent) {
if (!mHasFeature) {
return;
}
Objects.requireNonNull(who, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(who);
synchronized (getLockObject()) {
/*
* When called on the parent DPM instance (parent == true), affects active admin
* selection in two ways:
* * The ActiveAdmin must be of an org-owned profile owner.
* * The parent ActiveAdmin instance should be used for managing the restriction.
*/
final ActiveAdmin ap;
if (parent) {
ap = getParentOfAdminIfRequired(getOrganizationOwnedProfileOwnerLocked(caller),
parent);
} else {
ap = getParentOfAdminIfRequired(getProfileOwnerOrDeviceOwnerLocked(caller), parent);
}
if (disabled) {
ap.accountTypesWithManagementDisabled.add(accountType);
} else {
ap.accountTypesWithManagementDisabled.remove(accountType);
}
saveSettingsLocked(UserHandle.getCallingUserId());
}
}
|
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: setAccountManagementDisabled
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
Fixed Code:
@Override
public void setAccountManagementDisabled(ComponentName who, String accountType,
boolean disabled, boolean parent) {
if (!mHasFeature) {
return;
}
Objects.requireNonNull(who, "ComponentName is null");
enforceMaxStringLength(accountType, "account type");
final CallerIdentity caller = getCallerIdentity(who);
synchronized (getLockObject()) {
/*
* When called on the parent DPM instance (parent == true), affects active admin
* selection in two ways:
* * The ActiveAdmin must be of an org-owned profile owner.
* * The parent ActiveAdmin instance should be used for managing the restriction.
*/
final ActiveAdmin ap;
if (parent) {
ap = getParentOfAdminIfRequired(getOrganizationOwnedProfileOwnerLocked(caller),
parent);
} else {
ap = getParentOfAdminIfRequired(getProfileOwnerOrDeviceOwnerLocked(caller), parent);
}
if (disabled) {
ap.accountTypesWithManagementDisabled.add(accountType);
} else {
ap.accountTypesWithManagementDisabled.remove(accountType);
}
saveSettingsLocked(UserHandle.getCallingUserId());
}
}
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
setAccountManagementDisabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 1
|
Analyze the following code function for security vulnerabilities
|
public List<Diagnostic> doDiagnostics(DOMDocument xmlDocument, CancelChecker monitor,
XMLValidationSettings validationSettings) {
return diagnostics.doDiagnostics(xmlDocument, monitor, validationSettings);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doDiagnostics
File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
Repository: eclipse/lemminx
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2019-18212
|
MEDIUM
| 4
|
eclipse/lemminx
|
doDiagnostics
|
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
|
e37c399aa266be1b7a43061d4afc43dc230410d2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
synchronized (this.messageList) {
super.onCreateContextMenu(menu, v, menuInfo);
AdapterView.AdapterContextMenuInfo acmi = (AdapterContextMenuInfo) menuInfo;
this.selectedMessage = this.messageList.get(acmi.position);
populateContextMenu(menu);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreateContextMenu
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
|
onCreateContextMenu
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void securityXmlGenerator(XmlGenerator gen, Config config) {
SecurityConfig c = config.getSecurityConfig();
if (c == null) {
return;
}
gen.open("security", "enabled", c.isEnabled())
.node("client-block-unmapped-actions", c.getClientBlockUnmappedActions());
PermissionPolicyConfig ppc = c.getClientPolicyConfig();
if (ppc.getClassName() != null) {
gen.open("client-permission-policy", "class-name", ppc.getClassName())
.appendProperties(ppc.getProperties())
.close();
}
appendLoginModules(gen, "client-login-modules", c.getClientLoginModuleConfigs());
appendLoginModules(gen, "member-login-modules", c.getMemberLoginModuleConfigs());
CredentialsFactoryConfig cfc = c.getMemberCredentialsConfig();
if (cfc.getClassName() != null) {
gen.open("member-credentials-factory", "class-name", cfc.getClassName())
.appendProperties(cfc.getProperties())
.close();
}
List<SecurityInterceptorConfig> sic = c.getSecurityInterceptorConfigs();
if (!sic.isEmpty()) {
gen.open("security-interceptors");
for (SecurityInterceptorConfig s : sic) {
gen.open("interceptor", "class-name", s.getClassName())
.close();
}
gen.close();
}
appendSecurityPermissions(gen, "client-permissions", c.getClientPermissionConfigs());
gen.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: securityXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
securityXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getPreviousDocstructUrl() throws IndexUnreachableException, PresentationException, DAOException, ViewerConfigurationException {
// logger.trace("getPreviousDocstructUrl");
if (viewManager == null) {
return null;
}
List<String> docstructTypes =
DataManager.getInstance().getConfiguration().getDocstructNavigationTypes(viewManager.getTopStructElement().getDocStructType(), true);
if (docstructTypes.isEmpty()) {
return null;
}
String currentDocstructIddoc = String.valueOf(viewManager.getCurrentStructElementIddoc());
// Determine docstruct URL and cache it
if (prevDocstructUrlCache.get(currentDocstructIddoc) == null) {
int currentElementIndex = getToc().findTocElementIndexByIddoc(currentDocstructIddoc);
if (currentElementIndex == -1) {
logger.warn("Current IDDOC not found in TOC: {}", viewManager.getCurrentStructElement().getLuceneId());
return null;
}
boolean found = false;
for (int i = currentElementIndex - 1; i >= 0; --i) {
TOCElement tocElement = viewManager.getToc().getTocElements().get(i);
String docstructType = tocElement.getMetadataValue(SolrConstants.DOCSTRCT);
if (docstructType != null && docstructTypes.contains(docstructType) && StringUtils.isNotBlank(tocElement.getPageNo())) {
logger.trace("Found previous {}: {}", docstructType, tocElement.getLogId());
// Add LOGID to the URL because ViewManager.currentStructElementIddoc (IDDOC_OWNER) can be incorrect in the index sometimes,
// resulting in the URL pointing at the current element
prevDocstructUrlCache.put(currentDocstructIddoc,
"/" + viewManager.getPi() + "/" + Integer.valueOf(tocElement.getPageNo()) + "/" + tocElement.getLogId() + "/");
found = true;
break;
}
}
if (!found) {
prevDocstructUrlCache.put(currentDocstructIddoc, "");
}
}
if (StringUtils.isNotEmpty(prevDocstructUrlCache.get(currentDocstructIddoc))) {
return BeanUtils.getServletPathWithHostAsUrlFromJsfContext() + "/" + navigationHelper.getCurrentPageType().getName()
+ prevDocstructUrlCache.get(currentDocstructIddoc);
}
return "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPreviousDocstructUrl
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
getPreviousDocstructUrl
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
public ResourceInfo findResource(String libraryName, String resourceName, String contentType, boolean isViewResource, FacesContext ctx) {
String localePrefix = getLocalePrefix(ctx);
List<String> contracts = getResourceLibraryContracts(ctx);
ResourceInfo info = getFromCache(resourceName, libraryName, localePrefix, contracts);
if (info == null) {
if (isCompressable(contentType, ctx)) {
info = findResourceCompressed(libraryName, resourceName, isViewResource, localePrefix, contracts, ctx);
} else {
info = findResourceNonCompressed(libraryName, resourceName, isViewResource, localePrefix, contracts, ctx);
}
}
return info;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findResource
File: impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-14371
|
MEDIUM
| 5
|
eclipse-ee4j/mojarra
|
findResource
|
impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
|
1b434748d9239f42eae8aa7d37d7a0930c061e24
| 0
|
Analyze the following code function for security vulnerabilities
|
void tearDownAgentAndKill(ApplicationInfo app) {
try {
// unbind and tidy up even on timeout or failure, just in case
mActivityManager.unbindBackupAgent(app);
// The agent was running with a stub Application object, so shut it down.
// !!! We hardcode the confirmation UI's package name here rather than use a
// manifest flag! TODO something less direct.
if (app.uid != Process.SYSTEM_UID
&& !app.packageName.equals("com.android.backupconfirm")
&& app.uid != Process.PHONE_UID) {
if (MORE_DEBUG) Slog.d(TAG, "Killing agent host process");
mActivityManager.killApplicationProcess(app.processName, app.uid);
} else {
if (MORE_DEBUG) Slog.d(TAG, "Not killing after operation: " + app.processName);
}
} catch (RemoteException e) {
Slog.d(TAG, "Lost app trying to shut down");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: tearDownAgentAndKill
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
tearDownAgentAndKill
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setImageToShow(String imageToShow) {
synchronized (lock) {
this.imageToShow = imageToShow;
if (viewManager != null) {
viewManager.setDropdownSelected(String.valueOf(imageToShow));
}
// Reset LOGID (the LOGID setter is called later by PrettyFaces, so if a value is passed, it will still be set)
setLogid("");
logger.trace("imageToShow: {}", this.imageToShow);
}
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-29014
- Severity: MEDIUM
- CVSS Score: 6.1
Description: Only allow setting logId to a value matching [\w-]+
refs #24571
Function: setImageToShow
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
Fixed Code:
public void setImageToShow(String imageToShow) {
synchronized (lock) {
this.imageToShow = imageToShow;
if (viewManager != null) {
viewManager.setDropdownSelected(String.valueOf(imageToShow));
}
// Reset LOGID (the LOGID setter is called later by PrettyFaces, so if a value is passed, it will still be set)
try {
setLogid("");
} catch (PresentationException e) {
//cannot be thrown here
}
logger.trace("imageToShow: {}", this.imageToShow);
}
}
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
setImageToShow
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 1
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public <P extends ParaObject> P populate(HttpServletRequest req, P pobj, String... paramName) {
if (pobj == null || paramName == null) {
return pobj;
}
Map<String, Object> data = new LinkedHashMap<String, Object>();
if (isApiRequest(req)) {
try {
data = (Map<String, Object>) req.getAttribute(REST_ENTITY_ATTRIBUTE);
if (data == null) {
data = ParaObjectUtils.getJsonReader(Map.class).readValue(req.getInputStream());
}
} catch (IOException ex) {
logger.error(null, ex);
data = Collections.emptyMap();
}
} else {
for (String param : paramName) {
String[] values;
if (param.matches(".+?\\|.$")) {
// convert comma-separated value to list of strings
String cleanParam = param.substring(0, param.length() - 2);
values = req.getParameterValues(cleanParam);
String firstValue = (values != null && values.length > 0) ? values[0] : null;
String separator = param.substring(param.length() - 1);
if (!StringUtils.isBlank(firstValue)) {
data.put(cleanParam, Arrays.asList(firstValue.split(separator)));
}
} else {
values = req.getParameterValues(param);
if (values != null && values.length > 0) {
data.put(param, values.length > 1 ? Arrays.asList(values) :
Arrays.asList(values).iterator().next());
}
}
}
}
if (!data.isEmpty()) {
ParaObjectUtils.setAnnotatedFields(pobj, data, null);
}
return pobj;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: populate
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
populate
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
return file;
} catch (IOException e) {
throw new ApiException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: downloadFileFromResponse
File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
downloadFileFromResponse
|
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<IFileAsset> fromContentletsI(List<Contentlet> cons) {
List<IFileAsset> fas = new ArrayList<IFileAsset>();
for (Contentlet con : cons) {
fas.add(fromContentlet(con));
}
return fas;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fromContentletsI
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
|
fromContentletsI
|
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
|
ab2bb2e00b841d131b8734227f9106e3ac31bb99
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<? extends Post> getPostsForUser(String type, Pager pager) {
pager.setSortby("votes");
return client().findTerms(type, Collections.singletonMap(Config._CREATORID, getId()), true, pager);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPostsForUser
File: src/main/java/com/erudika/scoold/core/Profile.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
getPostsForUser
|
src/main/java/com/erudika/scoold/core/Profile.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Map<Object,Object> getSystemProperties(VirtualChannel channel) throws IOException, InterruptedException {
if(channel==null)
return Collections.<Object,Object>singletonMap("N/A","N/A");
return channel.call(new GetSystemProperties());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSystemProperties
File: core/src/main/java/hudson/util/RemotingDiagnostics.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-2068
|
LOW
| 3.5
|
jenkinsci/jenkins
|
getSystemProperties
|
core/src/main/java/hudson/util/RemotingDiagnostics.java
|
0530a6645aac10fec005614211660e98db44b5eb
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
int callingUid, int[] users) {
// TODO: come back and remove this assumption to triage all broadcasts
int pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING;
List<ResolveInfo> receivers = null;
try {
HashSet<ComponentName> singleUserReceivers = null;
boolean scannedFirstReceivers = false;
for (int user : users) {
// Skip users that have Shell restrictions, with exception of always permitted
// Shell broadcasts
if (callingUid == SHELL_UID
&& mUserController.hasUserRestriction(
UserManager.DISALLOW_DEBUGGING_FEATURES, user)
&& !isPermittedShellBroadcast(intent)) {
continue;
}
List<ResolveInfo> newReceivers = AppGlobals.getPackageManager()
.queryIntentReceivers(intent, resolvedType, pmFlags, user).getList();
if (user != UserHandle.USER_SYSTEM && newReceivers != null) {
// If this is not the system user, we need to check for
// any receivers that should be filtered out.
for (int i=0; i<newReceivers.size(); i++) {
ResolveInfo ri = newReceivers.get(i);
if ((ri.activityInfo.flags&ActivityInfo.FLAG_SYSTEM_USER_ONLY) != 0) {
newReceivers.remove(i);
i--;
}
}
}
if (newReceivers != null && newReceivers.size() == 0) {
newReceivers = null;
}
if (receivers == null) {
receivers = newReceivers;
} else if (newReceivers != null) {
// We need to concatenate the additional receivers
// found with what we have do far. This would be easy,
// but we also need to de-dup any receivers that are
// singleUser.
if (!scannedFirstReceivers) {
// Collect any single user receivers we had already retrieved.
scannedFirstReceivers = true;
for (int i=0; i<receivers.size(); i++) {
ResolveInfo ri = receivers.get(i);
if ((ri.activityInfo.flags&ActivityInfo.FLAG_SINGLE_USER) != 0) {
ComponentName cn = new ComponentName(
ri.activityInfo.packageName, ri.activityInfo.name);
if (singleUserReceivers == null) {
singleUserReceivers = new HashSet<ComponentName>();
}
singleUserReceivers.add(cn);
}
}
}
// Add the new results to the existing results, tracking
// and de-dupping single user receivers.
for (int i=0; i<newReceivers.size(); i++) {
ResolveInfo ri = newReceivers.get(i);
if ((ri.activityInfo.flags&ActivityInfo.FLAG_SINGLE_USER) != 0) {
ComponentName cn = new ComponentName(
ri.activityInfo.packageName, ri.activityInfo.name);
if (singleUserReceivers == null) {
singleUserReceivers = new HashSet<ComponentName>();
}
if (!singleUserReceivers.contains(cn)) {
singleUserReceivers.add(cn);
receivers.add(ri);
}
} else {
receivers.add(ri);
}
}
}
}
} catch (RemoteException ex) {
// pm is in same process, this will never happen.
}
return receivers;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: collectReceiverComponents
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
|
collectReceiverComponents
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public static long estimateMaxDirectMemory() {
long maxDirectMemory = 0;
ClassLoader systemClassLoader = null;
try {
systemClassLoader = getSystemClassLoader();
// When using IBM J9 / Eclipse OpenJ9 we should not use VM.maxDirectMemory() as it not reflects the
// correct value.
// See:
// - https://github.com/netty/netty/issues/7654
String vmName = SystemPropertyUtil.get("java.vm.name", "").toLowerCase();
if (!vmName.startsWith("ibm j9") &&
// https://github.com/eclipse/openj9/blob/openj9-0.8.0/runtime/include/vendor_version.h#L53
!vmName.startsWith("eclipse openj9")) {
// Try to get from sun.misc.VM.maxDirectMemory() which should be most accurate.
Class<?> vmClass = Class.forName("sun.misc.VM", true, systemClassLoader);
Method m = vmClass.getDeclaredMethod("maxDirectMemory");
maxDirectMemory = ((Number) m.invoke(null)).longValue();
}
} catch (Throwable ignored) {
// Ignore
}
if (maxDirectMemory > 0) {
return maxDirectMemory;
}
try {
// Now try to get the JVM option (-XX:MaxDirectMemorySize) and parse it.
// Note that we are using reflection because Android doesn't have these classes.
Class<?> mgmtFactoryClass = Class.forName(
"java.lang.management.ManagementFactory", true, systemClassLoader);
Class<?> runtimeClass = Class.forName(
"java.lang.management.RuntimeMXBean", true, systemClassLoader);
Object runtime = mgmtFactoryClass.getDeclaredMethod("getRuntimeMXBean").invoke(null);
@SuppressWarnings("unchecked")
List<String> vmArgs = (List<String>) runtimeClass.getDeclaredMethod("getInputArguments").invoke(runtime);
for (int i = vmArgs.size() - 1; i >= 0; i --) {
Matcher m = MAX_DIRECT_MEMORY_SIZE_ARG_PATTERN.matcher(vmArgs.get(i));
if (!m.matches()) {
continue;
}
maxDirectMemory = Long.parseLong(m.group(1));
switch (m.group(2).charAt(0)) {
case 'k': case 'K':
maxDirectMemory *= 1024;
break;
case 'm': case 'M':
maxDirectMemory *= 1024 * 1024;
break;
case 'g': case 'G':
maxDirectMemory *= 1024 * 1024 * 1024;
break;
default:
break;
}
break;
}
} catch (Throwable ignored) {
// Ignore
}
if (maxDirectMemory <= 0) {
maxDirectMemory = Runtime.getRuntime().maxMemory();
logger.debug("maxDirectMemory: {} bytes (maybe)", maxDirectMemory);
} else {
logger.debug("maxDirectMemory: {} bytes", maxDirectMemory);
}
return maxDirectMemory;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: estimateMaxDirectMemory
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
estimateMaxDirectMemory
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void scheduleSaveBaseState() {
scheduleSaveInner(UserHandle.USER_NULL); // Special case -- use USER_NULL for base state.
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scheduleSaveBaseState
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
|
scheduleSaveBaseState
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void reload(boolean checkForRepost) {
mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary();
if (mNativeContentViewCore != 0) {
nativeReload(mNativeContentViewCore, checkForRepost);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reload
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
|
reload
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private void addNewJar(final JARDesc desc, UpdatePolicy updatePolicy) {
available.add(desc);
tracker.addResource(desc.getLocation(),
desc.getVersion(),
null,
updatePolicy
);
// Give read permissions to the cached jar file
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
Permission p = CacheUtil.getReadPermission(desc.getLocation(),
desc.getVersion());
resourcePermissions.add(p);
return null;
}
});
final URL remoteURL = desc.getLocation();
final URL cachedUrl = tracker.getCacheURL(remoteURL); // blocks till download
available.remove(desc); // Resource downloaded. Remove from available list.
try {
// Verify if needed
final List<JARDesc> jars = new ArrayList<>();
jars.add(desc);
// Decide what level of security this jar should have
// The verification and security setting functions rely on
// having AllPermissions as those actions normally happen
// during initialization. We therefore need to do those
// actions as privileged.
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
@Override
public Void run() throws Exception {
jcv.add(jars, tracker);
checkTrustWithUser();
final SecurityDesc security = securityDelegate.getJarPermissions(file.getCodeBase());
jarLocationSecurityMap.put(remoteURL, security);
return null;
}
});
addURL(remoteURL);
CachedJarFileCallback.getInstance().addMapping(remoteURL, cachedUrl);
} catch (Exception e) {
// Do nothing. This code is called by loadClass which cannot
// throw additional exceptions. So instead, just ignore it.
// Exception => jar will not get added to classpath, which will
// result in CNFE from loadClass.
LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addNewJar
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
addNewJar
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
private void quitRoom(String room) {
Log.d(TAG, "Leaving MUC " + room);
MultiUserChat muc = multiUserChats.get(room);
muc.leave();
multiUserChats.remove(room);
mucLastPong.remove(room);
mContentResolver.delete(RosterProvider.CONTENT_URI, "jid = ?", new String[] {room});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: quitRoom
File: src/org/yaxim/androidclient/service/SmackableImp.java
Repository: ge0rg/yaxim
The code follows secure coding practices.
|
[
"CWE-20",
"CWE-346"
] |
CVE-2017-5589
|
MEDIUM
| 4.3
|
ge0rg/yaxim
|
quitRoom
|
src/org/yaxim/androidclient/service/SmackableImp.java
|
65a38dc77545d9568732189e86089390f0ceaf9f
| 0
|
Analyze the following code function for security vulnerabilities
|
void adjustStartingWindowFlags() {
if (mAttrs.type == TYPE_BASE_APPLICATION && mActivityRecord != null
&& mActivityRecord.mStartingWindow != null) {
// Special handling of starting window over the base
// window of the app: propagate lock screen flags to it,
// to provide the correct semantics while starting.
final int mask = FLAG_SHOW_WHEN_LOCKED | FLAG_DISMISS_KEYGUARD
| FLAG_ALLOW_LOCK_WHILE_SCREEN_ON;
WindowManager.LayoutParams sa = mActivityRecord.mStartingWindow.mAttrs;
sa.flags = (sa.flags & ~mask) | (mAttrs.flags & mask);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: adjustStartingWindowFlags
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
|
adjustStartingWindowFlags
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void memberAddressProviderConfigXmlGenerator(XmlGenerator gen, NetworkConfig netCfg) {
MemberAddressProviderConfig memberAddressProviderConfig = netCfg.getMemberAddressProviderConfig();
if (memberAddressProviderConfig == null) {
return;
}
String className = classNameOrImplClass(memberAddressProviderConfig.getClassName(),
memberAddressProviderConfig.getImplementation());
if (isNullOrEmpty(className)) {
return;
}
gen.open("member-address-provider", "enabled", memberAddressProviderConfig.isEnabled())
.node("class-name", className)
.appendProperties(memberAddressProviderConfig.getProperties())
.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: memberAddressProviderConfigXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
memberAddressProviderConfigXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean equals(
Object obj)
{
if (!(obj instanceof DHPublicKeyParameters))
{
return false;
}
DHPublicKeyParameters other = (DHPublicKeyParameters)obj;
return other.getY().equals(y) && super.equals(obj);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
File: core/src/main/java/org/bouncycastle/crypto/params/DHPublicKeyParameters.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2016-1000339
|
MEDIUM
| 5
|
bcgit/bc-java
|
equals
|
core/src/main/java/org/bouncycastle/crypto/params/DHPublicKeyParameters.java
|
413b42f4d770456508585c830cfcde95f9b0e93b
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean isCompatible(HotRestartConfig c1, HotRestartConfig c2) {
boolean c1Disabled = c1 == null || !c1.isEnabled();
boolean c2Disabled = c2 == null || !c2.isEnabled();
return c1 == c2 || (c1Disabled && c2Disabled) || (c1 != null && c2 != null && nullSafeEqual(c1.isFsync(), c2.isFsync()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCompatible
File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
isCompatible
|
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public WifiEnterpriseConfig createFromParcel(Parcel in) {
WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
int count = in.readInt();
for (int i = 0; i < count; i++) {
String key = in.readString();
String value = in.readString();
enterpriseConfig.mFields.put(key, value);
}
enterpriseConfig.mCaCert = readCertificate(in);
PrivateKey userKey = null;
int len = in.readInt();
if (len > 0) {
try {
byte[] bytes = new byte[len];
in.readByteArray(bytes);
String algorithm = in.readString();
KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
userKey = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(bytes));
} catch (NoSuchAlgorithmException e) {
userKey = null;
} catch (InvalidKeySpecException e) {
userKey = null;
}
}
enterpriseConfig.mClientPrivateKey = userKey;
enterpriseConfig.mClientCertificate = readCertificate(in);
enterpriseConfig.mTls12Enable = (in.readInt() == 1);
return enterpriseConfig;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createFromParcel
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
|
createFromParcel
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onError(Exception exception) {
error = true;
errorException = exception;
if (paused) {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "the task[%d] has already been paused, so pass the"
+ " error callback", model.getId());
}
return;
}
// discard all
@SuppressWarnings("unchecked") ArrayList<DownloadRunnable> discardList =
(ArrayList<DownloadRunnable>) downloadRunnableList.clone();
for (DownloadRunnable runnable : discardList) {
if (runnable != null) {
runnable.discard();
// if runnable is null, then that one must be completed and removed
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onError
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
|
onError
|
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
|
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("this")
private void finishForceStopPackageLocked(final String packageName, int uid) {
Intent intent = new Intent(Intent.ACTION_PACKAGE_RESTARTED,
Uri.fromParts("package", packageName, null));
if (!mProcessesReady) {
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY
| Intent.FLAG_RECEIVER_FOREGROUND);
}
intent.putExtra(Intent.EXTRA_UID, uid);
intent.putExtra(Intent.EXTRA_USER_HANDLE, UserHandle.getUserId(uid));
broadcastIntentLocked(null, null, null, intent,
null, null, 0, null, null, null, null, null, OP_NONE,
null, false, false, MY_PID, SYSTEM_UID, Binder.getCallingUid(),
Binder.getCallingPid(), UserHandle.getUserId(uid));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishForceStopPackageLocked
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
|
finishForceStopPackageLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static JSONObject toJSONObject(Reader reader, XMLParserConfiguration config) throws JSONException {
JSONObject jo = new JSONObject();
XMLTokener x = new XMLTokener(reader);
while (x.more()) {
x.skipPast("<");
if(x.more()) {
parse(x, jo, null, config);
}
}
return jo;
}
|
Vulnerability Classification:
- CWE: CWE-787
- CVE: CVE-2022-45688
- Severity: HIGH
- CVSS Score: 7.5
Description: fix: limit the nesting depth
Function: toJSONObject
File: src/main/java/org/json/XML.java
Repository: stleary/JSON-java
Fixed Code:
public static JSONObject toJSONObject(Reader reader, XMLParserConfiguration config) throws JSONException {
JSONObject jo = new JSONObject();
XMLTokener x = new XMLTokener(reader);
while (x.more()) {
x.skipPast("<");
if(x.more()) {
parse(x, jo, null, config, 0);
}
}
return jo;
}
|
[
"CWE-787"
] |
CVE-2022-45688
|
HIGH
| 7.5
|
stleary/JSON-java
|
toJSONObject
|
src/main/java/org/json/XML.java
|
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
| 1
|
Analyze the following code function for security vulnerabilities
|
@Nullable
private FileInput toFileInput(String fileUri, Settings withClauseOptions) {
URI uri = toURI(fileUri);
FileInputFactory fileInputFactory = fileInputFactories.get(uri.getScheme());
if (fileInputFactory != null) {
try {
return fileInputFactory.create(uri, withClauseOptions);
} catch (IOException e) {
return null;
}
}
return new URLFileInput(uri);
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2024-24565
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Restrict `COPY FROM` using local files to superuser
Fixing a security issue where any user could read/import content
of any file on the host system, the CrateDB process user has read
access to.
Function: toFileInput
File: server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java
Repository: crate
Fixed Code:
@Nullable
private FileInput toFileInput(URI uri, Settings withClauseOptions) {
FileInputFactory fileInputFactory = fileInputFactories.get(uri.getScheme());
if (fileInputFactory != null) {
try {
return fileInputFactory.create(uri, withClauseOptions);
} catch (IOException e) {
return null;
}
}
return new URLFileInput(uri);
}
|
[
"CWE-22"
] |
CVE-2024-24565
|
MEDIUM
| 6.5
|
crate
|
toFileInput
|
server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java
|
4e857d675683095945dd524d6ba03e692c70ecd6
| 1
|
Analyze the following code function for security vulnerabilities
|
private void applyConfiguredHeaders(MutableHttpHeaders headers) {
if (serverConfiguration.isDateHeader() && !headers.contains("Date")) {
headers.date(LocalDateTime.now());
}
serverConfiguration.getServerHeader().ifPresent((server) -> {
if (!headers.contains("Server")) {
headers.add("Server", server);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyConfiguredHeaders
File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
applyConfiguredHeaders
|
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public SaReactorFilter addInclude(String... paths) {
includeList.addAll(Arrays.asList(paths));
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addInclude
File: sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java
Repository: dromara/Sa-Token
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
addInclude
|
sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 0
|
Analyze the following code function for security vulnerabilities
|
protected long indexCount(String query) {
String qq=findAndReplaceQueryDates(translateQuery(query, null).getQuery());
// we check the query to figure out wich indexes to hit
String indexToHit;
IndiciesInfo info;
try {
info=APILocator.getIndiciesAPI().loadIndicies();
}
catch(DotDataException ee) {
Logger.fatal(this, "Can't get indicies information",ee);
return 0;
}
if(query.contains("+live:true") && !query.contains("+deleted:true"))
indexToHit=info.live;
else
indexToHit=info.working;
Client client=new ESClient().getClient();
QueryStringQueryBuilder qb = QueryBuilders.queryString(qq);
CountRequestBuilder crb = client.prepareCount();
crb.setQuery(qb);
crb.setIndices(indexToHit);
return crb.execute().actionGet().getCount();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: indexCount
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
|
indexCount
|
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getAccountVisibilityFromCache(Account account, String packageName,
UserAccounts accounts) {
synchronized (accounts.cacheLock) {
Map<String, Integer> accountVisibility =
getPackagesAndVisibilityForAccountLocked(account, accounts);
Integer visibility = accountVisibility.get(packageName);
return visibility != null ? visibility : AccountManager.VISIBILITY_UNDEFINED;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAccountVisibilityFromCache
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
|
getAccountVisibilityFromCache
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
KeyMapper<Object> getKeyMapper() {
return datasourceExtension.getKeyMapper();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getKeyMapper
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getKeyMapper
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
private HashMap<String, String> getExtraPropertyValues(HttpServletRequest request) {
// process extra properties
HashMap<String, String> properties = new HashMap<>();
Enumeration<String> parameters = request.getParameterNames();
while (parameters.hasMoreElements()) {
String parameterName = parameters.nextElement();
if (parameterName.startsWith("prop_")) {
// remove "prop_"
String property = parameterName.substring(5, parameterName.length());
properties.put(property, request.getParameter(parameterName));
}
}
return properties;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExtraPropertyValues
File: core-war/src/main/java/org/silverpeas/web/jobdomain/servlets/JobDomainPeasRequestRouter.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
getExtraPropertyValues
|
core-war/src/main/java/org/silverpeas/web/jobdomain/servlets/JobDomainPeasRequestRouter.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
@PermissionCheckerManager.PermissionResult
@RequiresPermission(value = Manifest.permission.UPDATE_APP_OPS_STATS, conditional = true)
public int checkPermissionForStartDataDelivery(@NonNull String permission,
@NonNull AttributionSource attributionSource, @Nullable String message) {
return PermissionChecker.checkPermissionForDataDelivery(mContext, permission,
// FIXME(b/199526514): PID should be passed inside AttributionSource.
PermissionChecker.PID_UNKNOWN, attributionSource, message, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkPermissionForStartDataDelivery
File: core/java/android/permission/PermissionManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
checkPermissionForStartDataDelivery
|
core/java/android/permission/PermissionManager.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getRobotNames() {
return "tested.robots.HttpAttack,sample.Target";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRobotNames
File: robocode.tests/src/test/java/net/sf/robocode/test/robots/TestHttpAttack.java
Repository: robo-code/robocode
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10648
|
HIGH
| 7.5
|
robo-code/robocode
|
getRobotNames
|
robocode.tests/src/test/java/net/sf/robocode/test/robots/TestHttpAttack.java
|
836c84635e982e74f2f2771b2c8640c3a34221bd
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Version getVersion() {
return VERSION;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getVersion
File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
Repository: geotools
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2022-24818
|
HIGH
| 7.5
|
geotools
|
getVersion
|
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
|
4f70fa3234391dd0cda883a20ab0ec75688cba49
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected FooterRow createRow() {
return new FooterRow(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createRow
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
createRow
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRootUrlFromRequest() {
StaplerRequest req = Stapler.getCurrentRequest();
StringBuilder buf = new StringBuilder();
buf.append(req.getScheme()+"://");
buf.append(req.getServerName());
if(req.getServerPort()!=80)
buf.append(':').append(req.getServerPort());
buf.append(req.getContextPath()).append('/');
return buf.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRootUrlFromRequest
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
|
getRootUrlFromRequest
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getTagText(Element element, String tag) {
try {
// From root element, identify first with tag, then find the
// first child under that, which we treat as a TEXT node.
Element firstElt = getFirstTag(element, tag);
if (firstElt == null) return "";
return getEltText(firstElt);
} catch (Exception e) {
log.warning("Exception thrown attempting to get tag text for tag="+tag+", from element="+element);
}
return "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTagText
File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-3878
|
HIGH
| 7.5
|
stanfordnlp/CoreNLP
|
getTagText
|
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
|
e5bbe135a02a74b952396751ed3015e8b8252e99
| 0
|
Analyze the following code function for security vulnerabilities
|
private void revisitSequenceFlows(Definitions def, String orig) {
try {
Map<String, Map<String, String>> sequenceFlowMapping = new HashMap<String, Map<String,String>>();
XMLInputFactory factory = XMLInputFactory.newInstance();
XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(orig));
while(reader.hasNext()) {
if (reader.next() == XMLStreamReader.START_ELEMENT) {
if ("sequenceFlow".equals(reader.getLocalName())) {
String id = "";
String source = "";
String target = "";
for (int i = 0 ; i < reader.getAttributeCount() ; i++) {
if ("id".equals(reader.getAttributeLocalName(i))) {
id = reader.getAttributeValue(i);
}
if ("sourceRef".equals(reader.getAttributeLocalName(i))) {
source = reader.getAttributeValue(i);
}
if ("targetRef".equals(reader.getAttributeLocalName(i))) {
target = reader.getAttributeValue(i);
}
}
Map<String, String> valueMap = new HashMap<String, String>();
valueMap.put("sourceRef", source);
valueMap.put("targetRef", target);
sequenceFlowMapping.put(id, valueMap);
}
}
}
List<RootElement> rootElements = def.getRootElements();
for(RootElement root : rootElements) {
if(root instanceof Process) {
Process process = (Process) root;
List<FlowElement> flowElements = process.getFlowElements();
for(FlowElement fe : flowElements) {
if(fe instanceof SequenceFlow) {
SequenceFlow sf = (SequenceFlow) fe;
if(sequenceFlowMapping.containsKey(sf.getId())) {
sf.setSourceRef(getFlowNode(def, sequenceFlowMapping.get(sf.getId()).get("sourceRef")));
sf.setTargetRef(getFlowNode(def, sequenceFlowMapping.get(sf.getId()).get("targetRef")));
} else {
_logger.error("Could not find mapping for sequenceFlow: " + sf.getId());
}
}
}
}
}
} catch (FactoryConfigurationError e) {
_logger.error(e.getMessage());
e.printStackTrace();
} catch (Exception e) {
_logger.error(e.getMessage());
e.printStackTrace();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: revisitSequenceFlows
File: jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/TransformerServlet.java
Repository: kiegroup/jbpm-designer
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2017-7545
|
MEDIUM
| 4
|
kiegroup/jbpm-designer
|
revisitSequenceFlows
|
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/TransformerServlet.java
|
a143f3b92a6a5a527d929d68c02a0c5d914ab81d
| 0
|
Analyze the following code function for security vulnerabilities
|
String getName();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getName
File: ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonRpcMethod.java
Repository: hyperledger/besu
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-21369
|
MEDIUM
| 4
|
hyperledger/besu
|
getName
|
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonRpcMethod.java
|
06e35a58c07a30c0fbdc0aae45a3e8b06b53c022
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setClientKeyId(String clientKeyId) {
attributes.put(CLIENT_KEY_ID, clientKeyId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setClientKeyId
File: base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setClientKeyId
|
base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void zipFolder(String srcFolder, String destZipFile, String ignore) throws Exception {
try (FileOutputStream fileWriter = new FileOutputStream(destZipFile);
ZipOutputStream zip = new ZipOutputStream(fileWriter)){
addFolderToZip("", srcFolder, zip, ignore);
zip.flush();
}
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2022-21675
- Severity: MEDIUM
- CVSS Score: 6.8
Description: Mitigate Zip Slip exlpoit
Function: zipFolder
File: src/main/java/the/bytecode/club/bytecodeviewer/util/ZipUtils.java
Repository: Konloch/bytecode-viewer
Fixed Code:
public static void zipFolder(String srcFolder, String destZipFile, String ignore) throws Exception {
try (FileOutputStream fileWriter = new FileOutputStream(destZipFile);
ZipOutputStream zip = new ZipOutputStream(fileWriter)) {
addFolderToZip("", srcFolder, zip, ignore);
zip.flush();
}
}
|
[
"CWE-22"
] |
CVE-2022-21675
|
MEDIUM
| 6.8
|
Konloch/bytecode-viewer
|
zipFolder
|
src/main/java/the/bytecode/club/bytecodeviewer/util/ZipUtils.java
|
c968e94b2c93da434a4ecfac6d08eda162d615d0
| 1
|
Analyze the following code function for security vulnerabilities
|
@Select("delete from sys_dict where id = #{id}")
public void deleteOneById(@Param("id") String id);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteOneById
File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
Repository: jeecgboot/jeecg-boot
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-45207
|
CRITICAL
| 9.8
|
jeecgboot/jeecg-boot
|
deleteOneById
|
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
|
8632a835c23f558dfee3584d7658cc6a13ccec6f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public WorkflowInstance ingest(MediaPackage mp, String wd, Map<String, String> properties)
throws IngestException, NotFoundException {
try {
return ingest(mp, wd, properties, null);
} catch (UnauthorizedException e) {
throw new IllegalStateException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ingest
File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-29237
|
MEDIUM
| 5.5
|
opencast
|
ingest
|
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
|
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void stopLockTaskModeOnCurrent() throws RemoteException {
enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS,
"stopLockTaskModeOnCurrent");
long ident = Binder.clearCallingIdentity();
try {
stopLockTaskMode();
} finally {
Binder.restoreCallingIdentity(ident);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopLockTaskModeOnCurrent
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
|
stopLockTaskModeOnCurrent
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@Nullable public WifiConfiguration getConnectedWifiConfiguration() {
if (!isConnected()) return null;
return getConnectedWifiConfigurationInternal();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getConnectedWifiConfiguration
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
|
getConnectedWifiConfiguration
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean deliverPreBootCompleted(final Runnable onFinishCallback,
ArrayList<ComponentName> doneReceivers, int userId) {
boolean waitingUpdate = false;
Intent intent = new Intent(Intent.ACTION_PRE_BOOT_COMPLETED);
List<ResolveInfo> ris = null;
try {
ris = AppGlobals.getPackageManager().queryIntentReceivers(
intent, null, 0, userId);
} catch (RemoteException e) {
}
if (ris != null) {
for (int i=ris.size()-1; i>=0; i--) {
if ((ris.get(i).activityInfo.applicationInfo.flags
&ApplicationInfo.FLAG_SYSTEM) == 0) {
ris.remove(i);
}
}
intent.addFlags(Intent.FLAG_RECEIVER_BOOT_UPGRADE);
// For User 0, load the version number. When delivering to a new user, deliver
// to all receivers.
if (userId == UserHandle.USER_OWNER) {
ArrayList<ComponentName> lastDoneReceivers = readLastDonePreBootReceivers();
for (int i=0; i<ris.size(); i++) {
ActivityInfo ai = ris.get(i).activityInfo;
ComponentName comp = new ComponentName(ai.packageName, ai.name);
if (lastDoneReceivers.contains(comp)) {
// We already did the pre boot receiver for this app with the current
// platform version, so don't do it again...
ris.remove(i);
i--;
// ...however, do keep it as one that has been done, so we don't
// forget about it when rewriting the file of last done receivers.
doneReceivers.add(comp);
}
}
}
// If primary user, send broadcast to all available users, else just to userId
final int[] users = userId == UserHandle.USER_OWNER ? getUsersLocked()
: new int[] { userId };
for (int i = 0; i < ris.size(); i++) {
ActivityInfo ai = ris.get(i).activityInfo;
ComponentName comp = new ComponentName(ai.packageName, ai.name);
doneReceivers.add(comp);
intent.setComponent(comp);
for (int j=0; j<users.length; j++) {
IIntentReceiver finisher = null;
// On last receiver and user, set up a completion callback
if (i == ris.size() - 1 && j == users.length - 1 && onFinishCallback != null) {
finisher = new IIntentReceiver.Stub() {
public void performReceive(Intent intent, int resultCode,
String data, Bundle extras, boolean ordered,
boolean sticky, int sendingUser) {
// The raw IIntentReceiver interface is called
// with the AM lock held, so redispatch to
// execute our code without the lock.
mHandler.post(onFinishCallback);
}
};
}
Slog.i(TAG, "Sending system update to " + intent.getComponent()
+ " for user " + users[j]);
broadcastIntentLocked(null, null, intent, null, finisher,
0, null, null, null, AppOpsManager.OP_NONE,
true, false, MY_PID, Process.SYSTEM_UID,
users[j]);
if (finisher != null) {
waitingUpdate = true;
}
}
}
}
return waitingUpdate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deliverPreBootCompleted
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
|
deliverPreBootCompleted
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public AppointmentService getAppointmentService() {
return appointmentService;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAppointmentService
File: api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java
Repository: openmrs/openmrs-module-appointmentscheduling
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-36635
|
MEDIUM
| 5.4
|
openmrs/openmrs-module-appointmentscheduling
|
getAppointmentService
|
api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java
|
34213c3f6ea22df427573076fb62744694f601d8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void abortPulsing() {
mDozeScrimController.abortPulsing();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: abortPulsing
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
|
abortPulsing
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Traverser<File> fileTraverser() {
return Traverser.forTree(FILE_TREE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fileTraverser
File: guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-552"
] |
CVE-2023-2976
|
HIGH
| 7.1
|
google/guava
|
fileTraverser
|
guava/src/com/google/common/io/Files.java
|
feb83a1c8fd2e7670b244d5afd23cba5aca43284
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getTagForIntentSender(IIntentSender pendingResult, String prefix) {
if (!(pendingResult instanceof PendingIntentRecord)) {
return null;
}
try {
PendingIntentRecord res = (PendingIntentRecord)pendingResult;
Intent intent = res.key.requestIntent;
if (intent != null) {
if (res.lastTag != null && res.lastTagPrefix == prefix && (res.lastTagPrefix == null
|| res.lastTagPrefix.equals(prefix))) {
return res.lastTag;
}
res.lastTagPrefix = prefix;
StringBuilder sb = new StringBuilder(128);
if (prefix != null) {
sb.append(prefix);
}
if (intent.getAction() != null) {
sb.append(intent.getAction());
} else if (intent.getComponent() != null) {
intent.getComponent().appendShortString(sb);
} else {
sb.append("?");
}
return res.lastTag = sb.toString();
}
} catch (ClassCastException e) {
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTagForIntentSender
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
|
getTagForIntentSender
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
@Override
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException
{
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
//string values have to be adjusted to the configured TZ.
switch (parser.getCurrentTokenId())
{
case JsonTokenId.ID_NUMBER_FLOAT:
return _fromDecimal(context, parser.getDecimalValue());
case JsonTokenId.ID_NUMBER_INT:
return _fromLong(context, parser.getLongValue());
case JsonTokenId.ID_STRING:
{
String string = parser.getText().trim();
if (string.length() == 0) {
return null;
}
// only check for other parsing modes if we are using default formatter
if (_formatter == DateTimeFormatter.ISO_INSTANT ||
_formatter == DateTimeFormatter.ISO_OFFSET_DATE_TIME ||
_formatter == DateTimeFormatter.ISO_ZONED_DATE_TIME) {
// 22-Jan-2016, [datatype-jsr310#16]: Allow quoted numbers too
int dots = _countPeriods(string);
if (dots >= 0) { // negative if not simple number
try {
if (dots == 0) {
return _fromLong(context, Long.parseLong(string));
}
if (dots == 1) {
return _fromDecimal(context, new BigDecimal(string));
}
} catch (NumberFormatException e) {
// fall through to default handling, to get error there
}
}
string = replaceZeroOffsetAsZIfNecessary(string);
}
T value;
try {
TemporalAccessor acc = _formatter.parse(string);
value = parsedToValue.apply(acc);
if (shouldAdjustToContextTimezone(context)) {
return adjust.apply(value, this.getZone(context));
}
} catch (DateTimeException e) {
value = _handleDateTimeException(context, e, string);
}
return value;
}
case JsonTokenId.ID_EMBEDDED_OBJECT:
// 20-Apr-2016, tatu: Related to [databind#1208], can try supporting embedded
// values quite easily
return (T) parser.getEmbeddedObject();
case JsonTokenId.ID_START_ARRAY:
return _deserializeFromArray(parser, context);
}
return _handleUnexpectedToken(context, parser, JsonToken.VALUE_STRING,
JsonToken.VALUE_NUMBER_INT, JsonToken.VALUE_NUMBER_FLOAT);
}
|
Vulnerability Classification:
- CWE: CWE-20
- CVE: CVE-2018-1000873
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Avoid latency problems converting decimal to time.
Fixes https://github.com/FasterXML/jackson-databind/issues/2141
Function: deserialize
File: datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java
Repository: FasterXML/jackson-modules-java8
Fixed Code:
@SuppressWarnings("unchecked")
@Override
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException
{
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
//string values have to be adjusted to the configured TZ.
switch (parser.getCurrentTokenId())
{
case JsonTokenId.ID_NUMBER_FLOAT:
return _fromDecimal(context, parser.getDecimalValue());
case JsonTokenId.ID_NUMBER_INT:
return _fromLong(context, parser.getLongValue());
case JsonTokenId.ID_STRING:
{
String string = parser.getText().trim();
if (string.length() == 0) {
return null;
}
// only check for other parsing modes if we are using default formatter
if (_formatter == DateTimeFormatter.ISO_INSTANT ||
_formatter == DateTimeFormatter.ISO_OFFSET_DATE_TIME ||
_formatter == DateTimeFormatter.ISO_ZONED_DATE_TIME) {
// 22-Jan-2016, [datatype-jsr310#16]: Allow quoted numbers too
int dots = _countPeriods(string);
if (dots >= 0) { // negative if not simple number
try {
if (dots == 0) {
return _fromLong(context, Long.parseLong(string));
}
if (dots == 1) {
return _fromDecimal(context, new BigDecimal(string));
}
} catch (NumberFormatException e) {
// fall through to default handling, to get error there
}
}
string = replaceZeroOffsetAsZIfNecessary(string);
}
T value;
try {
TemporalAccessor acc = _formatter.parse(string);
value = parsedToValue.apply(acc);
if (shouldAdjustToContextTimezone(context)) {
return adjust.apply(value, this.getZone(context));
}
} catch (DateTimeException e) {
value = _handleDateTimeException(context, e, string);
}
return value;
}
case JsonTokenId.ID_EMBEDDED_OBJECT:
// 20-Apr-2016, tatu: Related to [databind#1208], can try supporting embedded
// values quite easily
return (T) parser.getEmbeddedObject();
case JsonTokenId.ID_START_ARRAY:
return _deserializeFromArray(parser, context);
}
return _handleUnexpectedToken(context, parser, JsonToken.VALUE_STRING,
JsonToken.VALUE_NUMBER_INT, JsonToken.VALUE_NUMBER_FLOAT);
}
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
deserialize
|
datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 1
|
Analyze the following code function for security vulnerabilities
|
static long parseLongAttribute(TypedXmlPullParser parser, String attribute) {
return parseLongAttribute(parser, attribute, 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseLongAttribute
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
|
parseLongAttribute
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setHttpClient(Client httpClient) {
this.httpClient = httpClient;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHttpClient
File: samples/client/petstore/java/jersey2-java8-localdatetime/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
|
setHttpClient
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nonnull
public Long getTranslationCachesExpireAfterWriteInMinutes() {
return myTranslationCachesExpireAfterWriteInMinutes;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTranslationCachesExpireAfterWriteInMinutes
File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
getTranslationCachesExpireAfterWriteInMinutes
|
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void extendLink(EntityReference reference, Set<String> linksExtended)
{
for (EntityReference parent =
reference.getParameters().isEmpty() ? reference : new EntityReference(reference.getName(),
reference.getType(), reference.getParent(), null); parent != null; parent = parent.getParent()) {
linksExtended.add(this.linkSerializer.serialize(parent));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: extendLink
File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-312",
"CWE-200"
] |
CVE-2023-50719
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
extendLink
|
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
|
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
| 0
|
Analyze the following code function for security vulnerabilities
|
OortComet createOortComet(String cometURL) {
return _membership.createOortComet(cometURL);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createOortComet
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
Repository: cometd
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
createOortComet
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
throws IOException {
Path relativeFile = source.relativize(file);
final Path destFile = Paths.get(destDir.toString(), relativeFile.toString());
if(filter.matches(file)) {
String filename = file.getFileName().toString();
if(filename.startsWith(".")) {
//ignore
} else if(filename.endsWith("xml") && !filename.equals("imsmanifest.xml")) {
convertXmlFile(file, destFile);
} else {
Files.copy(file, destFile, StandardCopyOption.REPLACE_EXISTING);
}
}
return FileVisitResult.CONTINUE;
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-39180
- Severity: HIGH
- CVSS Score: 9.0
Description: OO-5549: check parent by unzip
Function: visitFile
File: src/main/java/org/olat/ims/qti21/repository/handlers/CopyAndConvertVisitor.java
Repository: OpenOLAT
Fixed Code:
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
throws IOException {
Path relativeFile = source.relativize(file);
final Path destFile = Paths.get(destDir.toString(), relativeFile.toString());
if(filter.matches(file)) {
String filename = file.getFileName().toString();
if(filename.startsWith(".")) {
//ignore
} else if(filename.endsWith("xml") && !filename.equals("imsmanifest.xml")) {
checkPath(destFile);
convertXmlFile(file, destFile);
} else {
checkPath(destFile);
Files.copy(file, destFile, StandardCopyOption.REPLACE_EXISTING);
}
}
return FileVisitResult.CONTINUE;
}
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
visitFile
|
src/main/java/org/olat/ims/qti21/repository/handlers/CopyAndConvertVisitor.java
|
5668a41ab3f1753102a89757be013487544279d5
| 1
|
Analyze the following code function for security vulnerabilities
|
Library findLibrary(String lib_name) throws XmlReaderException {
if (lib_name == null || lib_name.equals("")) {
return file;
}
Library ret = libs.get(lib_name);
if (ret == null) {
throw new XmlReaderException(StringUtil.format(
Strings.get("libMissingError"), lib_name));
} else {
return ret;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findLibrary
File: src/com/cburch/logisim/file/XmlReader.java
Repository: logisim-evolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000889
|
MEDIUM
| 6.8
|
logisim-evolution
|
findLibrary
|
src/com/cburch/logisim/file/XmlReader.java
|
90aee8f8ceef463884cc400af4f6d1f109fb0972
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void destroy() {
LOGGER.debug("(XssFilter) destroy");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroy
File: sm-shop/src/main/java/com/salesmanager/shop/filter/XssFilter.java
Repository: shopizer-ecommerce/shopizer
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2021-33561
|
LOW
| 3.5
|
shopizer-ecommerce/shopizer
|
destroy
|
sm-shop/src/main/java/com/salesmanager/shop/filter/XssFilter.java
|
197f8c78c8f673b957e41ca2c823afc654c19271
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getRequestPath(HttpServletRequest request) {
String path = request.getRequestURI();
if (path.startsWith(request.getContextPath())) {
path = path.substring(request.getContextPath().length());
}
return path;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestPath
File: core-rs/src/main/java/org/silverpeas/core/web/token/SynchronizerTokenService.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
getRequestPath
|
core-rs/src/main/java/org/silverpeas/core/web/token/SynchronizerTokenService.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
public HashMap<String, String> toParams() {
HashMap<String, String> ret = new HashMap<>();
ret.put("isRenewal", Boolean.valueOf(renewal).toString());
if (profileId != null) ret.put(PROFILE_ID, profileId);
if (serialNum != null) ret.put(SERIAL_NUM, serialNum.toHexString());
if (remoteHost != null) ret.put("remoteHost", remoteHost);
if (remoteAddr != null) ret.put("remoteAddr", remoteAddr);
if (serverSideKeygenP12Passwd != null) ret.put(SERVERSIDE_KEYGEN_P12_PASSWD, serverSideKeygenP12Passwd);
for (ProfileInput input: inputs) {
for (ProfileAttribute attr : input.getAttributes()) {
ret.put(attr.getName(), attr.getValue());
}
}
return ret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toParams
File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
toParams
|
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean sendGlobalRedirect(XWikiResponse response, String url, XWikiContext context) throws Exception
{
if ("1".equals(context.getWiki().Param("xwiki.preferences.redirect"))) {
// Note: This implementation is not performant at all and will slow down the wiki as the number
// of redirects increases. A better implementation would use a cache of redirects and would use
// the notification mechanism to update the cache when the XWiki.XWikiPreferences document is
// modified.
XWikiDocument globalPreferences = context.getWiki().getDocument("xwiki:XWiki.XWikiPreferences", context);
Vector<BaseObject> redirects = globalPreferences.getObjects("XWiki.GlobalRedirect");
if (redirects != null) {
for (BaseObject redir : redirects) {
if (redir != null) {
String p = redir.getStringValue("pattern");
if (p != null && url.matches(p)) {
String dest = redir.getStringValue("destination");
response.sendRedirect(url.replaceAll(p, dest));
return true;
}
}
}
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendGlobalRedirect
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2022-23617
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
sendGlobalRedirect
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
|
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0);
reply.readException();
boolean res = reply.readInt() != 0;
data.recycle();
reply.recycle();
return res;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAssistDataAllowedOnCurrentActivity
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
isAssistDataAllowedOnCurrentActivity
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTextPage(final String userID) throws IOException {
return getContactServiceProvider(userID, ContactType.textPage.toString());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTextPage
File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2021-25931
|
MEDIUM
| 6.8
|
OpenNMS/opennms
|
getTextPage
|
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
|
607151ea8f90212a3fb37c977fa57c7d58d26a84
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleOnDetach() {
assert isAttached();
// Ensure detach change is sent
markAsDirty();
owner.unregister(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleOnDetach
File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
handleOnDetach
|
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean attachedToProcess() {
return hasProcess() && app.hasThread();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attachedToProcess
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
|
attachedToProcess
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isDreaming() {
return mDreaming;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDreaming
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
isDreaming
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void copyFromCursorToContentValues(@NonNull String column, @NonNull Cursor cursor,
@NonNull ContentValues values) {
final int index = cursor.getColumnIndex(column);
if (index != -1) {
if (cursor.isNull(index)) {
values.putNull(column);
} else {
values.put(column, cursor.getString(index));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyFromCursorToContentValues
File: src/com/android/providers/media/util/DatabaseUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-35683
|
MEDIUM
| 5.5
|
android
|
copyFromCursorToContentValues
|
src/com/android/providers/media/util/DatabaseUtils.java
|
23d156ed1bed6d2c2b325f0be540d0afca510c49
| 0
|
Analyze the following code function for security vulnerabilities
|
private ModelAndView saveGroup(HttpServletRequest request, HttpServletResponse response) throws Exception {
HttpSession session = request.getSession(false);
if (session != null) {
WebGroup newGroup = (WebGroup) session.getAttribute("group.modifyGroup.jsp");
updateGroup(request, newGroup);
m_groupRepository.saveGroup(newGroup);
}
return cancel(request, response);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveGroup
File: opennms-webapp/src/main/java/org/opennms/web/controller/admin/group/GroupController.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-352",
"CWE-79"
] |
CVE-2021-25929
|
LOW
| 3.5
|
OpenNMS/opennms
|
saveGroup
|
opennms-webapp/src/main/java/org/opennms/web/controller/admin/group/GroupController.java
|
eb08b5ed4c5548f3e941a1f0d0363ae4439fa98c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onReceive(Context context, Intent intent){
String action = intent.getAction();
if (DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED
.equals(action)) {
enforceBeamShareActivityPolicy(context,
new UserHandle(getSendingUserId()), mIsNdefPushEnabled);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onReceive
File: src/com/android/nfc/NfcService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3761
|
LOW
| 2.1
|
android
|
onReceive
|
src/com/android/nfc/NfcService.java
|
9ea802b5456a36f1115549b645b65c791eff3c2c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void saveBatchEmpty(TestContext context) {
Async async = context.async();
List<Object> list = Collections.emptyList();
createFoo(context).saveBatch(FOO, list, res -> {
assertSuccess(context, res);
context.assertEquals(0, res.result().getRows().size());
context.assertEquals("id", res.result().getColumnNames().get(0));
async.complete();
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveBatchEmpty
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
saveBatchEmpty
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) {
enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS,
"moveTopActivityToPinnedStack()");
synchronized (this) {
if (!mSupportsPictureInPicture) {
throw new IllegalStateException("moveTopActivityToPinnedStack:"
+ "Device doesn't support picture-in-picture mode");
}
long ident = Binder.clearCallingIdentity();
try {
return mStackSupervisor.moveTopStackActivityToPinnedStackLocked(stackId, bounds);
} finally {
Binder.restoreCallingIdentity(ident);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: moveTopActivityToPinnedStack
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
|
moveTopActivityToPinnedStack
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) {
if (mKeyguardDelegate != null) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "PWM.startKeyguardExitAnimation");
mKeyguardDelegate.startKeyguardExitAnimation(startTime, fadeoutDuration);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startKeyguardExitAnimation
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
startKeyguardExitAnimation
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int stopUser(final int userId, final IStopUserCallback callback) {
if (checkCallingPermission(INTERACT_ACROSS_USERS_FULL)
!= PackageManager.PERMISSION_GRANTED) {
String msg = "Permission Denial: switchUser() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ " requires " + INTERACT_ACROSS_USERS_FULL;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
if (userId <= 0) {
throw new IllegalArgumentException("Can't stop primary user " + userId);
}
enforceShellRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES, userId);
synchronized (this) {
return stopUserLocked(userId, callback);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopUser
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
|
stopUser
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean getSettingOverrideableByRestore(Bundle args) {
return (args != null) && args.getBoolean(Settings.CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSettingOverrideableByRestore
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
|
getSettingOverrideableByRestore
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updatePersonalAppsSuspensionOnUserStart(int userHandle) {
final int profileUserHandle = getManagedUserId(userHandle);
if (profileUserHandle >= 0) {
// Given that the parent user has just started, profile should be locked.
updatePersonalAppsSuspension(profileUserHandle, false /* unlocked */);
} else {
suspendPersonalAppsInternal(userHandle, false);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updatePersonalAppsSuspensionOnUserStart
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
|
updatePersonalAppsSuspensionOnUserStart
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@PUT
@Path("posts/{messageKey}")
@Operation(summary = "Put posts",
description = "Creates a new reply in the forum of the course node.")
@ApiResponse(responseCode = "200", description = "Ok.",
content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = MessageVO.class)),
@Content(mediaType = "application/xml", schema = @Schema(implementation = MessageVO.class))
})
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient.")
@ApiResponse(responseCode = "404", description = "The author or message not found.")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response replyToPost(@PathParam("messageKey") Long messageKey, @QueryParam("title") @Parameter(description = "The title for the first post in the thread") String title,
@QueryParam("body") @Parameter(description = "The body for the first post in the thread") String body, @QueryParam("authorKey") @Parameter(description = "The author user key (optional)") Long authorKey,
@Context HttpServletRequest httpRequest, @Context UriInfo uriInfo) {
ServletUtil.printOutRequestHeaders(httpRequest);
return replyToPost(messageKey, new ReplyVO(title, body), authorKey, httpRequest, uriInfo);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: replyToPost
File: src/main/java/org/olat/modules/fo/restapi/ForumWebService.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
replyToPost
|
src/main/java/org/olat/modules/fo/restapi/ForumWebService.java
|
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
void suppressFitsSystemWindows() {
binding.controllerCallLayout.setFitsSystemWindows(false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: suppressFitsSystemWindows
File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
Repository: nextcloud/talk-android
The code follows secure coding practices.
|
[
"CWE-732",
"CWE-200"
] |
CVE-2022-41926
|
MEDIUM
| 5.5
|
nextcloud/talk-android
|
suppressFitsSystemWindows
|
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
|
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
| 0
|
Analyze the following code function for security vulnerabilities
|
@CalledByNative
private void onSmartClipDataExtracted(String text, String html, Rect clipRect) {
// Translate the positions by the offsets introduced by location bar. Note that the
// coordinates are in dp scale, and that this definitely has the potential to be
// different from the offsets when extractSmartClipData() was called. However,
// as long as OEM has a UI that consumes all the inputs and waits until the
// callback is called, then there shouldn't be any difference.
// TODO(changwan): once crbug.com/416432 is resolved, try to pass offsets as
// separate params for extractSmartClipData(), and apply them not the new offset
// values in the callback.
final float deviceScale = mRenderCoordinates.getDeviceScaleFactor();
final int offsetXInDp = (int) (mSmartClipOffsetX / deviceScale);
final int offsetYInDp = (int) (mSmartClipOffsetY / deviceScale);
clipRect.offset(-offsetXInDp, -offsetYInDp);
if (mSmartClipDataListener != null) {
mSmartClipDataListener.onSmartClipDataExtracted(text, html, clipRect);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSmartClipDataExtracted
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
onSmartClipDataExtracted
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String userID = request.getParameter("userID");
String newID = request.getParameter("newID");
// now save to the xml file
try {
UserManager userFactory = UserFactory.getInstance();
userFactory.renameUser(userID, newID);
} catch (Throwable e) {
throw new ServletException("Error renaming user " + userID + " to " + newID, e);
}
response.sendRedirect("list.jsp");
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2021-25933
- Severity: LOW
- CVSS Score: 3.5
Description: NMS-13125: user ID and group ID must not contain any HTML markup
Function: doPost
File: opennms-webapp/src/main/java/org/opennms/web/admin/users/RenameUserServlet.java
Repository: OpenNMS/opennms
Fixed Code:
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String userID = request.getParameter("userID");
String newID = request.getParameter("newID");
if (newID != null && newID.matches(".*[&<>\"`']+.*")) {
throw new ServletException("User ID must not contain any HTML markup.");
}
// now save to the xml file
try {
UserManager userFactory = UserFactory.getInstance();
userFactory.renameUser(userID, newID);
} catch (Throwable e) {
throw new ServletException("Error renaming user " + userID + " to " + newID, e);
}
response.sendRedirect("list.jsp");
}
|
[
"CWE-79"
] |
CVE-2021-25933
|
LOW
| 3.5
|
OpenNMS/opennms
|
doPost
|
opennms-webapp/src/main/java/org/opennms/web/admin/users/RenameUserServlet.java
|
8a97e6869d6e49da18b208c837438ace80049c01
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
try {
// 执行全局过滤器
beforeAuth.run(null);
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
auth.run(null);
});
} catch (StopMatchException e) {
// StopMatchException 异常代表:停止匹配,进入Controller
} catch (Throwable e) {
// 1. 获取异常处理策略结果
String result = (e instanceof BackResultException) ? e.getMessage() : String.valueOf(error.run(e));
// 2. 写入输出流
// 请注意此处默认 Content-Type 为 text/plain,如果需要返回 JSON 信息,需要在 return 前自行设置 Content-Type 为 application/json
// 例如:SaHolder.getResponse().setHeader("Content-Type", "application/json;charset=UTF-8");
if(response.getContentType() == null) {
response.setContentType("text/plain; charset=utf-8");
}
response.getWriter().print(result);
return;
}
// 执行
chain.doFilter(request, response);
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-44794
- Severity: CRITICAL
- CVSS Score: 9.8
Description: 修复路由拦截鉴权可被绕过的问题 fix #515
Function: doFilter
File: sa-token-starter/sa-token-spring-boot-starter/src/main/java/cn/dev33/satoken/filter/SaServletFilter.java
Repository: dromara/Sa-Token
Fixed Code:
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
try {
// 执行全局过滤器
beforeAuth.run(null);
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
auth.run(null);
});
} catch (StopMatchException e) {
// StopMatchException 异常代表:停止匹配,进入Controller
} catch (Throwable e) {
// 1. 获取异常处理策略结果
String result = (e instanceof BackResultException) ? e.getMessage() : String.valueOf(error.run(e));
// 2. 写入输出流
// 请注意此处默认 Content-Type 为 text/plain,如果需要返回 JSON 信息,需要在 return 前自行设置 Content-Type 为 application/json
// 例如:SaHolder.getResponse().setHeader("Content-Type", "application/json;charset=UTF-8");
if(response.getContentType() == null) {
response.setContentType(SaTokenConsts.CONTENT_TYPE_TEXT_PLAIN);
}
response.getWriter().print(result);
return;
}
// 执行
chain.doFilter(request, response);
}
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
doFilter
|
sa-token-starter/sa-token-spring-boot-starter/src/main/java/cn/dev33/satoken/filter/SaServletFilter.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 1
|
Analyze the following code function for security vulnerabilities
|
private void sendMessage(String iface, int what, int arg1, int arg2, Object obj) {
sendMessage(iface, Message.obtain(null, what, arg1, arg2, obj));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendMessage
File: service/java/com/android/server/wifi/WifiMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
sendMessage
|
service/java/com/android/server/wifi/WifiMonitor.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setup(byte[] ad) throws InvalidKeyException, InvalidAlgorithmParameterException
{
// Check for nonce wrap-around.
if (n == -1L)
throw new IllegalStateException("Nonce has wrapped around");
// Format the counter/IV block for AES/CTR/NoPadding.
iv[0] = 0;
iv[1] = 0;
iv[2] = 0;
iv[3] = 0;
iv[4] = (byte)(n >> 56);
iv[5] = (byte)(n >> 48);
iv[6] = (byte)(n >> 40);
iv[7] = (byte)(n >> 32);
iv[8] = (byte)(n >> 24);
iv[9] = (byte)(n >> 16);
iv[10] = (byte)(n >> 8);
iv[11] = (byte)n;
iv[12] = 0;
iv[13] = 0;
iv[14] = 0;
iv[15] = 1;
++n;
// Initialize the CTR mode cipher with the key and IV.
cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv));
// Encrypt a block of zeroes to generate the hash key to XOR
// the GHASH tag with at the end of the encrypt/decrypt operation.
Arrays.fill(hashKey, (byte)0);
try {
cipher.update(hashKey, 0, 16, hashKey, 0);
} catch (ShortBufferException e) {
// Shouldn't happen.
throw new IllegalStateException(e);
}
// Initialize the GHASH with the associated data value.
ghash.reset();
if (ad != null) {
ghash.update(ad, 0, ad.length);
ghash.pad();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setup
File: src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java
Repository: rweather/noise-java
The code follows secure coding practices.
|
[
"CWE-125",
"CWE-787"
] |
CVE-2020-25021
|
HIGH
| 7.5
|
rweather/noise-java
|
setup
|
src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java
|
18e86b6f8bea7326934109aa9ffa705ebf4bde90
| 0
|
Analyze the following code function for security vulnerabilities
|
public void aliasSystemAttribute(String alias, String systemAttributeName) {
if (systemAttributeAliasingMapper == null) {
throw new com.thoughtworks.xstream.InitializationException("No "
+ SystemAttributeAliasingMapper.class.getName()
+ " available");
}
systemAttributeAliasingMapper.addAliasFor(systemAttributeName, alias);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: aliasSystemAttribute
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
aliasSystemAttribute
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ParceledListSlice getShareTargets(String packageName,
IntentFilter filter, @UserIdInt int userId) {
Preconditions.checkStringNotEmpty(packageName, "packageName");
Objects.requireNonNull(filter, "intentFilter");
if (!isCallerChooserActivity()) {
verifyCaller(packageName, userId);
}
enforceCallingOrSelfPermission(android.Manifest.permission.MANAGE_APP_PREDICTIONS,
"getShareTargets");
final ComponentName chooser = injectChooserActivity();
final String pkg = chooser != null ? chooser.getPackageName() : mContext.getPackageName();
synchronized (mLock) {
throwIfUserLockedL(userId);
final List<ShortcutManager.ShareShortcutInfo> shortcutInfoList = new ArrayList<>();
final ShortcutUser user = getUserShortcutsLocked(userId);
user.forAllPackages(p -> shortcutInfoList.addAll(
p.getMatchingShareTargets(filter, pkg)));
return new ParceledListSlice<>(shortcutInfoList);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getShareTargets
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
|
getShareTargets
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String determineLoginType(boolean isSecure) {
String result = JBossSAMLURIConstants.AC_PASSWORD.get();
LoginConfig loginConfig = getContext().getLoginConfig();
if (loginConfig != null) {
String auth = loginConfig.getAuthMethod();
if (StringUtil.isNotNull(auth)) {
if ("CLIENT-CERT".equals(auth)) {
result = JBossSAMLURIConstants.AC_TLS_CLIENT.get();
} else if (isSecure) {
result = JBossSAMLURIConstants.AC_PASSWORD_PROTECTED_TRANSPORT.get();
}
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: determineLoginType
File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
Repository: picketlink/picketlink-bindings
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3158
|
MEDIUM
| 4
|
picketlink/picketlink-bindings
|
determineLoginType
|
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
|
341a37aefd69e67b6b5f6d775499730d6ccaff0d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String migrate(String xml) {
Document xmlDoc;
try {
xmlDoc = new SAXReader().read(new StringReader(xml));
} catch (DocumentException e) {
throw new RuntimeException(e);
}
List<NodeTuple> tuples = new ArrayList<>();
Node keyNode = new ScalarNode(Tag.STR, "version");
Node valueNode = new ScalarNode(Tag.INT, "0");
tuples.add(new NodeTuple(keyNode, valueNode));
List<Node> jobNodes = new ArrayList<>();
for (Element jobElement: xmlDoc.getRootElement().element("jobs").elements())
jobNodes.add(migrateJob(jobElement));
if (!jobNodes.isEmpty()) {
keyNode = new ScalarNode(Tag.STR, "jobs");
tuples.add(new NodeTuple(keyNode, new SequenceNode(Tag.SEQ, jobNodes, FlowStyle.BLOCK)));
}
List<Node> propertyNodes = new ArrayList<>();
Element propertiesElement = xmlDoc.getRootElement().element("properties");
if (propertiesElement != null) {
for (Element propertyElement: propertiesElement.elements()) {
Node nameNode = new ScalarNode(Tag.STR, propertyElement.elementText("name").trim());
valueNode = new ScalarNode(Tag.STR, propertyElement.elementText("value").trim());
List<NodeTuple> propertyTuples = Lists.newArrayList(
new NodeTuple(new ScalarNode(Tag.STR, "name"), nameNode),
new NodeTuple(new ScalarNode(Tag.STR, "value"), valueNode));
propertyNodes.add(new MappingNode(Tag.MAP, propertyTuples, FlowStyle.BLOCK));
}
}
if(!propertyNodes.isEmpty()) {
keyNode = new ScalarNode(Tag.STR, "properties");
tuples.add(new NodeTuple(keyNode, new SequenceNode(Tag.SEQ, propertyNodes, FlowStyle.BLOCK)));
}
MappingNode rootNode = new MappingNode(Tag.MAP, tuples, FlowStyle.BLOCK);
StringWriter writer = new StringWriter();
DumperOptions dumperOptions = new DumperOptions();
Serializer serializer = new Serializer(new Emitter(writer, dumperOptions),
new Resolver(), dumperOptions, Tag.MAP);
try {
serializer.open();
serializer.serialize(rootNode);
serializer.close();
return writer.toString();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
|
Vulnerability Classification:
- CWE: CWE-538
- CVE: CVE-2021-21250
- Severity: MEDIUM
- CVSS Score: 4.0
Description: Fix XXE injection attack by disabling XML DTD handling
Function: migrate
File: server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java
Repository: theonedev/onedev
Fixed Code:
public static String migrate(String xml) {
Document xmlDoc;
try {
SAXReader reader = new SAXReader();
// Prevent XXE attack as the xml might be provided by malicious users
reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
xmlDoc = reader.read(new StringReader(xml));
} catch (DocumentException | SAXException e) {
throw new RuntimeException(e);
}
List<NodeTuple> tuples = new ArrayList<>();
Node keyNode = new ScalarNode(Tag.STR, "version");
Node valueNode = new ScalarNode(Tag.INT, "0");
tuples.add(new NodeTuple(keyNode, valueNode));
List<Node> jobNodes = new ArrayList<>();
for (Element jobElement: xmlDoc.getRootElement().element("jobs").elements())
jobNodes.add(migrateJob(jobElement));
if (!jobNodes.isEmpty()) {
keyNode = new ScalarNode(Tag.STR, "jobs");
tuples.add(new NodeTuple(keyNode, new SequenceNode(Tag.SEQ, jobNodes, FlowStyle.BLOCK)));
}
List<Node> propertyNodes = new ArrayList<>();
Element propertiesElement = xmlDoc.getRootElement().element("properties");
if (propertiesElement != null) {
for (Element propertyElement: propertiesElement.elements()) {
Node nameNode = new ScalarNode(Tag.STR, propertyElement.elementText("name").trim());
valueNode = new ScalarNode(Tag.STR, propertyElement.elementText("value").trim());
List<NodeTuple> propertyTuples = Lists.newArrayList(
new NodeTuple(new ScalarNode(Tag.STR, "name"), nameNode),
new NodeTuple(new ScalarNode(Tag.STR, "value"), valueNode));
propertyNodes.add(new MappingNode(Tag.MAP, propertyTuples, FlowStyle.BLOCK));
}
}
if(!propertyNodes.isEmpty()) {
keyNode = new ScalarNode(Tag.STR, "properties");
tuples.add(new NodeTuple(keyNode, new SequenceNode(Tag.SEQ, propertyNodes, FlowStyle.BLOCK)));
}
MappingNode rootNode = new MappingNode(Tag.MAP, tuples, FlowStyle.BLOCK);
StringWriter writer = new StringWriter();
DumperOptions dumperOptions = new DumperOptions();
Serializer serializer = new Serializer(new Emitter(writer, dumperOptions),
new Resolver(), dumperOptions, Tag.MAP);
try {
serializer.open();
serializer.serialize(rootNode);
serializer.close();
return writer.toString();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
|
[
"CWE-538"
] |
CVE-2021-21250
|
MEDIUM
| 4
|
theonedev/onedev
|
migrate
|
server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java
|
9196fd795e87dab069b4260a3590a0ea886e770f
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public final void activityIdle(IBinder token, Configuration config, boolean stopProfiling) {
final long origId = Binder.clearCallingIdentity();
synchronized (this) {
ActivityStack stack = ActivityRecord.getStackLocked(token);
if (stack != null) {
ActivityRecord r =
mStackSupervisor.activityIdleInternalLocked(token, false, config);
if (stopProfiling) {
if ((mProfileProc == r.app) && (mProfileFd != null)) {
try {
mProfileFd.close();
} catch (IOException e) {
}
clearProfilerLocked();
}
}
}
}
Binder.restoreCallingIdentity(origId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: activityIdle
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
|
activityIdle
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
void onUiSelection(UserSelectionDialogResult selection);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUiSelection
File: services/credentials/java/com/android/server/credentials/CredentialManagerUi.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40076
|
MEDIUM
| 5.5
|
android
|
onUiSelection
|
services/credentials/java/com/android/server/credentials/CredentialManagerUi.java
|
9b68987df85b681f9362a3cadca6496796d23bbc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void updateApplicationByResourceId(String resourceId, ServiceProvider updatedApp, String tenantDomain,
String username) throws IdentityApplicationManagementException {
validateApplicationConfigurations(updatedApp, tenantDomain, username);
updatedApp.setApplicationResourceId(resourceId);
setDisplayNamesOfLocalAuthenticators(updatedApp, tenantDomain);
Collection<ApplicationResourceManagementListener> listeners =
ApplicationMgtListenerServiceComponent.getApplicationResourceMgtListeners();
for (ApplicationResourceManagementListener listener : listeners) {
if (listener.isEnabled() &&
!listener.doPreUpdateApplicationByResourceId(updatedApp, resourceId, tenantDomain, username)) {
throw buildServerException("Pre Update application operation of listener: " + getName(listener) +
" failed for application with resourceId: " + resourceId);
}
}
try {
startTenantFlow(tenantDomain);
ApplicationBasicInfo storedAppInfo = getApplicationBasicInfo(resourceId, tenantDomain);
if (storedAppInfo == null) {
String msg = "Cannot find an application for " + "resourceId: " + resourceId + " in tenantDomain: "
+ tenantDomain;
throw buildClientException(APPLICATION_NOT_FOUND, msg);
}
String updatedAppName = updatedApp.getApplicationName();
String storedAppName = storedAppInfo.getApplicationName();
doPreUpdateChecks(storedAppName, updatedApp, tenantDomain, username);
ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
appDAO.updateApplicationByResourceId(resourceId, tenantDomain, updatedApp);
if (isOwnerUpdateRequest(storedAppInfo.getAppOwner(), updatedApp.getOwner())) {
// User existence check is already done in appDAO.updateApplicationByResourceId() method.
assignApplicationRole(updatedApp.getApplicationName(), updatedApp.getOwner().getUserName());
}
updateApplicationPermissions(updatedApp, updatedAppName, storedAppName);
} catch (RegistryException e) {
String message = "Error while updating application with resourceId: " + resourceId + " in tenantDomain: "
+ tenantDomain;
throw buildServerException(message, e);
} finally {
endTenantFlow();
}
for (ApplicationResourceManagementListener listener : listeners) {
if (listener.isEnabled()
&& !listener.doPostUpdateApplicationByResourceId(updatedApp, resourceId, tenantDomain, username)) {
log.error("Post Update application operation of listener: " + getName(listener) + " failed for " +
"application with resourceId: " + resourceId);
return;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateApplicationByResourceId
File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
Repository: wso2/carbon-identity-framework
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-42646
|
MEDIUM
| 6.4
|
wso2/carbon-identity-framework
|
updateApplicationByResourceId
|
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
|
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract Set<String> getAlwaysUsedExtensions(XWikiContext context);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAlwaysUsedExtensions
File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29206
|
MEDIUM
| 5.4
|
xwiki/xwiki-platform
|
getAlwaysUsedExtensions
|
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
|
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setRenderThread(int tid) {
synchronized (mProcLock) {
ProcessRecord proc;
int pid = Binder.getCallingPid();
if (pid == Process.myPid()) {
demoteSystemServerRenderThread(tid);
return;
}
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(pid);
}
if (proc != null && proc.getRenderThreadTid() == 0 && tid > 0) {
// ensure the tid belongs to the process
if (!isThreadInProcess(pid, tid)) {
throw new IllegalArgumentException(
"Render thread does not belong to process");
}
proc.setRenderThreadTid(tid);
if (DEBUG_OOM_ADJ) {
Slog.d("UI_FIFO", "Set RenderThread tid " + tid + " for pid " + pid);
}
// promote to FIFO now
if (proc.mState.getCurrentSchedulingGroup() == ProcessList.SCHED_GROUP_TOP_APP) {
if (DEBUG_OOM_ADJ) Slog.d("UI_FIFO", "Promoting " + tid + "out of band");
if (mUseFifoUiScheduling) {
setThreadScheduler(proc.getRenderThreadTid(),
SCHED_FIFO | SCHED_RESET_ON_FORK, 1);
} else {
setThreadPriority(proc.getRenderThreadTid(), THREAD_PRIORITY_TOP_APP_BOOST);
}
}
} else {
if (DEBUG_OOM_ADJ) {
Slog.d("UI_FIFO", "Didn't set thread from setRenderThread? "
+ "PID: " + pid + ", TID: " + tid + " FIFO: " + mUseFifoUiScheduling);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRenderThread
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
|
setRenderThread
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy(anyOf = {"this", "mProcLock"})
private boolean uidOnBackgroundAllowlistLOSP(final int uid) {
final int appId = UserHandle.getAppId(uid);
final int[] allowlist = mBackgroundAppIdAllowlist;
for (int i = 0, len = allowlist.length; i < len; i++) {
if (appId == allowlist[i]) {
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uidOnBackgroundAllowlistLOSP
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
|
uidOnBackgroundAllowlistLOSP
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
static String renderNavItem(JSONObject item, String activeNav) {
final String navType = item.getString("type");
final boolean isUrlType = "URL".equals(navType);
String navName = item.getString("value");
String navUrl = item.getString("value");
String navEntity = null;
boolean isOutUrl = isUrlType && navUrl.startsWith("http");
if (isUrlType) {
navName = "nav_url-" + navName.hashCode();
if (isOutUrl) {
navUrl = AppUtils.getContextPath("/commons/url-safe?url=" + CodecUtils.urlEncode(navUrl));
} else {
navUrl = AppUtils.getContextPath(navUrl);
}
} else if (NAV_FEEDS.equals(navName)) {
navName = "nav_entity-FEEDS";
navUrl = AppUtils.getContextPath("/feeds/home");
} else if (NAV_FILEMRG.equals(navName)) {
navName = "nav_entity-ATTACHMENT";
navUrl = AppUtils.getContextPath("/files/home");
} else if (NAV_PROJECT.equals(navName)) {
navName = "nav_entity-PROJECT";
navUrl = AppUtils.getContextPath("/project/search");
} else if (NAV_PROJECT.equals(navType)) {
navName = "nav_project-" + navName;
navUrl = String.format("%s/project/%s/tasks", AppUtils.getContextPath(), navUrl);
} else if (navName.startsWith(NAV_PROJECT)) {
navName = "nav_project--add";
navUrl = AppUtils.getContextPath("/admin/projects");
} else {
navEntity = navName;
navName = "nav_entity-" + navName;
navUrl = AppUtils.getContextPath("/app/" + navUrl + "/list");
}
String iconClazz = StringUtils.defaultIfBlank(item.getString("icon"), "texture");
if (iconClazz.startsWith("mdi-")) iconClazz = "mdi " + iconClazz;
else iconClazz = "zmdi zmdi-" + iconClazz;
String navText = item.getString("text");
navText = CommonsUtils.escapeHtml(navText);
JSONArray subNavs = null;
if (activeNav != null) {
subNavs = item.getJSONArray("sub");
if (subNavs == null || subNavs.isEmpty()) {
subNavs = null;
}
}
String navItemHtml;
if (NAV_DIVIDER.equals(navType)) {
navItemHtml = "<li class=\"divider\">" + navText;
} else {
String parentClass = " parent";
if (item.getBooleanValue("open")) parentClass += " open";
navItemHtml = String.format(
"<li class=\"%s\" data-entity=\"%s\"><a href=\"%s\" target=\"%s\"><i class=\"icon %s\"></i><span>%s</span></a>",
navName + (subNavs == null ? StringUtils.EMPTY : parentClass),
navEntity == null ? StringUtils.EMPTY : navEntity,
subNavs == null ? navUrl : "###",
isOutUrl ? "_blank" : "_self",
iconClazz,
navText);
}
StringBuilder navHtml = new StringBuilder(navItemHtml);
if (subNavs != null) {
StringBuilder subHtml = new StringBuilder()
.append("<ul class=\"sub-menu\"><li class=\"title\">")
.append(navText)
.append("</li><li class=\"nav-items\"><div class=\"content\"><ul class=\"sub-menu-ul\">");
for (Object o : subNavs) {
JSONObject subNav = (JSONObject) o;
subHtml.append(renderNavItem(subNav, null));
}
subHtml.append("</ul></div></li></ul>");
navHtml.append(subHtml);
}
navHtml.append("</li>");
if (activeNav != null) {
Document navBody = Jsoup.parseBodyFragment(navHtml.toString());
for (Element nav : navBody.select("." + activeNav)) {
nav.addClass("active");
if (activeNav.startsWith("nav_entity-") || activeNav.startsWith("nav_project-")) {
Element navParent = nav.parent();
if (navParent != null && navParent.hasClass("sub-menu-ul")) {
//noinspection ConstantConditions
navParent.parent().parent().parent().parent().addClass("open active");
}
}
}
//noinspection ConstantConditions
return navBody.selectFirst("li").outerHtml();
}
return navHtml.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renderNavItem
File: src/main/java/com/rebuild/core/configuration/NavBuilder.java
Repository: getrebuild/rebuild
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-1495
|
MEDIUM
| 6.5
|
getrebuild/rebuild
|
renderNavItem
|
src/main/java/com/rebuild/core/configuration/NavBuilder.java
|
c9474f84e5f376dd2ade2078e3039961a9425da7
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized void deregisterHandler(String iface, int what, Handler handler) {
SparseArray<Set<Handler>> ifaceHandlers = mHandlerMap.get(iface);
if (ifaceHandlers == null) {
return;
}
Set<Handler> ifaceWhatHandlers = ifaceHandlers.get(what);
if (ifaceWhatHandlers == null) {
return;
}
ifaceWhatHandlers.remove(handler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deregisterHandler
File: service/java/com/android/server/wifi/WifiMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
deregisterHandler
|
service/java/com/android/server/wifi/WifiMonitor.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setShowBackURL(boolean showBackURL) {
_showBackURL = showBackURL;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setShowBackURL
File: util-taglib/src/com/liferay/taglib/ui/HeaderTag.java
Repository: brianchandotcom/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-12647
|
MEDIUM
| 4.3
|
brianchandotcom/liferay-portal
|
setShowBackURL
|
util-taglib/src/com/liferay/taglib/ui/HeaderTag.java
|
bd92daa70ab77a40eff0eb18e8e91f3e095694e1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int startVoiceActivity(String callingPackage, String callingFeatureId, int callingPid,
int callingUid, Intent intent, String resolvedType, IVoiceInteractionSession session,
IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
Bundle bOptions, int userId) {
assertPackageMatchesCallingUid(callingPackage);
mAmInternal.enforceCallingPermission(BIND_VOICE_INTERACTION, "startVoiceActivity()");
if (session == null || interactor == null) {
throw new NullPointerException("null session or interactor");
}
userId = handleIncomingUser(callingPid, callingUid, userId, "startVoiceActivity");
// TODO: Switch to user app stacks here.
return getActivityStartController().obtainStarter(intent, "startVoiceActivity")
.setCallingUid(callingUid)
.setCallingPackage(callingPackage)
.setCallingFeatureId(callingFeatureId)
.setResolvedType(resolvedType)
.setVoiceSession(session)
.setVoiceInteractor(interactor)
.setStartFlags(startFlags)
.setProfilerInfo(profilerInfo)
.setActivityOptions(bOptions)
.setUserId(userId)
.setAllowBackgroundActivityStart(true)
.execute();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startVoiceActivity
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
startVoiceActivity
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.