instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private static WebForm saveFormBean (Map<String, Object> parameters, Host host, String formType, String ignoreString, StringBuffer filesLinks) {
//Fields predefined for the form reports
String predefinedFields = ":prefix:title:firstName:middleInitial:middleName:lastName:fullName:organization:address:address1:address2:city:state:zip:country:phone:email:";
//Return variable
WebForm formBean = new WebForm();
formBean.setFormType(formType);
// Copy the common fields set in the form
try {
for (Entry<String, Object> param : parameters.entrySet()) {
BeanUtils.setProperty(formBean, param.getKey(), getMapValue(param.getKey(), parameters));
}
} catch (Exception e1) {
Logger.error(EmailFactory.class, "sendForm: Error ocurred trying to copy the form bean parameters", e1);
}
try {
HibernateUtil.save(formBean);
} catch (DotHibernateException e) {
Logger.error(EmailFactory.class, e.getMessage(), e);
}
String formId = formBean.getWebFormId();
// Loop over the request Map or the ordered Map to set the custom
// fields and also saving the submitted files
StringBuffer customFields = new StringBuffer();
Set<Entry<String, Object>> paramSet = parameters.entrySet();
for (Entry<String, Object> param : paramSet) {
String key = (String) param.getKey();
String value = null;
Object paramValue = getMapValue(key, parameters);
if (paramValue instanceof File) {
File f = (File) param.getValue();
String submittedFileName = f.getName();
String fileName = key + "." + UtilMethods.getFileExtension(submittedFileName);
if(getMapValue(fileName.substring(4, key.length()) + "FName", parameters) != null) {
fileName = getMapValue(fileName.substring(4, key.length()) + "FName", parameters) +
"." + UtilMethods.getFileExtension(submittedFileName);
}
//Saving the file
try {
if(f.exists()) {
String filesFolder = getMapValue("formFolder", parameters) instanceof String?(String)getMapValue("formFolder", parameters):null;
String fileLink = saveFormFile(formId, formType, fileName, f, host, filesFolder);
filesLinks.append(filesLinks.toString().equals("")? "http://" + host.getHostname() + fileLink : ",http://" + host.getHostname() + fileLink);
}
} catch (Exception e) {
Logger.error(EmailFactory.class, "sendForm: couldn't saved the submitted file into the cms = " + fileName, e);
try {
HibernateUtil.delete(formBean);
} catch (DotHibernateException e1) {
Logger.error(EmailFactory.class, e1.getMessage(), e1);
}
throw new DotRuntimeException("sendForm: couldn't saved the submitted file into the cms = " + fileName, e);
}
} else if (paramValue instanceof String)
value = (String)paramValue;
List<String> cFields = new ArrayList<String>();
if (predefinedFields.indexOf(":" + key + ":") < 0
&& ignoreString.indexOf(":" + key + ":") < 0
&& UtilMethods.isSet(value)) {
value = value.replaceAll("\\|", " ").replaceAll("=", " ");
if(key.equals("ccNumber"))
value = UtilMethods.obfuscateCreditCard(value);
String capKey = UtilMethods.capitalize(key);
int aux = 2;
String capKeyAux = capKey;
while (cFields.contains(capKeyAux)) {
capKeyAux = capKey + aux;
++aux;
}
cFields.add(capKeyAux);
String cField = capKeyAux + "=" + value;
customFields.append(cField + "|");
}
}
customFields.append("Files=" + filesLinks);
//Setting the custom fields and saving them
formBean.setCustomFields(customFields.toString());
formBean.setSubmitDate(new Date());
if(UtilMethods.isSet(formType)){
try {
HibernateUtil.saveOrUpdate(formBean);
} catch (DotHibernateException e) {
throw new DotRuntimeException("Webform Save Failed");
}
}
else{
Logger.debug(EmailFactory.class, "The web form doesn't have the required formType field, the form data will not be saved in the database.");
}
return formBean;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveFormBean
File: src/com/dotmarketing/factories/EmailFactory.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4040
|
MEDIUM
| 6.5
|
dotCMS/core
|
saveFormBean
|
src/com/dotmarketing/factories/EmailFactory.java
|
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
| 0
|
Analyze the following code function for security vulnerabilities
|
private void showCreateConferenceDialog() {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
CreateConferenceDialog createConferenceFragment = CreateConferenceDialog.newInstance(mActivatedAccounts);
createConferenceFragment.show(ft, FRAGMENT_TAG_DIALOG);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showCreateConferenceDialog
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
showCreateConferenceDialog
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isNewUserDisclaimerAcknowledged(@UserIdInt int userId) {
CallerIdentity callerIdentity = getCallerIdentity();
Preconditions.checkCallAuthorization(canManageUsers(callerIdentity)
|| hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS));
synchronized (getLockObject()) {
DevicePolicyData policyData = getUserData(userId);
return policyData.isNewUserDisclaimerAcknowledged();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNewUserDisclaimerAcknowledged
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
|
isNewUserDisclaimerAcknowledged
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
boolean addToFinishingAndWaitForIdle() {
ProtoLog.v(WM_DEBUG_STATES, "Enqueueing pending finish: %s", this);
setState(FINISHING, "addToFinishingAndWaitForIdle");
if (!mTaskSupervisor.mFinishingActivities.contains(this)) {
mTaskSupervisor.mFinishingActivities.add(this);
}
resumeKeyDispatchingLocked();
return mRootWindowContainer.resumeFocusedTasksTopActivities();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addToFinishingAndWaitForIdle
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
|
addToFinishingAndWaitForIdle
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getEditableApnType(String[] apnTypeList) {
final StringBuilder editableApnTypes = new StringBuilder();
final List<String> readOnlyApnTypes = Arrays.asList(mReadOnlyApnTypes);
boolean first = true;
for (String apnType : apnTypeList) {
// add APN type if it is not read-only and is not wild-cardable
if (!readOnlyApnTypes.contains(apnType)
&& !apnType.equals(APN_TYPE_IA)
&& !apnType.equals(APN_TYPE_EMERGENCY)
&& !apnType.equals(APN_TYPE_MCX)
&& !apnType.equals(APN_TYPE_IMS)) {
if (first) {
first = false;
} else {
editableApnTypes.append(",");
}
editableApnTypes.append(apnType);
}
}
return editableApnTypes.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEditableApnType
File: src/com/android/settings/network/apn/ApnEditor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40125
|
HIGH
| 7.8
|
android
|
getEditableApnType
|
src/com/android/settings/network/apn/ApnEditor.java
|
63d464c3fa5c7b9900448fef3844790756e557eb
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String uncompressString(byte[] input, int offset, int length, Charset encoding)
throws IOException,
UnsupportedEncodingException
{
byte[] uncompressed = new byte[uncompressedLength(input, offset, length)];
uncompress(input, offset, length, uncompressed, 0);
return new String(uncompressed, encoding);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uncompressString
File: src/main/java/org/xerial/snappy/Snappy.java
Repository: xerial/snappy-java
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2023-34454
|
HIGH
| 7.5
|
xerial/snappy-java
|
uncompressString
|
src/main/java/org/xerial/snappy/Snappy.java
|
d0042551e4a3509a725038eb9b2ad1f683674d94
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setShowNewUserDisclaimer(@UserIdInt int userId, String value) {
Slogf.i(LOG_TAG, "Setting new user disclaimer for user " + userId + " as " + value);
synchronized (getLockObject()) {
DevicePolicyData policyData = getUserData(userId);
policyData.mNewUserDisclaimer = value;
saveSettingsLocked(userId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setShowNewUserDisclaimer
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
|
setShowNewUserDisclaimer
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
void moveTaskToFrontLocked(int taskId, int flags, Bundle options) {
if (!checkAppSwitchAllowedLocked(Binder.getCallingPid(),
Binder.getCallingUid(), -1, -1, "Task to front")) {
ActivityOptions.abort(options);
return;
}
final long origId = Binder.clearCallingIdentity();
try {
final TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId);
if (task == null) {
Slog.d(TAG, "Could not find task for id: "+ taskId);
return;
}
if (mStackSupervisor.isLockTaskModeViolation(task)) {
mStackSupervisor.showLockTaskToast();
Slog.e(TAG, "moveTaskToFront: Attempt to violate Lock Task Mode");
return;
}
final ActivityRecord prev = mStackSupervisor.topRunningActivityLocked();
if (prev != null && prev.isRecentsActivity()) {
task.setTaskToReturnTo(ActivityRecord.RECENTS_ACTIVITY_TYPE);
}
mStackSupervisor.findTaskToMoveToFrontLocked(task, flags, options, "moveTaskToFront");
} finally {
Binder.restoreCallingIdentity(origId);
}
ActivityOptions.abort(options);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: moveTaskToFrontLocked
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
|
moveTaskToFrontLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void systemReady() {
mSystemReady = true;
// Read the compatibilty setting when the system is ready.
boolean compatibilityModeEnabled = android.provider.Settings.Global.getInt(
mContext.getContentResolver(),
android.provider.Settings.Global.COMPATIBILITY_MODE, 1) == 1;
PackageParser.setCompatibilityModeEnabled(compatibilityModeEnabled);
if (DEBUG_SETTINGS) {
Log.d(TAG, "compatibility mode:" + compatibilityModeEnabled);
}
int[] grantPermissionsUserIds = EMPTY_INT_ARRAY;
synchronized (mPackages) {
// Verify that all of the preferred activity components actually
// exist. It is possible for applications to be updated and at
// that point remove a previously declared activity component that
// had been set as a preferred activity. We try to clean this up
// the next time we encounter that preferred activity, but it is
// possible for the user flow to never be able to return to that
// situation so here we do a sanity check to make sure we haven't
// left any junk around.
ArrayList<PreferredActivity> removed = new ArrayList<PreferredActivity>();
for (int i=0; i<mSettings.mPreferredActivities.size(); i++) {
PreferredIntentResolver pir = mSettings.mPreferredActivities.valueAt(i);
removed.clear();
for (PreferredActivity pa : pir.filterSet()) {
if (mActivities.mActivities.get(pa.mPref.mComponent) == null) {
removed.add(pa);
}
}
if (removed.size() > 0) {
for (int r=0; r<removed.size(); r++) {
PreferredActivity pa = removed.get(r);
Slog.w(TAG, "Removing dangling preferred activity: "
+ pa.mPref.mComponent);
pir.removeFilter(pa);
}
mSettings.writePackageRestrictionsLPr(
mSettings.mPreferredActivities.keyAt(i));
}
}
for (int userId : UserManagerService.getInstance().getUserIds()) {
if (!mSettings.areDefaultRuntimePermissionsGrantedLPr(userId)) {
grantPermissionsUserIds = ArrayUtils.appendInt(
grantPermissionsUserIds, userId);
}
}
}
sUserManager.systemReady();
// If we upgraded grant all default permissions before kicking off.
for (int userId : grantPermissionsUserIds) {
mDefaultPermissionPolicy.grantDefaultPermissions(userId);
}
// Kick off any messages waiting for system ready
if (mPostSystemReadyMessages != null) {
for (Message msg : mPostSystemReadyMessages) {
msg.sendToTarget();
}
mPostSystemReadyMessages = null;
}
// Watch for external volumes that come and go over time
final StorageManager storage = mContext.getSystemService(StorageManager.class);
storage.registerListener(mStorageListener);
mInstallerService.systemReady();
mPackageDexOptimizer.systemReady();
MountServiceInternal mountServiceInternal = LocalServices.getService(
MountServiceInternal.class);
mountServiceInternal.addExternalStoragePolicy(
new MountServiceInternal.ExternalStorageMountPolicy() {
@Override
public int getMountMode(int uid, String packageName) {
if (Process.isIsolated(uid)) {
return Zygote.MOUNT_EXTERNAL_NONE;
}
if (checkUidPermission(WRITE_MEDIA_STORAGE, uid) == PERMISSION_GRANTED) {
return Zygote.MOUNT_EXTERNAL_DEFAULT;
}
if (checkUidPermission(READ_EXTERNAL_STORAGE, uid) == PERMISSION_DENIED) {
return Zygote.MOUNT_EXTERNAL_DEFAULT;
}
if (checkUidPermission(WRITE_EXTERNAL_STORAGE, uid) == PERMISSION_DENIED) {
return Zygote.MOUNT_EXTERNAL_READ;
}
return Zygote.MOUNT_EXTERNAL_WRITE;
}
@Override
public boolean hasExternalStorage(int uid, String packageName) {
return true;
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: systemReady
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
|
systemReady
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isProviderAndHostInUser(Widget widget, int userId) {
// Backup only widgets hosted or provided by the owner profile.
return widget.host.getUserId() == userId && (widget.provider == null
|| widget.provider.getUserId() == userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isProviderAndHostInUser
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
isProviderAndHostInUser
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean removeTask(int taskId) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeInt(taskId);
mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
reply.readException();
boolean result = reply.readInt() != 0;
reply.recycle();
data.recycle();
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeTask
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
removeTask
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private T setComponentSessionController(HttpSession session,
MainSessionController mainSessionCtrl, String spaceId, String componentId) {
// ask to MainSessionController to create the ComponentContext
ComponentContext componentContext =
mainSessionCtrl.createComponentContext(spaceId, componentId);
// instanciate a new CSC
T component = createComponentSessionController(mainSessionCtrl, componentContext);
if (componentId == null) {
session.setAttribute(SESSION_ATTR_PREFIX + getSessionControlBeanName(), component);
} else {
session.setAttribute(SESSION_ATTR_PREFIX + getSessionControlBeanName() + "_" + componentId,
component);
}
return component;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setComponentSessionController
File: core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
setComponentSessionController
|
core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isExternalClient(PersistentClientSessionEntity entity) {
return !entity.getExternalClientId().equals(PersistentClientSessionEntity.LOCAL);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isExternalClient
File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-6563
|
HIGH
| 7.7
|
keycloak
|
isExternalClient
|
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
|
11eb952e1df7cbb95b1e2c101dfd4839a2375695
| 0
|
Analyze the following code function for security vulnerabilities
|
@UnstableApi
public ServerBuilder requestAutoAbortDelay(Duration delay) {
return requestAutoAbortDelayMillis(requireNonNull(delay, "delay").toMillis());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestAutoAbortDelay
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
|
requestAutoAbortDelay
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initFromDraftMessage(Message message) {
LogUtils.d(LOG_TAG, "Initializing draft from previous draft message: %s", message);
synchronized (mDraftLock) {
// Draft id might already be set by the request to id map, if so we don't need to set it
if (mDraftId == UIProvider.INVALID_MESSAGE_ID) {
mDraftId = message.id;
} else {
message.id = mDraftId;
}
mDraft = message;
}
mSubject.setText(message.subject);
mForward = message.draftType == UIProvider.DraftType.FORWARD;
final List<String> toAddresses = Arrays.asList(message.getToAddressesUnescaped());
addToAddresses(toAddresses);
addCcAddresses(Arrays.asList(message.getCcAddressesUnescaped()), toAddresses);
addBccAddresses(Arrays.asList(message.getBccAddressesUnescaped()));
if (message.hasAttachments) {
List<Attachment> attachments = message.getAttachments();
for (Attachment a : attachments) {
addAttachmentAndUpdateView(a);
}
}
// If we don't need to re-populate the body, and the quoted text will be restored from
// ref message. So we can skip rest of this code.
if (mInnerSavedState != null && mInnerSavedState.getBoolean(EXTRA_SKIP_PARSING_BODY)) {
LogUtils.i(LOG_TAG, "Skipping manually populating body and quoted text from draft.");
return;
}
int quotedTextIndex = message.appendRefMessageContent ? message.quotedTextOffset : -1;
// Set the body
CharSequence quotedText = null;
if (!TextUtils.isEmpty(message.bodyHtml)) {
String body = message.bodyHtml;
if (quotedTextIndex > -1) {
// Find the offset in the html text of the actual quoted text and strip it out.
// Note that the actual quotedTextOffset in the message has not changed as
// this different offset is used only for display purposes. They point to different
// parts of the original message. Please see the comments in QuoteTextView
// to see the differences.
quotedTextIndex = QuotedTextView.findQuotedTextIndex(message.bodyHtml);
if (quotedTextIndex > -1) {
body = message.bodyHtml.substring(0, quotedTextIndex);
quotedText = message.bodyHtml.subSequence(quotedTextIndex,
message.bodyHtml.length());
}
}
new HtmlToSpannedTask().execute(body);
} else {
final String body = message.bodyText;
final CharSequence bodyText;
if (TextUtils.isEmpty(body)) {
bodyText = "";
quotedText = null;
} else {
if (quotedTextIndex > body.length()) {
// Sanity check to guarantee that we will not over index the String.
// If this happens there is a bigger problem. This should never happen hence
// the wtf logging.
quotedTextIndex = -1;
LogUtils.wtf(LOG_TAG, "quotedTextIndex (%d) > body.length() (%d)",
quotedTextIndex, body.length());
}
bodyText = quotedTextIndex > -1 ? body.substring(0, quotedTextIndex) : body;
if (quotedTextIndex > -1) {
quotedText = body.substring(quotedTextIndex);
}
}
setBody(bodyText, false);
}
if (quotedTextIndex > -1 && quotedText != null) {
mQuotedTextView.setQuotedTextFromDraft(quotedText, mForward);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initFromDraftMessage
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
|
initFromDraftMessage
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getEncryptionStatusName(int encryptionStatus) {
switch (encryptionStatus) {
case DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER:
return "per-user";
case DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED:
return "unsupported";
default:
return "unknown";
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEncryptionStatusName
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getEncryptionStatusName
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getStringIndex(String arr[], String toBeFound, int defaultIndex) {
if (TextUtils.isEmpty(toBeFound)) return defaultIndex;
for (int i = 0; i < arr.length; i++) {
if (toBeFound.equals(arr[i])) return i;
}
return defaultIndex;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStringIndex
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3897
|
MEDIUM
| 4.3
|
android
|
getStringIndex
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
private SelectionMode getSelectionMode() {
GridSelectionModel<T> selectionModel = getSelectionModel();
SelectionMode mode = null;
if (selectionModel.getClass().equals(SingleSelectionModelImpl.class)) {
mode = SelectionMode.SINGLE;
} else if (selectionModel.getClass()
.equals(MultiSelectionModelImpl.class)) {
mode = SelectionMode.MULTI;
} else if (selectionModel.getClass().equals(NoSelectionModel.class)) {
mode = SelectionMode.NONE;
}
return mode;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSelectionMode
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
|
getSelectionMode
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(token);
mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
reply.readException();
data.recycle();
reply.recycle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyLaunchTaskBehindComplete
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
notifyLaunchTaskBehindComplete
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private void copyAttachments(XWikiDocument sourceDocument, boolean overwrite)
{
if (overwrite) {
// Note: when clearing the attachment list, we automatically mark the document's metadata as dirty.
getAttachmentList().clear();
}
for (XWikiAttachment attachment : sourceDocument.getAttachmentList()) {
if (overwrite || this.getAttachment(attachment.getFilename()) == null) {
try {
copyAttachment(attachment, true);
} catch (XWikiException e) {
LOGGER.warn("Cannot copy attachment [{}] from [{}] to [{}]. Root cause is [{}].",
attachment.getFilename(), sourceDocument.getDocumentReference(), this.getDocumentReference(),
ExceptionUtils.getRootCauseMessage(e));
// Skip this attachment because we cannot load its content.
continue;
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyAttachments
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
copyAttachments
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private String endCapture() {
pauseCapture();
String captured;
if (captureBuffer.length()>0) {
captured=captureBuffer.toString();
captureBuffer.setLength(0);
} else {
captured="";
}
capture=false;
return captured;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: endCapture
File: src/main/org/hjson/HjsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
endCapture
|
src/main/org/hjson/HjsonParser.java
|
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getIconURL(String iconName, XWikiContext context)
{
// TODO: Do a better mapping between generic icon name and physical resource name, especially to be independent
// of the underlying icon library. Right now we assume it's the Silk icon library.
return getSkinFile("icons/silk/" + iconName + ".png", context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIconURL
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
|
getIconURL
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
public String dialogSubheadline(String headline) {
StringBuffer retValue = new StringBuffer(128);
retValue.append("<div class=\"dialogsubheader\" unselectable=\"on\">");
retValue.append(headline);
retValue.append("</div>\n");
return retValue.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dialogSubheadline
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
|
dialogSubheadline
|
src/org/opencms/workplace/CmsDialog.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void sortMemItems(List<MemItem> items, final boolean pss) {
Collections.sort(items, new Comparator<MemItem>() {
@Override
public int compare(MemItem lhs, MemItem rhs) {
long lss = pss ? lhs.pss : lhs.mRss;
long rss = pss ? rhs.pss : rhs.mRss;
if (lss < rss) {
return 1;
} else if (lss > rss) {
return -1;
}
return 0;
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sortMemItems
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
|
sortMemItems
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected Mono<Void> doNotify(InstanceEvent event, Instance instance) {
if (webhookUrl == null) {
return Mono.error(new IllegalStateException("'webhookUrl' must not be null."));
}
return Mono.fromRunnable(
() -> restTemplate.postForEntity(webhookUrl, createDiscordNotification(event, instance), Void.class));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doNotify
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DiscordNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
doNotify
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DiscordNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Route.Collection delete(final String path1,
final String path2, final Route.ZeroArgHandler handler) {
return new Route.Collection(
new Route.Definition[]{delete(path1, handler), delete(path2, handler)});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
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
|
delete
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ArrayList<HashMap<String, Object>> getSerializerStatus() {
return serializer_status;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSerializerStatus
File: src/tsd/HttpQuery.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
getSerializerStatus
|
src/tsd/HttpQuery.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 0
|
Analyze the following code function for security vulnerabilities
|
final StandardTemplateParams disallowColorization() {
this.allowColorization = false;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disallowColorization
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
disallowColorization
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void startElement(final String uri, final String localName, final String qName, final Attributes attributes) throws SAXException {
if (logger.isDebugEnabled()) {
logger.debug("Start Element: " + qName);
}
if (tagQueue.isEmpty() && !"eef".equalsIgnoreCase(qName)) {
throw new GsaConfigException("Invalid format.");
} else if (COLLECTION.equalsIgnoreCase(qName) && COLLECTIONS.equalsIgnoreCase(tagQueue.peekLast())) {
final long now = System.currentTimeMillis();
final String name = attributes.getValue("Name");
labelType = new LabelType();
labelType.setName(name);
labelType.setValue(name);
labelType.setPermissions(new String[] { "Rguest" });
labelType.setCreatedBy(Constants.SYSTEM_USER);
labelType.setCreatedTime(now);
labelType.setUpdatedBy(Constants.SYSTEM_USER);
labelType.setUpdatedTime(now);
}
tagQueue.offer(qName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startElement
File: src/main/java/org/codelibs/fess/util/GsaConfigParser.java
Repository: codelibs/fess
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000822
|
HIGH
| 7.5
|
codelibs/fess
|
startElement
|
src/main/java/org/codelibs/fess/util/GsaConfigParser.java
|
faa265b8d8f1c71e1bf3229fba5f8cc58a5611b7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setMonthlyVotes(Integer monthlyVotes) {
this.monthlyVotes = monthlyVotes;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMonthlyVotes
File: src/main/java/com/erudika/scoold/core/Profile.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
setMonthlyVotes
|
src/main/java/com/erudika/scoold/core/Profile.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void preNav(StringBuffer sb) {
HtmlTag div = new HtmlTag("div");
div.setAttribute("class", "spacewalk-content-nav");
sb.append(div.renderOpenTag());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: preNav
File: java/code/src/com/redhat/rhn/frontend/nav/DialognavRenderer.java
Repository: spacewalkproject/spacewalk
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2016-3079
|
MEDIUM
| 4.3
|
spacewalkproject/spacewalk
|
preNav
|
java/code/src/com/redhat/rhn/frontend/nav/DialognavRenderer.java
|
7b9ff9ad
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void switchToConversation(Contact contact, String body) {
Conversation conversation = xmppConnectionService
.findOrCreateConversation(contact.getAccount(),
contact.getJid(), false, true);
switchToConversation(conversation, body);
}
|
Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2018-18467
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Do not insert text shared over XMPP uri when already drafting message
XMPP uris in the style of `xmpp:test@domain.tld?body=Something` can be used to
directly share a message with a specific contact. Previously the text was
always appended to the message currently in draft. The message was never send
automatically. Essentially those links where treated like normal text share
intents (for example when sharing a URL from the browser) but without the
contact selection.
There is a concern (CVE-2018-18467) that when this URI is invoked automatically
and the user is currently drafting a long message to that particular contact
the text could be inserted in the draft field (input box) without the user
noticing.
To circumvent that the text shared over XMPP uris that contain a particular
contact is now appended only if the draft box is currently empty.
Sharing text normally (**with** manual contact selection) is still treated the
same; meaning the shared text will be appended to the current draft. This is
intended behaviour to make the
'Hey I have this cool link here;' *open browser*, *share link* - secenario
work.
Function: switchToConversation
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
Fixed Code:
protected void switchToConversation(Contact contact) {
Conversation conversation = xmppConnectionService.findOrCreateConversation(contact.getAccount(), contact.getJid(), false, true);
switchToConversation(conversation);
}
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
switchToConversation
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 1
|
Analyze the following code function for security vulnerabilities
|
void enforcePermission(String permission, int pid, int uid, String func) {
if (checkPermission(permission, pid, uid) == PackageManager.PERMISSION_GRANTED) {
return;
}
String msg = "Permission Denial: " + func + " from pid=" + pid + ", uid=" + uid
+ " requires " + permission;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforcePermission
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
|
enforcePermission
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public DriverResult tempLoadFromRemote(String remoteUrl) {
Path dirPath;
try {
dirPath = Files.createTempDirectory("databasir-drivers");
} catch (IOException e) {
log.error("load driver error cause create temp dir failed", e);
throw DomainErrors.DOWNLOAD_DRIVER_ERROR.exception();
}
File file = download(remoteUrl, dirPath.toString());
return new DriverResult(file.getAbsolutePath(), file);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: tempLoadFromRemote
File: core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java
Repository: vran-dev/databasir
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-31196
|
HIGH
| 7.5
|
vran-dev/databasir
|
tempLoadFromRemote
|
core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java
|
226c20e0c9124037671a91d6b3e5083bd2462058
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_ACCOUNT_MANAGEMENT, conditional = true)
public @Nullable String[] getAccountTypesWithManagementDisabledAsUser(int userId) {
return getAccountTypesWithManagementDisabledAsUser(userId, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAccountTypesWithManagementDisabledAsUser
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
|
getAccountTypesWithManagementDisabledAsUser
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private String extractRun(JsonNode stepNode) {
if (stepNode != null) {
if (stepNode.has(RUN)) {
return stepNode.get(RUN).asText();
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: extractRun
File: src/main/java/org/commonwl/view/cwl/CWLService.java
Repository: common-workflow-language/cwlviewer
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-41110
|
HIGH
| 7.5
|
common-workflow-language/cwlviewer
|
extractRun
|
src/main/java/org/commonwl/view/cwl/CWLService.java
|
f6066f09edb70033a2ce80200e9fa9e70a5c29de
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setElement(int element, boolean toggle)
{
if (toggle) {
this.elements = this.elements | element;
} else {
this.elements = this.elements & (~element);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setElement
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
setElement
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override public void onUidCachedChanged(int uid, boolean cached) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUidCachedChanged
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40092
|
MEDIUM
| 5.5
|
android
|
onUidCachedChanged
|
services/core/java/com/android/server/pm/ShortcutService.java
|
a5e55363e69b3c84d3f4011c7b428edb1a25752c
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean testMethodHasAnnotation(Class<? extends Annotation> clazz) {
String testName = getName();
Method method = null;
try {
method = getClass().getMethod(testName);
} catch (NoSuchMethodException e) {
Log.w(TAG, "Test method name not found.", e);
return false;
}
// Cast to AnnotatedElement to work around a compilation failure.
// Method.isAnnotationPresent() was removed in Java 8 (which is used by the Android N SDK),
// so compilation with Java 7 fails. See crbug.com/608792.
return ((AnnotatedElement) method).isAnnotationPresent(clazz);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testMethodHasAnnotation
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5155
|
MEDIUM
| 4.3
|
chromium
|
testMethodHasAnnotation
|
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
| 0
|
Analyze the following code function for security vulnerabilities
|
public SearchResult getByQuery(SearchQuery q) throws SearchException {
try {
logger.debug("Searching index using query object '" + q + "'");
return solrRequester.getForRead(q);
} catch (SolrServerException e) {
throw new SearchException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getByQuery
File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-21318
|
MEDIUM
| 5.5
|
opencast
|
getByQuery
|
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
|
b18c6a7f81f08ed14884592a6c14c9ab611ad450
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean bindBackupAgent(ApplicationInfo appInfo, int backupRestoreMode)
throws RemoteException;
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2016-3832
- Severity: HIGH
- CVSS Score: 8.3
Description: Don't trust callers to supply app info to bindBackupAgent()
Get the canonical identity and metadata about the package from the
Package Manager at time of usage rather than rely on the caller to
have gotten things right, even when the caller has the system uid.
Bug 28795098
Change-Id: I215786bc894dedf7ca28e9c80cefabd0e40ca877
Merge conflict resolution for ag/1133474 (referencing ag/1148862)
- directly to mnc-mr2-release
Function: bindBackupAgent
File: core/java/android/app/IActivityManager.java
Repository: android
Fixed Code:
public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId)
throws RemoteException;
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
bindBackupAgent
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 1
|
Analyze the following code function for security vulnerabilities
|
public void use(String className)
{
this.currentObj = getObject(className);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: use
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
use
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onPopState(AjaxRequestTarget target, Serializable data) {
super.onPopState(target, data);
State popState = (State) data;
if (!popState.blobIdent.revision.equals(state.blobIdent.revision)) {
state = popState;
newSearchResult(target, null);
onResolvedRevisionChange(target);
} else {
state = popState;
newBlobNavigator(target);
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPopState
File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2021-21245
|
HIGH
| 7.5
|
theonedev/onedev
|
onPopState
|
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
|
0c060153fb97c0288a1917efdb17cc426934dacb
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String patternStringToBaseZero(String pattern) {
if (pattern == null) {
return "";
}
final int patternSize = pattern.length();
byte[] res = new byte[patternSize];
final byte[] bytes = pattern.getBytes();
for (int i = 0; i < patternSize; i++) {
res[i] = (byte) (bytes[i] - '1');
}
return new String(res);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: patternStringToBaseZero
File: core/java/com/android/internal/widget/LockPatternUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
patternStringToBaseZero
|
core/java/com/android/internal/widget/LockPatternUtils.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public HttpHeaders remove(String name) {
headers.remove(name);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: remove
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
remove
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void extractFile(
final File srcF,
final File dir,
final InputStream compressedInputStream,
String entryName,
final Date entryDate,
final boolean isDirectory,
final Integer mode,
String symlinkDestination,
final FileMapper[] fileMappers)
throws IOException, ArchiverException {
if (fileMappers != null) {
for (final FileMapper fileMapper : fileMappers) {
entryName = fileMapper.getMappedFileName(entryName);
}
}
// Hmm. Symlinks re-evaluate back to the original file here. Unsure if this is a good thing...
final File targetFileName = FileUtils.resolveFile(dir, entryName);
// Make sure that the resolved path of the extracted file doesn't escape the destination directory
// getCanonicalFile().toPath() is used instead of getCanonicalPath() (returns String),
// because "/opt/directory".startsWith("/opt/dir") would return false negative.
Path canonicalDirPath = dir.getCanonicalFile().toPath();
Path canonicalDestPath = targetFileName.getCanonicalFile().toPath();
if (!canonicalDestPath.startsWith(canonicalDirPath)) {
throw new ArchiverException("Entry is outside of the target directory (" + entryName + ")");
}
try {
if (!shouldExtractEntry(dir, targetFileName, entryName, entryDate)) {
return;
}
// create intermediary directories - sometimes zip don't add them
final File dirF = targetFileName.getParentFile();
if (dirF != null) {
dirF.mkdirs();
}
if (!StringUtils.isEmpty(symlinkDestination)) {
SymlinkUtils.createSymbolicLink(targetFileName, new File(symlinkDestination));
} else if (isDirectory) {
targetFileName.mkdirs();
} else {
try (OutputStream out = Files.newOutputStream(targetFileName.toPath())) {
IOUtil.copy(compressedInputStream, out);
}
}
targetFileName.setLastModified(entryDate.getTime());
if (!isIgnorePermissions() && mode != null && !isDirectory) {
ArchiveEntryUtils.chmod(targetFileName, mode);
}
} catch (final FileNotFoundException ex) {
getLogger().warn("Unable to expand to file " + targetFileName.getPath());
}
}
|
Vulnerability Classification:
- CWE: CWE-22, CWE-61
- CVE: CVE-2023-37460
- Severity: CRITICAL
- CVSS Score: 9.8
Description: Avoid override target symlink by standard file in AbstractUnArchiver
Function: extractFile
File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
Repository: codehaus-plexus/plexus-archiver
Fixed Code:
protected void extractFile(
final File srcF,
final File dir,
final InputStream compressedInputStream,
String entryName,
final Date entryDate,
final boolean isDirectory,
final Integer mode,
String symlinkDestination,
final FileMapper[] fileMappers)
throws IOException, ArchiverException {
if (fileMappers != null) {
for (final FileMapper fileMapper : fileMappers) {
entryName = fileMapper.getMappedFileName(entryName);
}
}
// Hmm. Symlinks re-evaluate back to the original file here. Unsure if this is a good thing...
final File targetFileName = FileUtils.resolveFile(dir, entryName);
// Make sure that the resolved path of the extracted file doesn't escape the destination directory
// getCanonicalFile().toPath() is used instead of getCanonicalPath() (returns String),
// because "/opt/directory".startsWith("/opt/dir") would return false negative.
Path canonicalDirPath = dir.getCanonicalFile().toPath();
Path canonicalDestPath = targetFileName.getCanonicalFile().toPath();
if (!canonicalDestPath.startsWith(canonicalDirPath)) {
throw new ArchiverException("Entry is outside of the target directory (" + entryName + ")");
}
// don't allow override target symlink by standard file
if (StringUtils.isEmpty(symlinkDestination) && Files.isSymbolicLink(canonicalDestPath)) {
throw new ArchiverException("Entry is outside of the target directory (" + entryName + ")");
}
try {
if (!shouldExtractEntry(dir, targetFileName, entryName, entryDate)) {
return;
}
// create intermediary directories - sometimes zip don't add them
final File dirF = targetFileName.getParentFile();
if (dirF != null) {
dirF.mkdirs();
}
if (!StringUtils.isEmpty(symlinkDestination)) {
SymlinkUtils.createSymbolicLink(targetFileName, new File(symlinkDestination));
} else if (isDirectory) {
targetFileName.mkdirs();
} else {
Files.copy(compressedInputStream, targetFileName.toPath(), REPLACE_EXISTING);
}
targetFileName.setLastModified(entryDate.getTime());
if (!isIgnorePermissions() && mode != null && !isDirectory) {
ArchiveEntryUtils.chmod(targetFileName, mode);
}
} catch (final FileNotFoundException ex) {
getLogger().warn("Unable to expand to file " + targetFileName.getPath());
}
}
|
[
"CWE-22",
"CWE-61"
] |
CVE-2023-37460
|
CRITICAL
| 9.8
|
codehaus-plexus/plexus-archiver
|
extractFile
|
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
|
54759839fbdf85caf8442076f001d5fd64e0dcb2
| 1
|
Analyze the following code function for security vulnerabilities
|
public LocalFolderImpl getWikiRootContainer(OLATResourceable ores) {
// Check if Resource is a BusinessGroup, because BusinessGroup-wiki's are stored at a different place
if(log.isDebugEnabled()){
log.debug("calculating wiki root container with ores id: "+ores.getResourceableId()+" and resourcable type name: "+ores.getResourceableTypeName());
}
if (isGroupContextWiki(ores)) {
// Group Wiki
return VFSManager.olatRootContainer(getGroupWikiRelPath(ores), null);
} else {
// Repository Wiki
return getFileResourceManager().getFileResourceRootImpl(ores);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWikiRootContainer
File: src/main/java/org/olat/modules/wiki/WikiManager.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
getWikiRootContainer
|
src/main/java/org/olat/modules/wiki/WikiManager.java
|
699490be8e931af0ef1f135c55384db1f4232637
| 0
|
Analyze the following code function for security vulnerabilities
|
void settingsSecurePutIntForUser(String name, int value, int userHandle) {
Settings.Secure.putIntForUser(mContext.getContentResolver(),
name, value, userHandle);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: settingsSecurePutIntForUser
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
|
settingsSecurePutIntForUser
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Boolean getMinorEdit1()
{
return Boolean.valueOf(isMinorEdit());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMinorEdit1
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getMinorEdit1
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isCallActionColorCustomizable() {
// NOTE: this doesn't need to check StandardTemplateParams.allowColorization because
// that is only used for disallowing colorization of headers for the minimized state,
// and neither of those conditions applies when showing actions.
// Not requiring StandardTemplateParams as an argument simplifies the creation process.
return mN.isColorized() && mContext.getResources().getBoolean(
R.bool.config_callNotificationActionColorsRequireColorized);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCallActionColorCustomizable
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
isCallActionColorCustomizable
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public LocalAuthenticatorConfig[] getAllLocalAuthenticators(String tenantDomain)
throws IdentityApplicationManagementException {
try {
startTenantFlow(tenantDomain);
IdentityProviderDAO idpdao = ApplicationMgtSystemConfig.getInstance().getIdentityProviderDAO();
List<LocalAuthenticatorConfig> localAuthenticators = idpdao.getAllLocalAuthenticators();
if (localAuthenticators != null) {
return localAuthenticators.toArray(new LocalAuthenticatorConfig[localAuthenticators.size()]);
}
return new LocalAuthenticatorConfig[0];
} catch (Exception e) {
String error = "Error occurred while retrieving all Local Authenticators" + ". " + e.getMessage();
throw new IdentityApplicationManagementException(error, e);
} finally {
endTenantFlow();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllLocalAuthenticators
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
|
getAllLocalAuthenticators
|
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
|
@LargeTest
@Test
public void testPullExternalCall() throws Exception {
// TODO: Revisit this unit test once telecom support for filtering external calls from
// InCall services is implemented.
mConnectionServiceFixtureA.mConnectionServiceDelegate.mCapabilities =
Connection.CAPABILITY_CAN_PULL_CALL;
mConnectionServiceFixtureA.mConnectionServiceDelegate.mProperties =
Connection.PROPERTY_IS_EXTERNAL_CALL;
IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
assertEquals(Call.STATE_ACTIVE, mInCallServiceFixtureX.getCall(ids.mCallId).getState());
// Attempt to pull the call and verify the API call makes it through
mInCallServiceFixtureX.mInCallAdapter.pullExternalCall(ids.mCallId);
verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT))
.pullExternalCall(eq(ids.mConnectionId), any());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testPullExternalCall
File: tests/src/com/android/server/telecom/tests/BasicCallTests.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
testPullExternalCall
|
tests/src/com/android/server/telecom/tests/BasicCallTests.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Token jjFillToken()
{
final Token t;
final String curTokenImage;
final int beginLine;
final int endLine;
final int beginColumn;
final int endColumn;
String im = jjstrLiteralImages[jjmatchedKind];
curTokenImage = (im == null) ? input_stream.GetImage() : im;
beginLine = input_stream.getBeginLine();
beginColumn = input_stream.getBeginColumn();
endLine = input_stream.getEndLine();
endColumn = input_stream.getEndColumn();
t = Token.newToken(jjmatchedKind);
t.kind = jjmatchedKind;
t.image = curTokenImage;
t.beginLine = beginLine;
t.endLine = endLine;
t.beginColumn = beginColumn;
t.endColumn = endColumn;
return t;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jjFillToken
File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
Repository: jakartaee/expression-language
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2021-28170
|
MEDIUM
| 5
|
jakartaee/expression-language
|
jjFillToken
|
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
|
b6a3943ac5fba71cbc6719f092e319caa747855b
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<Void> internalRemoveSubscriptionDispatchRate() {
return getTopicPoliciesAsyncWithRetry(topicName)
.thenCompose(op -> {
if (!op.isPresent()) {
return CompletableFuture.completedFuture(null);
}
op.get().setSubscriptionDispatchRate(null);
return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, op.get());
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalRemoveSubscriptionDispatchRate
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalRemoveSubscriptionDispatchRate
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Jooby err(final Err.Handler err) {
this.bag.add(requireNonNull(err, "An err handler is required."));
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: err
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
|
err
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAlgorithmOID(String algorithmOID) {
attributes.put(ALGORITHM_OID, algorithmOID);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAlgorithmOID
File: base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setAlgorithmOID
|
base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setStatus(int status) {
this.status = status;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setStatus
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
setStatus
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setAccessToken(String accessToken) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).setAccessToken(accessToken);
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAccessToken
File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/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
|
setAccessToken
|
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
void requestDrawIfNeeded(List<WindowState> outWaitingForDrawn) {
if (!isVisible()) {
return;
}
if (mActivityRecord != null) {
if (mActivityRecord.allDrawn) {
// The allDrawn of activity is reset when the visibility is changed to visible, so
// the content should be ready if allDrawn is set.
return;
}
if (mAttrs.type == TYPE_APPLICATION_STARTING) {
if (isDrawn()) {
// Unnecessary to redraw a drawn starting window.
return;
}
} else if (mActivityRecord.mStartingWindow != null) {
// If the activity has an active starting window, there is no need to wait for the
// main window.
return;
}
} else if (!mPolicy.isKeyguardHostWindow(mAttrs)) {
return;
// Always invalidate keyguard host window to make sure it shows the latest content
// because its visibility may not be changed.
}
mWinAnimator.mDrawState = DRAW_PENDING;
// Force add to {@link WindowManagerService#mResizingWindows}.
forceReportingResized();
outWaitingForDrawn.add(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestDrawIfNeeded
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
requestDrawIfNeeded
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public File getResource(String providerName, String resourcePath) {
if (providerName == null) {
for (ResourceProvider provider : resourceProviders.values()) {
File ret = provider.getResource(resourcePath);
if (ret != null)
return ret;
}
// not found in any registered provider
return null;
} else {
ResourceProvider provider = resourceProviders.get(providerName);
return provider.getResource(resourcePath);
}
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2020-24621
- Severity: MEDIUM
- CVSS Score: 6.5
Description: UIFR-215: Do not allow loading arbitrary files
Function: getResource
File: api/src/main/java/org/openmrs/ui/framework/resource/ResourceFactory.java
Repository: openmrs/openmrs-module-uiframework
Fixed Code:
public File getResource(String providerName, String resourcePath) {
if (resourcePath == null) {
return null;
}
if (!resourcePath.equals(FilenameUtils.normalize(resourcePath))) {
log.warn("Attempted to load file via directory traversal using path: {}", resourcePath);
return null;
}
if (providerName == null) {
for (ResourceProvider provider : resourceProviders.values()) {
File ret = provider.getResource(resourcePath);
if (ret != null)
return ret;
}
// not found in any registered provider
return null;
} else {
ResourceProvider provider = resourceProviders.get(providerName);
return provider.getResource(resourcePath);
}
}
|
[
"CWE-22"
] |
CVE-2020-24621
|
MEDIUM
| 6.5
|
openmrs/openmrs-module-uiframework
|
getResource
|
api/src/main/java/org/openmrs/ui/framework/resource/ResourceFactory.java
|
0422fa52c7eba3d96cce2936cb92897dca4b680a
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onProcessMapped(int pid, WindowProcessController proc) {
synchronized (mGlobalLock) {
mProcessMap.put(pid, proc);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onProcessMapped
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
|
onProcessMapped
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int startActivityAsUser(IApplicationThread caller, String callingPackage,
String callingFeatureId, Intent intent, String resolvedType, IBinder resultTo,
String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo,
Bundle bOptions, int userId) {
return startActivityAsUser(caller, callingPackage, callingFeatureId, intent, resolvedType,
resultTo, resultWho, requestCode, startFlags, profilerInfo, bOptions, userId,
true /*validateIncomingUser*/);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startActivityAsUser
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
|
startActivityAsUser
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public ZentaoConfig setUserConfig() {
return setUserConfig(getUserPlatInfo(this.workspaceId));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUserConfig
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
setUserConfig
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public PodOperationContext getContext() {
return (PodOperationContext) context;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContext
File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
Repository: fabric8io/kubernetes-client
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-20218
|
MEDIUM
| 5.8
|
fabric8io/kubernetes-client
|
getContext
|
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
|
325d67cc80b73f049a5d0cea4917c1f2709a8d86
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getProfileOwnerName(int userHandle) {
if (!mHasFeature) {
return null;
}
Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity())
|| hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS));
return getProfileOwnerNameUnchecked(userHandle);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProfileOwnerName
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getProfileOwnerName
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private long handleAttachmentUrisFromIntent(List<Uri> uris) {
ArrayList<Attachment> attachments = Lists.newArrayList();
for (Uri uri : uris) {
try {
if (uri != null) {
if ("file".equals(uri.getScheme())) {
final File f = new File(uri.getPath());
// We should not be attaching any files from the data directory UNLESS
// the data directory is part of the calling process.
final String filePath = f.getCanonicalPath();
if (filePath.startsWith(DATA_DIRECTORY_ROOT)) {
final String callingPackage = getCallingPackage();
if (callingPackage == null) {
showErrorToast(getString(R.string.attachment_permission_denied));
continue;
}
// So it looks like the data directory are usually /data/data, but
// DATA_DIRECTORY_ROOT is only /data.. so let's check for both
final String pathWithoutRoot;
// We add 1 to the length for the additional / before the package name.
if (filePath.startsWith(ALTERNATE_DATA_DIRECTORY_ROOT)) {
pathWithoutRoot = filePath.substring(
ALTERNATE_DATA_DIRECTORY_ROOT.length() + 1);
} else {
pathWithoutRoot = filePath.substring(
DATA_DIRECTORY_ROOT.length() + 1);
}
// If we are trying to access a data package that's not part of the
// calling package, show error toast and ignore this attachment.
if (!pathWithoutRoot.startsWith(callingPackage)) {
showErrorToast(getString(R.string.attachment_permission_denied));
continue;
}
}
}
if (!handleSpecialAttachmentUri(uri)) {
final Attachment a = mAttachmentsView.generateLocalAttachment(uri);
attachments.add(a);
Analytics.getInstance().sendEvent("send_intent_attachment",
Utils.normalizeMimeType(a.getContentType()), null, a.size);
}
}
} catch (AttachmentFailureException e) {
LogUtils.e(LOG_TAG, e, "Error adding attachment");
showAttachmentTooBigToast(e.getErrorRes());
} catch (IOException | SecurityException e) {
LogUtils.e(LOG_TAG, e, "Error adding attachment");
showErrorToast(getString(R.string.attachment_permission_denied));
}
}
return addAttachments(attachments);
}
|
Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2016-2425
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Don't allow file attachment from file:///data.
Commit 24ed2941ab132e4156bd38f0ab734c81dae8fc2e allows file://
attachment on the /data directory if they are from the same process.
This was done to work around applications that shared their internal
data file. However, this is bad practice, and other apps should share
content:// Uri instead.
With this change, Email doesn't allow this anymore. This fixes
security issue 199888.
Also, add Analytics for these errors
compose_errors > send_intent_attachment > data_dir
https://code.google.com/p/android/issues/detail?id=199888
b/26989185
Change-Id: I7cae3389f4f7cf5f86600a58c6ccdffaf889d1c3
Function: handleAttachmentUrisFromIntent
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
Fixed Code:
private long handleAttachmentUrisFromIntent(List<Uri> uris) {
ArrayList<Attachment> attachments = Lists.newArrayList();
for (Uri uri : uris) {
try {
if (uri != null) {
if ("file".equals(uri.getScheme())) {
// We must not allow files from /data, even from our process.
final File f = new File(uri.getPath());
final String filePath = f.getCanonicalPath();
if (filePath.startsWith(DATA_DIRECTORY_ROOT)) {
showErrorToast(getString(R.string.attachment_permission_denied));
Analytics.getInstance().sendEvent(ANALYTICS_CATEGORY_ERRORS,
"send_intent_attachment", "data_dir", 0);
continue;
}
}
if (!handleSpecialAttachmentUri(uri)) {
final Attachment a = mAttachmentsView.generateLocalAttachment(uri);
attachments.add(a);
Analytics.getInstance().sendEvent("send_intent_attachment",
Utils.normalizeMimeType(a.getContentType()), null, a.size);
}
}
} catch (AttachmentFailureException e) {
LogUtils.e(LOG_TAG, e, "Error adding attachment");
showAttachmentTooBigToast(e.getErrorRes());
} catch (IOException | SecurityException e) {
LogUtils.e(LOG_TAG, e, "Error adding attachment");
showErrorToast(getString(R.string.attachment_permission_denied));
}
}
return addAttachments(attachments);
}
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
handleAttachmentUrisFromIntent
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 1
|
Analyze the following code function for security vulnerabilities
|
public abstract JavaType withContentType(JavaType contentType);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: withContentType
File: src/main/java/com/fasterxml/jackson/databind/JavaType.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
withContentType
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
public TimeFrameUnits getMaxTimeFrameUnits() {
return maxTimeFrameUnits;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMaxTimeFrameUnits
File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
Repository: openmrs/openmrs-module-appointmentscheduling
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-4727
|
MEDIUM
| 6.1
|
openmrs/openmrs-module-appointmentscheduling
|
getMaxTimeFrameUnits
|
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
|
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void eagerlyMergeMessageSetExtension(
CodedInputStream input,
ExtensionRegistry.ExtensionInfo extension,
ExtensionRegistryLite extensionRegistry,
MergeTarget target)
throws IOException {
Descriptors.FieldDescriptor field = extension.descriptor;
Object value = target.parseMessage(input, extensionRegistry, field, extension.defaultInstance);
target.setField(field, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: eagerlyMergeMessageSetExtension
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
|
eagerlyMergeMessageSetExtension
|
java/core/src/main/java/com/google/protobuf/MessageReflection.java
|
a3888f53317a8018e7a439bac4abeb8f3425d5e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void removeUserReferences(String userId) throws DotDataException, DotStateException, ElasticsearchException, DotSecurityException {
DotConnect dc = new DotConnect();
User systemUser = null;
try {
systemUser = APILocator.getUserAPI().getSystemUser();
dc.setSQL("Select * from contentlet where mod_user = ?");
dc.addParam(userId);
List<HashMap<String, String>> contentInodes = dc.loadResults();
dc.setSQL("UPDATE contentlet set mod_user = ? where mod_user = ? ");
dc.addParam(systemUser.getUserId());
dc.addParam(userId);
dc.loadResult();
for(HashMap<String, String> ident:contentInodes){
String inode = ident.get("inode");
cc.remove(inode);
Contentlet content = find(inode);
new ESContentletIndexAPI().addContentToIndex(content);
}
} catch (DotDataException e) {
Logger.error(this.getClass(),e.getMessage(),e);
throw new DotDataException(e.getMessage(), e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeUserReferences
File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
removeUserReferences
|
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected Response newBrowserAuthentication(AuthenticationSessionModel authSession, boolean isPassive, boolean redirectToAuthentication, SamlProtocol samlProtocol) {
return super.newBrowserAuthentication(authSession, isPassive, redirectToAuthentication, createEcpSamlProtocol());
}
|
Vulnerability Classification:
- CWE: CWE-287
- CVE: CVE-2021-3827
- Severity: MEDIUM
- CVSS Score: 6.8
Description: KEYCLOAK-19177 Disable ECP flow by default for all Saml clients; ecp flow creates only transient users sessions
Function: newBrowserAuthentication
File: services/src/main/java/org/keycloak/protocol/saml/profile/ecp/SamlEcpProfileService.java
Repository: keycloak
Fixed Code:
@Override
protected Response newBrowserAuthentication(AuthenticationSessionModel authSession, boolean isPassive, boolean redirectToAuthentication, SamlProtocol samlProtocol) {
// Saml ECP flow creates only TRANSIENT user sessions
authSession.setClientNote(AuthenticationManager.USER_SESSION_PERSISTENT_STATE, UserSessionModel.SessionPersistenceState.TRANSIENT.toString());
return super.newBrowserAuthentication(authSession, isPassive, redirectToAuthentication, createEcpSamlProtocol());
}
|
[
"CWE-287"
] |
CVE-2021-3827
|
MEDIUM
| 6.8
|
keycloak
|
newBrowserAuthentication
|
services/src/main/java/org/keycloak/protocol/saml/profile/ecp/SamlEcpProfileService.java
|
44000caaf5051d7f218d1ad79573bd3d175cad0d
| 1
|
Analyze the following code function for security vulnerabilities
|
protected void cdataImpl(String data) {
xmlNode.appendChild(
getDocument().createCDATASection(data));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cdataImpl
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
cdataImpl
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean deleteRecording(File destDir, String recordingId, File recordingDir, String format) {
File metadataXml = recordingServiceHelper.getMetadataXmlLocation(recordingDir.getPath());
RecordingMetadata r = recordingServiceHelper.getRecordingMetadata(metadataXml);
if (r != null) {
if (!destDir.exists()) destDir.mkdirs();
try {
FileUtils.moveDirectory(recordingDir, new File(destDir.getPath() + File.separatorChar + recordingId));
r.setState(Recording.STATE_DELETED);
r.setPublished(false);
File medataXmlFile = recordingServiceHelper.getMetadataXmlLocation(
destDir.getAbsolutePath() + File.separatorChar + recordingId);
// Process the changes by saving the recording into metadata.xml
return recordingServiceHelper.saveRecordingMetadata(medataXmlFile, r);
} catch (IOException e) {
log.error("Failed to delete recording : " + recordingId, e);
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteRecording
File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
Repository: bigbluebutton
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-12443
|
HIGH
| 7.5
|
bigbluebutton
|
deleteRecording
|
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
|
b21ca8355a57286a1e6df96984b3a4c57679a463
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public LibraryInfo findLibrary(String libraryName, String localePrefix, String contract, FacesContext ctx) {
ClassLoader loader = Util.getCurrentLoader(this);
String basePath;
if (localePrefix == null) {
basePath = getBasePath(contract) + '/' + libraryName + '/';
} else {
basePath = getBasePath(contract)
+ '/'
+ localePrefix
+ '/'
+ libraryName
+ '/';
}
URL basePathURL = loader.getResource(basePath);
if (basePathURL == null) {
// try using this class' loader (necessary when running in OSGi)
basePathURL = this.getClass().getClassLoader().getResource(basePath);
if (basePathURL == null) {
return null;
}
}
return new LibraryInfo(libraryName, null, localePrefix, contract, this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findLibrary
File: impl/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-6950
|
MEDIUM
| 4.3
|
eclipse-ee4j/mojarra
|
findLibrary
|
impl/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java
|
cefbb9447e7be560e59da2da6bd7cb93776f7741
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setEndUserSessionMessage(
@NonNull ComponentName admin, @Nullable CharSequence endUserSessionMessage) {
throwIfParentInstance("setEndUserSessionMessage");
try {
mService.setEndUserSessionMessage(admin, endUserSessionMessage);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setEndUserSessionMessage
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
|
setEndUserSessionMessage
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String escape(String value) {
String fixedValue = '#' == value.charAt(0) ? "\"" + value + "\"" : value;
fixedValue = fixedValue.replace("\\", "\\\\");
return fixedValue;
}
|
Vulnerability Classification:
- CWE: CWE-269
- CVE: CVE-2022-31267
- Severity: HIGH
- CVSS Score: 7.5
Description: fix: Fix StoredUserConfig not escaping control characters
The `StoredUserConfig` only escaped the escape character, i.e. backslash.
But it does not escape control characters like tab or newline. This
introduces a vulnerability where an attacker can create new entries
in their user account and create new accounts.
In addition, other characters are also not properly handled. Field values
with a comment character need to be quoted. This only happens for the
`#` character and only when the value starts with it. Also the quote
is note escaped in values.
This change completely rewrites the `escape` method of `StoredUserConfig`.
It takes care of properly escaping characters that need escaping for the
git configuration file format.
This fixes #1410
Function: escape
File: src/main/java/com/gitblit/StoredUserConfig.java
Repository: gitblit-org/gitblit
Fixed Code:
private static String escape(String value) {
boolean quoteIt = false;
StringBuilder fixedValue = new StringBuilder(value.length() + 20);
for (char c : value.toCharArray()) {
switch (c) {
case '\n':
fixedValue.append("\\n");
break;
case '\t':
fixedValue.append("\\t");
break;
case '\b':
fixedValue.append("\\b");
break;
case '\\':
fixedValue.append("\\\\");
break;
case '"':
fixedValue.append("\\\"");
break;
case ';':
case '#':
quoteIt = true;
fixedValue.append(c);
break;
default:
fixedValue.append(c);
break;
}
}
if (quoteIt) {
fixedValue.insert(0,"\"");
fixedValue.append("\"");
}
return fixedValue.toString();
}
|
[
"CWE-269"
] |
CVE-2022-31267
|
HIGH
| 7.5
|
gitblit-org/gitblit
|
escape
|
src/main/java/com/gitblit/StoredUserConfig.java
|
9b4afad6f4be212474809533ec2c280cce86501a
| 1
|
Analyze the following code function for security vulnerabilities
|
public List<String> getFollows(String issueId) {
List<String> result = new ArrayList<>();
if (StringUtils.isBlank(issueId)) {
return result;
}
IssueFollowExample example = new IssueFollowExample();
example.createCriteria().andIssueIdEqualTo(issueId);
List<IssueFollow> follows = issueFollowMapper.selectByExample(example);
if (follows == null || follows.size() == 0) {
return result;
}
result = follows.stream().map(IssueFollow::getFollowId).distinct().collect(Collectors.toList());
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFollows
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
getFollows
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
private void assertOverlayIsValid(AndroidPackage pkg,
@ParsingPackageUtils.ParseFlags int parseFlags,
@PackageManagerService.ScanFlags int scanFlags) throws PackageManagerException {
// System overlays have some restrictions on their use of the 'static' state.
if ((scanFlags & SCAN_AS_SYSTEM) != 0) {
// We are scanning a system overlay. This can be the first scan of the
// system/vendor/oem partition, or an update to the system overlay.
if ((parseFlags & ParsingPackageUtils.PARSE_IS_SYSTEM_DIR) == 0) {
// This must be an update to a system overlay. Immutable overlays cannot be
// upgraded.
if (!mPm.isOverlayMutable(pkg.getPackageName())) {
throw new PackageManagerException("Overlay "
+ pkg.getPackageName()
+ " is static and cannot be upgraded.");
}
} else {
if ((scanFlags & SCAN_AS_VENDOR) != 0) {
if (pkg.getTargetSdkVersion() < ScanPackageUtils.getVendorPartitionVersion()) {
Slog.w(TAG, "System overlay " + pkg.getPackageName()
+ " targets an SDK below the required SDK level of vendor"
+ " overlays ("
+ ScanPackageUtils.getVendorPartitionVersion()
+ ")."
+ " This will become an install error in a future release");
}
} else if (pkg.getTargetSdkVersion() < Build.VERSION.SDK_INT) {
Slog.w(TAG, "System overlay " + pkg.getPackageName()
+ " targets an SDK below the required SDK level of system"
+ " overlays (" + Build.VERSION.SDK_INT + ")."
+ " This will become an install error in a future release");
}
}
} else {
// A non-preloaded overlay packages must have targetSdkVersion >= Q, or be
// signed with the platform certificate. Check this in increasing order of
// computational cost.
if (pkg.getTargetSdkVersion() < Build.VERSION_CODES.Q) {
final PackageSetting platformPkgSetting =
mPm.mSettings.getPackageLPr("android");
if (!comparePackageSignatures(platformPkgSetting,
pkg.getSigningDetails().getSignatures())) {
throw new PackageManagerException("Overlay "
+ pkg.getPackageName()
+ " must target Q or later, "
+ "or be signed with the platform certificate");
}
}
// A non-preloaded overlay package, without <overlay android:targetName>, will
// only be used if it is signed with the same certificate as its target OR if
// it is signed with the same certificate as a reference package declared
// in 'overlay-config-signature' tag of SystemConfig.
// If the target is already installed or 'overlay-config-signature' tag in
// SystemConfig is set, check this here to augment the last line of defense
// which is OMS.
if (pkg.getOverlayTargetOverlayableName() == null) {
final PackageSetting targetPkgSetting =
mPm.mSettings.getPackageLPr(pkg.getOverlayTarget());
if (targetPkgSetting != null) {
if (!comparePackageSignatures(targetPkgSetting,
pkg.getSigningDetails().getSignatures())) {
// check reference signature
if (mPm.mOverlayConfigSignaturePackage == null) {
throw new PackageManagerException("Overlay "
+ pkg.getPackageName() + " and target "
+ pkg.getOverlayTarget() + " signed with"
+ " different certificates, and the overlay lacks"
+ " <overlay android:targetName>");
}
final PackageSetting refPkgSetting =
mPm.mSettings.getPackageLPr(
mPm.mOverlayConfigSignaturePackage);
if (!comparePackageSignatures(refPkgSetting,
pkg.getSigningDetails().getSignatures())) {
throw new PackageManagerException("Overlay "
+ pkg.getPackageName() + " signed with a different "
+ "certificate than both the reference package and "
+ "target " + pkg.getOverlayTarget() + ", and the "
+ "overlay lacks <overlay android:targetName>");
}
}
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: assertOverlayIsValid
File: services/core/java/com/android/server/pm/InstallPackageHelper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21257
|
HIGH
| 7.8
|
android
|
assertOverlayIsValid
|
services/core/java/com/android/server/pm/InstallPackageHelper.java
|
1aec7feaf07e6d4568ca75d18158445dbeac10f6
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Response attachToPost(Long messageKey, String filename, InputStream file, HttpServletRequest request) {
//load message
Message mess = fom.loadMessage(messageKey);
if(mess == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
if(!forum.equalsByPersistableKey(mess.getForum())) {
return Response.serverError().status(Status.CONFLICT).build();
}
return attachToPost(mess, filename, file, request);
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-41242
- Severity: HIGH
- CVSS Score: 7.9
Description: OO-5819: container can only create file in its own path
Function: attachToPost
File: src/main/java/org/olat/modules/fo/restapi/ForumWebService.java
Repository: OpenOLAT
Fixed Code:
private Response attachToPost(Long messageKey, String filename, InputStream file, HttpServletRequest request) {
//load message
Message mess = fom.loadMessage(messageKey);
if(mess == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
if(!forum.equalsByPersistableKey(mess.getForum())) {
return Response.serverError().status(Status.CONFLICT).build();
}
return attachToPost(mess, filename, file, request);
}
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
attachToPost
|
src/main/java/org/olat/modules/fo/restapi/ForumWebService.java
|
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
| 1
|
Analyze the following code function for security vulnerabilities
|
public void visitUris(@NonNull Consumer<Uri> visitor) {
visitor.accept(sound);
if (tickerView != null) tickerView.visitUris(visitor);
if (contentView != null) contentView.visitUris(visitor);
if (bigContentView != null) bigContentView.visitUris(visitor);
if (headsUpContentView != null) headsUpContentView.visitUris(visitor);
visitIconUri(visitor, mSmallIcon);
visitIconUri(visitor, mLargeIcon);
if (actions != null) {
for (Action action : actions) {
visitIconUri(visitor, action.getIcon());
}
}
if (extras != null) {
visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class));
visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class));
// NOTE: The documentation of EXTRA_AUDIO_CONTENTS_URI explicitly says that it is a
// String representation of a Uri, but the previous implementation (and unit test) of
// this method has always treated it as a Uri object. Given the inconsistency,
// supporting both going forward is the safest choice.
Object audioContentsUri = extras.get(EXTRA_AUDIO_CONTENTS_URI);
if (audioContentsUri instanceof Uri) {
visitor.accept((Uri) audioContentsUri);
} else if (audioContentsUri instanceof String) {
visitor.accept(Uri.parse((String) audioContentsUri));
}
if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) {
visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI)));
}
ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST);
if (people != null && !people.isEmpty()) {
for (Person p : people) {
visitor.accept(p.getIconUri());
}
}
final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
if (person != null) {
visitor.accept(person.getIconUri());
}
}
if (isStyle(MessagingStyle.class) && extras != null) {
final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES);
if (!ArrayUtils.isEmpty(messages)) {
for (MessagingStyle.Message message : MessagingStyle.Message
.getMessagesFromBundleArray(messages)) {
visitor.accept(message.getDataUri());
Person senderPerson = message.getSenderPerson();
if (senderPerson != null) {
visitor.accept(senderPerson.getIconUri());
}
}
}
final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES);
if (!ArrayUtils.isEmpty(historic)) {
for (MessagingStyle.Message message : MessagingStyle.Message
.getMessagesFromBundleArray(historic)) {
visitor.accept(message.getDataUri());
Person senderPerson = message.getSenderPerson();
if (senderPerson != null) {
visitor.accept(senderPerson.getIconUri());
}
}
}
}
if (mBubbleMetadata != null) {
visitIconUri(visitor, mBubbleMetadata.getIcon());
}
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-21239
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Grant URI permissions to the CallStyle-related ones
This will also verify that the caller app can actually grant them.
Fix: 274592467
Test: atest NotificationManagerServiceTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4dee5aab12e95cd8b4d663ad050f07b0f2433596)
Merged-In: I83429f9e63e51c615a6e3f03befb76bb5b8ea7fc
Change-Id: I83429f9e63e51c615a6e3f03befb76bb5b8ea7fc
Function: visitUris
File: core/java/android/app/Notification.java
Repository: android
Fixed Code:
public void visitUris(@NonNull Consumer<Uri> visitor) {
visitor.accept(sound);
if (tickerView != null) tickerView.visitUris(visitor);
if (contentView != null) contentView.visitUris(visitor);
if (bigContentView != null) bigContentView.visitUris(visitor);
if (headsUpContentView != null) headsUpContentView.visitUris(visitor);
visitIconUri(visitor, mSmallIcon);
visitIconUri(visitor, mLargeIcon);
if (actions != null) {
for (Action action : actions) {
visitIconUri(visitor, action.getIcon());
}
}
if (extras != null) {
visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class));
visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class));
// NOTE: The documentation of EXTRA_AUDIO_CONTENTS_URI explicitly says that it is a
// String representation of a Uri, but the previous implementation (and unit test) of
// this method has always treated it as a Uri object. Given the inconsistency,
// supporting both going forward is the safest choice.
Object audioContentsUri = extras.get(EXTRA_AUDIO_CONTENTS_URI);
if (audioContentsUri instanceof Uri) {
visitor.accept((Uri) audioContentsUri);
} else if (audioContentsUri instanceof String) {
visitor.accept(Uri.parse((String) audioContentsUri));
}
if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) {
visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI)));
}
ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST);
if (people != null && !people.isEmpty()) {
for (Person p : people) {
visitor.accept(p.getIconUri());
}
}
final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
if (person != null) {
visitor.accept(person.getIconUri());
}
}
if (isStyle(MessagingStyle.class) && extras != null) {
final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES);
if (!ArrayUtils.isEmpty(messages)) {
for (MessagingStyle.Message message : MessagingStyle.Message
.getMessagesFromBundleArray(messages)) {
visitor.accept(message.getDataUri());
Person senderPerson = message.getSenderPerson();
if (senderPerson != null) {
visitor.accept(senderPerson.getIconUri());
}
}
}
final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES);
if (!ArrayUtils.isEmpty(historic)) {
for (MessagingStyle.Message message : MessagingStyle.Message
.getMessagesFromBundleArray(historic)) {
visitor.accept(message.getDataUri());
Person senderPerson = message.getSenderPerson();
if (senderPerson != null) {
visitor.accept(senderPerson.getIconUri());
}
}
}
}
if (isStyle(CallStyle.class) & extras != null) {
Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON);
if (callPerson != null) {
visitor.accept(callPerson.getIconUri());
}
visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON));
}
if (mBubbleMetadata != null) {
visitIconUri(visitor, mBubbleMetadata.getIcon());
}
}
|
[
"CWE-Other"
] |
CVE-2023-21239
|
MEDIUM
| 5.5
|
android
|
visitUris
|
core/java/android/app/Notification.java
|
c451aa5710e1da19139eb3716e39a5d6f04de5c2
| 1
|
Analyze the following code function for security vulnerabilities
|
void clearFrozenInsetsState() {
mFrozenInsetsState = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearFrozenInsetsState
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
clearFrozenInsetsState
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void handleIssueUpdate(IssuesUpdateRequest request) {
request.setUpdateTime(System.currentTimeMillis());
issuesMapper.updateByPrimaryKeySelective(request);
handleTestCaseIssues(request);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleIssueUpdate
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
handleIssueUpdate
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public void initCategoryUrl(SysSite site, CmsCategory entity) {
if (!entity.isOnlyUrl()) {
entity.setUrl(getUrl(site, entity.isHasStatic(), entity.getUrl()));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initCategoryUrl
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2020-20914
|
CRITICAL
| 9.8
|
sanluan/PublicCMS
|
initCategoryUrl
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
|
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
boolean isActiveAdminWithPolicyForUserLocked(ActiveAdmin admin, int reqPolicy,
int userId) {
ensureLocked();
final boolean ownsDevice = isDeviceOwner(admin.info.getComponent(), userId);
final boolean ownsProfile = isProfileOwner(admin.info.getComponent(), userId);
boolean allowedToUsePolicy = ownsDevice || ownsProfile
|| !DA_DISALLOWED_POLICIES.contains(reqPolicy)
|| getTargetSdk(admin.info.getPackageName(), userId) < Build.VERSION_CODES.Q;
return allowedToUsePolicy && admin.info.usesPolicy(reqPolicy);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isActiveAdminWithPolicyForUserLocked
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
|
isActiveAdminWithPolicyForUserLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDumpCheckIn(boolean dumpCheckIn) {
mDumpCheckIn = dumpCheckIn;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDumpCheckIn
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
setDumpCheckIn
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void cacheSystemId(String systemId, byte[] content) {
initCaches();
m_cachePermanent.put(systemId, content);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cacheSystemId
File: src/org/opencms/xml/CmsXmlEntityResolver.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-3312
|
MEDIUM
| 4
|
alkacon/opencms-core
|
cacheSystemId
|
src/org/opencms/xml/CmsXmlEntityResolver.java
|
92e035423aa6967822d343e54392d4291648c0ee
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onStartedWakingUp() {
mDeviceInteractive = true;
mStackScroller.setAnimationsEnabled(true);
mVisualStabilityManager.setScreenOn(true);
mNotificationPanel.setTouchDisabled(false);
updateVisibleToUser();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStartedWakingUp
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
|
onStartedWakingUp
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void doDispose() {
//autodisposed by BasicController
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doDispose
File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdUnzip.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41152
|
MEDIUM
| 4
|
OpenOLAT
|
doDispose
|
src/main/java/org/olat/core/commons/modules/bc/commands/CmdUnzip.java
|
418bb509ffcb0e25ab4390563c6c47f0458583eb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void goToNavigationIndex(int index) {
if (mWebContents != null) {
mWebContents.getNavigationController().goToNavigationIndex(index);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: goToNavigationIndex
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
|
goToNavigationIndex
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
protected XWikiDocument prepareDocument(HttpServletRequest request, EditForm editForm, ChangeRequest changeRequest)
throws ChangeRequestException
{
XWikiContext context = this.contextProvider.get();
String serializedDocReference = request.getParameter("docReference");
DocumentReference documentReference = this.documentReferenceResolver.resolve(serializedDocReference);
XWikiDocument modifiedDocument = null;
try {
if (isFromChangeRequest(request) && changeRequest != null) {
List<FileChange> fileChangeList = this.fileChangeStorageManager.load(changeRequest, documentReference);
String previousVersion = getPreviousVersion(request);
FileChange fileChange = null;
for (FileChange change : fileChangeList) {
if (change.getVersion().equals(previousVersion)) {
fileChange = change;
break;
}
}
if (fileChange != null) {
modifiedDocument = (XWikiDocument) fileChange.getModifiedDocument();
} else {
throw new ChangeRequestException(
String.format("Cannot find file change with version [%s]", previousVersion));
}
} else {
modifiedDocument = context.getWiki().getDocument(documentReference, context);
}
// cloning the document to ensure we don't impact the document in cache.
modifiedDocument = modifiedDocument.clone();
// Read info from the template if there's one.
if (!StringUtils.isBlank(editForm.getTemplate())) {
DocumentReference templateRef =
this.currentMixedDocumentReferenceResolver.resolve(editForm.getTemplate());
// Check that the template can be read by current user.
if (this.contextualAuthorizationManager.hasAccess(Right.VIEW, templateRef)) {
modifiedDocument.readFromTemplate(templateRef, context);
}
}
modifiedDocument.readFromForm(editForm, context);
if (modifiedDocument.getDefaultLocale() == Locale.ROOT) {
modifiedDocument.setDefaultLocale(context.getWiki().getLocalePreference(context));
}
return modifiedDocument;
} catch (XWikiException e) {
throw new ChangeRequestException(
String.format("Cannot read document [%s]", serializedDocReference), e);
}
}
|
Vulnerability Classification:
- CWE: CWE-522
- CVE: CVE-2023-49280
- Severity: MEDIUM
- CVSS Score: 6.5
Description: CRAPP-302: Edit button is not displayed for guest user
* Change the way to deal with change request edition right
Function: prepareDocument
File: application-changerequest-default/src/main/java/org/xwiki/contrib/changerequest/internal/handlers/AbstractChangeRequestActionHandler.java
Repository: xwiki-contrib/application-changerequest
Fixed Code:
protected XWikiDocument prepareDocument(HttpServletRequest request, EditForm editForm, ChangeRequest changeRequest)
throws ChangeRequestException
{
XWikiContext context = this.contextProvider.get();
String serializedDocReference = request.getParameter("docReference");
DocumentReference documentReference = this.documentReferenceResolver.resolve(serializedDocReference);
UserReference currentUserReference = this.currentUserReferenceResolver.resolve(CurrentUserReference.INSTANCE);
if (!this.changeRequestRightsManager.isEditWithChangeRequestAllowed(currentUserReference, documentReference)) {
throw new ChangeRequestException(
String.format("User [%s] is not allowed to edit the document [%s] through a change request.",
currentUserReference, documentReference));
}
XWikiDocument modifiedDocument = null;
try {
if (isFromChangeRequest(request) && changeRequest != null) {
List<FileChange> fileChangeList = this.fileChangeStorageManager.load(changeRequest, documentReference);
String previousVersion = getPreviousVersion(request);
FileChange fileChange = null;
for (FileChange change : fileChangeList) {
if (change.getVersion().equals(previousVersion)) {
fileChange = change;
break;
}
}
if (fileChange != null) {
modifiedDocument = (XWikiDocument) fileChange.getModifiedDocument();
} else {
throw new ChangeRequestException(
String.format("Cannot find file change with version [%s]", previousVersion));
}
} else {
modifiedDocument = context.getWiki().getDocument(documentReference, context);
}
// cloning the document to ensure we don't impact the document in cache.
modifiedDocument = modifiedDocument.clone();
// Read info from the template if there's one.
if (!StringUtils.isBlank(editForm.getTemplate())) {
DocumentReference templateRef =
this.currentMixedDocumentReferenceResolver.resolve(editForm.getTemplate());
// Check that the template can be read by current user.
if (this.contextualAuthorizationManager.hasAccess(Right.VIEW, templateRef)) {
modifiedDocument.readFromTemplate(templateRef, context);
}
}
modifiedDocument.readFromForm(editForm, context);
if (modifiedDocument.getDefaultLocale() == Locale.ROOT) {
modifiedDocument.setDefaultLocale(context.getWiki().getLocalePreference(context));
}
return modifiedDocument;
} catch (XWikiException e) {
throw new ChangeRequestException(
String.format("Cannot read document [%s]", serializedDocReference), e);
}
}
|
[
"CWE-522"
] |
CVE-2023-49280
|
MEDIUM
| 6.5
|
xwiki-contrib/application-changerequest
|
prepareDocument
|
application-changerequest-default/src/main/java/org/xwiki/contrib/changerequest/internal/handlers/AbstractChangeRequestActionHandler.java
|
ff0f5368ea04f0e4aa7b33821c707dc68a8c5ca8
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean isOpenQsEvent(MotionEvent event) {
final int pointerCount = event.getPointerCount();
final int action = event.getActionMasked();
final boolean twoFingerDrag = action == MotionEvent.ACTION_POINTER_DOWN
&& pointerCount == 2;
final boolean stylusButtonClickDrag = action == MotionEvent.ACTION_DOWN
&& (event.isButtonPressed(MotionEvent.BUTTON_STYLUS_PRIMARY)
|| event.isButtonPressed(MotionEvent.BUTTON_STYLUS_SECONDARY));
final boolean mouseButtonClickDrag = action == MotionEvent.ACTION_DOWN
&& (event.isButtonPressed(MotionEvent.BUTTON_SECONDARY)
|| event.isButtonPressed(MotionEvent.BUTTON_TERTIARY));
return twoFingerDrag || stylusButtonClickDrag || mouseButtonClickDrag;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOpenQsEvent
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
isOpenQsEvent
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isProfileEnabled(int profileId) {
final long identity = Binder.clearCallingIdentity();
try {
UserInfo userInfo = mUserManager.getUserInfo(profileId);
if (userInfo == null || !userInfo.isEnabled()) {
return false;
}
} finally {
Binder.restoreCallingIdentity(identity);
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isProfileEnabled
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
isProfileEnabled
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Object createMutableImage(int width, int height, int fillColor) {
Bitmap bitmap = Bitmap.createBitmap(width, height,
Bitmap.Config.ARGB_8888);
AndroidGraphics graphics = (AndroidGraphics) this.getNativeGraphics(bitmap);
graphics.fillBitmap(fillColor);
return bitmap;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createMutableImage
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
|
createMutableImage
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getAttributePrefix(int index) {
throw new RuntimeException("getAttributePrefix not supported");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttributePrefix
File: core/java/android/content/res/XmlBlock.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
getAttributePrefix
|
core/java/android/content/res/XmlBlock.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String, String> getServerVariables() {
return serverVariables;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServerVariables
File: samples/client/petstore/java/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
|
getServerVariables
|
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ComplexData convertToComplexData(HttpServletRequest request, String name) {
MultipartHttpServletRequest mRequest = (MultipartHttpServletRequest) request;
MultipartFile file = mRequest.getFile(name);
if (file != null && file.getSize() > 0) {
try {
return new ComplexData(file.getOriginalFilename(), file.getInputStream());
}
catch (IOException e) {
throw new IllegalArgumentException(e);
}
} else {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertToComplexData
File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
Repository: openmrs/openmrs-module-htmlformentry
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-16521
|
HIGH
| 7.5
|
openmrs/openmrs-module-htmlformentry
|
convertToComplexData
|
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
|
9dcd304688e65c31cac5532fe501b9816ed975ae
| 0
|
Analyze the following code function for security vulnerabilities
|
void setTlsChannelId(long sslNativePointer, OpenSSLKey channelIdPrivateKey)
throws SSLHandshakeException, SSLException {
// TLS Channel ID
if (channelIdEnabled) {
if (client_mode) {
// Client-side TLS Channel ID
if (channelIdPrivateKey == null) {
throw new SSLHandshakeException("Invalid TLS channel ID key specified");
}
NativeCrypto.SSL_set1_tls_channel_id(sslNativePointer,
channelIdPrivateKey.getNativeRef());
} else {
// Server-side TLS Channel ID
NativeCrypto.SSL_enable_tls_channel_id(sslNativePointer);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTlsChannelId
File: src/main/java/org/conscrypt/SSLParametersImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3840
|
HIGH
| 10
|
android
|
setTlsChannelId
|
src/main/java/org/conscrypt/SSLParametersImpl.java
|
5af5e93463f4333187e7e35f3bd2b846654aa214
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getPackageName() {
return mPackageName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPackageName
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21280
|
MEDIUM
| 5.5
|
android
|
getPackageName
|
services/core/java/com/android/server/media/MediaSessionRecord.java
|
06e772e05514af4aa427641784c5eec39a892ed3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int countDocuments(String wheresql, XWikiContext context) throws XWikiException
{
String sql = createSQLQuery("select count(distinct doc.fullName)", wheresql);
List<Number> l = search(sql, 0, 0, context);
return l.get(0).intValue();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: countDocuments
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
countDocuments
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
final void addFloat(CharSequence name, float value) {
add(name, String.valueOf(value));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addFloat
File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2019-16771
|
MEDIUM
| 5
|
line/armeria
|
addFloat
|
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.