instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
protected void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException {
checkAndSetEncodedKey(opmode, key);
try {
engineInitInternal(this.encodedKey, null, random);
} catch (InvalidAlgorithmParameterException e) {
// This can't actually happen since we pass in null.
throw new RuntimeException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: engineInit
File: src/main/java/org/conscrypt/OpenSSLCipher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2461
|
HIGH
| 7.6
|
android
|
engineInit
|
src/main/java/org/conscrypt/OpenSSLCipher.java
|
1638945d4ed9403790962ec7abed1b7a232a9ff8
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setArgumentQuoteDelimiter( char argQuoteDelimiter )
{
this.argQuoteDelimiter = argQuoteDelimiter;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setArgumentQuoteDelimiter
File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2017-1000487
|
HIGH
| 7.5
|
codehaus-plexus/plexus-utils
|
setArgumentQuoteDelimiter
|
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
private void addAddressesToRecipientList(
final List<String> recipients, final String addressString) {
if (recipients == null) {
throw new IllegalArgumentException("recipientList cannot be null");
}
if (TextUtils.isEmpty(addressString)) {
return;
}
final Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(addressString);
for (final Rfc822Token token : tokens) {
recipients.add(token.getAddress());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addAddressesToRecipientList
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
|
addAddressesToRecipientList
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public SearchResult getForAdministrativeRead(SearchQuery q) throws SearchException, UnauthorizedException {
User user = securityService.getUser();
if (!user.hasRole(GLOBAL_ADMIN_ROLE) && !user.hasRole(user.getOrganization().getAdminRole()))
throw new UnauthorizedException(user, getClass().getName() + ".getForAdministrativeRead");
try {
return solrRequester.getForAdministrativeRead(q);
} catch (SolrServerException e) {
throw new SearchException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getForAdministrativeRead
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
|
getForAdministrativeRead
|
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
|
b18c6a7f81f08ed14884592a6c14c9ab611ad450
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateServerStatusIconAndText(RemoteOperationResult result) {
mServerStatusIcon = R.drawable.ic_alert; // the most common case in the switch below
switch (result.getCode()) {
case OK_SSL:
mServerStatusIcon = R.drawable.ic_lock_white;
mServerStatusText = getResources().getString(R.string.auth_secure_connection);
break;
case OK_NO_SSL:
case OK:
if (mHostUrlInput.getText().toString().trim().toLowerCase(Locale.ROOT).startsWith(HTTP_PROTOCOL)) {
mServerStatusText = getResources().getString(R.string.auth_connection_established);
mServerStatusIcon = R.drawable.ic_ok;
} else {
mServerStatusText = getResources().getString(R.string.auth_nossl_plain_ok_title);
mServerStatusIcon = R.drawable.ic_lock_open_white;
}
break;
case NO_NETWORK_CONNECTION:
mServerStatusIcon = R.drawable.no_network;
mServerStatusText = getResources().getString(R.string.auth_no_net_conn_title);
break;
case SSL_RECOVERABLE_PEER_UNVERIFIED:
mServerStatusText = getResources().getString(R.string.auth_ssl_unverified_server_title);
break;
case BAD_OC_VERSION:
mServerStatusText = getResources().getString(R.string.auth_bad_oc_version_title);
break;
case WRONG_CONNECTION:
mServerStatusText = getResources().getString(R.string.auth_wrong_connection_title);
break;
case TIMEOUT:
mServerStatusText = getResources().getString(R.string.auth_timeout_title);
break;
case INCORRECT_ADDRESS:
mServerStatusText = getResources().getString(R.string.auth_incorrect_address_title);
break;
case SSL_ERROR:
mServerStatusText = getResources().getString(R.string.auth_ssl_general_error_title);
break;
case UNAUTHORIZED:
mServerStatusText = getResources().getString(R.string.auth_unauthorized);
break;
case HOST_NOT_AVAILABLE:
mServerStatusText = getResources().getString(R.string.auth_unknown_host_title);
break;
case INSTANCE_NOT_CONFIGURED:
mServerStatusText = getResources().getString(R.string.auth_not_configured_title);
break;
case FILE_NOT_FOUND:
mServerStatusText = getResources().getString(R.string.auth_incorrect_path_title);
break;
case OAUTH2_ERROR:
mServerStatusText = getResources().getString(R.string.auth_oauth_error);
break;
case OAUTH2_ERROR_ACCESS_DENIED:
mServerStatusText = getResources().getString(R.string.auth_oauth_error_access_denied);
break;
case UNHANDLED_HTTP_CODE:
mServerStatusText = getResources().getString(R.string.auth_unknown_error_http_title);
break;
case UNKNOWN_ERROR:
if (result.getException() != null &&
!TextUtils.isEmpty(result.getException().getMessage())) {
mServerStatusText = getResources().getString(
R.string.auth_unknown_error_exception_title,
result.getException().getMessage()
);
} else {
mServerStatusText = getResources().getString(R.string.auth_unknown_error_title);
}
break;
case OK_REDIRECT_TO_NON_SECURE_CONNECTION:
mServerStatusIcon = R.drawable.ic_lock_open_white;
mServerStatusText = getResources().getString(R.string.auth_redirect_non_secure_connection_title);
break;
case MAINTENANCE_MODE:
mServerStatusText = getResources().getString(R.string.maintenance_mode);
break;
case UNTRUSTED_DOMAIN:
mServerStatusText = getResources().getString(R.string.untrusted_domain);
break;
default:
mServerStatusText = EMPTY_STRING;
mServerStatusIcon = 0;
break;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateServerStatusIconAndText
File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-248"
] |
CVE-2021-32694
|
MEDIUM
| 4.3
|
nextcloud/android
|
updateServerStatusIconAndText
|
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
|
9343bdd85d70625a90e0c952897957a102c2421b
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setTargetRootTaskIfNeeded(ActivityRecord intentActivity) {
intentActivity.getTaskFragment().clearLastPausedActivity();
Task intentTask = intentActivity.getTask();
if (mTargetRootTask == null) {
// Update launch target task when it is not indicated.
if (mSourceRecord != null && mSourceRecord.mLaunchRootTask != null) {
// Inherit the target-root-task from source to ensure trampoline activities will be
// launched into the same root task.
mTargetRootTask = Task.fromWindowContainerToken(mSourceRecord.mLaunchRootTask);
} else {
mTargetRootTask = getOrCreateRootTask(mStartActivity, mLaunchFlags, intentTask,
mOptions);
}
} else {
// If a launch target indicated, and the matching task is already in the adjacent task
// of the launch target. Adjust to use the adjacent task as its launch target. So the
// existing task will be launched into the closer one and won't be reparent redundantly.
// TODO(b/231541706): Migrate the logic to wm-shell after having proper APIs to help
// resolve target task without actually starting the activity.
final Task adjacentTargetTask = mTargetRootTask.getAdjacentTaskFragment() != null
? mTargetRootTask.getAdjacentTaskFragment().asTask() : null;
if (adjacentTargetTask != null && intentActivity.isDescendantOf(adjacentTargetTask)) {
mTargetRootTask = adjacentTargetTask;
}
}
// If the target task is not in the front, then we need to bring it to the front...
// except... well, with SINGLE_TASK_LAUNCH it's not entirely clear. We'd like to have
// the same behavior as if a new instance was being started, which means not bringing it
// to the front if the caller is not itself in the front.
final boolean differentTopTask;
if (mTargetRootTask.getDisplayArea() == mPreferredTaskDisplayArea) {
final Task focusRootTask = mTargetRootTask.mDisplayContent.getFocusedRootTask();
final ActivityRecord curTop = (focusRootTask == null)
? null : focusRootTask.topRunningNonDelayedActivityLocked(mNotTop);
final Task topTask = curTop != null ? curTop.getTask() : null;
differentTopTask = topTask != intentTask
|| (focusRootTask != null && topTask != focusRootTask.getTopMostTask());
} else {
// The existing task should always be different from those in other displays.
differentTopTask = true;
}
if (differentTopTask && !mAvoidMoveToFront) {
mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
if (mSourceRecord == null || (mSourceRootTask.getTopNonFinishingActivity() != null
&& mSourceRootTask.getTopNonFinishingActivity().getTask()
== mSourceRecord.getTask())) {
// We really do want to push this one into the user's face, right now.
if (mLaunchTaskBehind && mSourceRecord != null) {
intentActivity.setTaskToAffiliateWith(mSourceRecord.getTask());
}
if (intentActivity.isDescendantOf(mTargetRootTask)) {
// TODO(b/151572268): Figure out a better way to move tasks in above 2-levels
// tasks hierarchies.
if (mTargetRootTask != intentTask
&& mTargetRootTask != intentTask.getParent().asTask()) {
intentTask.getParent().positionChildAt(POSITION_TOP, intentTask,
false /* includingParents */);
intentTask = intentTask.getParent().asTaskFragment().getTask();
}
// If the activity is visible in multi-windowing mode, it may already be on
// the top (visible to user but not the global top), then the result code
// should be START_DELIVERED_TO_TOP instead of START_TASK_TO_FRONT.
final boolean wasTopOfVisibleRootTask = intentActivity.mVisibleRequested
&& intentActivity.inMultiWindowMode()
&& intentActivity == mTargetRootTask.topRunningActivity();
// We only want to move to the front, if we aren't going to launch on a
// different root task. If we launch on a different root task, we will put the
// task on top there.
// Defer resuming the top activity while moving task to top, since the
// current task-top activity may not be the activity that should be resumed.
mTargetRootTask.moveTaskToFront(intentTask, mNoAnimation, mOptions,
mStartActivity.appTimeTracker, DEFER_RESUME,
"bringingFoundTaskToFront");
mMovedToFront = !wasTopOfVisibleRootTask;
} else if (intentActivity.getWindowingMode() != WINDOWING_MODE_PINNED) {
// Leaves reparenting pinned task operations to task organizer to make sure it
// dismisses pinned task properly.
// TODO(b/199997762): Consider leaving all reparent operation of organized tasks
// to task organizer.
intentTask.reparent(mTargetRootTask, ON_TOP, REPARENT_MOVE_ROOT_TASK_TO_FRONT,
ANIMATE, DEFER_RESUME, "reparentToTargetRootTask");
mMovedToFront = true;
}
mOptions = null;
}
}
// Update the target's launch cookie to those specified in the options if set
if (mStartActivity.mLaunchCookie != null) {
intentActivity.mLaunchCookie = mStartActivity.mLaunchCookie;
}
// Need to update mTargetRootTask because if task was moved out of it, the original root
// task may be destroyed.
mTargetRootTask = intentActivity.getRootTask();
mSupervisor.handleNonResizableTaskIfNeeded(intentTask, WINDOWING_MODE_UNDEFINED,
mRootWindowContainer.getDefaultTaskDisplayArea(), mTargetRootTask);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTargetRootTaskIfNeeded
File: services/core/java/com/android/server/wm/ActivityStarter.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-269"
] |
CVE-2023-21269
|
HIGH
| 7.8
|
android
|
setTargetRootTaskIfNeeded
|
services/core/java/com/android/server/wm/ActivityStarter.java
|
70ec64dc5a2a816d6aa324190a726a85fd749b30
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String quoteArgument( String argument )
throws CommandLineException
{
return CommandLineUtils.quote( argument );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: quoteArgument
File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2017-1000487
|
HIGH
| 7.5
|
codehaus-plexus/plexus-utils
|
quoteArgument
|
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
void scheduleUpdateBinderHeavyHitterWatcherConfig() {
// There are two sets of configs: the default watcher and the auto sampler,
// the default one takes precedence. System would kick off auto sampler when there is
// an anomaly (i.e., consecutive ANRs), but it'll be stopped automatically after a while.
mHandler.post(() -> {
final boolean enabled;
final int batchSize;
final float threshold;
final BinderCallHeavyHitterListener listener;
synchronized (mProcLock) {
if (mConstants.BINDER_HEAVY_HITTER_WATCHER_ENABLED) {
// Default watcher takes precedence, ignore the auto sampler.
mHandler.removeMessages(BINDER_HEAVYHITTER_AUTOSAMPLER_TIMEOUT_MSG);
// Set the watcher with the default watcher's config
enabled = true;
batchSize = mConstants.BINDER_HEAVY_HITTER_WATCHER_BATCHSIZE;
threshold = mConstants.BINDER_HEAVY_HITTER_WATCHER_THRESHOLD;
listener = (a, b, c, d) -> mHandler.post(
() -> handleBinderHeavyHitters(a, b, c, d));
} else if (mHandler.hasMessages(BINDER_HEAVYHITTER_AUTOSAMPLER_TIMEOUT_MSG)) {
// There is an ongoing auto sampler session, update it
enabled = mConstants.BINDER_HEAVY_HITTER_AUTO_SAMPLER_ENABLED;
batchSize = mConstants.BINDER_HEAVY_HITTER_AUTO_SAMPLER_BATCHSIZE;
threshold = mConstants.BINDER_HEAVY_HITTER_AUTO_SAMPLER_THRESHOLD;
listener = (a, b, c, d) -> mHandler.post(
() -> handleBinderHeavyHitters(a, b, c, d));
} else {
// Stop it
enabled = false;
batchSize = 0;
threshold = 0.0f;
listener = null;
}
}
Binder.setHeavyHitterWatcherConfig(enabled, batchSize, threshold, listener);
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scheduleUpdateBinderHeavyHitterWatcherConfig
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
|
scheduleUpdateBinderHeavyHitterWatcherConfig
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void includeResource(ServletRequest request, Response response, RequestDispatcher dispatch)
throws ServletException, IOException {
dispatch.include(request, response);
// we need to re-configure the content length because Tomcat will truncate the output with the size of the welcome page
// (eg.: index.html).
response.getCoyoteResponse().setContentLength(response.getContentCount());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: includeResource
File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
Repository: picketlink/picketlink-bindings
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3158
|
MEDIUM
| 4
|
picketlink/picketlink-bindings
|
includeResource
|
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
|
341a37aefd69e67b6b5f6d775499730d6ccaff0d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getLaunchedFromUid(IBinder activityToken) {
return ActivityClient.getInstance().getLaunchedFromUid(activityToken);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLaunchedFromUid
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
|
getLaunchedFromUid
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void loadXWikiCollectionInternal(BaseCollection object, XWikiContext context, boolean bTransaction,
boolean alreadyLoaded) throws XWikiException
{
loadXWikiCollectionInternal(object, null, context, bTransaction, alreadyLoaded);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadXWikiCollectionInternal
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
|
loadXWikiCollectionInternal
|
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
|
void answer(Call call, int videoState) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("answer")) {
try {
logOutgoing("answer %s %d", callId, videoState);
if (VideoProfile.isAudioOnly(videoState)) {
mServiceInterface.answer(callId, Log.getExternalSession(TELECOM_ABBREVIATION));
} else {
mServiceInterface.answerVideo(callId, videoState,
Log.getExternalSession(TELECOM_ABBREVIATION));
}
} catch (RemoteException e) {
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: answer
File: src/com/android/server/telecom/ConnectionServiceWrapper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
answer
|
src/com/android/server/telecom/ConnectionServiceWrapper.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
private String readName() throws IOException {
if (current=='"' || current=='\'') return readStringInternal(false);
StringBuilder name=new StringBuilder();
int space=-1, start=index;
while (true) {
if (current==':') {
if (name.length()==0) throw error("Found ':' but no key name (for an empty key name use quotes)");
else if (space>=0 && space!=name.length()) { index=start+space; throw error("Found whitespace in your key name (use quotes to include)"); }
return name.toString();
} else if (isWhiteSpace(current)) {
if (space<0) space=name.length();
} else if (current<' ') {
throw error("Name is not closed");
} else if (JsonValue.isPunctuatorChar(current)) {
throw error("Found '" + (char)current + "' where a key name was expected (check your syntax or use quotes if the key name includes {}[],: or whitespace)");
} else name.append((char)current);
read();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readName
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
|
readName
|
src/main/org/hjson/HjsonParser.java
|
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public List<String> searchDocuments(String parameterizedWhereClause, List<?> parameterValues) throws XWikiException
{
return this.xwiki.getStore().searchDocumentsNames(parameterizedWhereClause, parameterValues, getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: searchDocuments
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
searchDocuments
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setAffiliationIds(ComponentName admin, List<String> ids) {
if (!mHasFeature) {
return;
}
if (ids == null) {
throw new IllegalArgumentException("ids must not be null");
}
for (String id : ids) {
if (TextUtils.isEmpty(id)) {
throw new IllegalArgumentException("ids must not contain empty string");
}
}
final Set<String> affiliationIds = new ArraySet<>(ids);
final CallerIdentity caller = getCallerIdentity(admin);
Preconditions.checkCallAuthorization(
isProfileOwner(caller) || isDefaultDeviceOwner(caller));
final int callingUserId = caller.getUserId();
synchronized (getLockObject()) {
getUserData(callingUserId).mAffiliationIds = affiliationIds;
saveSettingsLocked(callingUserId);
if (callingUserId != UserHandle.USER_SYSTEM && isDeviceOwner(admin, callingUserId)) {
// Affiliation ids specified by the device owner are additionally stored in
// UserHandle.USER_SYSTEM's DevicePolicyData.
getUserData(UserHandle.USER_SYSTEM).mAffiliationIds = affiliationIds;
saveSettingsLocked(UserHandle.USER_SYSTEM);
}
// Affiliation status for any user, not just the calling user, might have changed.
// The device owner user will still be affiliated after changing its affiliation ids,
// but as a result of that other users might become affiliated or un-affiliated.
maybePauseDeviceWideLoggingLocked();
maybeResumeDeviceWideLoggingLocked();
maybeClearLockTaskPolicyLocked();
updateAdminCanGrantSensorsPermissionCache(callingUserId);
}
}
|
Vulnerability Classification:
- CWE: CWE-20
- CVE: CVE-2023-21284
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Ensure policy has no absurdly long strings
The following APIs now enforce limits and throw IllegalArgumentException
when limits are violated:
* DPM.setTrustAgentConfiguration() limits agent packgage name,
component name, and strings within configuration bundle.
* DPM.setPermittedAccessibilityServices() limits package names.
* DPM.setPermittedInputMethods() limits package names.
* DPM.setAccountManagementDisabled() limits account name.
* DPM.setLockTaskPackages() limits package names.
* DPM.setAffiliationIds() limits id.
* DPM.transferOwnership() limits strings inside the bundle.
Package names are limited at 223, because they become directory names
and it is a filesystem restriction, see FrameworkParsingPackageUtils.
All other strings are limited at 65535, because longer ones break binary
XML serializer.
The following APIs silently truncate strings that are long beyond reason:
* DPM.setShortSupportMessage() truncates message at 200.
* DPM.setLongSupportMessage() truncates message at 20000.
* DPM.setOrganizationName() truncates org name at 200.
Bug: 260729089
Test: atest com.android.server.devicepolicy
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5dd3e81347e3c841510094fb5effd51fc0fa995b)
Merged-In: Idcf54e408722f164d16bf2f24a00cd1f5b626d23
Change-Id: Idcf54e408722f164d16bf2f24a00cd1f5b626d23
Function: setAffiliationIds
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
Fixed Code:
@Override
public void setAffiliationIds(ComponentName admin, List<String> ids) {
if (!mHasFeature) {
return;
}
if (ids == null) {
throw new IllegalArgumentException("ids must not be null");
}
for (String id : ids) {
Preconditions.checkArgument(!TextUtils.isEmpty(id), "ids must not have empty string");
enforceMaxStringLength(id, "affiliation id");
}
final Set<String> affiliationIds = new ArraySet<>(ids);
final CallerIdentity caller = getCallerIdentity(admin);
Preconditions.checkCallAuthorization(
isProfileOwner(caller) || isDefaultDeviceOwner(caller));
final int callingUserId = caller.getUserId();
synchronized (getLockObject()) {
getUserData(callingUserId).mAffiliationIds = affiliationIds;
saveSettingsLocked(callingUserId);
if (callingUserId != UserHandle.USER_SYSTEM && isDeviceOwner(admin, callingUserId)) {
// Affiliation ids specified by the device owner are additionally stored in
// UserHandle.USER_SYSTEM's DevicePolicyData.
getUserData(UserHandle.USER_SYSTEM).mAffiliationIds = affiliationIds;
saveSettingsLocked(UserHandle.USER_SYSTEM);
}
// Affiliation status for any user, not just the calling user, might have changed.
// The device owner user will still be affiliated after changing its affiliation ids,
// but as a result of that other users might become affiliated or un-affiliated.
maybePauseDeviceWideLoggingLocked();
maybeResumeDeviceWideLoggingLocked();
maybeClearLockTaskPolicyLocked();
updateAdminCanGrantSensorsPermissionCache(callingUserId);
}
}
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
setAffiliationIds
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 1
|
Analyze the following code function for security vulnerabilities
|
@NotNull
public static List<Element> getChildElementList(
Element parent,
String nodeName) {
List<Element> list = new ArrayList<>();
for (org.w3c.dom.Node node = parent.getFirstChild(); node != null; node = node.getNextSibling()) {
if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE &&
nodeName.equals(node.getNodeName())) {
list.add((Element) node);
}
}
return list;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getChildElementList
File: bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
Repository: dbeaver
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-3836
|
MEDIUM
| 4.3
|
dbeaver
|
getChildElementList
|
bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
|
4debf8f25184b7283681ed3fb5e9e887d9d4fe22
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isLockTaskFeatureEnabled(int lockTaskFeature) throws RemoteException {
int lockTaskFeatures = 0;
if (isPolicyEngineForFinanceFlagEnabled()) {
LockTaskPolicy policy = mDevicePolicyEngine.getResolvedPolicy(
PolicyDefinition.LOCK_TASK, getCurrentForegroundUserId());
lockTaskFeatures = policy == null
// We default on the power button menu, in order to be consistent with pre-P
// behaviour.
? DevicePolicyManager.LOCK_TASK_FEATURE_GLOBAL_ACTIONS
: policy.getFlags();
} else {
//TODO(b/175285301): Explicitly get the user's identity to check.
lockTaskFeatures =
getUserData(getCurrentForegroundUserId()).mLockTaskFeatures;
}
return (lockTaskFeatures & lockTaskFeature) == lockTaskFeature;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isLockTaskFeatureEnabled
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
|
isLockTaskFeatureEnabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean getAutoTimeRequired() {
if (!mHasFeature) {
return false;
}
synchronized (getLockObject()) {
ActiveAdmin deviceOwner = getDeviceOwnerAdminLocked();
if (deviceOwner != null && deviceOwner.requireAutoTime) {
// If the device owner enforces auto time, we don't need to check the PO's
return true;
}
// Now check to see if any profile owner on any user enforces auto time
for (Integer userId : mOwners.getProfileOwnerKeys()) {
ActiveAdmin profileOwner = getProfileOwnerAdminLocked(userId);
if (profileOwner != null && profileOwner.requireAutoTime) {
return true;
}
}
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAutoTimeRequired
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
|
getAutoTimeRequired
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
protected URL resolve(final String path) throws Exception {
return loader.getResource(path);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolve
File: jooby/src/main/java/org/jooby/handlers/AssetHandler.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
resolve
|
jooby/src/main/java/org/jooby/handlers/AssetHandler.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
ConnInfo getConnInfo() {
return connInfo;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getConnInfo
File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Repository: hierynomus/sshj
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
hierynomus/sshj
|
getConnInfo
|
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
|
94fcc960e0fb198ddec0f7efc53f95ac627fe083
| 0
|
Analyze the following code function for security vulnerabilities
|
private static final Logger getLogger() {
return Logger.getLogger(VaadinService.class.getName());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLogger
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31403
|
LOW
| 1.9
|
vaadin/framework
|
getLogger
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
d852126ab6f0c43f937239305bd0e9594834fe34
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onScan() {
if (PermissionUtil.checkSelfPermission(this, Manifest.permission.CAMERA)) {
startQRScanner();
} else {
PermissionUtil.requestCameraPermission(this);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onScan
File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-248"
] |
CVE-2021-32694
|
MEDIUM
| 4.3
|
nextcloud/android
|
onScan
|
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
|
9343bdd85d70625a90e0c952897957a102c2421b
| 0
|
Analyze the following code function for security vulnerabilities
|
private void discardData() throws ClassNotFoundException, IOException {
primitiveData = emptyStream;
boolean resolve = mustResolve;
mustResolve = false;
do {
byte tc = nextTC();
if (tc == TC_ENDBLOCKDATA) {
mustResolve = resolve;
return; // End of annotation
}
readContent(tc);
} while (true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: discardData
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
discardData
|
luni/src/main/java/java/io/ObjectInputStream.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
protected int engineGetBlockSize()
{
try
{
return cipher.getInputBlockSize();
}
catch (NullPointerException e)
{
throw new IllegalStateException("RSA Cipher not initialised");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: engineGetBlockSize
File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-361"
] |
CVE-2016-1000345
|
MEDIUM
| 4.3
|
bcgit/bc-java
|
engineGetBlockSize
|
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
|
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract void sendStanzaInternal(Stanza packet) throws NotConnectedException, InterruptedException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendStanzaInternal
File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
sendStanzaInternal
|
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean cleanupDisabledPackageReceiversLocked(
String packageName, Set<String> filterByClasses, int userId, boolean doit) {
boolean didSomething = false;
for (int i = mParallelBroadcasts.size() - 1; i >= 0; i--) {
didSomething |= mParallelBroadcasts.get(i).cleanupDisabledPackageReceiversLocked(
packageName, filterByClasses, userId, doit);
if (!doit && didSomething) {
return true;
}
}
for (int i = mOrderedBroadcasts.size() - 1; i >= 0; i--) {
didSomething |= mOrderedBroadcasts.get(i).cleanupDisabledPackageReceiversLocked(
packageName, filterByClasses, userId, doit);
if (!doit && didSomething) {
return true;
}
}
return didSomething;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanupDisabledPackageReceiversLocked
File: services/core/java/com/android/server/am/BroadcastQueue.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
cleanupDisabledPackageReceiversLocked
|
services/core/java/com/android/server/am/BroadcastQueue.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
public URI getWebhookUrl() {
return webhookUrl;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWebhookUrl
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
|
getWebhookUrl
|
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
|
private boolean isRegistered() {
return isAttached() && getOwner().hasNode(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRegistered
File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
isRegistered
|
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isWhitespace() throws XmlPullParserException {
// whitespace was stripped by aapt.
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isWhitespace
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
|
isWhitespace
|
core/java/android/content/res/XmlBlock.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getPasswordMinimumUpperCase(ComponentName who, int userHandle, boolean parent) {
return getStrictestPasswordRequirement(who, userHandle, parent,
admin -> admin.mPasswordPolicy.upperCase, PASSWORD_QUALITY_COMPLEX);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPasswordMinimumUpperCase
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
|
getPasswordMinimumUpperCase
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Exported(visibility=3)
public String getUpstreamProject() {
return upstreamProject;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUpstreamProject
File: core/src/main/java/hudson/model/Cause.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2067
|
LOW
| 3.5
|
jenkinsci/jenkins
|
getUpstreamProject
|
core/src/main/java/hudson/model/Cause.java
|
5d57c855f3147bfc5e7fda9252317b428a700014
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onConversationUpdate() {
refreshUi();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onConversationUpdate
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
|
onConversationUpdate
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@TestOnly
public int clone(ConsoleOutputStreamConsumer outputStreamConsumer, String url) {
return clone(outputStreamConsumer, url, Integer.MAX_VALUE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clone
File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
clone
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getAutoUpdate() {
return autoUpdate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAutoUpdate
File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
getAutoUpdate
|
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setLastSizeChangedWH(int w, int h) {
// not used?
//this.lastSizeChangeW = w;
//this.lastSizeChangeH = h;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLastSizeChangedWH
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
|
setLastSizeChangedWH
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private void fireReadEvent() {
if (activity != null && this.conversation != null) {
String uuid = getLastVisibleMessageUuid();
if (uuid != null) {
activity.onConversationRead(this.conversation, uuid);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fireReadEvent
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
fireReadEvent
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void close() throws IOException {
if (inflater != null) {
inflater.end();
}
super.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: close
File: src/main/java/net/lingala/zip4j/io/inputstream/InflaterInputStream.java
Repository: srikanth-lingala/zip4j
The code follows secure coding practices.
|
[
"CWE-346"
] |
CVE-2023-22899
|
MEDIUM
| 5.9
|
srikanth-lingala/zip4j
|
close
|
src/main/java/net/lingala/zip4j/io/inputstream/InflaterInputStream.java
|
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String generateSetiId(String oortURL) {
return Oort.replacePunctuation(oortURL, '_');
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateSetiId
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
Repository: cometd
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
generateSetiId
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setOauthCredentials(String clientId, String clientSecret) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).setCredentials(clientId, clientSecret, isDebugging());
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOauthCredentials
File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setOauthCredentials
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setP2pModes(int initiatorModes, int targetModes) throws RemoteException {
NfcPermissions.enforceAdminPermissions(mContext);
mDeviceHost.setP2pInitiatorModes(initiatorModes);
mDeviceHost.setP2pTargetModes(targetModes);
applyRouting(true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setP2pModes
File: src/com/android/nfc/NfcService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3761
|
LOW
| 2.1
|
android
|
setP2pModes
|
src/com/android/nfc/NfcService.java
|
9ea802b5456a36f1115549b645b65c791eff3c2c
| 0
|
Analyze the following code function for security vulnerabilities
|
private Exception readException() throws WriteAbortedException,
OptionalDataException, ClassNotFoundException, IOException {
resetSeenObjects();
// Now we read the Throwable object that was saved
// WARNING - the grammar says it is a Throwable, but the
// WriteAbortedException constructor takes an Exception. So, we read an
// Exception from the stream
Exception exc = (Exception) readObject();
// We reset the receiver's state (the grammar has "reset" in normal
// font)
resetSeenObjects();
return exc;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readException
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
readException
|
luni/src/main/java/java/io/ObjectInputStream.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void disconnect() {
sendMessage(CMD_DISCONNECT, StaEvent.DISCONNECT_GENERIC);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disconnect
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
disconnect
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return "SQLiteDatabase: " + getPath();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
toString
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<ApkSigningBlockUtils.Result.SignerInfo.ContentDigest> getContentDigests() {
return mContentDigests;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentDigests
File: src/main/java/com/android/apksig/ApkVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
getContentDigests
|
src/main/java/com/android/apksig/ApkVerifier.java
|
039f815895f62c9f8af23df66622b66246f3f61e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static PageParameters paramsOf(Project project, BlobIdent blobIdent) {
return paramsOf(project, new State(blobIdent));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: paramsOf
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
|
paramsOf
|
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
|
0c060153fb97c0288a1917efdb17cc426934dacb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCrossedThreshold(boolean above) {
mStackScroller.setDimmed(!above /* dimmed */, true /* animate */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCrossedThreshold
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
|
onCrossedThreshold
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T> T unmarshal(final Class<T> clazz, final InputStream stream, final boolean validate) {
try (final Reader reader = new InputStreamReader(stream)) {
return unmarshal(clazz, new InputSource(reader), null, validate, false);
} catch (final IOException e) {
throw EXCEPTION_TRANSLATOR.translate("reading stream", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unmarshal
File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-0871
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
unmarshal
|
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
|
3c17231714e3d55809efc580a05734ed530f9ad4
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removerCliente(Cliente cliente) throws ClassNotFoundException {
Connection con = null;
PreparedStatement stmt = null;
try {
con = ConnectionFactory.getConnection();
stmt = con.prepareStatement(stmtRemoveCliente);
stmt.setLong(1, cliente.getIdCliente());
stmt.executeUpdate();
} catch (SQLException e) {
throw new RuntimeException(e);
} finally {
try {
stmt.close();
} catch (Exception ex) {
System.out.println("Erro ao fechar stmt. Ex=" + ex.getMessage());
}
try {
con.close();
} catch (Exception ex) {
System.out.println("Erro ao fechar conexao. Ex = " + ex.getMessage());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removerCliente
File: src/java/br/com/magazine/dao/ClienteDAO.java
Repository: evandro-machado/Trabalho-Web2
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2015-10061
|
MEDIUM
| 5.2
|
evandro-machado/Trabalho-Web2
|
removerCliente
|
src/java/br/com/magazine/dao/ClienteDAO.java
|
f59ac954625d0a4f6d34f069a2e26686a7a20aeb
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setSignalStrengthDefaultValues() {
mSignalStrength = new SignalStrength(true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSignalStrengthDefaultValues
File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
setSignalStrengthDefaultValues
|
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServerHttpResponse end(String data) {
response.end(data);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: end
File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-0981
|
MEDIUM
| 6.5
|
quarkusio/quarkus
|
end
|
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
|
96c64fd8f09c02a497e2db366c64dd9196582442
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract Object createDeserializationProxy(Object target, Map<String, ResultLoaderMap.LoadPair> unloadedProperties, ObjectFactory objectFactory,
List<Class<?>> constructorArgTypes, List<Object> constructorArgs);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createDeserializationProxy
File: src/main/java/org/apache/ibatis/executor/loader/AbstractSerialStateHolder.java
Repository: mybatis/mybatis-3
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2020-26945
|
MEDIUM
| 5.1
|
mybatis/mybatis-3
|
createDeserializationProxy
|
src/main/java/org/apache/ibatis/executor/loader/AbstractSerialStateHolder.java
|
9caf480e05c389548c9889362c2cb080d728b5d8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String name() {
return route.name();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: name
File: jooby/src/main/java/org/jooby/internal/RouteImpl.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-15477
|
MEDIUM
| 4.3
|
jooby-project/jooby
|
name
|
jooby/src/main/java/org/jooby/internal/RouteImpl.java
|
34856a738829d8fedca4ed27bd6ff413af87186f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void validateNotOutsideSandbox() {
String dest = this.getFolder();
if (dest == null) {
return;
}
if (!(FilenameUtil.isNormalizedPathOutsideWorkingDir(dest))) {
setDestinationFolderError(format("Dest folder '%s' is not valid. It must be a sub-directory of the working folder.", dest));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateNotOutsideSandbox
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
validateNotOutsideSandbox
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isActionAddedByCallStyle(Action action) {
// This is an internal extra added by the style to these actions. If an app were to add
// this extra to the action themselves, the action would be dropped. :shrug:
return action != null && action.getExtras().getBoolean(KEY_ACTION_PRIORITY);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isActionAddedByCallStyle
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
isActionAddedByCallStyle
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public int countAttachments(String parametrizedSqlClause, List<?> parameterValues) throws XWikiException
{
return this.xwiki.countAttachments(parametrizedSqlClause, parameterValues, this.context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: countAttachments
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
countAttachments
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
@MediumTest
@Test
public void testAddCallToConference1() throws Exception {
ParcelableCall conferenceCall = makeConferenceCall();
IdPair callId3 = startAndMakeActiveOutgoingCall("650-555-1214",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
// testAddCallToConference{1,2} differ in the order of arguments to InCallAdapter#conference
mInCallServiceFixtureX.getInCallAdapter().conference(
conferenceCall.getId(), callId3.mCallId);
Thread.sleep(200);
ParcelableCall call3 = mInCallServiceFixtureX.getCall(callId3.mCallId);
ParcelableCall updatedConference = mInCallServiceFixtureX.getCall(conferenceCall.getId());
assertEquals(conferenceCall.getId(), call3.getParentCallId());
assertEquals(3, updatedConference.getChildCallIds().size());
assertTrue(updatedConference.getChildCallIds().contains(callId3.mCallId));
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-21283
- Severity: MEDIUM
- CVSS Score: 5.5
Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634
Fixes: 285211549
Fixes: 280797684
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15)
Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7
Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7
Function: testAddCallToConference1
File: tests/src/com/android/server/telecom/tests/BasicCallTests.java
Repository: android
Fixed Code:
@MediumTest
@Test
public void testAddCallToConference1() throws Exception {
ParcelableCall conferenceCall = makeConferenceCall(null, null);
IdPair callId3 = startAndMakeActiveOutgoingCall("650-555-1214",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
// testAddCallToConference{1,2} differ in the order of arguments to InCallAdapter#conference
mInCallServiceFixtureX.getInCallAdapter().conference(
conferenceCall.getId(), callId3.mCallId);
Thread.sleep(200);
ParcelableCall call3 = mInCallServiceFixtureX.getCall(callId3.mCallId);
ParcelableCall updatedConference = mInCallServiceFixtureX.getCall(conferenceCall.getId());
assertEquals(conferenceCall.getId(), call3.getParentCallId());
assertEquals(3, updatedConference.getChildCallIds().size());
assertTrue(updatedConference.getChildCallIds().contains(callId3.mCallId));
}
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
testAddCallToConference1
|
tests/src/com/android/server/telecom/tests/BasicCallTests.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getClearKeyCode() {
return DROID_IMPL_KEY_CLEAR;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClearKeyCode
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
|
getClearKeyCode
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getIdleCurrentMa() {
return getResources().getInteger(R.integer.config_bluetooth_idle_cur_ma);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIdleCurrentMa
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
getIdleCurrentMa
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean isKeyValid(String key) {
return !(TextUtils.isEmpty(key) || SettingsState.isBinary(key));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isKeyValid
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
isKeyValid
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
private void processAdmin(Context context,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException, SQLException, AuthorizeException
{
// Token
String token = request.getParameter("token");
boolean free = request.getParameter("submit_free") != null;
String name = request.getParameter("name");
String mail = request.getParameter("email");
// get token, get register, get email template, format email, get
// message to jsp
TableRow requestItem = RequestItemManager.getRequestbyToken(context,
token);
if (requestItem != null && free) {
try {
Item item = Item.find(context,
requestItem.getIntColumn("item_id"));
String emailRequest;
EPerson submiter = item.getSubmitter();
if (submiter != null) {
emailRequest = submiter.getEmail();
} else {
emailRequest = ConfigurationManager
.getProperty("mail.helpdesk");
}
if (emailRequest == null) {
emailRequest = ConfigurationManager
.getProperty("mail.admin");
}
Email email = Email.getEmail(I18nUtil.getEmailFilename(
context.getCurrentLocale(), "request_item.admin"));
email.addRecipient(emailRequest);
email.addArgument(Bitstream.find(context,
requestItem.getIntColumn("bitstream_id")).getName());
email.addArgument(HandleManager.getCanonicalForm(item
.getHandle()));
email.addArgument(requestItem.getStringColumn("token"));
email.addArgument(name);
email.addArgument(mail);
email.send();
log.info(LogManager.getHeader(context, "sent_adm_requestItem",
"token=" + requestItem.getStringColumn("token")
+ "item_id=" + item.getID()));
JSPManager.showJSP(request, response,
"/requestItem/response-send.jsp");
} catch (MessagingException me) {
log.warn(LogManager.getHeader(context,
"error_mailing_requestItem", ""), me);
JSPManager.showInternalError(request, response);
}
} else {
JSPManager.showInvalidIDError(request, response, token, -1);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processAdmin
File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/RequestItemServlet.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-601",
"CWE-79"
] |
CVE-2022-31192
|
MEDIUM
| 6.1
|
DSpace
|
processAdmin
|
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/RequestItemServlet.java
|
28eb8158210d41168a62ed5f9e044f754513bc37
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<? extends LocationLink> findTypeDefinition(DOMDocument xmlDocument, Position position,
CancelChecker cancelChecker) {
return typeDefinition.findTypeDefinition(xmlDocument, position, cancelChecker);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findTypeDefinition
File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
Repository: eclipse/lemminx
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2019-18212
|
MEDIUM
| 4
|
eclipse/lemminx
|
findTypeDefinition
|
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
|
e37c399aa266be1b7a43061d4afc43dc230410d2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void mergeFiles(String projectName, String repositoryName, Revision revision,
MergeQuery mergeQuery, AsyncMethodCallback resultHandler) {
handle(projectManager.get(projectName).repos().get(repositoryName)
.mergeFiles(convert(revision), convert(mergeQuery))
.thenApply(merged -> new MergedEntry(convert(merged.revision()),
convert(merged.type()),
merged.contentAsText(),
merged.paths())),
resultHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: mergeFiles
File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
Repository: line/centraldogma
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
mergeFiles
|
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
|
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
| 0
|
Analyze the following code function for security vulnerabilities
|
private UserAccountDAO uadao() {
return new UserAccountDAO(dataSource);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uadao
File: web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-24830
|
HIGH
| 7.5
|
OpenClinica
|
uadao
|
web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java
|
6f864e86543f903bd20d6f9fc7056115106441f3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void includeHosts( String hosts ) {
flags.addIncludedHost( hosts ) ;
}
|
Vulnerability Classification:
- CWE: CWE-78
- CVE: CVE-2018-17228
- Severity: HIGH
- CVSS Score: 7.5
Description: Adding hosts validation fixing https://github.com/narkisr/nmap4j/issues/9
Function: includeHosts
File: src/main/java/org/nmap4j/Nmap4j.java
Repository: narkisr/nmap4j
Fixed Code:
public void includeHosts(String hosts) {
if (!validator.valid(hosts)) {
throw new RuntimeException("Non legal hosts parameter");
}
flags.addIncludedHost(hosts);
}
|
[
"CWE-78"
] |
CVE-2018-17228
|
HIGH
| 7.5
|
narkisr/nmap4j
|
includeHosts
|
src/main/java/org/nmap4j/Nmap4j.java
|
06b58aa3345d2f977553685a026b93e61f0c491e
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isTransformSupported() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isTransformSupported
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
|
isTransformSupported
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<String> getRecordLanguages() {
return recordLanguages;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRecordLanguages
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
getRecordLanguages
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon)
{
Log.v(TAG, "Url changed: " + url);
super.onPageStarted(view, url, favicon);
nativeOnPageStarted(url, favicon);
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2021-29978
- Severity: HIGH
- CVSS Score: 10.0
Description: Add rebase
Function: onPageStarted
File: android/src/org/mozilla/firefox/vpn/qt/VPNWebView.java
Repository: mozilla-mobile/mozilla-vpn-client
Fixed Code:
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// While the login view is open, disable the ability to do screenshots.
m_activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
super.onPageStarted(view, url, favicon);
nativeOnPageStarted(url, favicon);
}
|
[
"CWE-Other"
] |
CVE-2021-29978
|
HIGH
| 10
|
mozilla-mobile/mozilla-vpn-client
|
onPageStarted
|
android/src/org/mozilla/firefox/vpn/qt/VPNWebView.java
|
c8440f464a2f5c4e7d4990152ee5850df8b23f42
| 1
|
Analyze the following code function for security vulnerabilities
|
public List<BaseBlock> getHeaders() {
return new ArrayList<BaseBlock>(headers);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHeaders
File: src/main/java/com/github/junrar/Archive.java
Repository: junrar
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2018-12418
|
MEDIUM
| 4.3
|
junrar
|
getHeaders
|
src/main/java/com/github/junrar/Archive.java
|
ad8d0ba8e155630da8a1215cee3f253e0af45817
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean validateBssid(String bssid) {
if (bssid == null) return true;
if (bssid.isEmpty()) {
Log.e(TAG, "validateBssid failed: empty string");
return false;
}
// Allow reset of bssid with "any".
if (bssid.equals(ClientModeImpl.SUPPLICANT_BSSID_ANY)) return true;
MacAddress bssidMacAddress;
try {
bssidMacAddress = MacAddress.fromString(bssid);
} catch (IllegalArgumentException e) {
Log.e(TAG, "validateBssid failed: malformed string: " + bssid);
return false;
}
if (!validateBssid(bssidMacAddress)) {
return false;
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateBssid
File: service/java/com/android/server/wifi/WifiConfigurationUtil.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21252
|
MEDIUM
| 5.5
|
android
|
validateBssid
|
service/java/com/android/server/wifi/WifiConfigurationUtil.java
|
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void attachFile(List<String> spaces, String page, String name, InputStream is, boolean failIfExists,
UsernamePasswordCredentials credentials) throws Exception
{
UsernamePasswordCredentials currentCredentials = getDefaultCredentials();
try {
if (credentials != null) {
setDefaultCredentials(credentials);
}
attachFile(spaces, page, name, is, failIfExists);
} finally {
setDefaultCredentials(currentCredentials);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attachFile
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
attachFile
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setOauthAuthorizationCodeFlow(String code) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).useAuthorizationCodeFlow(code);
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOauthAuthorizationCodeFlow
File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setOauthAuthorizationCodeFlow
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() {
enforceNotIsolatedCaller("getProcessesInErrorState");
// assume our apps are happy - lazy create the list
List<ActivityManager.ProcessErrorStateInfo> errList = null;
final boolean allUsers = ActivityManager.checkUidPermission(INTERACT_ACROSS_USERS_FULL,
Binder.getCallingUid()) == PackageManager.PERMISSION_GRANTED;
int userId = UserHandle.getUserId(Binder.getCallingUid());
synchronized (this) {
// iterate across all processes
for (int i=mLruProcesses.size()-1; i>=0; i--) {
ProcessRecord app = mLruProcesses.get(i);
if (!allUsers && app.userId != userId) {
continue;
}
if ((app.thread != null) && (app.crashing || app.notResponding)) {
// This one's in trouble, so we'll generate a report for it
// crashes are higher priority (in case there's a crash *and* an anr)
ActivityManager.ProcessErrorStateInfo report = null;
if (app.crashing) {
report = app.crashingReport;
} else if (app.notResponding) {
report = app.notRespondingReport;
}
if (report != null) {
if (errList == null) {
errList = new ArrayList<ActivityManager.ProcessErrorStateInfo>(1);
}
errList.add(report);
} else {
Slog.w(TAG, "Missing app error report, app = " + app.processName +
" crashing = " + app.crashing +
" notResponding = " + app.notResponding);
}
}
}
}
return errList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProcessesInErrorState
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
|
getProcessesInErrorState
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@PUT
@Path("task/{nodeId}/configuration")
@Operation(summary = "This attaches the run-time configuration", description = "This attaches the run-time configuration onto a given task element")
@ApiResponse(responseCode = "200", description = "The task node configuration", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = SurveyConfigVO.class)),
@Content(mediaType = "application/xml", schema = @Schema(implementation = SurveyConfigVO.class)) })
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient")
@ApiResponse(responseCode = "404", description = "The course or task node not found")
@ApiResponse(responseCode = "406", description = "The call is not applicable to task course node")
@ApiResponse(responseCode = "409", description = "The configuration is not valid ")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response addTaskConfiguration(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId,
@QueryParam("enableAssignment") Boolean enableAssignment,
@QueryParam("taskAssignmentType") String taskAssignmentType,
@QueryParam("taskAssignmentText") String taskAssignmentText,
@QueryParam("enableTaskPreview") Boolean enableTaskPreview,
@QueryParam("enableTaskDeselect") Boolean enableTaskDeselect,
@QueryParam("onlyOneUserPerTask") Boolean onlyOneUserPerTask,
@QueryParam("enableDropbox") Boolean enableDropbox,
@QueryParam("enableDropboxConfirmationMail") Boolean enableDropboxConfirmationMail,
@QueryParam("dropboxConfirmationText") String dropboxConfirmationText,
@QueryParam("enableReturnbox") Boolean enableReturnbox,
@QueryParam("enableScoring") Boolean enableScoring,
@QueryParam("grantScoring") Boolean grantScoring,
@QueryParam("scoreMin") Float scoreMin,
@QueryParam("scoreMax") Float scoreMax,
@QueryParam("grantPassing") Boolean grantPassing,
@QueryParam("scorePassingThreshold") Float scorePassingThreshold,
@QueryParam("enableCommentField") Boolean enableCommentField,
@QueryParam("commentForUser") String commentForUser,
@QueryParam("commentForCoaches") String commentForCoaches,
@QueryParam("enableSolution") Boolean enableSolution,
@QueryParam("accessExpertRuleTask") String accessExpertRuleTask,
@QueryParam("accessExpertRuleDropbox") String accessExpertRuleDropbox,
@QueryParam("accessExpertRuleReturnbox") String accessExpertRuleReturnbox,
@QueryParam("accessExpertRuleScoring") String accessExpertRuleScoring,
@QueryParam("accessExpertRuleSolution") String accessExpertRuleSolution,
@Context HttpServletRequest request) {
TaskFullConfig config = new TaskFullConfig(enableAssignment, taskAssignmentType, taskAssignmentText, enableTaskPreview,
enableTaskDeselect, onlyOneUserPerTask, enableDropbox, enableDropboxConfirmationMail, dropboxConfirmationText, enableReturnbox,
enableScoring, grantScoring, scoreMin, scoreMax, grantPassing, scorePassingThreshold, enableCommentField, commentForUser,
commentForCoaches, enableSolution, accessExpertRuleTask, accessExpertRuleDropbox, accessExpertRuleReturnbox,
accessExpertRuleScoring, accessExpertRuleSolution);
return attachNodeConfig(courseId, nodeId, config, request);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addTaskConfiguration
File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
addTaskConfiguration
|
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
|
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isProcessAliveLocked(ProcessRecord proc) {
if (proc.procStatFile == null) {
proc.procStatFile = "/proc/" + proc.pid + "/stat";
}
mProcessStateStatsLongs[0] = 0;
if (!Process.readProcFile(proc.procStatFile, PROCESS_STATE_STATS_FORMAT, null,
mProcessStateStatsLongs, null)) {
if (DEBUG_OOM_ADJ) Slog.d(TAG, "UNABLE TO RETRIEVE STATE FOR " + proc.procStatFile);
return false;
}
final long state = mProcessStateStatsLongs[0];
if (DEBUG_OOM_ADJ) Slog.d(TAG, "RETRIEVED STATE FOR " + proc.procStatFile + ": "
+ (char)state);
return state != 'Z' && state != 'X' && state != 'x' && state != 'K';
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isProcessAliveLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
isProcessAliveLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getAggregatedPasswordComplexityLocked(@UserIdInt int userHandle,
boolean deviceWideOnly) {
ensureLocked();
final List<ActiveAdmin> admins;
if (deviceWideOnly) {
admins = getActiveAdminsForUserAndItsManagedProfilesLocked(userHandle,
/* shouldIncludeProfileAdmins */ (user) -> false);
} else {
admins = getActiveAdminsForLockscreenPoliciesLocked(userHandle);
}
int maxRequiredComplexity = PASSWORD_COMPLEXITY_NONE;
for (ActiveAdmin admin : admins) {
maxRequiredComplexity = Math.max(maxRequiredComplexity, admin.mPasswordComplexity);
}
return maxRequiredComplexity;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAggregatedPasswordComplexityLocked
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
|
getAggregatedPasswordComplexityLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return this;
}
}
throw new RuntimeException("No API key authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setApiKey
File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setApiKey
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private Block tranform(XDOM xdom, Block block) throws RenderingException
{
TransformationContext transformationContext =
new TransformationContext(xdom, this.configuration.getDefaultSyntax(), false);
transformationContext.setTargetSyntax(this.configuration.getTargetSyntax());
transformationContext.setId(this.configuration.getTransformationId());
transform(block, transformationContext);
// The result is often inserted in a bigger content so we remove the XDOM around it
if (block instanceof XDOM) {
return new MetaDataBlock(block.getChildren(), ((XDOM) block).getMetaData());
}
return block;
}
|
Vulnerability Classification:
- CWE: CWE-284
- CVE: CVE-2023-26471
- Severity: HIGH
- CVSS Score: 8.8
Description: XWIKI-20234: It's possible to execute anything with superadmin right through comments and async macro
Function: tranform
File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java
Repository: xwiki/xwiki-platform
Fixed Code:
private Block tranform(XDOM xdom, Block block) throws RenderingException
{
TransformationContext transformationContext =
new TransformationContext(xdom, this.configuration.getDefaultSyntax(), this.configuration.isResricted());
transformationContext.setTargetSyntax(this.configuration.getTargetSyntax());
transformationContext.setId(this.configuration.getTransformationId());
transform(block, transformationContext);
// The result is often inserted in a bigger content so we remove the XDOM around it
if (block instanceof XDOM) {
return new MetaDataBlock(block.getChildren(), ((XDOM) block).getMetaData());
}
return block;
}
|
[
"CWE-284"
] |
CVE-2023-26471
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
tranform
|
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java
|
00532d9f1404287cf3ec3a05056640d809516006
| 1
|
Analyze the following code function for security vulnerabilities
|
AssetManager rebaseTheme(long themePtr, @NonNull AssetManager newAssetManager,
@StyleRes int[] styleIds, @StyleRes boolean[] force, int count) {
// Exchange ownership of the theme with the new asset manager.
if (this != newAssetManager) {
synchronized (this) {
ensureValidLocked();
decRefsLocked(themePtr);
}
synchronized (newAssetManager) {
newAssetManager.ensureValidLocked();
newAssetManager.incRefsLocked(themePtr);
}
}
try {
synchronized (newAssetManager) {
newAssetManager.ensureValidLocked();
nativeThemeRebase(newAssetManager.mObject, themePtr, styleIds, force, count);
}
} finally {
Reference.reachabilityFence(newAssetManager);
}
return newAssetManager;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: rebaseTheme
File: core/java/android/content/res/AssetManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
rebaseTheme
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hostedByPackageForUser(String packageName, int userId) {
final int N = widgets.size();
for (int i = 0; i < N; i++) {
Widget widget = widgets.get(i);
if (packageName.equals(widget.host.id.packageName)
&& widget.host.getUserId() == userId) {
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hostedByPackageForUser
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
|
hostedByPackageForUser
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
public ViewPage createPageWithAttachment(EntityReference reference, String content, String title,
String attachmentName, InputStream attachmentData, UsernamePasswordCredentials credentials) throws Exception
{
ViewPage vp = createPage(reference, content, title);
attachFile(reference, attachmentName, attachmentData, false, credentials);
return vp;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPageWithAttachment
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
createPageWithAttachment
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isDirectoryDirty(File dir) {
File nomedia = new File(dir, ".nomedia");
// We return false for directories that don't have .nomedia
if (!nomedia.exists()) {
return false;
}
// We don't write to ".nomedia" dirs, only to ".nomedia" files. If this ".nomedia" is not
// a file, then don't try to read it.
if (!nomedia.isFile()) {
return true;
}
try {
Optional<String> expectedPath = readString(nomedia);
// Returns true If .nomedia file is empty or content doesn't match |dir|
// Returns false otherwise
return !expectedPath.isPresent()
|| !expectedPath.get().equals(dir.getPath());
} catch (IOException e) {
Log.w(TAG, "Failed to read directory dirty" + dir);
return true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDirectoryDirty
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
isDirectoryDirty
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
private void startQsSizeChangeAnimation(int oldHeight, final int newHeight) {
if (mQsSizeChangeAnimator != null) {
oldHeight = (int) mQsSizeChangeAnimator.getAnimatedValue();
mQsSizeChangeAnimator.cancel();
}
mQsSizeChangeAnimator = ValueAnimator.ofInt(oldHeight, newHeight);
mQsSizeChangeAnimator.setDuration(300);
mQsSizeChangeAnimator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
mQsSizeChangeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
requestScrollerTopPaddingUpdate(false /* animate */);
requestPanelHeightUpdate();
int height = (int) mQsSizeChangeAnimator.getAnimatedValue();
mQs.setHeightOverride(height);
}
});
mQsSizeChangeAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mQsSizeChangeAnimator = null;
}
});
mQsSizeChangeAnimator.start();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startQsSizeChangeAnimation
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
|
startQsSizeChangeAnimation
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T extends Descriptor> T find(Collection<? extends T> list, String className) {
for (T d : list) {
if(d.getClass().getName().equals(className))
return d;
}
// Since we introduced Descriptor.getId(), it is a preferred method of identifying descriptor by a string.
// To make that migration easier without breaking compatibility, let's also match up with the id.
for (T d : list) {
if(d.getId().equals(className))
return d;
}
return null;
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2013-7330
- Severity: MEDIUM
- CVSS Score: 4.0
Description: [SECURITY-55]
This patch makes standard post-build action refuse to let you configure a downstream project you cannot currently build.
The one from parameterized-trigger will show an error in the configure screen but still lets you save the configuration; needs an analogous patch to that plugin.
Does not yet protect against POSTing config.xml with the trigger.
(cherry picked from commit 757bc8a53956e6fbab267214e6e0896f03c3c262)
Conflicts:
core/src/main/java/hudson/model/Descriptor.java
Function: find
File: core/src/main/java/hudson/model/Descriptor.java
Repository: jenkinsci/jenkins
Fixed Code:
public static @CheckForNull <T extends Descriptor> T find(Collection<? extends T> list, String className) {
for (T d : list) {
if(d.getClass().getName().equals(className))
return d;
}
// Since we introduced Descriptor.getId(), it is a preferred method of identifying descriptor by a string.
// To make that migration easier without breaking compatibility, let's also match up with the id.
for (T d : list) {
if(d.getId().equals(className))
return d;
}
return null;
}
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
find
|
core/src/main/java/hudson/model/Descriptor.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 1
|
Analyze the following code function for security vulnerabilities
|
private void handleGroupSummaryRemoved(String key,
RankingMap ranking) {
Entry entry = mNotificationData.get(key);
if (entry != null && entry.row != null
&& entry.row.isSummaryWithChildren()) {
if (entry.notification.getOverrideGroupKey() != null && !entry.row.isDismissed()) {
// We don't want to remove children for autobundled notifications as they are not
// always cancelled. We only remove them if they were dismissed by the user.
return;
}
List<ExpandableNotificationRow> notificationChildren =
entry.row.getNotificationChildren();
ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>();
for (int i = 0; i < notificationChildren.size(); i++) {
ExpandableNotificationRow row = notificationChildren.get(i);
if ((row.getStatusBarNotification().getNotification().flags
& Notification.FLAG_FOREGROUND_SERVICE) != 0) {
// the child is a forground service notification which we can't remove!
continue;
}
toRemove.add(row);
row.setKeepInParent(true);
// we need to set this state earlier as otherwise we might generate some weird
// animations
row.setRemoved();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleGroupSummaryRemoved
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
|
handleGroupSummaryRemoved
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setTreatBaseUrlsAsLocal(Set<String> theTreatBaseUrlsAsLocal) {
myModelConfig.setTreatBaseUrlsAsLocal(theTreatBaseUrlsAsLocal);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTreatBaseUrlsAsLocal
File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
setTreatBaseUrlsAsLocal
|
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 0
|
Analyze the following code function for security vulnerabilities
|
private CloseableHttpResponse getHttpResponse(BaseMessage message) throws Exception {
URI uri = null;
HttpRequestBase httpRequest;
if (message instanceof CustomWebhookMessage) {
CustomWebhookMessage customWebhookMessage = (CustomWebhookMessage) message;
uri = buildUri(customWebhookMessage.getUrl(), customWebhookMessage.getScheme(), customWebhookMessage.getHost(),
customWebhookMessage.getPort(), customWebhookMessage.getPath(), customWebhookMessage.getQueryParams());
httpRequest = constructHttpRequest(((CustomWebhookMessage) message).getMethod());
// set headers
Map<String, String> headerParams = customWebhookMessage.getHeaderParams();
if(headerParams == null || headerParams.isEmpty()) {
// set default header
httpRequest.setHeader("Content-Type", "application/json");
} else {
for (Map.Entry<String, String> e : customWebhookMessage.getHeaderParams().entrySet())
httpRequest.setHeader(e.getKey(), e.getValue());
}
} else {
httpRequest = new HttpPost();
uri = buildUri(message.getUrl().trim(), null, null, -1, null, null);
}
httpRequest.setURI(uri);
if (httpRequest instanceof HttpEntityEnclosingRequestBase){
StringEntity entity = new StringEntity(extractBody(message), StandardCharsets.UTF_8);
((HttpEntityEnclosingRequestBase) httpRequest).setEntity(entity);
}
return HTTP_CLIENT.execute(httpRequest);
}
|
Vulnerability Classification:
- CWE: CWE-918
- CVE: CVE-2021-31828
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Support deny list for destinations
Function: getHttpResponse
File: notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java
Repository: opendistro-for-elasticsearch/alerting
Fixed Code:
private CloseableHttpResponse getHttpResponse(BaseMessage message) throws Exception {
URI uri = null;
HttpRequestBase httpRequest;
if (message instanceof CustomWebhookMessage) {
CustomWebhookMessage customWebhookMessage = (CustomWebhookMessage) message;
uri = customWebhookMessage.getUri();
httpRequest = constructHttpRequest(((CustomWebhookMessage) message).getMethod());
// set headers
Map<String, String> headerParams = customWebhookMessage.getHeaderParams();
if(headerParams == null || headerParams.isEmpty()) {
// set default header
httpRequest.setHeader("Content-Type", "application/json");
} else {
for (Map.Entry<String, String> e : customWebhookMessage.getHeaderParams().entrySet())
httpRequest.setHeader(e.getKey(), e.getValue());
}
} else {
httpRequest = new HttpPost();
uri = message.getUri();
}
httpRequest.setURI(uri);
if (httpRequest instanceof HttpEntityEnclosingRequestBase){
StringEntity entity = new StringEntity(extractBody(message), StandardCharsets.UTF_8);
((HttpEntityEnclosingRequestBase) httpRequest).setEntity(entity);
}
return HTTP_CLIENT.execute(httpRequest);
}
|
[
"CWE-918"
] |
CVE-2021-31828
|
MEDIUM
| 5.5
|
opendistro-for-elasticsearch/alerting
|
getHttpResponse
|
notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java
|
49cc584dd6bd38ca26129eeaca5cd04e40a27f25
| 1
|
Analyze the following code function for security vulnerabilities
|
private void energyInfoCallback (int status, int ctrl_state,
long tx_time, long rx_time, long idle_time, long energy_used)
throws RemoteException {
if (ctrl_state >= BluetoothActivityEnergyInfo.BT_STACK_STATE_INVALID &&
ctrl_state <= BluetoothActivityEnergyInfo.BT_STACK_STATE_STATE_IDLE) {
mStackReportedState = ctrl_state;
mTxTimeTotalMs += tx_time;
mRxTimeTotalMs += rx_time;
mIdleTimeTotalMs += idle_time;
// Energy is product of mA, V and ms. If the chipset doesn't
// report it, we have to compute it from time
if (energy_used == 0) {
energy_used = (long)((mTxTimeTotalMs * getTxCurrentMa()
+ mRxTimeTotalMs * getRxCurrentMa()
+ mIdleTimeTotalMs * getIdleCurrentMa()) * getOperatingVolt());
}
mEnergyUsedTotalVoltAmpSecMicro += energy_used;
}
debugLog("energyInfoCallback() status = " + status +
"tx_time = " + tx_time + "rx_time = " + rx_time +
"idle_time = " + idle_time + "energy_used = " + energy_used +
"ctrl_state = " + ctrl_state);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: energyInfoCallback
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
energyInfoCallback
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isLastLockedTask(TaskRecord task) {
return mLockTaskModeTasks.size() == 1 && mLockTaskModeTasks.contains(task);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isLastLockedTask
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
isLastLockedTask
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void unfreezeInsetsAfterStartInput() {
if (mActivityRecord != null) {
mActivityRecord.mImeInsetsFrozenUntilStartInput = false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unfreezeInsetsAfterStartInput
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
|
unfreezeInsetsAfterStartInput
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ActivityManager.TaskThumbnail getTaskThumbnail(int id) {
synchronized (this) {
enforceCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER,
"getTaskThumbnail()");
TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(id, false);
if (tr != null) {
return tr.getTaskThumbnailLocked();
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTaskThumbnail
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
getTaskThumbnail
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean canShowWindows() {
return allDrawn && !(isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION)
&& hasNonDefaultColorWindow());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canShowWindows
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
|
canShowWindows
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isUIActive(UI ui) {
if (ui.isClosing()) {
return false;
}
// Check for long running tasks
Lock lockInstance = ui.getSession().getLockInstance();
if (lockInstance instanceof ReentrantLock) {
if (((ReentrantLock) lockInstance).hasQueuedThreads()) {
/*
* Someone is trying to access the session. Leaving all UIs
* alive for now. A possible kill decision will be made at a
* later time when the session access has ended.
*/
return true;
}
}
// Check timeout
long now = System.currentTimeMillis();
int timeout = 1000 * getHeartbeatTimeout();
return timeout < 0 || now - ui.getLastHeartbeatTimestamp() < timeout;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isUIActive
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31403
|
LOW
| 1.9
|
vaadin/framework
|
isUIActive
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
d852126ab6f0c43f937239305bd0e9594834fe34
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ConfigurationInfo getDeviceConfigurationInfo() {
ConfigurationInfo config = new ConfigurationInfo();
synchronized (mGlobalLock) {
final Configuration globalConfig = getGlobalConfigurationForCallingPid();
config.reqTouchScreen = globalConfig.touchscreen;
config.reqKeyboardType = globalConfig.keyboard;
config.reqNavigation = globalConfig.navigation;
if (globalConfig.navigation == Configuration.NAVIGATION_DPAD
|| globalConfig.navigation == Configuration.NAVIGATION_TRACKBALL) {
config.reqInputFeatures |= ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV;
}
if (globalConfig.keyboard != Configuration.KEYBOARD_UNDEFINED
&& globalConfig.keyboard != Configuration.KEYBOARD_NOKEYS) {
config.reqInputFeatures |= ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD;
}
config.reqGlEsVersion = GL_ES_VERSION;
}
return config;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeviceConfigurationInfo
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
|
getDeviceConfigurationInfo
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setConnectionTimeout(int timeout) {
if(timeout < 0) {
throw new IllegalArgumentException("TCP connection timeout cannot be negative");
}
this.connectionTimeout = timeout;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setConnectionTimeout
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
setConnectionTimeout
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
private void fillInDefaultActivity(List<ShortcutInfo> shortcuts) {
ComponentName defaultActivity = null;
for (int i = shortcuts.size() - 1; i >= 0; i--) {
final ShortcutInfo si = shortcuts.get(i);
if (si.getActivity() == null) {
if (defaultActivity == null) {
defaultActivity = injectGetDefaultMainActivity(
si.getPackage(), si.getUserId());
Preconditions.checkState(defaultActivity != null,
"Launcher activity not found for package " + si.getPackage());
}
si.setActivity(defaultActivity);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fillInDefaultActivity
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
|
fillInDefaultActivity
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
private void announceSearchResultIfNeeded() {
if (AccessibilityManager.getInstance(mContext).isEnabled()) {
if (mAnnounceFilterResult == null) {
mAnnounceFilterResult = new AnnounceFilterResult();
}
mAnnounceFilterResult.post();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: announceSearchResultIfNeeded
File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-610"
] |
CVE-2023-40133
|
MEDIUM
| 5.5
|
android
|
announceSearchResultIfNeeded
|
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
|
08becc8c600f14c5529115cc1a1e0c97cd503f33
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isInAdminMode()
{
return getDriver().getCurrentUrl().contains("/admin/");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isInAdminMode
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
isInAdminMode
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public static int executeUpdateDelete(@NonNull SQLiteDatabase db, @NonNull String sql,
@Nullable Object[] bindArgs) throws SQLException {
Trace.beginSection("executeUpdateDelete");
try (SQLiteStatement st = db.compileStatement(sql)) {
bindArgs(st, bindArgs);
return st.executeUpdateDelete();
} finally {
Trace.endSection();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeUpdateDelete
File: src/com/android/providers/media/util/DatabaseUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-35683
|
MEDIUM
| 5.5
|
android
|
executeUpdateDelete
|
src/com/android/providers/media/util/DatabaseUtils.java
|
23d156ed1bed6d2c2b325f0be540d0afca510c49
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public SocketAddress getLocalAddress() {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocalAddress
File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10184
|
MEDIUM
| 5
|
undertow-io/undertow
|
getLocalAddress
|
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
|
d2715e3afa13f50deaa19643676816ce391551e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public OHttpRequest getRequest() {
return request;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequest
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
Repository: orientechnologies/orientdb
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2015-2912
|
MEDIUM
| 6.8
|
orientechnologies/orientdb
|
getRequest
|
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
|
d5a45e608ba8764fd817c1bdd7cf966564e828e9
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.