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
|
protected String generateLessCss() {
String css = "";
String lessVariables = "";
String primary = "";
String dark = "darken(@primary , 10%)";
String light = "lighten(@primary , 5%)";
String accent = getDefaultColor("accent");
String lightAccent = "lighten(@accent , 10%)";
String button = getDefaultColor("button");
String buttonText = getDefaultColor("buttonText");
String font = getDefaultColor("font");
if ("custom".equals(getPropertyString("primaryColor"))) {
primary = getPropertyString("customPrimary");
if (!getPropertyString("customPrimaryDark").isEmpty()) {
dark = getPropertyString("customPrimaryDark");
}
if (!getPropertyString("customPrimaryLight").isEmpty()) {
light = getPropertyString("customPrimaryLight");
}
} else {
Color p = Color.valueOf(getDefaultColor("primary"));
if (!getPropertyString("primaryColor").isEmpty()){
p = Color.valueOf(getPropertyString("primaryColor"));
}
if (p != null) {
primary = p.color;
dark = (p.dark.isEmpty())?dark:p.dark;
if ("light".equals(getPropertyString("themeScheme"))) {
light = "screen(@primary, #eeeeee)";
} else {
light = (p.light.isEmpty())?light:p.light;
}
}
}
if ("custom".equals(getPropertyString("accentColor"))) {
accent = getPropertyString("customAccent");
if (!getPropertyString("customAccentLight").isEmpty()) {
lightAccent = getPropertyString("customAccentLight");
}
} else if (!getPropertyString("accentColor").isEmpty()) {
Color a = Color.valueOf(getPropertyString("accentColor"));
if (a != null) {
accent = a.color;
lightAccent = (a.light.isEmpty())?lightAccent:a.light;
}
}
if ("custom".equals(getPropertyString("buttonColor"))) {
button = getPropertyString("customButton");
} else if (!getPropertyString("buttonColor").isEmpty()) {
Color a = Color.valueOf(getPropertyString("buttonColor"));
if (a != null) {
button = a.color;
}
}
if ("custom".equals(getPropertyString("buttonTextColor"))) {
buttonText = getPropertyString("customButtonText");
} else if (!getPropertyString("buttonTextColor").isEmpty()) {
Color a = Color.valueOf(getPropertyString("buttonTextColor"));
if (a != null) {
buttonText = a.color;
}
}
if ("custom".equals(getPropertyString("fontColor"))) {
font = getPropertyString("customFontColor");
} else if (!getPropertyString("fontColor").isEmpty()) {
Color a = Color.valueOf(getPropertyString("fontColor"));
if (a != null) {
font = a.color;
}
}
if ("light".equals(getPropertyString("themeScheme"))) {
String menuFont = getDefaultColor("menuFont");
if ("custom".equals(getPropertyString("menuFontColor"))) {
menuFont = getPropertyString("customMenuFontColor");
} else if (!getPropertyString("menuFontColor").isEmpty()) {
Color a = Color.valueOf(getPropertyString("menuFontColor"));
if (a != null) {
menuFont = a.color;
}
}
lessVariables += "@primary: " + primary + "; @darkPrimary: " + dark + "; @lightPrimary: " + light + "; @accent: " + accent + "; @lightAccent: " + lightAccent + "; @menuFont: " + menuFont + "; @button: " + button + "; @buttonText: " + buttonText + "; @defaultFontColor : " + font + ";";
} else {
lessVariables += "@primary: " + primary + "; @darkPrimary: " + dark + "; @lightPrimary: " + light + "; @accent: " + accent + "; @lightAccent: " + lightAccent + "; @button: " + button + "; @buttonText: " + buttonText + "; @defaultFontColor : " + font + ";";
}
// process LESS
String less = AppUtil.readPluginResource(getClass().getName(), "resources/themes/" + getPathName() + "/" + getPropertyString("themeScheme") + ".less");
less = lessVariables + "\n" + less;
// read CSS from cache
Cache cache = (Cache) AppUtil.getApplicationContext().getBean("cssCache");
if (cache != null) {
Element element = cache.get(less);
if (element != null) {
css = (String) element.getObjectValue();
}
}
if (css == null || css.isEmpty()) {
// not available in cache, compile LESS
css = compileLess(less);
// store CSS in cache
if (cache != null) {
Element element = new Element(less, css);
cache.put(element);
}
}
return css;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateLessCss
File: wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
Repository: jogetworkflow/jw-community
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-4560
|
MEDIUM
| 6.1
|
jogetworkflow/jw-community
|
generateLessCss
|
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
|
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@Transactional
public long addProgram( Program program )
{
programStore.save( program );
return program.getId();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addProgram
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
Repository: dhis2/dhis2-core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24848
|
MEDIUM
| 6.5
|
dhis2/dhis2-core
|
addProgram
|
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
|
ef04483a9b177d62e48dcf4e498b302a11f95e7d
| 0
|
Analyze the following code function for security vulnerabilities
|
private SysLogConstants.SOURCE_TYPE buiType(Integer type) {
SysLogConstants.SOURCE_TYPE targetType = SysLogConstants.SOURCE_TYPE.USER;
if (type == 1) {
targetType = SysLogConstants.SOURCE_TYPE.ROLE;
} else if (type == 2) {
targetType = SysLogConstants.SOURCE_TYPE.DEPT;
}
return targetType;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buiType
File: backend/src/main/java/io/dataease/service/panel/ShareService.java
Repository: dataease
The code follows secure coding practices.
|
[
"CWE-639"
] |
CVE-2023-32310
|
HIGH
| 8.1
|
dataease
|
buiType
|
backend/src/main/java/io/dataease/service/panel/ShareService.java
|
72f428e87b5395c03d2f94ef6185fc247ddbc8dc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void simulateBlockMine(BlockVector3 pt) {
getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).breakNaturally();
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2023-35925
- Severity: MEDIUM
- CVSS Score: 5.5
Description: feat: prevent edits outside +/- 30,000,000 blocks
Function: simulateBlockMine
File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
Repository: IntellectualSites/FastAsyncWorldEdit
Fixed Code:
@Override
public void simulateBlockMine(BlockVector3 pt) {
//FAWE start - safe edit region
testCoords(pt);
//FAWE end
getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).breakNaturally();
}
|
[
"CWE-400"
] |
CVE-2023-35925
|
MEDIUM
| 5.5
|
IntellectualSites/FastAsyncWorldEdit
|
simulateBlockMine
|
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
|
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
| 1
|
Analyze the following code function for security vulnerabilities
|
@Test
public void startTxGetConnectionFails(TestContext context) {
postgresClientGetConnectionFails().startTx(context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startTxGetConnectionFails
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
|
startTxGetConnectionFails
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void saveCurrentStepConfig(HttpServletRequest request,
SubmissionStepConfig step)
{
// save to request
request.setAttribute("step", step);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveCurrentStepConfig
File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31194
|
HIGH
| 7.2
|
DSpace
|
saveCurrentStepConfig
|
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
|
d1dd7d23329ef055069759df15cfa200c8e3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getLockTaskModeState() throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
reply.readException();
int lockTaskModeState = reply.readInt();
data.recycle();
reply.recycle();
return lockTaskModeState;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLockTaskModeState
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getLockTaskModeState
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private void validateApplicationCertificate(ServiceProvider updatedApp,
String tenantDomain) throws IdentityApplicationManagementException {
if (!isValidPEMCertificate(updatedApp.getCertificateContent())) {
String error = "Provided application certificate for application with name: %s in tenantDomain: %s " +
"is malformed.";
throw buildClientException(INVALID_REQUEST,
String.format(error, updatedApp.getApplicationName(), tenantDomain));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateApplicationCertificate
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
|
validateApplicationCertificate
|
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
|
private void initMediaSession() {
ComponentName mediaButtonReceiver = new ComponentName(getApplicationContext(), MediaButtonReceiver.class);
mMediaSessionCompat = new MediaSessionCompat(getApplicationContext(), "Tag", mediaButtonReceiver, null);
mMediaSessionCompat.setCallback(mMediaSessionCallback);
mMediaSessionCompat.setFlags( MediaSessionCompat.FLAG_HANDLES_QUEUE_COMMANDS | MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS | MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS );
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setClass(this, MediaButtonReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, mediaButtonIntent, 0);
mMediaSessionCompat.setMediaButtonReceiver(pendingIntent);
setSessionToken(mMediaSessionCompat.getSessionToken());
}
|
Vulnerability Classification:
- CWE: CWE-668
- CVE: CVE-2022-4903
- Severity: MEDIUM
- CVSS Score: 5.1
Description: Fixed #3583 Pending Intent vulnerability
Function: initMediaSession
File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java
Repository: codenameone/CodenameOne
Fixed Code:
private void initMediaSession() {
ComponentName mediaButtonReceiver = new ComponentName(getApplicationContext(), MediaButtonReceiver.class);
mMediaSessionCompat = new MediaSessionCompat(getApplicationContext(), "Tag", mediaButtonReceiver, null);
mMediaSessionCompat.setCallback(mMediaSessionCallback);
mMediaSessionCompat.setFlags( MediaSessionCompat.FLAG_HANDLES_QUEUE_COMMANDS | MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS | MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS );
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setClass(this, MediaButtonReceiver.class);
PendingIntent pendingIntent = AndroidImplementation.getBroadcastPendingIntent(this, 0, mediaButtonIntent);
mMediaSessionCompat.setMediaButtonReceiver(pendingIntent);
setSessionToken(mMediaSessionCompat.getSessionToken());
}
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
initMediaSession
|
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 1
|
Analyze the following code function for security vulnerabilities
|
private void cancelHeavyWeightProcessNotification(int userId) {
final INotificationManager inm = NotificationManager.getService();
if (inm == null) {
return;
}
try {
inm.cancelNotificationWithTag("android", "android", null,
SystemMessage.NOTE_HEAVY_WEIGHT_NOTIFICATION, userId);
} catch (RuntimeException e) {
Slog.w(TAG, "Error canceling notification for service", e);
} catch (RemoteException e) {
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancelHeavyWeightProcessNotification
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
|
cancelHeavyWeightProcessNotification
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
protected DeleteMethod executeDelete(String uri, String userName, String password) throws Exception
{
HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, password));
httpClient.getParams().setAuthenticationPreemptive(true);
DeleteMethod deleteMethod = new DeleteMethod(uri);
httpClient.executeMethod(deleteMethod);
return deleteMethod;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeDelete
File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2023-37277
|
CRITICAL
| 9.6
|
xwiki/xwiki-platform
|
executeDelete
|
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
|
4c175405faa0e62437df397811c7526dfc0fbae7
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS)
public static ActivityOptions makeRemoteTransition(RemoteTransition remoteTransition) {
final ActivityOptions opts = new ActivityOptions();
opts.mRemoteTransition = remoteTransition;
return opts;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeRemoteTransition
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
makeRemoteTransition
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setPasswordIfNotBlank(String password) {
this.password = stripToNull(password);
this.encryptedPassword = stripToNull(encryptedPassword);
if (this.password == null) {
return;
}
try {
this.encryptedPassword = this.goCipher.encrypt(password);
} catch (Exception e) {
bomb("Password encryption failed. Please verify your cipher key.", e);
}
this.password = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPasswordIfNotBlank
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
setPasswordIfNotBlank
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public NavigationHistory getNavigationHistory() {
NavigationHistory history = new NavigationHistory();
if (mNativeContentViewCore != 0) {
int currentIndex = nativeGetNavigationHistory(mNativeContentViewCore, history);
history.setCurrentEntryIndex(currentIndex);
}
return history;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNavigationHistory
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
|
getNavigationHistory
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void deleteByCriterionX(TestContext context) throws FieldException {
deleteByCriterion(context, "x");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteByCriterionX
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
|
deleteByCriterionX
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public ViewPage createPage(String space, String page, String content, String title, String syntaxId,
String parentFullPageName)
{
return createPage(Collections.singletonList(space), page, content, title, syntaxId, parentFullPageName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPage
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
createPage
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
@Binds
NotifInflater bindNotifInflater(NotifInflaterImpl notifInflaterImpl);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bindNotifInflater
File: packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40098
|
MEDIUM
| 5.5
|
android
|
bindNotifInflater
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean makeActiveIfNeeded(ActivityRecord activeActivity) {
if (shouldResumeActivity(activeActivity)) {
if (DEBUG_VISIBILITY) {
Slog.v(TAG_VISIBILITY, "Resume visible activity, " + this);
}
return getRootTask().resumeTopActivityUncheckedLocked(activeActivity /* prev */,
null /* options */);
} else if (shouldPauseActivity(activeActivity)) {
if (DEBUG_VISIBILITY) {
Slog.v(TAG_VISIBILITY, "Pause visible activity, " + this);
}
// An activity must be in the {@link PAUSING} state for the system to validate
// the move to {@link PAUSED}.
setState(PAUSING, "makeActiveIfNeeded");
try {
mAtmService.getLifecycleManager().scheduleTransaction(app.getThread(), token,
PauseActivityItem.obtain(finishing, false /* userLeaving */,
configChangeFlags, false /* dontReport */));
} catch (Exception e) {
Slog.w(TAG, "Exception thrown sending pause: " + intent.getComponent(), e);
}
} else if (shouldStartActivity()) {
if (DEBUG_VISIBILITY) {
Slog.v(TAG_VISIBILITY, "Start visible activity, " + this);
}
setState(STARTED, "makeActiveIfNeeded");
try {
mAtmService.getLifecycleManager().scheduleTransaction(app.getThread(), token,
StartActivityItem.obtain(takeOptions()));
} catch (Exception e) {
Slog.w(TAG, "Exception thrown sending start: " + intent.getComponent(), e);
}
// The activity may be waiting for stop, but that is no longer appropriate if we are
// starting the activity again
mTaskSupervisor.mStoppingActivities.remove(this);
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeActiveIfNeeded
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
|
makeActiveIfNeeded
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
void timeoutUserSwitch(UserStartedState uss, int oldUserId, int newUserId) {
synchronized (this) {
Slog.w(TAG, "User switch timeout: from " + oldUserId + " to " + newUserId);
sendContinueUserSwitchLocked(uss, oldUserId, newUserId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: timeoutUserSwitch
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
|
timeoutUserSwitch
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public MvcClass renderer(final String name) {
this.renderer = name;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renderer
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
renderer
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean getBoolProperty(Properties props, String key, boolean defaultValue) {
String result = props.getProperty(key);
if (result != null) {
return Boolean.parseBoolean(result);
}
return defaultValue;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBoolProperty
File: umlet-swing/src/main/java/com/baselet/control/config/handler/ConfigHandler.java
Repository: umlet
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000548
|
MEDIUM
| 6.8
|
umlet
|
getBoolProperty
|
umlet-swing/src/main/java/com/baselet/control/config/handler/ConfigHandler.java
|
e1c4cc6ae692cc8d1c367460dbf79343e996f9bd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setCurrentUser(final int newUserId, final int[] currentProfileIds) {
synchronized (mWindowMap) {
mCurrentUserId = newUserId;
mCurrentProfileIds = currentProfileIds;
mAppTransition.setCurrentUser(newUserId);
mPolicy.setCurrentUserLw(newUserId);
// Hide windows that should not be seen by the new user.
final int numDisplays = mDisplayContents.size();
for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) {
final DisplayContent displayContent = mDisplayContents.valueAt(displayNdx);
displayContent.switchUserStacks();
rebuildAppWindowListLocked(displayContent);
}
performLayoutAndPlaceSurfacesLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCurrentUser
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
setCurrentUser
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
int match = sURLMatcher.match(uri);
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.d(TAG, "openFile: uri=" + uri + ", mode=" + mode + ", match=" + match);
}
if (match != MMS_PART_ID) {
return null;
}
// Verify that the _data path points to mms data
Cursor c = query(uri, new String[]{"_data"}, null, null, null);
int count = (c != null) ? c.getCount() : 0;
if (count != 1) {
// If there is not exactly one result, throw an appropriate
// exception.
if (c != null) {
c.close();
}
if (count == 0) {
throw new FileNotFoundException("No entry for " + uri);
}
throw new FileNotFoundException("Multiple items at " + uri);
}
c.moveToFirst();
int i = c.getColumnIndex("_data");
String path = (i >= 0 ? c.getString(i) : null);
c.close();
if (path == null) {
return null;
}
try {
File filePath = new File(path);
if (!filePath.getCanonicalPath()
.startsWith(getContext().getDir(PARTS_DIR_NAME, 0).getCanonicalPath())) {
Log.e(TAG, "openFile: path "
+ filePath.getCanonicalPath()
+ " does not start with "
+ getContext().getDir(PARTS_DIR_NAME, 0).getCanonicalPath());
// Don't care return value
filePath.delete();
return null;
}
} catch (IOException e) {
Log.e(TAG, "openFile: create path failed " + e, e);
return null;
}
return openFileHelper(uri, mode);
}
|
Vulnerability Classification:
- CWE: CWE-362
- CVE: CVE-2016-3914
- Severity: HIGH
- CVSS Score: 9.3
Description: 30481342: Security Vulnerability - TOCTOU in MmsProvider allows access to files as phone (radio) uid
Problem: MmsProvider.openFile validated the current _data column
in the DB and then called ContentProvider.openFileHelper which was again
reading from the DB. A race condition could cause the second DB read to
read an updated, malicious value.
Fix: instead of doing the first DB check and calling
ContentProvider.openFileHelper, we're now just calling
MmsProvider.safeOpenFileHelper which does a single check.
Test: used the POC provided for this incident.
b/30481342
Change-Id: I653129359130b9fae59d4c355320b266c158a698
(cherry picked from commit 5bc7f9682d72c89ba252be6471b2db9b7e7815e3)
Function: openFile
File: src/com/android/providers/telephony/MmsProvider.java
Repository: android
Fixed Code:
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
int match = sURLMatcher.match(uri);
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.d(TAG, "openFile: uri=" + uri + ", mode=" + mode + ", match=" + match);
}
if (match != MMS_PART_ID) {
return null;
}
return safeOpenFileHelper(uri, mode);
}
|
[
"CWE-362"
] |
CVE-2016-3914
|
HIGH
| 9.3
|
android
|
openFile
|
src/com/android/providers/telephony/MmsProvider.java
|
3a3a5d145d380deef2d5b7c3150864cd04be397f
| 1
|
Analyze the following code function for security vulnerabilities
|
protected void getSCDs(String crfVersionIds, ArrayList<ItemDefBean> its, HashMap<String,Integer> itPoses, HashMap<String,Integer> inFormPoses) {
logger.debug("Begin to execute getSCDsSql");
this.setSCDsTypesExpected();
ArrayList rows = this.select(this.getSCDsSql(crfVersionIds));
if(rows==null || rows.size()<1) {
logger.info("OdmExtracDAO.getSCDsSql returns no rows.");
} else {
Iterator iter = rows.iterator();
while(iter.hasNext()) {
HashMap row = (HashMap) iter.next();
String cvOID = (String) row.get("crf_version_oid");
String itOID = (String) row.get("item_oid");
String controlItemName = (String) row.get("control_item_name");
String option = (String) row.get("option_value");
String message = (String) row.get("message");
if(controlItemName!=null && controlItemName.length()>0 && option!=null && option.length()>0
&&message!=null && message.length()>0) {
SimpleConditionalDisplayBean scd = new SimpleConditionalDisplayBean();
scd.setControlItemName(controlItemName);
scd.setOptionValue(option);
scd.setMessage(message);
if(itPoses.containsKey(itOID) && inFormPoses.containsKey(itOID+"-"+cvOID)) {
its.get(itPoses.get(itOID)).getItemDetails().getItemPresentInForm().get(inFormPoses.get(itOID+"-"+cvOID)).setSimpleConditionalDisplay(scd);
} else {
logger.info("There is no <ItemDef> with item_oid="+itOID+" or has <ItemPresentInForm> with FormOID="+cvOID+".");
}
}else {
logger.info("No Simple Conditional Display added for <ItemDef> with crf_version_oid="+cvOID+" and item_oid="+itOID);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSCDs
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
getSCDs
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<KBTemplate> findByUuid_C(String uuid, long companyId) {
return findByUuid_C(uuid, companyId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findByUuid_C
File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
Repository: brianchandotcom/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-12647
|
MEDIUM
| 4.3
|
brianchandotcom/liferay-portal
|
findByUuid_C
|
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
|
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
| 0
|
Analyze the following code function for security vulnerabilities
|
public void reportUnlockAttempt(int userId, boolean success, int timeoutMs) {
int bouncerSide = SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__SIDE__DEFAULT;
if (mView.getMode() == KeyguardSecurityContainer.MODE_ONE_HANDED) {
bouncerSide = mView.isOneHandedModeLeftAligned()
? SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__SIDE__LEFT
: SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__SIDE__RIGHT;
}
if (success) {
SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED,
SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__RESULT__SUCCESS,
bouncerSide);
mLockPatternUtils.reportSuccessfulPasswordAttempt(userId);
// Force a garbage collection in an attempt to erase any lockscreen password left in
// memory. Do it asynchronously with a 5-sec delay to avoid making the keyguard
// dismiss animation janky.
ThreadUtils.postOnBackgroundThread(() -> {
try {
Thread.sleep(5000);
} catch (InterruptedException ignored) { }
System.gc();
System.runFinalization();
System.gc();
});
} else {
SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED,
SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__RESULT__FAILURE,
bouncerSide);
reportFailedUnlockAttempt(userId, timeoutMs);
}
mMetricsLogger.write(new LogMaker(MetricsEvent.BOUNCER)
.setType(success ? MetricsEvent.TYPE_SUCCESS : MetricsEvent.TYPE_FAILURE));
mUiEventLogger.log(success ? BouncerUiEvent.BOUNCER_PASSWORD_SUCCESS
: BouncerUiEvent.BOUNCER_PASSWORD_FAILURE, getSessionId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportUnlockAttempt
File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21245
|
HIGH
| 7.8
|
android
|
reportUnlockAttempt
|
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
|
a33159e8cb297b9eee6fa5c63c0e343d05fad622
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean shouldShowRequestPermissionRationale(@NonNull String permissionName) {
try {
final String packageName = mContext.getPackageName();
return mPermissionManager.shouldShowRequestPermissionRationale(packageName,
permissionName, mContext.getUserId());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldShowRequestPermissionRationale
File: core/java/android/permission/PermissionManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
shouldShowRequestPermissionRationale
|
core/java/android/permission/PermissionManager.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
private int handleIncomingUser(int userId) {
try {
return ActivityManager.getService().handleIncomingUser(
Binder.getCallingPid(), Binder.getCallingUid(), userId, true, true, "", null);
} catch (RemoteException re) {
// Shouldn't happen, local.
}
return userId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleIncomingUser
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
|
handleIncomingUser
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return id;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.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
|
toString
|
core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
|
2ab070cdac087bd208f64fa8138bb709f8d7680c
| 0
|
Analyze the following code function for security vulnerabilities
|
@POST
@Path("singlepage")
@Operation(summary = "Attach a Single Page Element on course", description = "This attaches a Single Page Element onto a given course. The element will\n" +
" be inserted underneath the supplied parentNodeId")
@ApiResponse(responseCode = "200", description = "The course node metadatas", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)),
@Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) })
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient")
@ApiResponse(responseCode = "404", description = "The course or parentNode not found")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response attachSinglePagePost(@PathParam("courseId") Long courseId, @FormParam("parentNodeId") String parentNodeId,
@FormParam("position") Integer position, @FormParam("shortTitle") @DefaultValue("undefined") String shortTitle,
@FormParam("longTitle") @DefaultValue("undefined") String longTitle, @FormParam("objectives") @DefaultValue("undefined") String objectives,
@FormParam("visibilityExpertRules") String visibilityExpertRules, @FormParam("accessExpertRules") String accessExpertRules,
@FormParam("filename") String filename, @FormParam("path") String path, @Context HttpServletRequest request) {
return attachSinglePage(courseId, parentNodeId, position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, filename, path, request);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attachSinglePagePost
File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
attachSinglePagePost
|
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
|
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
| 0
|
Analyze the following code function for security vulnerabilities
|
ServerBuilder serviceConfigBuilder(ServiceConfigBuilder serviceConfigBuilder) {
virtualHostTemplate.addServiceConfigSetters(serviceConfigBuilder);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: serviceConfigBuilder
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
serviceConfigBuilder
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public final String getUsedSaslMechansism() {
return saslAuthentication.getNameOfLastUsedSaslMechansism();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUsedSaslMechansism
File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
getUsedSaslMechansism
|
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
public ValueGenerator getCodeVerifierGenerator() {
return codeVerifierGenerator;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCodeVerifierGenerator
File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
Repository: pac4j
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-44878
|
MEDIUM
| 5
|
pac4j
|
getCodeVerifierGenerator
|
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
|
22b82ffd702a132d9f09da60362fc6264fc281ae
| 0
|
Analyze the following code function for security vulnerabilities
|
private void validateRelationships() throws GameParseException {
// for every player
for (final PlayerId player : data.getPlayerList()) {
// in relation to every player
for (final PlayerId player2 : data.getPlayerList()) {
// See if there is a relationship between them
if ((data.getRelationshipTracker().getRelationshipType(player, player2) == null)) {
// or else throw an exception!
throw newGameParseException("No relation set for: " + player.getName() + " and " + player2.getName());
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateRelationships
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
validateRelationships
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getWorkspaceFormat() {
if (workspaceFormat==0)
return SVNAdminAreaFactory.WC_FORMAT_14; // default
return workspaceFormat;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWorkspaceFormat
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices.
|
[
"CWE-255"
] |
CVE-2013-6372
|
LOW
| 2.1
|
jenkinsci/subversion-plugin
|
getWorkspaceFormat
|
src/main/java/hudson/scm/SubversionSCM.java
|
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
| 0
|
Analyze the following code function for security vulnerabilities
|
public void cleanupSession(VaadinSession session) {
if (isSessionActive(session)) {
closeInactiveUIs(session);
removeClosedUIs(session);
} else {
if (session.getState() == State.OPEN) {
closeSession(session);
if (session.getSession() != null) {
getLogger().log(Level.FINE, "Closing inactive session {0}",
session.getSession().getId());
}
}
if (session.getSession() != null) {
/*
* If the VaadinSession has no WrappedSession then it has
* already been removed from the HttpSession and we do not have
* to do it again
*/
removeSession(session.getSession());
}
/*
* The session was destroyed during this request and therefore no
* destroy event has yet been sent
*/
fireSessionDestroy(session);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanupSession
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31403
|
LOW
| 1.9
|
vaadin/framework
|
cleanupSession
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
d852126ab6f0c43f937239305bd0e9594834fe34
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updatePermissionsLPw(String changingPkg,
PackageParser.Package pkgInfo, String replaceVolumeUuid, int flags) {
// Make sure there are no dangling permission trees.
Iterator<BasePermission> it = mSettings.mPermissionTrees.values().iterator();
while (it.hasNext()) {
final BasePermission bp = it.next();
if (bp.packageSetting == null) {
// We may not yet have parsed the package, so just see if
// we still know about its settings.
bp.packageSetting = mSettings.mPackages.get(bp.sourcePackage);
}
if (bp.packageSetting == null) {
Slog.w(TAG, "Removing dangling permission tree: " + bp.name
+ " from package " + bp.sourcePackage);
it.remove();
} else if (changingPkg != null && changingPkg.equals(bp.sourcePackage)) {
if (pkgInfo == null || !hasPermission(pkgInfo, bp.name)) {
Slog.i(TAG, "Removing old permission tree: " + bp.name
+ " from package " + bp.sourcePackage);
flags |= UPDATE_PERMISSIONS_ALL;
it.remove();
}
}
}
// Make sure all dynamic permissions have been assigned to a package,
// and make sure there are no dangling permissions.
it = mSettings.mPermissions.values().iterator();
while (it.hasNext()) {
final BasePermission bp = it.next();
if (bp.type == BasePermission.TYPE_DYNAMIC) {
if (DEBUG_SETTINGS) Log.v(TAG, "Dynamic permission: name="
+ bp.name + " pkg=" + bp.sourcePackage
+ " info=" + bp.pendingInfo);
if (bp.packageSetting == null && bp.pendingInfo != null) {
final BasePermission tree = findPermissionTreeLP(bp.name);
if (tree != null && tree.perm != null) {
bp.packageSetting = tree.packageSetting;
bp.perm = new PackageParser.Permission(tree.perm.owner,
new PermissionInfo(bp.pendingInfo));
bp.perm.info.packageName = tree.perm.info.packageName;
bp.perm.info.name = bp.name;
bp.uid = tree.uid;
}
}
}
if (bp.packageSetting == null) {
// We may not yet have parsed the package, so just see if
// we still know about its settings.
bp.packageSetting = mSettings.mPackages.get(bp.sourcePackage);
}
if (bp.packageSetting == null) {
Slog.w(TAG, "Removing dangling permission: " + bp.name
+ " from package " + bp.sourcePackage);
it.remove();
} else if (changingPkg != null && changingPkg.equals(bp.sourcePackage)) {
if (pkgInfo == null || !hasPermission(pkgInfo, bp.name)) {
Slog.i(TAG, "Removing old permission: " + bp.name
+ " from package " + bp.sourcePackage);
flags |= UPDATE_PERMISSIONS_ALL;
it.remove();
}
}
}
// Now update the permissions for all packages, in particular
// replace the granted permissions of the system packages.
if ((flags&UPDATE_PERMISSIONS_ALL) != 0) {
for (PackageParser.Package pkg : mPackages.values()) {
if (pkg != pkgInfo) {
// Only replace for packages on requested volume
final String volumeUuid = getVolumeUuidForPackage(pkg);
final boolean replace = ((flags & UPDATE_PERMISSIONS_REPLACE_ALL) != 0)
&& Objects.equals(replaceVolumeUuid, volumeUuid);
grantPermissionsLPw(pkg, replace, changingPkg);
}
}
}
if (pkgInfo != null) {
// Only replace for packages on requested volume
final String volumeUuid = getVolumeUuidForPackage(pkgInfo);
final boolean replace = ((flags & UPDATE_PERMISSIONS_REPLACE_PKG) != 0)
&& Objects.equals(replaceVolumeUuid, volumeUuid);
grantPermissionsLPw(pkgInfo, replace, changingPkg);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updatePermissionsLPw
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
updatePermissionsLPw
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void showWaitingForDebugger(IApplicationThread who, boolean waiting) {
synchronized (mProcLock) {
final ProcessRecord app = who != null ? getRecordForAppLOSP(who) : null;
if (app == null) return;
Message msg = Message.obtain();
msg.what = WAIT_FOR_DEBUGGER_UI_MSG;
msg.obj = app;
msg.arg1 = waiting ? 1 : 0;
mUiHandler.sendMessage(msg);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showWaitingForDebugger
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
|
showWaitingForDebugger
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public final void setPassword(String password) {
resetPassword(password);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPassword
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
setPassword
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String readUntilTag(Reader r) throws IOException {
if (!r.ready()) {
return "";
}
StringBuilder b = new StringBuilder();
int c = r.read();
while (c >= 0 && c != '<') {
b.append((char) c);
c = r.read();
}
return b.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readUntilTag
File: src/edu/stanford/nlp/util/XMLUtils.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-0239
|
HIGH
| 7.5
|
stanfordnlp/CoreNLP
|
readUntilTag
|
src/edu/stanford/nlp/util/XMLUtils.java
|
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public <T> List<T> execute(Query query) throws QueryException
{
this.progress.startStep(query, "query.solr.progress.execute", "Execute Solr query [{}]", query);
this.progress.pushLevelProgress(3, query);
try {
this.progress.startStep(query, "query.solr.progress.execute.prepare", "Prepare");
SolrQuery solrQuery = createSolrQuery(query);
this.progress.startStep(query, "query.solr.progress.execute.execute", "Execute");
QueryResponse response = this.solrInstance.query(solrQuery);
this.progress.startStep(query, "query.solr.progress.execute.filter", "Filter");
// Check access rights need to be checked before returning the response.
// FIXME: this is not really the best way, mostly because at this point all grouping operations
// have already been performed and any change on the result will not ensure that the grouping
// information (facets, highlighting, maxScore, etc.) is still relevant.
// A better way would be using a PostFilter as described in this article:
// http://java.dzone.com/articles/custom-security-filtering-solr
// Basically, we would be asking
List<DocumentReference> usersToCheck = new ArrayList<>(2);
if (query instanceof SecureQuery) {
if (((SecureQuery) query).isCurrentUserChecked()) {
usersToCheck.add(xcontextProvider.get().getUserReference());
}
if (((SecureQuery) query).isCurrentAuthorChecked()) {
usersToCheck.add(xcontextProvider.get().getAuthorReference());
}
} else {
usersToCheck.add(xcontextProvider.get().getUserReference());
usersToCheck.add(xcontextProvider.get().getAuthorReference());
}
if (!usersToCheck.isEmpty()) {
filterResponse(response, usersToCheck);
}
return (List<T>) Arrays.asList(response);
} catch (Exception e) {
throw new QueryException("Exception while executing query", query, e);
} finally {
this.progress.popLevelProgress(query);
this.progress.endStep(query);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: execute
File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-query/src/main/java/org/xwiki/query/solr/internal/SolrQueryExecutor.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-285"
] |
CVE-2023-48241
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
execute
|
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-query/src/main/java/org/xwiki/query/solr/internal/SolrQueryExecutor.java
|
93b8ec702d7075f0f5794bb05dfb651382596764
| 0
|
Analyze the following code function for security vulnerabilities
|
protected ReplyFromAccount getMatchingRecipient(Account account, List<String> sentTo) {
// Tokenize the list and place in a hashmap.
ReplyFromAccount matchingReplyFrom = null;
Rfc822Token[] tokens;
HashSet<String> recipientsMap = new HashSet<String>();
for (String address : sentTo) {
tokens = Rfc822Tokenizer.tokenize(address);
for (final Rfc822Token token : tokens) {
recipientsMap.add(token.getAddress());
}
}
int matchingAddressCount = 0;
List<ReplyFromAccount> customFroms;
customFroms = account.getReplyFroms();
if (customFroms != null) {
for (ReplyFromAccount entry : customFroms) {
if (recipientsMap.contains(entry.address)) {
matchingReplyFrom = entry;
matchingAddressCount++;
}
}
}
if (matchingAddressCount > 1) {
matchingReplyFrom = getDefaultReplyFromAccount(account);
}
return matchingReplyFrom;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMatchingRecipient
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
getMatchingRecipient
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void fillAttributeValues(Node node, BeanDefinitionBuilder builder, Collection<String> epn) {
NamedNodeMap attributes = node.getAttributes();
if (attributes != null) {
for (int a = 0; a < attributes.getLength(); a++) {
Node attribute = attributes.item(a);
String name = xmlToJavaName(attribute.getNodeName());
if (epn != null && epn.contains(name)) {
continue;
}
String value = attribute.getNodeValue();
builder.addPropertyValue(name, value);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fillAttributeValues
File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
fillAttributeValues
|
hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
void dumpActivityContainersLocked(PrintWriter pw) {
pw.println("ACTIVITY MANAGER CONTAINERS (dumpsys activity containers)");
mRootWindowContainer.dumpChildrenNames(pw, " ");
pw.println(" ");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpActivityContainersLocked
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
|
dumpActivityContainersLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getNetworkLoggingTitle() {
return getUpdatableString(
NETWORK_LOGGING_TITLE, R.string.network_logging_notification_title);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNetworkLoggingTitle
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
|
getNetworkLoggingTitle
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@XmlElement
public long getId() {
return id;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getId
File: core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
getId
|
core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isKeyguardSecure() {
if (mStatusBarKeyguardViewManager == null) {
// startKeyguard() hasn't been called yet, so we don't know.
// Make sure anything that needs to know isKeyguardSecure() checks and re-checks this
// value onVisibilityChanged().
Slog.w(TAG, "isKeyguardSecure() called before startKeyguard(), returning false",
new Throwable());
return false;
}
return mStatusBarKeyguardViewManager.isSecure();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isKeyguardSecure
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
|
isKeyguardSecure
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isCompatibleWithProperty(Renderer<?> renderer,
Converter<?, ?> converter) {
Class<?> type;
if (converter == null) {
type = getModelType();
} else {
type = converter.getPresentationType();
}
return renderer.getPresentationType().isAssignableFrom(type);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCompatibleWithProperty
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
|
isCompatibleWithProperty
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
static boolean isResolverActivity(String className) {
return ResolverActivity.class.getName().equals(className);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isResolverActivity
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
|
isResolverActivity
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void importProject(long projectID, InputStream inputStream, boolean gziped) throws IOException {
File destDir = this.getProjectDir(projectID);
destDir.mkdirs();
if (gziped) {
GZIPInputStream gis = new GZIPInputStream(inputStream);
untar(destDir, gis);
} else {
untar(destDir, inputStream);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: importProject
File: main/src/com/google/refine/io/FileProjectManager.java
Repository: OpenRefine
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-37476
|
HIGH
| 7.8
|
OpenRefine
|
importProject
|
main/src/com/google/refine/io/FileProjectManager.java
|
e9c1e65d58b47aec8cd676bd5c07d97b002f205e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public VisitResult visit(VisitContext context, UIComponent comp) {
try {
if (curPhase == PhaseId.APPLY_REQUEST_VALUES) {
// RELEASE_PENDING handle immediate request(s)
// If the user requested an immediate request
// Make sure to set the immediate flag here.
comp.processDecodes(ctx);
} else if (curPhase == PhaseId.PROCESS_VALIDATIONS) {
comp.processValidators(ctx);
} else if (curPhase == PhaseId.UPDATE_MODEL_VALUES) {
comp.processUpdates(ctx);
} else if (curPhase == PhaseId.RENDER_RESPONSE) {
PartialResponseWriter writer = ctx.getPartialViewContext().getPartialResponseWriter();
writer.startUpdate(comp.getClientId(ctx));
// do the default behavior...
comp.encodeAll(ctx);
writer.endUpdate();
} else {
throw new IllegalStateException("I18N: Unexpected " +
"PhaseId passed to " +
" PhaseAwareContextCallback: " +
curPhase.toString());
}
}
catch (IOException ex) {
if (LOGGER.isLoggable(Level.SEVERE)) {
LOGGER.severe(ex.toString());
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,
ex.toString(),
ex);
}
throw new FacesException(ex);
}
// Once we visit a component, there is no need to visit
// its children, since processDecodes/Validators/Updates and
// encodeAll() already traverse the subtree. We return
// VisitResult.REJECT to supress the subtree visit.
return VisitResult.REJECT;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: visit
File: impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-17091
|
MEDIUM
| 4.3
|
eclipse-ee4j/mojarra
|
visit
|
impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
|
a3fa9573789ed5e867c43ea38374f4dbd5a8f81f
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void connectionError() {
Orient.instance().getProfiler()
.updateCounter("server.http." + listeningAddress + ".errors", "Error on HTTP connection", +1, "server.http.*.errors");
sendShutdown();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: connectionError
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
Repository: orientechnologies/orientdb
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2015-2912
|
MEDIUM
| 6.8
|
orientechnologies/orientdb
|
connectionError
|
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
|
d5a45e608ba8764fd817c1bdd7cf966564e828e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public T readFrom(Class<T> type, Type genericType, Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
throws WebApplicationException {
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
T t = yaml.loadAs(toString(entityStream), type);
return t;
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2023-46302
- Severity: CRITICAL
- CVSS Score: 9.8
Description: Replace snakyaml to jackson yaml
Function: readFrom
File: submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/provider/YamlEntityProvider.java
Repository: apache/submarine
Fixed Code:
@Override
public T readFrom(Class<T> type, Type genericType, Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
throws WebApplicationException {
T t = YamlUtils.readValue(toString(entityStream), type);
return t;
}
|
[
"CWE-502"
] |
CVE-2023-46302
|
CRITICAL
| 9.8
|
apache/submarine
|
readFrom
|
submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/provider/YamlEntityProvider.java
|
ed5ad3b824ba388259e0d1ea137d7fca5f0c288e
| 1
|
Analyze the following code function for security vulnerabilities
|
private void onLockSettingsReady() {
synchronized (getLockObject()) {
fixupAutoTimeRestrictionDuringOrganizationOwnedDeviceMigration();
}
getUserData(UserHandle.USER_SYSTEM);
cleanUpOldUsers();
maybeSetDefaultProfileOwnerUserRestrictions();
handleStartUser(UserHandle.USER_SYSTEM);
maybeLogStart();
// Register an observer for watching for user setup complete and settings changes.
mSetupContentObserver.register();
// Initialize the user setup state, to handle the upgrade case.
updateUserSetupCompleteAndPaired();
List<String> packageList;
synchronized (getLockObject()) {
packageList = getKeepUninstalledPackagesLocked();
}
if (packageList != null) {
mInjector.getPackageManagerInternal().setKeepUninstalledPackages(packageList);
}
synchronized (getLockObject()) {
ActiveAdmin deviceOwner = getDeviceOwnerAdminLocked();
if (deviceOwner != null) {
// Push the force-ephemeral-users policy to the user manager.
mUserManagerInternal.setForceEphemeralUsers(deviceOwner.forceEphemeralUsers);
// Update user switcher message to activity manager.
ActivityManagerInternal activityManagerInternal =
mInjector.getActivityManagerInternal();
activityManagerInternal.setSwitchingFromSystemUserMessage(
deviceOwner.startUserSessionMessage);
activityManagerInternal.setSwitchingToSystemUserMessage(
deviceOwner.endUserSessionMessage);
}
revertTransferOwnershipIfNecessaryLocked();
}
updateUsbDataSignal();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onLockSettingsReady
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
|
onLockSettingsReady
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateLockTaskPackagesLocked(List<String> packages, int userId) {
String[] packagesArray = null;
if (!packages.isEmpty()) {
// When adding packages, we need to include the exempt apps so they can still be
// launched (ideally we should use a different AM API as these apps don't need to use
// lock-task mode).
// They're not added when the packages is empty though, as in that case we're disabling
// lock-task mode.
List<String> exemptApps = listPolicyExemptAppsUnchecked();
if (!exemptApps.isEmpty()) {
// TODO(b/175377361): add unit test to verify it (cannot be CTS because the policy-
// -exempt apps are provided by OEM and the test would have no control over it) once
// tests are migrated to the new infra-structure
HashSet<String> updatedPackages = new HashSet<>(packages);
updatedPackages.addAll(exemptApps);
if (VERBOSE_LOG) {
Slogf.v(LOG_TAG, "added %d policy-exempt apps to %d lock task packages. Final "
+ "list: %s", exemptApps.size(), packages.size(), updatedPackages);
}
packagesArray = updatedPackages.toArray(new String[updatedPackages.size()]);
}
}
if (packagesArray == null) {
packagesArray = packages.toArray(new String[packages.size()]);
}
long ident = mInjector.binderClearCallingIdentity();
try {
mInjector.getIActivityManager().updateLockTaskPackages(userId, packagesArray);
} catch (RemoteException e) {
// Not gonna happen.
} finally {
mInjector.binderRestoreCallingIdentity(ident);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateLockTaskPackagesLocked
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
|
updateLockTaskPackagesLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<FileAsset> findFileAssetsByHost(Host parentHost, User user, boolean live, boolean working, boolean archived, boolean respectFrontendRoles) throws DotDataException,
DotSecurityException {
List<FileAsset> assets = null;
try{
Folder parentFolder = APILocator.getFolderAPI().find(FolderAPI.SYSTEM_FOLDER, user, false);
assets = fromContentlets(perAPI.filterCollection(contAPI.search("+conHost:" +parentHost.getIdentifier() +" +structureType:" + Structure.STRUCTURE_TYPE_FILEASSET+" +conFolder:" + parentFolder.getInode() + (live?" +live:true":"") + (working? " +working:true":"") + (archived? " +deleted:true":""), -1, 0, null , user, respectFrontendRoles),
PermissionAPI.PERMISSION_READ, respectFrontendRoles, user));
} catch (Exception e) {
Logger.error(this.getClass(), e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
}
return assets;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findFileAssetsByHost
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
|
findFileAssetsByHost
|
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
|
ab2bb2e00b841d131b8734227f9106e3ac31bb99
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getRequestPath() {
return request.getURI().getPath();
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-44794
- Severity: CRITICAL
- CVSS Score: 9.8
Description: 修复路由拦截鉴权可被绕过的问题 fix #515
Function: getRequestPath
File: sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
Repository: dromara/Sa-Token
Fixed Code:
@Override
public String getRequestPath() {
return ApplicationInfo.cutPathPrefix(request.getPath().toString());
}
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
getRequestPath
|
sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean updateLastAuthenticatedTime(Account account) {
final UserAccounts accounts = getUserAccountsForCaller();
synchronized (accounts.dbLock) {
synchronized (accounts.cacheLock) {
return accounts.accountsDb.updateAccountLastAuthenticatedTime(account);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateLastAuthenticatedTime
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
|
updateLastAuthenticatedTime
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public static HgMaterial hgMaterial() {
return new HgMaterial("hg-url", null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hgMaterial
File: domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
hgMaterial
|
domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setOCEventDataDNsTypesExpected() {
this.unsetTypeExpected();
int i = 1;
this.setTypeExpected(i, TypeNames.STRING); // study_subject_oid
++i;
this.setTypeExpected(i, TypeNames.STRING); // definition_oid
++i;
this.setTypeExpected(i, TypeNames.INT); // parent_dn_id
++i;
this.setTypeExpected(i, TypeNames.INT); // dn_id
++i;
this.setTypeExpected(i, TypeNames.STRING); // description
++i;
this.setTypeExpected(i, TypeNames.STRING); // detailed_notes
++i;
this.setTypeExpected(i, TypeNames.INT); // owner_id
++i;
this.setTypeExpected(i, TypeNames.DATE); // date_created
++i;
this.setTypeExpected(i, TypeNames.STRING); // status
++i;
this.setTypeExpected(i, TypeNames.STRING); // discrepancy_note_type.name
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOCEventDataDNsTypesExpected
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
setOCEventDataDNsTypesExpected
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
private SettingsState getSsaidSettingsLocked(int userId) {
return getSettingsLocked(SETTINGS_TYPE_SSAID, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSsaidSettingsLocked
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
|
getSsaidSettingsLocked
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
public FormValidation doDefaultJDKCheck(StaplerRequest request, @QueryParameter String value) {
if(!value.equals("(Default)"))
// assume the user configured named ones properly in system config ---
// or else system config should have reported form field validation errors.
return FormValidation.ok();
// default JDK selected. Does such java really exist?
if(JDK.isDefaultJDKValid(Jenkins.this))
return FormValidation.ok();
else
return FormValidation.errorWithMarkup(Messages.Hudson_NoJavaInPath(request.getContextPath()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doDefaultJDKCheck
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
|
doDefaultJDKCheck
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean first() throws SQLException {
checkScrollable();
if (rows.size() <= 0) {
return false;
}
currentRow = 0;
initRowBuffer();
onInsertRow = false;
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: first
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
first
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onSwitchChanged(Switch switchView, boolean isChecked) {
if (isChecked != isChecked()) {
setChecked(isChecked);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSwitchChanged
File: src/com/android/settings/location/BluetoothScanningMainSwitchPreferenceController.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21247
|
HIGH
| 7.8
|
android
|
onSwitchChanged
|
src/com/android/settings/location/BluetoothScanningMainSwitchPreferenceController.java
|
edd4023805bc7fa54ae31de222cde02b9012bbc4
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setMarkupFormatter(MarkupFormatter f) {
this.markupFormatter = f;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMarkupFormatter
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
|
setMarkupFormatter
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public KeyguardAffordanceView getLeftView() {
return mLeftAffordanceView;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLeftView
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
getLeftView
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@Transactional( readOnly = true )
public List<Program> getPrograms( OrganisationUnit organisationUnit )
{
return programStore.get( organisationUnit );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPrograms
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
Repository: dhis2/dhis2-core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24848
|
MEDIUM
| 6.5
|
dhis2/dhis2-core
|
getPrograms
|
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
|
ef04483a9b177d62e48dcf4e498b302a11f95e7d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String dialogButtonsOkCancel(String okAttributes, String cancelAttributes) {
return dialogButtons(new int[] {BUTTON_OK, BUTTON_CANCEL}, new String[] {okAttributes, cancelAttributes});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dialogButtonsOkCancel
File: src/org/opencms/workplace/CmsDialog.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-4600
|
MEDIUM
| 4.3
|
alkacon/opencms-core
|
dialogButtonsOkCancel
|
src/org/opencms/workplace/CmsDialog.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object parseGroovyFromString(String script, XWikiContext xcontext) throws XWikiException
{
return getParseGroovyFromString().parseGroovyFromString(script, xcontext);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseGroovyFromString
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
parseGroovyFromString
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean csrfTokenCheck(XWikiContext context) throws XWikiException
{
return csrfTokenCheck(context, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: csrfTokenCheck
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
|
csrfTokenCheck
|
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
|
@NonNull XmlBlock openXmlBlockAsset(@NonNull String fileName) throws IOException {
return openXmlBlockAsset(0, fileName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openXmlBlockAsset
File: core/java/android/content/res/AssetManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
openXmlBlockAsset
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Double getDouble(K name) {
V v = get(name);
try {
return v != null ? toDouble(name, v) : null;
} catch (RuntimeException ignore) {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDouble
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
getDouble
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
private int createDataDirsLI(String volumeUuid, String packageName, int uid, String seinfo) {
int[] users = sUserManager.getUserIds();
int res = mInstaller.install(volumeUuid, packageName, uid, uid, seinfo);
if (res < 0) {
return res;
}
for (int user : users) {
if (user != 0) {
res = mInstaller.createUserData(volumeUuid, packageName,
UserHandle.getUid(user, uid), user, seinfo);
if (res < 0) {
return res;
}
}
}
return res;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createDataDirsLI
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
createDataDirsLI
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getBaseBinURL(String wiki)
{
return getBaseURL() + ((StringUtils.isEmpty(wiki) || wiki.equals("xwiki")) ? "bin/" : "wiki/" + wiki + '/');
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBaseBinURL
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getBaseBinURL
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean bringPointIntoView(int offset) {
if (mDisableTextScrollingFromAutocomplete) return false;
return super.bringPointIntoView(offset);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bringPointIntoView
File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5163
|
MEDIUM
| 4.3
|
chromium
|
bringPointIntoView
|
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
3bd33fee094e863e5496ac24714c558bd58d28ef
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<Message> getHistoricMessages() {
return mHistoricMessages;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHistoricMessages
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
getHistoricMessages
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
int flags, int userId) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRecentTasks
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getRecentTasks
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
protected InputStream createFileInputStream(String fileName) throws FileNotFoundException {
return new FileInputStream(removeFilePrefix(fileName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createFileInputStream
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
createFileInputStream
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public @Nullable Object getObject(String columnName) throws SQLException {
return getObject(findColumn(columnName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getObject
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
getObject
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
public void uninstallCaCert(@Nullable ComponentName admin, byte[] certBuffer) {
throwIfParentInstance("uninstallCaCert");
if (mService != null) {
try {
final String alias = getCaCertAlias(certBuffer);
mService.uninstallCaCerts(admin, mContext.getPackageName(), new String[] {alias});
} catch (CertificateException e) {
Log.w(TAG, "Unable to parse certificate", e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uninstallCaCert
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
uninstallCaCert
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getWidth() {
return this.getData("width");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWidth
File: src/net/sourceforge/plantuml/ugraphic/UImageSvg.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-1231
|
MEDIUM
| 4.3
|
plantuml
|
getWidth
|
src/net/sourceforge/plantuml/ugraphic/UImageSvg.java
|
c9137be051ce98b3e3e27f65f54ec7d9f8886903
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
public Rect getLaunchBounds() {
return mLaunchBounds;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLaunchBounds
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
getLaunchBounds
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onSaveToClipboard(String text, boolean isUrl) {
mClipboard.setText(text, text);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSaveToClipboard
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
onSaveToClipboard
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isDownloading(User user, OCFile file) {
return user != null && file != null && mPendingDownloads.contains(user.getAccountName(), file.getRemotePath());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDownloading
File: src/main/java/com/owncloud/android/files/services/FileDownloader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2022-24886
|
LOW
| 2.1
|
nextcloud/android
|
isDownloading
|
src/main/java/com/owncloud/android/files/services/FileDownloader.java
|
27559efb79d45782e000b762860658d49e9c35e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setIntentResultListener(IntentResultListener l) {
//if the activity is waiting for result don't override the intent listener
if(waitingForResult){
return;
}
this.intentResultListener = l;
if (l != null && l != defaultResultListener) {
waitingForResult = true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setIntentResultListener
File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
setIntentResultListener
|
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkExcessivePowerUsage() {
updateCpuStatsNow();
final boolean monitorPhantomProcs = mSystemReady && FeatureFlagUtils.isEnabled(mContext,
SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS);
synchronized (mProcLock) {
final boolean doCpuKills = mLastPowerCheckUptime != 0;
final long curUptime = SystemClock.uptimeMillis();
final long uptimeSince = curUptime - mLastPowerCheckUptime;
mLastPowerCheckUptime = curUptime;
mProcessList.forEachLruProcessesLOSP(false, app -> {
if (app.getThread() == null) {
return;
}
if (app.mState.getSetProcState() >= ActivityManager.PROCESS_STATE_HOME) {
int cpuLimit;
long checkDur = curUptime - app.mState.getWhenUnimportant();
if (checkDur <= mConstants.POWER_CHECK_INTERVAL) {
cpuLimit = mConstants.POWER_CHECK_MAX_CPU_1;
} else if (checkDur <= (mConstants.POWER_CHECK_INTERVAL * 2)
|| app.mState.getSetProcState() <= ActivityManager.PROCESS_STATE_HOME) {
cpuLimit = mConstants.POWER_CHECK_MAX_CPU_2;
} else if (checkDur <= (mConstants.POWER_CHECK_INTERVAL * 3)) {
cpuLimit = mConstants.POWER_CHECK_MAX_CPU_3;
} else {
cpuLimit = mConstants.POWER_CHECK_MAX_CPU_4;
}
updateAppProcessCpuTimeLPr(uptimeSince, doCpuKills, checkDur, cpuLimit, app);
if (monitorPhantomProcs) {
// Also check the phantom processes if there is any
updatePhantomProcessCpuTimeLPr(
uptimeSince, doCpuKills, checkDur, cpuLimit, app);
}
}
});
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkExcessivePowerUsage
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
|
checkExcessivePowerUsage
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean setBackupPassword(String currentPw, String newPw) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"setBackupPassword");
// When processing v1 passwords we may need to try two different PBKDF2 checksum regimes
final boolean pbkdf2Fallback = (mPasswordVersion < BACKUP_PW_FILE_VERSION);
// If the supplied pw doesn't hash to the the saved one, fail. The password
// might be caught in the legacy crypto mismatch; verify that too.
if (!passwordMatchesSaved(PBKDF_CURRENT, currentPw, PBKDF2_HASH_ROUNDS)
&& !(pbkdf2Fallback && passwordMatchesSaved(PBKDF_FALLBACK,
currentPw, PBKDF2_HASH_ROUNDS))) {
return false;
}
// Snap up to current on the pw file version
mPasswordVersion = BACKUP_PW_FILE_VERSION;
FileOutputStream pwFout = null;
DataOutputStream pwOut = null;
try {
pwFout = new FileOutputStream(mPasswordVersionFile);
pwOut = new DataOutputStream(pwFout);
pwOut.writeInt(mPasswordVersion);
} catch (IOException e) {
Slog.e(TAG, "Unable to write backup pw version; password not changed");
return false;
} finally {
try {
if (pwOut != null) pwOut.close();
if (pwFout != null) pwFout.close();
} catch (IOException e) {
Slog.w(TAG, "Unable to close pw version record");
}
}
// Clearing the password is okay
if (newPw == null || newPw.isEmpty()) {
if (mPasswordHashFile.exists()) {
if (!mPasswordHashFile.delete()) {
// Unable to delete the old pw file, so fail
Slog.e(TAG, "Unable to clear backup password");
return false;
}
}
mPasswordHash = null;
mPasswordSalt = null;
return true;
}
try {
// Okay, build the hash of the new backup password
byte[] salt = randomBytes(PBKDF2_SALT_SIZE);
String newPwHash = buildPasswordHash(PBKDF_CURRENT, newPw, salt, PBKDF2_HASH_ROUNDS);
OutputStream pwf = null, buffer = null;
DataOutputStream out = null;
try {
pwf = new FileOutputStream(mPasswordHashFile);
buffer = new BufferedOutputStream(pwf);
out = new DataOutputStream(buffer);
// integer length of the salt array, followed by the salt,
// then the hex pw hash string
out.writeInt(salt.length);
out.write(salt);
out.writeUTF(newPwHash);
out.flush();
mPasswordHash = newPwHash;
mPasswordSalt = salt;
return true;
} finally {
if (out != null) out.close();
if (buffer != null) buffer.close();
if (pwf != null) pwf.close();
}
} catch (IOException e) {
Slog.e(TAG, "Unable to set backup password");
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBackupPassword
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
|
setBackupPassword
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearManagedProfileApnUnchecked() {
if (!mHasTelephonyFeature) {
return;
}
final List<ApnSetting> apns = getOverrideApnsUnchecked();
for (ApnSetting apn : apns) {
if (apn.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE) {
removeOverrideApnUnchecked(apn.getId());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearManagedProfileApnUnchecked
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
|
clearManagedProfileApnUnchecked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
throws RemoteException {
synchronized (this) {
final ProcessRecord app = findProcessLocked(process, userId, "setProcessMemoryTrimLevel");
if (app == null) {
throw new IllegalArgumentException("Unknown process: " + process);
}
if (app.thread == null) {
throw new IllegalArgumentException("Process has no app thread");
}
if (app.trimMemoryLevel >= level) {
throw new IllegalArgumentException(
"Unable to set a higher trim level than current level");
}
if (!(level < ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN ||
app.curProcState > ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND)) {
throw new IllegalArgumentException("Unable to set a background trim level "
+ "on a foreground process");
}
app.thread.scheduleTrimMemory(level);
app.trimMemoryLevel = level;
return true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProcessMemoryTrimLevel
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
|
setProcessMemoryTrimLevel
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void finishReceiver(IBinder who, int resultCode, String resultData,
Bundle resultExtras, boolean resultAbort, int flags) {
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "Finish receiver: " + who);
// Refuse possible leaked file descriptors
if (resultExtras != null && resultExtras.hasFileDescriptors()) {
throw new IllegalArgumentException("File descriptors passed in Bundle");
}
final long origId = Binder.clearCallingIdentity();
try {
boolean doNext = false;
BroadcastRecord r;
synchronized(this) {
BroadcastQueue queue = (flags & Intent.FLAG_RECEIVER_FOREGROUND) != 0
? mFgBroadcastQueue : mBgBroadcastQueue;
r = queue.getMatchingOrderedReceiver(who);
if (r != null) {
doNext = r.queue.finishReceiverLocked(r, resultCode,
resultData, resultExtras, resultAbort, true);
}
}
if (doNext) {
r.queue.processNextBroadcast(false);
}
trimApplications();
} finally {
Binder.restoreCallingIdentity(origId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishReceiver
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
finishReceiver
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@CanIgnoreReturnValue
public MergeTarget clearOneof(Descriptors.OneofDescriptor oneof) {
// Nothing to clear.
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearOneof
File: java/core/src/main/java/com/google/protobuf/MessageReflection.java
Repository: protocolbuffers/protobuf
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-3509
|
HIGH
| 7.5
|
protocolbuffers/protobuf
|
clearOneof
|
java/core/src/main/java/com/google/protobuf/MessageReflection.java
|
a3888f53317a8018e7a439bac4abeb8f3425d5e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setStringData(String stringData) {
fData = stringData;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setStringData
File: ext/java/nokogiri/XmlSchema.java
Repository: sparklemotion/nokogiri
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2020-26247
|
MEDIUM
| 4
|
sparklemotion/nokogiri
|
setStringData
|
ext/java/nokogiri/XmlSchema.java
|
9c87439d9afa14a365ff13e73adc809cb2c3d97b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
boolean isFocusable() {
return super.isFocusable() && (canReceiveKeys() || isAlwaysFocusable());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFocusable
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
|
isFocusable
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public HttpServletRequest getReq() {
return req;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getReq
File: src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java
Repository: Bedework/bw-webdav
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-20000
|
MEDIUM
| 5
|
Bedework/bw-webdav
|
getReq
|
src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java
|
67283fb8b9609acdb1a8d2e7fefe195b4a261062
| 0
|
Analyze the following code function for security vulnerabilities
|
public IntentBuilder setForFingerprint(boolean forFingerprint) {
mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, forFingerprint);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setForFingerprint
File: src/com/android/settings/password/ChooseLockPassword.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
setForFingerprint
|
src/com/android/settings/password/ChooseLockPassword.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
@GET
@Path("/test")
public Response test() {
String jobToken = Job.getToken(request);
if (TEST_JOB_TOKEN.equals(jobToken))
return Response.ok().build();
else
return Response.status(400).entity("Invalid or missing job token").build();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: test
File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesResource.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-21243
|
HIGH
| 7.5
|
theonedev/onedev
|
test
|
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesResource.java
|
9637fc8fa461c5777282a0021c3deb1e7a48f137
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object map2bean(final Map map, Class targetType) {
Object target = null;
// create targets type
String className = (String) map.get(classMetadataName);
if (className == null) {
if (targetType == null) {
// nothing to do, no information about target type found
target = map;
}
}
else {
try {
targetType = ClassLoaderUtil.loadClass(className);
} catch (ClassNotFoundException cnfex) {
throw new JsonException(cnfex);
}
}
if (target == null) {
target = jsonParser.newObjectInstance(targetType);
}
ClassDescriptor cd = ClassIntrospector.get().lookup(target.getClass());
boolean targetIsMap = target instanceof Map;
for (Object key : map.keySet()) {
String keyName = key.toString();
if (classMetadataName != null) {
if (keyName.equals(classMetadataName)) {
continue;
}
}
PropertyDescriptor pd = cd.getPropertyDescriptor(keyName, declared);
if (!targetIsMap && pd == null) {
// target property does not exist, continue
continue;
}
// value is one of JSON basic types, like Number, Map, List...
Object value = map.get(key);
Class propertyType = pd == null ? null : pd.getType();
Class componentType = pd == null ? null : pd.resolveComponentType(true);
if (value != null) {
if (value instanceof List) {
if (componentType != null && componentType != String.class) {
value = generifyList((List) value, componentType);
}
}
else if (value instanceof Map) {
// if the value we want to inject is a Map...
if (!ClassUtil.isTypeOf(propertyType, Map.class)) {
// ... and if target is NOT a map
value = map2bean((Map) value, propertyType);
}
else {
// target is also a Map, but we might need to generify it
Class keyType = pd == null ? null : pd.resolveKeyType(true);
if (keyType != String.class || componentType != String.class) {
// generify
value = generifyMap((Map) value, keyType, componentType);
}
}
}
}
if (targetIsMap) {
((Map)target).put(keyName, value);
}
else {
try {
setValue(target, pd, value);
} catch (Exception ignore) {
ignore.printStackTrace();
}
}
}
return target;
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2018-21234
- Severity: HIGH
- CVSS Score: 7.5
Description: Added `allowClass` (closes #628)
Function: map2bean
File: jodd-json/src/main/java/jodd/json/MapToBean.java
Repository: oblac/jodd
Fixed Code:
public Object map2bean(final Map map, Class targetType) {
Object target = null;
// create targets type
String className = (String) map.get(classMetadataName);
if (className == null) {
if (targetType == null) {
// nothing to do, no information about target type found
target = map;
}
}
else {
checkClassName(jsonParser.classnameWhitelist, className);
try {
targetType = ClassLoaderUtil.loadClass(className);
} catch (ClassNotFoundException cnfex) {
throw new JsonException(cnfex);
}
}
if (target == null) {
target = jsonParser.newObjectInstance(targetType);
}
ClassDescriptor cd = ClassIntrospector.get().lookup(target.getClass());
boolean targetIsMap = target instanceof Map;
for (Object key : map.keySet()) {
String keyName = key.toString();
if (classMetadataName != null) {
if (keyName.equals(classMetadataName)) {
continue;
}
}
PropertyDescriptor pd = cd.getPropertyDescriptor(keyName, declared);
if (!targetIsMap && pd == null) {
// target property does not exist, continue
continue;
}
// value is one of JSON basic types, like Number, Map, List...
Object value = map.get(key);
Class propertyType = pd == null ? null : pd.getType();
Class componentType = pd == null ? null : pd.resolveComponentType(true);
if (value != null) {
if (value instanceof List) {
if (componentType != null && componentType != String.class) {
value = generifyList((List) value, componentType);
}
}
else if (value instanceof Map) {
// if the value we want to inject is a Map...
if (!ClassUtil.isTypeOf(propertyType, Map.class)) {
// ... and if target is NOT a map
value = map2bean((Map) value, propertyType);
}
else {
// target is also a Map, but we might need to generify it
Class keyType = pd == null ? null : pd.resolveKeyType(true);
if (keyType != String.class || componentType != String.class) {
// generify
value = generifyMap((Map) value, keyType, componentType);
}
}
}
}
if (targetIsMap) {
((Map)target).put(keyName, value);
}
else {
try {
setValue(target, pd, value);
} catch (Exception ignore) {
ignore.printStackTrace();
}
}
}
return target;
}
|
[
"CWE-502"
] |
CVE-2018-21234
|
HIGH
| 7.5
|
oblac/jodd
|
map2bean
|
jodd-json/src/main/java/jodd/json/MapToBean.java
|
9bffc3913aeb8472c11bb543243004b4b4376f16
| 1
|
Analyze the following code function for security vulnerabilities
|
public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAuthentication
File: samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
getAuthentication
|
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "2.2M1")
public int getObjectNumbers(String className)
{
return getXObjectSize(resolveClassReference(className));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getObjectNumbers
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getObjectNumbers
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
private int toInt(K name, V value) {
try {
return valueConverter.convertToInt(value);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Failed to convert header value to int for header '" + name + '\'');
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toInt
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
toInt
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.