instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private void updateShouldShowDialogsLocked(Configuration config) {
final boolean inputMethodExists = !(config.keyboard == Configuration.KEYBOARD_NOKEYS
&& config.touchscreen == Configuration.TOUCHSCREEN_NOTOUCH
&& config.navigation == Configuration.NAVIGATION_NONAV);
final boolean hideDialogsSet = Settings.Global.getInt(mContext.getContentResolver(),
HIDE_ERROR_DIALOGS, 0) != 0;
mShowDialogs = inputMethodExists
&& ActivityTaskManager.currentUiModeSupportsErrorDialogs(config)
&& !hideDialogsSet;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateShouldShowDialogsLocked
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
|
updateShouldShowDialogsLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@UnstableApi
public ServerBuilder idleTimeoutMillis(long idleTimeoutMillis, boolean keepAliveOnPing) {
return idleTimeout(Duration.ofMillis(idleTimeoutMillis), keepAliveOnPing);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: idleTimeoutMillis
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
idleTimeoutMillis
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void pausePolling(int timeoutInMs) {
NfcPermissions.enforceAdminPermissions(mContext);
if (timeoutInMs <= 0 || timeoutInMs > MAX_POLLING_PAUSE_TIMEOUT) {
Log.e(TAG, "Refusing to pause polling for " + timeoutInMs + "ms.");
return;
}
synchronized (NfcService.this) {
mPollingPaused = true;
mDeviceHost.disableDiscovery();
mHandler.sendMessageDelayed(
mHandler.obtainMessage(MSG_RESUME_POLLING), timeoutInMs);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pausePolling
File: src/com/android/nfc/NfcService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3761
|
LOW
| 2.1
|
android
|
pausePolling
|
src/com/android/nfc/NfcService.java
|
9ea802b5456a36f1115549b645b65c791eff3c2c
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean checkModifyQuietModePermission(String packageName, @UserIdInt int userId) {
try {
final int uid = Objects.requireNonNull(
mInjector.getPackageManager().getApplicationInfoAsUser(
Objects.requireNonNull(packageName), /* flags= */ 0, userId)).uid;
return PackageManager.PERMISSION_GRANTED
== ActivityManager.checkComponentPermission(
android.Manifest.permission.MODIFY_QUIET_MODE, uid, /* owningUid= */
-1, /* exported= */ true);
} catch (NameNotFoundException ex) {
Slogf.w(LOG_TAG, "Cannot find the package %s to check for permissions.",
packageName);
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkModifyQuietModePermission
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
|
checkModifyQuietModePermission
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseGrids(final List<Element> grids) throws GameParseException {
for (final Element current : grids) {
final String gridType = current.getAttribute("type");
final String name = current.getAttribute("name");
final String xs = current.getAttribute("x");
final String ys = current.getAttribute("y");
final List<Element> waterNodes = getChildren("water", current);
final Set<String> water = parseGridWater(waterNodes);
final String horizontalConnections = current.getAttribute("horizontal-connections");
final String verticalConnections = current.getAttribute("vertical-connections");
final String diagonalConnections = current.getAttribute("diagonal-connections");
setGrids(data, gridType, name, xs, ys, water, horizontalConnections, verticalConnections, diagonalConnections);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseGrids
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
parseGrids
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
private void internalExpireMessagesByTimestampForSinglePartition(String subName, int expireTimeInSeconds,
boolean authoritative) {
if (topicName.isGlobal()) {
validateGlobalNamespaceOwnership(namespaceName);
}
// If the topic name is a partition name, no need to get partition topic metadata again
if (!topicName.isPartitioned() && getPartitionedTopicMetadata(topicName, authoritative, false).partitions > 0) {
String msg = "This method should not be called for partitioned topic";
log.error("[{}] {} {} {}", clientAppId(), msg, topicName, subName);
throw new IllegalStateException(msg);
}
validateTopicOwnership(topicName, authoritative);
validateTopicOperation(topicName, TopicOperation.EXPIRE_MESSAGES);
if (!(getTopicReference(topicName) instanceof PersistentTopic)) {
log.error("[{}] Not supported operation of non-persistent topic {} {}", clientAppId(), topicName, subName);
throw new RestException(Status.METHOD_NOT_ALLOWED,
"Expire messages on a non-persistent topic is not allowed");
}
PersistentTopic topic = (PersistentTopic) getTopicReference(topicName);
try {
boolean issued;
if (subName.startsWith(topic.getReplicatorPrefix())) {
String remoteCluster = PersistentReplicator.getRemoteCluster(subName);
PersistentReplicator repl = (PersistentReplicator) topic.getPersistentReplicator(remoteCluster);
checkNotNull(repl);
issued = repl.expireMessages(expireTimeInSeconds);
} else {
PersistentSubscription sub = topic.getSubscription(subName);
checkNotNull(sub);
issued = sub.expireMessages(expireTimeInSeconds);
}
if (issued) {
log.info("[{}] Message expire started up to {} on {} {}", clientAppId(), expireTimeInSeconds, topicName,
subName);
} else {
if (log.isDebugEnabled()) {
log.debug("Expire message by timestamp not issued on topic {} for subscription {} due to ongoing "
+ "message expiration not finished or subscription almost catch up. If it's performed on "
+ "a partitioned topic operation might succeeded on other partitions, please check "
+ "stats of individual partition.", topicName, subName);
}
throw new RestException(Status.CONFLICT, "Expire message by timestamp not issued on topic "
+ topicName + " for subscription " + subName + " due to ongoing message expiration not finished or "
+ " subscription almost catch up. If it's performed on a partitioned topic operation might succeeded "
+ "on other partitions, please check stats of individual partition.");
}
} catch (NullPointerException npe) {
throw new RestException(Status.NOT_FOUND, "Subscription not found");
} catch (Exception exception) {
log.error("[{}] Failed to expire messages up to {} on {} with subscription {} {}", clientAppId(),
expireTimeInSeconds, topicName, subName, exception);
throw new RestException(exception);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalExpireMessagesByTimestampForSinglePartition
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalExpireMessagesByTimestampForSinglePartition
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
private int writeEncryptedData(final ByteBuffer src) {
final int pos = src.position();
final int len = src.remaining();
final int netWrote;
if (src.isDirect()) {
final long addr = Buffer.address(src) + pos;
netWrote = SSL.writeToBIO(networkBIO, addr, len);
if (netWrote >= 0) {
src.position(pos + netWrote);
}
} else {
final ByteBuf buf = alloc.directBuffer(len);
try {
final long addr = memoryAddress(buf);
buf.setBytes(0, src);
netWrote = SSL.writeToBIO(networkBIO, addr, len);
if (netWrote >= 0) {
src.position(pos + netWrote);
} else {
src.position(pos);
}
} finally {
buf.release();
}
}
return netWrote;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeEncryptedData
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
writeEncryptedData
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setPinchToZoomEnabled(final PeerComponent browserPeer, final boolean e) {
super.setPinchToZoomEnabled(browserPeer, e);
if (getActivity() == null) {
return;
}
getActivity().runOnUiThread(new Runnable() {
public void run() {
AndroidBrowserComponent bc = (AndroidBrowserComponent)browserPeer;
bc.setPinchZoomEnabled(e);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPinchToZoomEnabled
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
|
setPinchToZoomEnabled
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
ActiveAdmin getDeviceOwnerAdminLocked() {
ensureLocked();
ComponentName component = mOwners.getDeviceOwnerComponent();
if (component == null) {
return null;
}
DevicePolicyData policy = getUserData(mOwners.getDeviceOwnerUserId());
final int n = policy.mAdminList.size();
for (int i = 0; i < n; i++) {
ActiveAdmin admin = policy.mAdminList.get(i);
if (component.equals(admin.info.getComponent())) {
return admin;
}
}
Slogf.wtf(LOG_TAG, "Active admin for device owner not found. component=" + component);
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeviceOwnerAdminLocked
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
|
getDeviceOwnerAdminLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getIdTokenString() {
return idTokenString;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIdTokenString
File: core/src/main/java/org/keycloak/KeycloakSecurityContext.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2020-1714
|
MEDIUM
| 6.5
|
keycloak
|
getIdTokenString
|
core/src/main/java/org/keycloak/KeycloakSecurityContext.java
|
d5483d884de797e2ef6e69f92085bc10bf87e864
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Pair<ManifestParser.Section, Map<String, ManifestParser.Section>> parseManifest(
byte[] manifestBytes, Set<String> cdEntryNames, Result result) {
ManifestParser manifest = new ManifestParser(manifestBytes);
ManifestParser.Section manifestMainSection = manifest.readSection();
List<ManifestParser.Section> manifestIndividualSections = manifest.readAllSections();
Map<String, ManifestParser.Section> entryNameToManifestSection =
new HashMap<>(manifestIndividualSections.size());
int manifestSectionNumber = 0;
for (ManifestParser.Section manifestSection : manifestIndividualSections) {
manifestSectionNumber++;
String entryName = manifestSection.getName();
if (entryName == null) {
result.addError(Issue.JAR_SIG_UNNNAMED_MANIFEST_SECTION, manifestSectionNumber);
continue;
}
if (entryNameToManifestSection.put(entryName, manifestSection) != null) {
result.addError(Issue.JAR_SIG_DUPLICATE_MANIFEST_SECTION, entryName);
continue;
}
if (!cdEntryNames.contains(entryName)) {
result.addError(
Issue.JAR_SIG_MISSING_ZIP_ENTRY_REFERENCED_IN_MANIFEST, entryName);
continue;
}
}
return Pair.of(manifestMainSection, entryNameToManifestSection);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseManifest
File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
parseManifest
|
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
|
41d882324288085fd32ae0bb70dc85f5fd0e2be7
| 0
|
Analyze the following code function for security vulnerabilities
|
private ISessionManager getSessionManager(String username, String password)
throws RepositoryLoginException, RepositoryException {
ILoginInfo loginInfo = clientX.getLoginInfo();
loginInfo.setUser(username);
loginInfo.setPassword(password);
ISessionManager sessionManagerUser =
clientX.getLocalClient().newSessionManager();
sessionManagerUser.setIdentity(docbase, loginInfo);
return sessionManagerUser;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSessionManager
File: projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java
Repository: AnantLabs/google-enterprise-connector-dctm
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2014-125083
|
MEDIUM
| 5.2
|
AnantLabs/google-enterprise-connector-dctm
|
getSessionManager
|
projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java
|
6fba04f18ab7764002a1da308e7cd9712b501cb7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Editable(order=100, name="LDAP URL", description=
"Specifies LDAP URL, for example: <i>ldap://localhost</i>, or <i>ldaps://localhost</i>.")
@NotEmpty
public String getLdapUrl() {
return ldapUrl;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLdapUrl
File: server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-90"
] |
CVE-2021-32651
|
MEDIUM
| 4.3
|
theonedev/onedev
|
getLdapUrl
|
server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
|
4440f0c57e440488d7e653417b2547eaae8ad19c
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<Uri> cleanUris(List<Uri> uris) {
Iterator<Uri> iterator = uris.iterator();
while(iterator.hasNext()) {
final Uri uri = iterator.next();
if (FileBackend.weOwnFile(getActivity(), uri)) {
iterator.remove();
Toast.makeText(getActivity(), R.string.security_violation_not_attaching_file, Toast.LENGTH_SHORT).show();
}
}
return uris;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanUris
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
|
cleanUris
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull ActiveAdmin getOrganizationOwnedProfileOwnerLocked(final CallerIdentity caller) {
Preconditions.checkCallAuthorization(
mOwners.isProfileOwnerOfOrganizationOwnedDevice(caller.getUserId()),
"Caller %s is not an admin of an org-owned device",
caller.getComponentName());
final ActiveAdmin profileOwner = getProfileOwnerLocked(caller.getUserId());
return profileOwner;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOrganizationOwnedProfileOwnerLocked
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
|
getOrganizationOwnedProfileOwnerLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean killProcessesBelowForeground(String reason) {
if (Binder.getCallingUid() != SYSTEM_UID) {
throw new SecurityException("killProcessesBelowForeground() only available to system");
}
return killProcessesBelowAdj(ProcessList.FOREGROUND_APP_ADJ, reason);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: killProcessesBelowForeground
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2018-9492
|
HIGH
| 7.2
|
android
|
killProcessesBelowForeground
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
void clearOptionsAnimationForSiblings() {
if (task == null) {
clearOptionsAnimation();
} else {
// This will clear the options for all the ActivityRecords for this Task.
task.forAllActivities(ActivityRecord::clearOptionsAnimation);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearOptionsAnimationForSiblings
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
|
clearOptionsAnimationForSiblings
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private byte[] checkAndSetEncodedKey(int opmode, Key key) throws InvalidKeyException {
if (opmode == Cipher.ENCRYPT_MODE || opmode == Cipher.WRAP_MODE) {
encrypting = true;
} else if (opmode == Cipher.DECRYPT_MODE || opmode == Cipher.UNWRAP_MODE) {
encrypting = false;
} else {
throw new InvalidParameterException("Unsupported opmode " + opmode);
}
if (!(key instanceof SecretKey)) {
throw new InvalidKeyException("Only SecretKey is supported");
}
final byte[] encodedKey = key.getEncoded();
if (encodedKey == null) {
throw new InvalidKeyException("key.getEncoded() == null");
}
checkSupportedKeySize(encodedKey.length);
this.encodedKey = encodedKey;
return encodedKey;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAndSetEncodedKey
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
|
checkAndSetEncodedKey
|
src/main/java/org/conscrypt/OpenSSLCipher.java
|
1638945d4ed9403790962ec7abed1b7a232a9ff8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void reportFailedUnlockAttempt(int userId, int timeoutMs) {
// +1 for this time
final int failedAttempts = mLockPatternUtils.getCurrentFailedPasswordAttempts(userId) + 1;
if (DEBUG) Log.d(TAG, "reportFailedPatternAttempt: #" + failedAttempts);
final DevicePolicyManager dpm = mLockPatternUtils.getDevicePolicyManager();
final int failedAttemptsBeforeWipe =
dpm.getMaximumFailedPasswordsForWipe(null, userId);
final int remainingBeforeWipe = failedAttemptsBeforeWipe > 0
? (failedAttemptsBeforeWipe - failedAttempts)
: Integer.MAX_VALUE; // because DPM returns 0 if no restriction
if (remainingBeforeWipe < LockPatternUtils.FAILED_ATTEMPTS_BEFORE_WIPE_GRACE) {
// The user has installed a DevicePolicyManager that requests a user/profile to be wiped
// N attempts. Once we get below the grace period, we post this dialog every time as a
// clear warning until the deletion fires.
// Check which profile has the strictest policy for failed password attempts
final int expiringUser = dpm.getProfileWithMinimumFailedPasswordsForWipe(userId);
int userType = USER_TYPE_PRIMARY;
if (expiringUser == userId) {
// TODO: http://b/23522538
if (expiringUser != UserHandle.USER_SYSTEM) {
userType = USER_TYPE_SECONDARY_USER;
}
} else if (expiringUser != UserHandle.USER_NULL) {
userType = USER_TYPE_WORK_PROFILE;
} // If USER_NULL, which shouldn't happen, leave it as USER_TYPE_PRIMARY
if (remainingBeforeWipe > 0) {
mView.showAlmostAtWipeDialog(failedAttempts, remainingBeforeWipe, userType);
} else {
// Too many attempts. The device will be wiped shortly.
Slog.i(TAG, "Too many unlock attempts; user " + expiringUser + " will be wiped!");
mView.showWipeDialog(failedAttempts, userType);
}
}
mLockPatternUtils.reportFailedPasswordAttempt(userId);
if (timeoutMs > 0) {
mLockPatternUtils.reportPasswordLockout(timeoutMs, userId);
mView.showTimeoutDialog(userId, timeoutMs, mLockPatternUtils,
mSecurityModel.getSecurityMode(userId));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportFailedUnlockAttempt
File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21245
|
HIGH
| 7.8
|
android
|
reportFailedUnlockAttempt
|
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
|
a33159e8cb297b9eee6fa5c63c0e343d05fad622
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void mergeMessageSetExtensionFromBytes(
ByteString rawBytes,
ExtensionRegistry.ExtensionInfo extension,
ExtensionRegistryLite extensionRegistry,
MergeTarget target)
throws IOException {
Descriptors.FieldDescriptor field = extension.descriptor;
boolean hasOriginalValue = target.hasField(field);
if (hasOriginalValue || ExtensionRegistryLite.isEagerlyParseMessageSets()) {
// If the field already exists, we just parse the field.
Object value =
target.parseMessageFromBytes(
rawBytes, extensionRegistry, field, extension.defaultInstance);
target.setField(field, value);
} else {
// Use LazyField to load MessageSet lazily.
LazyField lazyField = new LazyField(extension.defaultInstance, extensionRegistry, rawBytes);
target.setField(field, lazyField);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: mergeMessageSetExtensionFromBytes
File: java/core/src/main/java/com/google/protobuf/MessageReflection.java
Repository: protocolbuffers/protobuf
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-3509
|
HIGH
| 7.5
|
protocolbuffers/protobuf
|
mergeMessageSetExtensionFromBytes
|
java/core/src/main/java/com/google/protobuf/MessageReflection.java
|
a3888f53317a8018e7a439bac4abeb8f3425d5e9
| 0
|
Analyze the following code function for security vulnerabilities
|
Method getMethodWriteObject() {
return methodWriteObject;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMethodWriteObject
File: luni/src/main/java/java/io/ObjectStreamClass.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
getMethodWriteObject
|
luni/src/main/java/java/io/ObjectStreamClass.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setRevokedBy(String revokedBy) {
this.revokedBy = revokedBy;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRevokedBy
File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setRevokedBy
|
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
void setFlags(byte b) {
flags = b;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFlags
File: luni/src/main/java/java/io/ObjectStreamClass.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
setFlags
|
luni/src/main/java/java/io/ObjectStreamClass.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override // binder call
public void onRemoved(long deviceId, int fingerId, int groupId) {
mHandler.obtainMessage(MSG_REMOVED, fingerId, groupId, deviceId).sendToTarget();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onRemoved
File: core/java/android/hardware/fingerprint/FingerprintManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
onRemoved
|
core/java/android/hardware/fingerprint/FingerprintManager.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
private Enumeration<URL> findResourcesBySearching(String name) throws IOException {
List<URL> lresources = new ArrayList<>();
Enumeration<URL> e = null;
for (JNLPClassLoader loader : loaders) {
// TODO check if this will blow up or not
// if loaders[1].getResource() is called, wont it call getResource() on
// the original caller? infinite recursion?
if (loader == this) {
final String fName = name;
try {
e = AccessController.doPrivileged(
new PrivilegedExceptionAction<Enumeration<URL>>() {
@Override
public Enumeration<URL> run() throws IOException {
return JNLPClassLoader.super.findResources(fName);
}
}, getAccessControlContextForClassLoading());
} catch (PrivilegedActionException pae) {
}
} else {
e = loader.findResources(name);
}
final Enumeration<URL> fURLEnum = e;
try {
lresources.addAll(AccessController.doPrivileged(
new PrivilegedExceptionAction<Collection<URL>>() {
@Override
public Collection<URL> run() {
List<URL> resources = new ArrayList<>();
while (fURLEnum != null && fURLEnum.hasMoreElements()) {
resources.add(fURLEnum.nextElement());
}
return resources;
}
}, getAccessControlContextForClassLoading()));
} catch (PrivilegedActionException pae) {
}
}
// Add resources from codebase (only if nothing was found above,
// otherwise the server will get hammered)
if (lresources.isEmpty() && codeBaseLoader != null) {
e = codeBaseLoader.findResources(name);
while (e.hasMoreElements()) {
lresources.add(e.nextElement());
}
}
return Collections.enumeration(lresources);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findResourcesBySearching
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
findResourcesBySearching
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
public long getMinHomeDownlinkBandwidth() {
return mMinHomeDownlinkBandwidth;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMinHomeDownlinkBandwidth
File: framework/java/android/net/wifi/hotspot2/pps/Policy.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21240
|
MEDIUM
| 5.5
|
android
|
getMinHomeDownlinkBandwidth
|
framework/java/android/net/wifi/hotspot2/pps/Policy.java
|
69119d1d3102e27b6473c785125696881bce9563
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void initRequest() {
connectionKeepAlive(false);
if (Defaults.headers.size() > 0) {
for (Map.Entry<String, String> entry : Defaults.headers) {
this.headers.add(entry.getKey(), entry.getValue());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initRequest
File: src/main/java/jodd/http/HttpRequest.java
Repository: oblac/jodd-http
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2022-29631
|
MEDIUM
| 5
|
oblac/jodd-http
|
initRequest
|
src/main/java/jodd/http/HttpRequest.java
|
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
| 0
|
Analyze the following code function for security vulnerabilities
|
protected B initialSettings(Http2Settings settings) {
initialSettings = checkNotNull(settings, "settings");
return self();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initialSettings
File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
netty
|
initialSettings
|
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
|
58f75f665aa81a8cbcf6ffa74820042a285c5e61
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isDecodingNeeded() {
return decodingNeeded;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDecodingNeeded
File: websockets-jsr/src/main/java/io/undertow/websockets/jsr/FrameHandler.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-401"
] |
CVE-2021-3690
|
HIGH
| 7.5
|
undertow-io/undertow
|
isDecodingNeeded
|
websockets-jsr/src/main/java/io/undertow/websockets/jsr/FrameHandler.java
|
c7e84a0b7efced38506d7d1dfea5902366973877
| 0
|
Analyze the following code function for security vulnerabilities
|
public ClientConfig getDefaultClientConfig() {
ClientConfig clientConfig = new ClientConfig();
clientConfig.register(MultiPartFeature.class);
clientConfig.register(json);
clientConfig.register(JacksonFeature.class);
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
// Set logger to ALL
java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL);
} else {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}
return clientConfig;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultClientConfig
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
getDefaultClientConfig
|
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object getProperty(String name) {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProperty
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
|
getProperty
|
core/java/android/content/res/XmlBlock.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public @Nullable String getAlwaysOnVpnPackage(@NonNull ComponentName admin) {
throwIfParentInstance("getAlwaysOnVpnPackage");
if (mService != null) {
try {
return mService.getAlwaysOnVpnPackage(admin);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAlwaysOnVpnPackage
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getAlwaysOnVpnPackage
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
void killAppAtUsersRequest(ProcessRecord app, Dialog fromDialog) {
synchronized (this) {
mAppErrors.killAppAtUserRequestLocked(app, fromDialog);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: killAppAtUsersRequest
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2018-9492
|
HIGH
| 7.2
|
android
|
killAppAtUsersRequest
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setColumnId(String id, Column<T, ?> column) {
if (columnIds.containsKey(id)) {
throw new IllegalArgumentException("Duplicate ID for columns");
}
columnIds.put(id, column);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setColumnId
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
setColumnId
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void updateUi() {
final boolean canInput = mSaveAndFinishWorker == null;
LockscreenCredential password = mIsAlphaMode
? LockscreenCredential.createPasswordOrNone(mPasswordEntry.getText())
: LockscreenCredential.createPinOrNone(mPasswordEntry.getText());
final int length = password.size();
if (mUiStage == Stage.Introduction) {
mPasswordRestrictionView.setVisibility(View.VISIBLE);
final boolean passwordCompliant = validatePassword(password);
String[] messages = convertErrorCodeToMessages();
// Update the fulfillment of requirements.
mPasswordRequirementAdapter.setRequirements(messages);
// Enable/Disable the next button accordingly.
setNextEnabled(passwordCompliant);
} else {
// Hide password requirement view when we are just asking user to confirm the pw.
mPasswordRestrictionView.setVisibility(View.GONE);
setHeaderText(mUiStage.getHint(getContext(), mIsAlphaMode, getStageType(),
mIsManagedProfile));
setNextEnabled(canInput && length >= LockPatternUtils.MIN_LOCK_PASSWORD_SIZE);
mSkipOrClearButton.setVisibility(toVisibility(canInput && length > 0));
}
final int stage = getStageType();
if (getStageType() != Stage.TYPE_NONE) {
int message = mUiStage.getMessage(mIsAlphaMode, stage);
if (message != 0) {
mMessage.setVisibility(View.VISIBLE);
mMessage.setText(message);
} else {
mMessage.setVisibility(View.INVISIBLE);
}
} else {
mMessage.setVisibility(View.GONE);
}
setNextText(mUiStage.buttonText);
mPasswordEntryInputDisabler.setInputEnabled(canInput);
password.zeroize();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateUi
File: src/com/android/settings/password/ChooseLockPassword.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
updateUi
|
src/com/android/settings/password/ChooseLockPassword.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
protected List<CmsProperty> tryAddImageSizeFromSvg(byte[] content, List<CmsProperty> properties) {
if ((content == null) || (content.length == 0)) {
return properties;
}
List<CmsProperty> newProps = properties;
try {
double w = -1, h = -1;
SAXReader reader = new SAXReader();
Document doc = reader.read(new ByteArrayInputStream(content));
Element node = (Element)(doc.selectSingleNode("/svg"));
if (node != null) {
String widthStr = node.attributeValue("width");
String heightStr = node.attributeValue("height");
SvgSize width = SvgSize.parse(widthStr);
SvgSize height = SvgSize.parse(heightStr);
if ((width != null) && (height != null) && Objects.equals(width.getUnit(), height.getUnit())) {
// If width and height are given and have the same units, just interpret them as pixels, otherwise use viewbox
w = width.getSize();
h = height.getSize();
} else {
String viewboxStr = node.attributeValue("viewBox");
if (viewboxStr != null) {
viewboxStr = viewboxStr.replace(",", " ");
String[] viewboxParts = viewboxStr.trim().split(" +");
if (viewboxParts.length == 4) {
w = Double.parseDouble(viewboxParts[2]);
h = Double.parseDouble(viewboxParts[3]);
}
}
}
if ((w > 0) && (h > 0)) {
String propValue = "w:" + (int)Math.round(w) + ",h:" + (int)Math.round(h);
Map<String, CmsProperty> propsMap = properties == null
? new HashMap<>()
: CmsProperty.toObjectMap(properties);
propsMap.put(
CmsPropertyDefinition.PROPERTY_IMAGE_SIZE,
new CmsProperty(CmsPropertyDefinition.PROPERTY_IMAGE_SIZE, null, propValue));
newProps = new ArrayList<>(propsMap.values());
}
}
} catch (Exception e) {
LOG.error("Error while trying to determine size of SVG: " + e.getLocalizedMessage(), e);
}
return newProps;
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2021-3312
- Severity: MEDIUM
- CVSS Score: 4.0
Description: Fixed XXE issue in SVG processing (github issue #725).
Function: tryAddImageSizeFromSvg
File: src/org/opencms/file/types/CmsResourceTypeImage.java
Repository: alkacon/opencms-core
Fixed Code:
protected List<CmsProperty> tryAddImageSizeFromSvg(byte[] content, List<CmsProperty> properties) {
if ((content == null) || (content.length == 0)) {
return properties;
}
List<CmsProperty> newProps = properties;
try {
double w = -1, h = -1;
SAXReader reader = new SAXReader();
reader.setEntityResolver(new CmsXmlEntityResolver(null));
Document doc = reader.read(new ByteArrayInputStream(content));
Element node = (Element)(doc.selectSingleNode("/svg"));
if (node != null) {
String widthStr = node.attributeValue("width");
String heightStr = node.attributeValue("height");
SvgSize width = SvgSize.parse(widthStr);
SvgSize height = SvgSize.parse(heightStr);
if ((width != null) && (height != null) && Objects.equals(width.getUnit(), height.getUnit())) {
// If width and height are given and have the same units, just interpret them as pixels, otherwise use viewbox
w = width.getSize();
h = height.getSize();
} else {
String viewboxStr = node.attributeValue("viewBox");
if (viewboxStr != null) {
viewboxStr = viewboxStr.replace(",", " ");
String[] viewboxParts = viewboxStr.trim().split(" +");
if (viewboxParts.length == 4) {
w = Double.parseDouble(viewboxParts[2]);
h = Double.parseDouble(viewboxParts[3]);
}
}
}
if ((w > 0) && (h > 0)) {
String propValue = "w:" + (int)Math.round(w) + ",h:" + (int)Math.round(h);
Map<String, CmsProperty> propsMap = properties == null
? new HashMap<>()
: CmsProperty.toObjectMap(properties);
propsMap.put(
CmsPropertyDefinition.PROPERTY_IMAGE_SIZE,
new CmsProperty(CmsPropertyDefinition.PROPERTY_IMAGE_SIZE, null, propValue));
newProps = new ArrayList<>(propsMap.values());
}
}
} catch (Exception e) {
LOG.error("Error while trying to determine size of SVG: " + e.getLocalizedMessage(), e);
}
return newProps;
}
|
[
"CWE-611"
] |
CVE-2021-3312
|
MEDIUM
| 4
|
alkacon/opencms-core
|
tryAddImageSizeFromSvg
|
src/org/opencms/file/types/CmsResourceTypeImage.java
|
92e035423aa6967822d343e54392d4291648c0ee
| 1
|
Analyze the following code function for security vulnerabilities
|
@Test // If the file doesn't exist, we don't use it, obviously.
public void staleCacheFileDoesntExist() throws Exception {
final File cachedfile = fakeFile("/cache/fake-file");
// From the JDK manual: "returns 0L if the file does not exist
// or if an I/O error occurs"
when(cachedfile.lastModified()).thenReturn(0L);
assertTrue("File is stale", staleCacheFile(null, 0, 10, cachedfile));
verify(cachedfile).lastModified(); // Ensure we do a single stat() call.
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: staleCacheFileDoesntExist
File: test/tsd/TestGraphHandler.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2023-25826
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
staleCacheFileDoesntExist
|
test/tsd/TestGraphHandler.java
|
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
| 0
|
Analyze the following code function for security vulnerabilities
|
private static native int nativeAssetRead(long assetPtr, byte[] b, int off, int len);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeAssetRead
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
|
nativeAssetRead
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getUserId() {
return userId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserId
File: src/com/dotmarketing/cms/comment/struts/CommentsForm.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-254",
"CWE-264"
] |
CVE-2016-8600
|
MEDIUM
| 5
|
dotCMS/core
|
getUserId
|
src/com/dotmarketing/cms/comment/struts/CommentsForm.java
|
cb84b130065c9eed1d1df9e4770ffa5d4bd30569
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public CmsResource createResource(
CmsObject cms,
CmsSecurityManager securityManager,
String resourcename,
byte[] content,
List<CmsProperty> properties)
throws CmsException {
if (resourcename.toLowerCase().endsWith(".svg")) {
List<CmsProperty> prop2 = tryAddImageSizeFromSvg(content, properties);
properties = prop2;
} else if (CmsImageLoader.isEnabled()) {
String rootPath = cms.getRequestContext().addSiteRoot(resourcename);
// get the downscaler to use
CmsImageScaler downScaler = getDownScaler(cms, rootPath);
// create a new image scale adjuster
CmsImageAdjuster adjuster = new CmsImageAdjuster(content, rootPath, properties, downScaler);
// update the image scale adjuster - this will calculate the image dimensions and (optionally) downscale the size
adjuster.adjust();
// continue with the updated content and properties
content = adjuster.getContent();
properties = adjuster.getProperties();
}
return super.createResource(cms, securityManager, resourcename, content, properties);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createResource
File: src/org/opencms/file/types/CmsResourceTypeImage.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-3312
|
MEDIUM
| 4
|
alkacon/opencms-core
|
createResource
|
src/org/opencms/file/types/CmsResourceTypeImage.java
|
92e035423aa6967822d343e54392d4291648c0ee
| 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/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setOauthAuthorizationCodeFlow
|
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean setResetPasswordToken(ComponentName admin, String callerPackageName,
byte[] token) {
if (!mHasFeature || !mLockPatternUtils.hasSecureLockScreen()) {
return false;
}
if (token == null || token.length < 32) {
throw new IllegalArgumentException("token must be at least 32-byte long");
}
CallerIdentity caller;
if (isUnicornFlagEnabled()) {
caller = getCallerIdentity(admin, callerPackageName);
} else {
caller = getCallerIdentity(admin);
}
final int userId = caller.getUserId();
if (isUnicornFlagEnabled()) {
EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin(
admin,
MANAGE_DEVICE_POLICY_RESET_PASSWORD,
caller.getPackageName(),
userId);
Long currentTokenHandle = mDevicePolicyEngine.getLocalPolicySetByAdmin(
PolicyDefinition.RESET_PASSWORD_TOKEN,
enforcingAdmin,
userId);
long tokenHandle = addEscrowToken(
token, currentTokenHandle == null ? 0 : currentTokenHandle, userId);
if (tokenHandle == 0) {
return false;
}
mDevicePolicyEngine.setLocalPolicy(
PolicyDefinition.RESET_PASSWORD_TOKEN,
enforcingAdmin,
new LongPolicyValue(tokenHandle),
userId);
return true;
} else {
Objects.requireNonNull(admin, "ComponentName is null");
Preconditions.checkCallAuthorization(
isProfileOwner(caller) || isDefaultDeviceOwner(caller));
synchronized (getLockObject()) {
DevicePolicyData policy = getUserData(userId);
policy.mPasswordTokenHandle = addEscrowToken(
token, policy.mPasswordTokenHandle, userId);
saveSettingsLocked(userId);
return policy.mPasswordTokenHandle != 0;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setResetPasswordToken
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
|
setResetPasswordToken
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRealAssetPath(String inode) {
String _inode = inode;
String path = "";
String realPath = Config.getStringProperty("ASSET_REAL_PATH");
if (UtilMethods.isSet(realPath) && !realPath.endsWith(java.io.File.separator))
realPath = realPath + java.io.File.separator;
String assetPath = Config.getStringProperty("ASSET_PATH");
if (UtilMethods.isSet(assetPath) && !assetPath.endsWith(java.io.File.separator))
assetPath = assetPath + java.io.File.separator;
path = ((!UtilMethods.isSet(realPath)) ? assetPath : realPath)
+ _inode.charAt(0) + java.io.File.separator + _inode.charAt(1)
+ java.io.File.separator + _inode+ java.io.File.separator + "fileAsset" + java.io.File.separator;
if (!UtilMethods.isSet(realPath))
return FileUtil.getRealPath(path);
else
return path;
}
|
Vulnerability Classification:
- CWE: CWE-434
- CVE: CVE-2017-11466
- Severity: HIGH
- CVSS Score: 9.0
Description: #12131 fixes arbitrary upload (#12134)
* #12131 fixes arbitrary upload
* #12131 fixes jenkins feedback
Function: getRealAssetPath
File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
Repository: dotCMS/core
Fixed Code:
public String getRealAssetPath(String inode) {
String _inode = inode;
String path = "";
String realPath = Config.getStringProperty("ASSET_REAL_PATH", null);
if (UtilMethods.isSet(realPath) && !realPath.endsWith(java.io.File.separator))
realPath = realPath + java.io.File.separator;
String assetPath = Config.getStringProperty("ASSET_PATH", DEFAULT_RELATIVE_ASSET_PATH);
if (UtilMethods.isSet(assetPath) && !assetPath.endsWith(java.io.File.separator))
assetPath = assetPath + java.io.File.separator;
path = ((!UtilMethods.isSet(realPath)) ? assetPath : realPath)
+ _inode.charAt(0) + java.io.File.separator + _inode.charAt(1)
+ java.io.File.separator + _inode+ java.io.File.separator + "fileAsset" + java.io.File.separator;
if (!UtilMethods.isSet(realPath))
return FileUtil.getRealPath(path);
else
return path;
}
|
[
"CWE-434"
] |
CVE-2017-11466
|
HIGH
| 9
|
dotCMS/core
|
getRealAssetPath
|
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
|
ab2bb2e00b841d131b8734227f9106e3ac31bb99
| 1
|
Analyze the following code function for security vulnerabilities
|
private void registerLogoutListener()
{
this.observationManager.addListener(new EventListener()
{
private final Event ev = new ActionExecutingEvent();
@Override
public String getName()
{
return "deleteLocksOnLogoutListener";
}
@Override
public List<Event> getEvents()
{
return Collections.<Event>singletonList(this.ev);
}
@Override
public void onEvent(Event event, Object source, Object data)
{
if ("logout".equals(((ActionExecutingEvent) event).getActionName())) {
final XWikiContext ctx = (XWikiContext) data;
if (ctx.getUserReference() != null) {
releaseAllLocksForCurrentUser(ctx);
}
}
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerLogoutListener
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
|
registerLogoutListener
|
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
|
public boolean has_error() {
return parser.cs == puma_parser_error;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: has_error
File: ext/puma_http11/org/jruby/puma/Http11Parser.java
Repository: puma
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-41136
|
LOW
| 3.6
|
puma
|
has_error
|
ext/puma_http11/org/jruby/puma/Http11Parser.java
|
acdc3ae571dfae0e045cf09a295280127db65c7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public final Clock getClock() {
return clock;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClock
File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
Repository: googleapis/google-oauth-java-client
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2020-7692
|
MEDIUM
| 6.4
|
googleapis/google-oauth-java-client
|
getClock
|
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
|
13433cd7dd06267fc261f0b1d4764f8e3432c824
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setWindowsForAccessibilityCallback(WindowsForAccessibilityCallback callback) {
synchronized (mWindowMap) {
if (mAccessibilityController == null) {
mAccessibilityController = new AccessibilityController(
WindowManagerService.this);
}
mAccessibilityController.setWindowsForAccessibilityCallback(callback);
if (!mAccessibilityController.hasCallbacksLocked()) {
mAccessibilityController = null;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setWindowsForAccessibilityCallback
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
setWindowsForAccessibilityCallback
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Object createClassFromConfig(String param, String defClass, XWikiContext context) throws XWikiException
{
String storeclass = getConfiguration().getProperty(param, defClass);
try {
Class<?>[] classes = new Class<?>[] { XWikiContext.class };
Object[] args = new Object[] { context };
Object result = Class.forName(storeclass).getConstructor(classes).newInstance(args);
return result;
} catch (Exception e) {
Throwable ecause = e;
if (e instanceof InvocationTargetException) {
ecause = ((InvocationTargetException) e).getTargetException();
}
Object[] args = { param, storeclass };
throw new XWikiException(XWikiException.MODULE_XWIKI_STORE,
XWikiException.ERROR_XWIKI_STORE_CLASSINVOCATIONERROR, "Cannot load class {1} from param {0}", ecause,
args);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createClassFromConfig
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
createClassFromConfig
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isValidCustomMapping(BaseClass bclass, Metadata metadata)
{
PersistentClass mapping = metadata.getEntityBinding(bclass.getName());
if (mapping == null) {
return true;
}
Iterator<Property> it = mapping.getPropertyIterator();
while (it.hasNext()) {
Property hibprop = it.next();
String propname = hibprop.getName();
PropertyClass propclass = (PropertyClass) bclass.getField(propname);
if (propclass == null) {
this.logger.warn("Mapping contains invalid field name [{}]", propname);
return false;
}
boolean result = isValidColumnType(hibprop.getValue().getType().getName(), propclass.getClassName());
if (!result) {
this.logger.warn("Mapping contains invalid type in field [{}]", propname);
return false;
}
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isValidCustomMapping
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
|
isValidCustomMapping
|
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
|
@Override
public String getUriForDisplay() {
return this.getUrlArgument().forDisplay();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUriForDisplay
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
|
getUriForDisplay
|
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("rawtypes")
private StudyEventDefinitionDAO seddao() {
return new StudyEventDefinitionDAO(dataSource);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: seddao
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
|
seddao
|
web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java
|
6f864e86543f903bd20d6f9fc7056115106441f3
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String quoteOneItem( String inputString, boolean isExecutable )
{
char[] escapeChars = getEscapeChars( isSingleQuotedExecutableEscaped(), isDoubleQuotedExecutableEscaped() );
return StringUtils.quoteAndEscape(
inputString,
isExecutable ? getExecutableQuoteDelimiter() : getArgumentQuoteDelimiter(),
escapeChars,
getQuotingTriggerChars(),
'\\',
unconditionalQuoting
);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: quoteOneItem
File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
Repository: apache/maven-shared-utils
The code follows secure coding practices.
|
[
"CWE-116"
] |
CVE-2022-29599
|
HIGH
| 7.5
|
apache/maven-shared-utils
|
quoteOneItem
|
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
|
bb6b6a4bf44cc09f120068bd29fed3e9ab10eb6f
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getSmallLogoUrl() {
String defaultLogo = CONF.serverUrl() + CONF.imagesLink() + "/logowhite.png";
String logoUrl = CONF.logoSmallUrl();
String defaultMainLogoUrl = CONF.imagesLink() + "/logo.svg";
String mainLogoUrl = CONF.logoUrl();
if (!defaultLogo.equals(logoUrl)) {
return logoUrl;
} else if (!mainLogoUrl.equals(defaultMainLogoUrl)) {
return mainLogoUrl;
}
return logoUrl;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSmallLogoUrl
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
getSmallLogoUrl
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Collection create(Context context, Community community,
String handle, UUID uuid) throws SQLException, AuthorizeException {
if (community == null) {
throw new IllegalArgumentException("Community cannot be null when creating a new collection.");
}
Collection newCollection;
if (uuid != null) {
newCollection = collectionDAO.create(context, new Collection(uuid));
} else {
newCollection = collectionDAO.create(context, new Collection());
}
//Add our newly created collection to our community, authorization checks occur in THIS method
communityService.addCollection(context, community, newCollection);
// create the default authorization policy for collections
// of 'anonymous' READ
Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS);
authorizeService.createResourcePolicy(context, newCollection, anonymousGroup, null, Constants.READ, null);
// now create the default policies for submitted items
authorizeService
.createResourcePolicy(context, newCollection, anonymousGroup, null, Constants.DEFAULT_ITEM_READ, null);
authorizeService
.createResourcePolicy(context, newCollection, anonymousGroup, null,
Constants.DEFAULT_BITSTREAM_READ, null);
collectionDAO.save(context, newCollection);
//Update our collection so we have a collection identifier
try {
if (handle == null) {
identifierService.register(context, newCollection);
} else {
identifierService.register(context, newCollection, handle);
}
} catch (IllegalStateException | IdentifierException ex) {
throw new IllegalStateException(ex);
}
context.addEvent(new Event(Event.CREATE, Constants.COLLECTION,
newCollection.getID(), newCollection.getHandle(),
getIdentifiers(context, newCollection)));
log.info(LogHelper.getHeader(context, "create_collection",
"collection_id=" + newCollection.getID())
+ ",handle=" + newCollection.getHandle());
return newCollection;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: create
File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41189
|
HIGH
| 9
|
DSpace
|
create
|
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
|
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder addOption(String option, String value) {
if (option != null) {
if (value != null) {
options.put(option, value);
} else {
options.remove(option);
}
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addOption
File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
Repository: ClickHouse/clickhouse-java
The code follows secure coding practices.
|
[
"CWE-209"
] |
CVE-2024-23689
|
HIGH
| 8.8
|
ClickHouse/clickhouse-java
|
addOption
|
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
|
4f8d9303eb991b39ec7e7e34825241efa082238a
| 0
|
Analyze the following code function for security vulnerabilities
|
public IntentSender getIntentSender() {
return new IntentSender((IIntentSender) mLocalSender);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIntentSender
File: cmds/pm/src/com/android/commands/pm/Pm.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3833
|
HIGH
| 9.3
|
android
|
getIntentSender
|
cmds/pm/src/com/android/commands/pm/Pm.java
|
4e4743a354e26467318b437892a9980eb9b8328a
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getDocumentRoot() {
return this.fileRoot;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDocumentRoot
File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java
Repository: jflyfox/jfinal_cms
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2021-37262
|
MEDIUM
| 5
|
jflyfox/jfinal_cms
|
getDocumentRoot
|
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
|
e7fd0fe9362464c4d2bd308318eecc89a847b116
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void reply(Context launcher, Account account, Message message) {
launch(launcher, account, message, REPLY, null, null, null, null, null /* extraValues */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reply
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
|
reply
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean requestForbidden(HttpServletRequest request) {
if (!xsrfProtectionEnabled) {
return false;
}
HttpSession session = request.getSession(false);
if (session == null) {
return false;
}
String csrfTokenInSession = (String) session
.getAttribute(VaadinService.getCsrfTokenAttributeName());
if (csrfTokenInSession == null) {
if (getLogger().isInfoEnabled()) {
getLogger().info(
"Unable to verify CSRF token for endpoint request, got null token in session");
}
return true;
}
if (!csrfTokenInSession.equals(request.getHeader("X-CSRF-Token"))) {
if (getLogger().isInfoEnabled()) {
getLogger().info("Invalid CSRF token in endpoint request");
}
return true;
}
return false;
}
|
Vulnerability Classification:
- CWE: CWE-203
- CVE: CVE-2021-31406
- Severity: LOW
- CVSS Score: 1.9
Description: Use time-constant comparison for CSRF tokens in endpoint
Function: requestForbidden
File: fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
Repository: vaadin/flow
Fixed Code:
private boolean requestForbidden(HttpServletRequest request) {
if (!xsrfProtectionEnabled) {
return false;
}
HttpSession session = request.getSession(false);
if (session == null) {
return false;
}
String csrfTokenInSession = (String) session
.getAttribute(VaadinService.getCsrfTokenAttributeName());
if (csrfTokenInSession == null) {
if (getLogger().isInfoEnabled()) {
getLogger().info(
"Unable to verify CSRF token for endpoint request, got null token in session");
}
return true;
}
String csrfTokenInRequest = request.getHeader("X-CSRF-Token");
if (csrfTokenInRequest == null || !MessageDigest.isEqual(
csrfTokenInSession.getBytes(StandardCharsets.UTF_8),
csrfTokenInRequest.getBytes(StandardCharsets.UTF_8))) {
if (getLogger().isInfoEnabled()) {
getLogger().info("Invalid CSRF token in endpoint request");
}
return true;
}
return false;
}
|
[
"CWE-203"
] |
CVE-2021-31406
|
LOW
| 1.9
|
vaadin/flow
|
requestForbidden
|
fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
|
3fe644cab2cffa5b86316dbe71b11df1083861a9
| 1
|
Analyze the following code function for security vulnerabilities
|
protected int computeStatusBarMode(int oldVal, int newVal) {
return computeBarMode(oldVal, newVal, View.STATUS_BAR_TRANSIENT,
View.STATUS_BAR_TRANSLUCENT, View.STATUS_BAR_TRANSPARENT);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: computeStatusBarMode
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
|
computeStatusBarMode
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addShortcutChangeCallback(
@NonNull LauncherApps.ShortcutChangeCallback callback) {
synchronized (mLock) {
mShortcutChangeCallbacks.add(Objects.requireNonNull(callback));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addShortcutChangeCallback
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
|
addShortcutChangeCallback
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearMediaDB(String lastId, String capturePath) {
final String[] imageColumns = {MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_TAKEN, MediaStore.Images.Media.SIZE, MediaStore.Images.Media._ID};
final String imageOrderBy = MediaStore.Images.Media._ID + " DESC";
final String imageWhere = MediaStore.Images.Media._ID + ">?";
final String[] imageArguments = {lastId};
Cursor imageCursor = getContext().getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, imageColumns, imageWhere, imageArguments, imageOrderBy);
if (imageCursor.getCount() > 1) {
while (imageCursor.moveToNext()) {
int id = imageCursor.getInt(imageCursor.getColumnIndex(MediaStore.Images.Media._ID));
String path = imageCursor.getString(imageCursor.getColumnIndex(MediaStore.Images.Media.DATA));
Long takenTimeStamp = imageCursor.getLong(imageCursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN));
Long size = imageCursor.getLong(imageCursor.getColumnIndex(MediaStore.Images.Media.SIZE));
if (path.contentEquals(capturePath)) {
// Remove it
ContentResolver cr = getContext().getContentResolver();
cr.delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, MediaStore.Images.Media._ID + "=?", new String[]{Long.toString(id)});
break;
}
}
}
imageCursor.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearMediaDB
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
|
clearMediaDB
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<Modification> latestOneModificationAsModifications() {
return findRecentModifications(1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: latestOneModificationAsModifications
File: domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2022-29184
|
MEDIUM
| 6.5
|
gocd
|
latestOneModificationAsModifications
|
domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java
|
37d35115db2ada2190173f9413cfe1bc6c295ecb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String pattern() {
return route.pattern().substring(route.pattern().indexOf('/'));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pattern
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
|
pattern
|
jooby/src/main/java/org/jooby/internal/RouteImpl.java
|
34856a738829d8fedca4ed27bd6ff413af87186f
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeInt(maxNum);
data.writeInt(flags);
mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
reply.readException();
ArrayList<ActivityManager.RunningServiceInfo> list = null;
int N = reply.readInt();
if (N >= 0) {
list = new ArrayList<>();
while (N > 0) {
ActivityManager.RunningServiceInfo info =
ActivityManager.RunningServiceInfo.CREATOR
.createFromParcel(reply);
list.add(info);
N--;
}
}
data.recycle();
reply.recycle();
return list;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServices
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getServices
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private void createClusterRoleBinding(String namespace, TaskLogger jobLogger) {
AtomicBoolean clusterRoleBindingExists = new AtomicBoolean(false);
Commandline cmd = newKubeCtl();
cmd.addArgs("get", "clusterrolebindings", "--field-selector", "metadata.name=" + namespace,
"-o", "name");
cmd.execute(new LineConsumer() {
@Override
public void consume(String line) {
clusterRoleBindingExists.set(true);
}
}, new LineConsumer() {
@Override
public void consume(String line) {
jobLogger.error("Kubernetes: " + line);
}
}).checkReturnCode();
if (clusterRoleBindingExists.get())
deleteClusterRoleBinding(namespace, jobLogger);
Map<Object, Object> clusterRoleBindingDef = CollectionUtils.newLinkedHashMap(
"apiVersion", "rbac.authorization.k8s.io/v1",
"kind", "ClusterRoleBinding",
"metadata", CollectionUtils.newLinkedHashMap(
"name", namespace),
"subjects", Lists.<Object>newArrayList(CollectionUtils.newLinkedHashMap(
"kind", "ServiceAccount",
"name", "default",
"namespace", namespace)),
"roleRef", CollectionUtils.newLinkedHashMap(
"apiGroup", "rbac.authorization.k8s.io",
"kind", "ClusterRole",
"name", getClusterRole()));
createResource(clusterRoleBindingDef, new HashSet<>(), jobLogger);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createClusterRoleBinding
File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-610"
] |
CVE-2022-39206
|
CRITICAL
| 9.9
|
theonedev/onedev
|
createClusterRoleBinding
|
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
|
0052047a5b5095ac6a6b4a73a522d0272fec3a22
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateResources() {
FontSizeUtils.updateFontSize(mAlarmStatus, R.dimen.qs_date_collapsed_size);
FontSizeUtils.updateFontSize(mEmergencyOnly, R.dimen.qs_emergency_calls_only_text_size);
mGearTranslation = mContext.getResources().getDimension(R.dimen.qs_header_gear_translation);
mDateTimeTranslation = mContext.getResources().getDimension(
R.dimen.qs_date_anim_translation);
mDateTimeAlarmTranslation = mContext.getResources().getDimension(
R.dimen.qs_date_alarm_anim_translation);
float dateCollapsedSize = mContext.getResources().getDimension(
R.dimen.qs_date_collapsed_text_size);
float dateExpandedSize = mContext.getResources().getDimension(
R.dimen.qs_date_text_size);
mDateScaleFactor = dateExpandedSize / dateCollapsedSize;
updateDateTimePosition();
mSecondHalfAnimator = new TouchAnimator.Builder()
.addFloat(mShowFullAlarm ? mAlarmStatus : findViewById(R.id.date), "alpha", 0, 1)
.addFloat(mEmergencyOnly, "alpha", 0, 1)
.setStartDelay(.5f)
.build();
if (mShowFullAlarm) {
mFirstHalfAnimator = new TouchAnimator.Builder()
.addFloat(mAlarmStatusCollapsed, "alpha", 1, 0)
.setEndDelay(.5f)
.build();
}
mDateSizeAnimator = new TouchAnimator.Builder()
.addFloat(mDateTimeGroup, "scaleX", 1, mDateScaleFactor)
.addFloat(mDateTimeGroup, "scaleY", 1, mDateScaleFactor)
.setStartDelay(.36f)
.build();
updateSettingsAnimator();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateResources
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3886
|
HIGH
| 7.2
|
android
|
updateResources
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
|
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Provides
@Singleton
SessionStore sessionStoreAdapter(@Named(LOCAL_MEMORY_SESSION_CACHE_BINDING_NAME) Cache<AsciiString, ByteBuf> cache) {
return new LocalMemorySessionStore(cache);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sessionStoreAdapter
File: ratpack-session/src/main/java/ratpack/session/SessionModule.java
Repository: ratpack
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2019-11808
|
MEDIUM
| 4.3
|
ratpack
|
sessionStoreAdapter
|
ratpack-session/src/main/java/ratpack/session/SessionModule.java
|
f2b63eb82dd71194319fd3945f5edf29b8f3a42d
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void cacheUniqueFindersCache(
KBTemplateModelImpl kbTemplateModelImpl) {
Object[] args = new Object[] {
kbTemplateModelImpl.getUuid(), kbTemplateModelImpl.getGroupId()
};
finderCache.putResult(FINDER_PATH_COUNT_BY_UUID_G, args,
Long.valueOf(1), false);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G, args,
kbTemplateModelImpl, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cacheUniqueFindersCache
File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
Repository: brianchandotcom/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-12647
|
MEDIUM
| 4.3
|
brianchandotcom/liferay-portal
|
cacheUniqueFindersCache
|
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
|
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void checkCreateClassLoader() {
try {
if (enterPublicInterface())
return;
if (isMainThreadAndInactive()) {
LOG.trace("Allowing main thread to create a ClassLoader inbetween tests"); //$NON-NLS-1$
return;
}
checkForNonWhitelistedStackFrames(() -> localized("security.error_classloader")); //$NON-NLS-1$
} finally {
exitPublicInterface();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkCreateClassLoader
File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
Repository: ls1intum/Ares
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2024-23683
|
HIGH
| 8.2
|
ls1intum/Ares
|
checkCreateClassLoader
|
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
|
af4f28a56e2fe600d8750b3b415352a0a3217392
| 0
|
Analyze the following code function for security vulnerabilities
|
private void enforceRegisterSimSubscriptionPermission() {
enforcePermission(REGISTER_SIM_SUBSCRIPTION);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforceRegisterSimSubscriptionPermission
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0847
|
HIGH
| 7.2
|
android
|
enforceRegisterSimSubscriptionPermission
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
2750faaa1ec819eed9acffea7bd3daf867fda444
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public short readShort() throws JMSException {
return (Short)this.readPrimitiveType(Short.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readShort
File: src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
Repository: rabbitmq/rabbitmq-jms-client
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2020-36282
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-jms-client
|
readShort
|
src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
|
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setSubscriptionGroup(ParcelUuid subscriptionGroup) {
this.mSubscriptionGroup = subscriptionGroup;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSubscriptionGroup
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
setSubscriptionGroup
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private Set<EntityReference> getUniqueLinkedEntityReferences(XWikiContext context, EntityType entityType)
{
Set<EntityReference> references;
XWikiDocument contextDoc = context.getDoc();
WikiReference contextWikiReference = context.getWikiReference();
try {
// Make sure the right document is used as context document
context.setDoc(this);
// Make sure the right wiki is used as context document
context.setWikiReference(getDocumentReference().getWikiReference());
if (is10Syntax()) {
references = (Set) getUniqueLinkedPages10(context);
} else {
references = new LinkedHashSet<>();
// Document content
XDOM dom = getXDOM();
getUniqueLinkedEntityReferences(dom, entityType, references);
// XObjects
for (List<BaseObject> xobjects : getXObjects().values()) {
xobjects.stream()
.forEach(xobject -> getUniqueLinkedEntityReferences(xobject, entityType, references, context));
}
}
} finally {
context.setDoc(contextDoc);
context.setWikiReference(contextWikiReference);
}
return references;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUniqueLinkedEntityReferences
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getUniqueLinkedEntityReferences
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<? extends LocationLink> findDefinition(DOMDocument xmlDocument, Position position,
CancelChecker cancelChecker) {
return definition.findDefinition(xmlDocument, position, cancelChecker);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findDefinition
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
|
findDefinition
|
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
|
e37c399aa266be1b7a43061d4afc43dc230410d2
| 0
|
Analyze the following code function for security vulnerabilities
|
private void logStartTemplateGeneration(TemplateDescriptorEntity template) {
log.finest("started: " + template.toString());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logStartTemplateGeneration
File: AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java
Repository: liimaorg/liima
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2023-26092
|
CRITICAL
| 9.8
|
liimaorg/liima
|
logStartTemplateGeneration
|
AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java
|
78ba2e198c615dc8858e56eee3290989f0362686
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onPackageRemoved(@NonNull AndroidPackage pkg) {
mPermissionManagerServiceImpl.onPackageRemoved(pkg);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPackageRemoved
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
onPackageRemoved
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient addDefaultCookie(String key, String value) {
defaultCookieMap.put(key, value);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addDefaultCookie
File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
addDefaultCookie
|
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void onCreateAndProvisionManagedProfileCompleted(
ManagedProfileProvisioningParams provisioningParams) {}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreateAndProvisionManagedProfileCompleted
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
|
onCreateAndProvisionManagedProfileCompleted
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
protected GetMethod executeGet(String uri, String userName, String password) throws Exception
{
HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, password));
httpClient.getParams().setAuthenticationPreemptive(true);
GetMethod getMethod = new GetMethod(uri);
getMethod.addRequestHeader("Accept", MediaType.APPLICATION_XML.toString());
httpClient.executeMethod(getMethod);
return getMethod;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeGet
File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2023-37277
|
CRITICAL
| 9.6
|
xwiki/xwiki-platform
|
executeGet
|
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
|
4c175405faa0e62437df397811c7526dfc0fbae7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public <K, V> RemoteCache<K, V> getCache() {
return getCache(configuration.forceReturnValues());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCache
File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
Repository: infinispan
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2017-15089
|
MEDIUM
| 6.5
|
infinispan
|
getCache
|
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
|
efc44b7b0a5dd4f44773808840dd9785cabcf21c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void launchCamera(boolean animate, int source) {
if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP) {
mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP;
} else if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_WIGGLE) {
mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_WIGGLE;
} else {
// Default.
mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_AFFORDANCE;
}
// If we are launching it when we are occluded already we don't want it to animate,
// nor setting these flags, since the occluded state doesn't change anymore, hence it's
// never reset.
if (!isFullyCollapsed()) {
mLaunchingAffordance = true;
setLaunchingAffordance(true);
} else {
animate = false;
}
mAffordanceHelper.launchAffordance(animate, getLayoutDirection() == LAYOUT_DIRECTION_RTL);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: launchCamera
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
|
launchCamera
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) {
//System.out.println("SERVLET GOT CALL"+request.getPathInfo());
String keys[] = {"latitude","longitude","name","check_in_info","points1"};
if(request.getPathInfo()!=null && request.getPathInfo().contains("points1")) {
//Connect to database
String city = request.getParameter("city");
String category = request.getParameter("category");
//System.out.println("Got request for: "+city+" and category: "+category);
//System.out.println(city + ":");
String queryString = "select business.latitude,business.longitude,business.name,c.check_in_info "
+ "from business "
+ "inner join categories "
+ "on categories.bid = business.bid "
+ "inner join checkin c "
+ "on c.bid = business.bid "
+ "where business.city='" + city
+ "' and categories.category='"+category +"'"
+"order by c.check_in_info DESC";
System.out.println("QString: "+queryString);
ResultSet set = dbWrapper.executeQuery(queryString);
if(set==null) {
return;
}
//Create response
JSONArray array = new JSONArray();
int count = 0;
try {
while(set.next()) {
count++;
JSONObject obj = new JSONObject();
obj.put(keys[0], set.getDouble(keys[0]));
obj.put(keys[1], set.getDouble(keys[1]));
obj.put(keys[3], set.getInt(keys[3]));
obj.put(keys[2], set.getString(keys[2]));
array.add(obj);
}
JSONObject resultObject = new JSONObject();
resultObject.put("source", "We got from database");
resultObject.put("city", city);
resultObject.put("category", category);
resultObject.put("points", array);
response.setContentType("application/json");
//System.out.println("JSON Object" + resultObject);
response.getWriter().println(resultObject.toString());
} catch (SQLException | IOException e) {
e.printStackTrace();
System.out.println("Heat map Servlet: "+e.getMessage());
}
} else if(request.getPathInfo()!=null && request.getPathInfo().contains("points")) {
double latitude[] = {40.35762,40.391255,40.4704573375885,40.4285874,40.492067,40.499398,40.487671,40.495483,40.459082,40.4499962,40.463717,40.4882149,40.450249,40.467794,40.462105,40.457881,40.458577,40.458335,40.4852511,40.4582511,40.4653904,40.458703,40.4657572,40.457598,40.457271,40.4606263,40.464176,40.485645,40.474884,40.459747,40.4583902,40.4579265,40.4575612,40.4582381,40.458477,40.4638365,40.4584723,40.4592437,40.4617424,40.4605003,40.475405,40.4601614,40.4613612,40.4605159,40.464615,40.463935,40.457589,40.4641113,40.4582251,40.4573589,40.4585106474725,40.460997,40.459676,40.458522,40.4572607,40.4538201,40.458138,40.464485,40.4572935,40.4502135,40.4472949,40.4481991,40.4496169180659,40.447942,40.447942,40.4574605383472,40.457835,40.4484869,40.4148896,40.4407497519697,40.4115087,40.415053,40.4147064,40.4216159,40.4218925,40.3668,40.3926169,40.3923844,40.393115,40.391732,40.388311,40.39261,40.3923831,40.387167,40.4531335,40.4534167,40.455167,40.4541341,40.4535039,40.4521309,40.4959456,40.4489884,40.455833,40.4621686,40.455167,40.4643755,40.4457075,40.4435041,40.4546428,40.4566455,40.4566092,40.4566994,40.4509987,40.4542747,40.454859,40.4534984,40.4543344,40.455929,40.4531769,40.4480678,40.4527029402106,40.4535915,40.456259,40.4460204,40.4534946,40.4481509,40.4480946,40.464958,40.4484039,40.4730851446399,40.4846476,40.4702876,40.4812123,40.4851129,40.4810824,40.489973,40.4215177,40.3918758,40.3959923,40.3950481,40.3943248,40.3949331,40.3953119,40.409199,40.3996765,40.3992789,40.3971675,40.409125,40.394911,40.388562,40.38892,40.3953565,40.3942631,40.3954709,40.420335,40.412659,40.4025781,40.3885545,40.401054,40.395871,40.3958828,40.443213,40.390935,40.422068,40.3897336,40.397846,40.3959206,40.3966306,40.396132,40.388395,40.420335,40.420335,40.414716,40.409944,40.3886105,40.3886666};
double longitude[] = {-80.05998,-80.073426,-80.0889587402344,-79.9865459,-80.06235,-80.07249,-80.055464,-80.065652,-80.077006,-80.0575565,-79.931884,-79.920642,-79.9145,-79.926611,-79.922481,-79.924269,-79.921053,-79.924717,-79.9259794,-79.9251169,-79.9229971,-79.922447,-79.9148356,-79.9100009,-79.925517,-79.9238313,-79.9252199,-79.926487,-79.918862,-79.9185679,-79.9255146,-79.9180322,-79.9250618,-79.9251176,-79.921901,-79.9316767,-79.9187095,-79.9313671,-79.9251969,-79.9256896,-79.919627,-79.9274944,-79.9259052,-79.925241,-79.922397,-79.933126,-79.9254969,-79.9250911,-79.9251182,-79.9251969,-79.928830198608,-79.928355,-79.923615,-79.925436,-79.9336632,-79.9211464,-79.924797,-79.935388,-79.9252056,-79.9143225,-79.90508,-79.8954753,-79.898855609787,-79.895957,-79.895957,-79.9084721005249,-79.9275276,-79.9012971,-79.987783,-79.9996304512024,-79.9558863,-79.987206,-79.9877685,-79.9934656,-79.992815,-79.981359,-79.9866014,-79.9866275,-79.986911,-79.98718,-79.996225,-79.9968169,-79.9972486,-79.98224,-80.0013672,-79.9997426,-79.999815,-79.9981189,-79.9992711,-79.9981452,-79.9606482,-80.0088714,-80.006512,-80.0190648,-79.994957,-79.9821671,-80.018213,-79.9495881,-79.9907425,-80.0070383,-80.0015054,-80.0105349,-80.0009426,-80.0005142,-79.999162,-80.0012052,-80.0126074,-80.0065429,-80.001199,-80.0042395,-80.0066578388214,-80.0008071,-80.014446,-80.0153356,-79.9993338,-80.0040779,-80.0042488,-79.983936,-80.010841,-79.9621242834648,-80.0354937,-80.0302515,-80.0414427,-80.0416964,-80.0414027,-80.018177,-80.0297492,-80.037826,-80.0350352,-80.034704,-80.0464255,-80.0342686,-80.0343,-80.031761,-80.0434133,-80.0445647,-80.0294805,-80.024957,-80.0339862,-80.049448,-80.049921,-80.0345551,-80.0352133,-80.0347424,-80.030114,-80.030322,-80.041926,-80.0500275,-80.0433063,-80.033585,-80.0466445,-79.9534393,-80.039142,-80.029239,-80.0409102,-80.036197,-80.0348023,-80.0357966,-80.033232,-80.049821,-80.030114,-80.030114,-80.03063,-80.024985,-80.0499034,-80.049779};
String city = request.getParameter("city");
String category = request.getParameter("category");
//System.out.println("Got request for: "+city);
JSONArray array = new JSONArray();
for(int i=0; i<latitude.length; i++) {
JSONObject obj = new JSONObject();
obj.put(keys[0], latitude[i]);
obj.put(keys[1], longitude[i]);
array.add(obj);
}
JSONObject resultObject = new JSONObject();
resultObject.put("city", city);
resultObject.put("points", array);
resultObject.put("category", category);
response.setContentType("application/json");
try {
response.getWriter().println(resultObject.toString());
} catch (IOException e) {
e.printStackTrace();
}
} else {
try {
response.setContentType("text/plain");
response.getWriter().println("This is the response");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2015-10020
- Severity: MEDIUM
- CVSS Score: 5.2
Description: sql injection changes
Function: doGet
File: HeatMapServer/src/com/datformers/servlet/HeatMapServlet.java
Repository: ssn2013/cis450Project
Fixed Code:
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) {
//System.out.println("SERVLET GOT CALL"+request.getPathInfo());
String keys[] = {"latitude","longitude","name","check_in_info","points1"};
if(request.getPathInfo()!=null && request.getPathInfo().contains("points1")) {
//Connect to database
String city = request.getParameter("city");
String category = request.getParameter("category");
//System.out.println("Got request for: "+city+" and category: "+category);
//System.out.println(city + ":");
String queryString = "select business.latitude,business.longitude,business.name,c.check_in_info "
+ "from business "
+ "inner join categories "
+ "on categories.bid = business.bid "
+ "inner join checkin c "
+ "on c.bid = business.bid "
+ "where business.city='" + city
+ "' and categories.category='"+category +"'"
+"order by c.check_in_info DESC";
ResultSet set = dbWrapper.executeQuery(queryString);
if(set==null) {
return;
}
//Create response
JSONArray array = new JSONArray();
int count = 0;
try {
while(set.next()) {
count++;
JSONObject obj = new JSONObject();
obj.put(keys[0], set.getDouble(keys[0]));
obj.put(keys[1], set.getDouble(keys[1]));
obj.put(keys[3], set.getInt(keys[3]));
obj.put(keys[2], set.getString(keys[2]));
array.add(obj);
}
JSONObject resultObject = new JSONObject();
resultObject.put("source", "We got from database");
resultObject.put("city", city);
resultObject.put("category", category);
resultObject.put("points", array);
response.setContentType("application/json");
//System.out.println("JSON Object" + resultObject);
response.getWriter().println(resultObject.toString());
} catch (SQLException | IOException e) {
e.printStackTrace();
System.out.println("Heat map Servlet: "+e.getMessage());
}
} else if(request.getPathInfo()!=null && request.getPathInfo().contains("points")) {
double latitude[] = {40.35762,40.391255,40.4704573375885,40.4285874,40.492067,40.499398,40.487671,40.495483,40.459082,40.4499962,40.463717,40.4882149,40.450249,40.467794,40.462105,40.457881,40.458577,40.458335,40.4852511,40.4582511,40.4653904,40.458703,40.4657572,40.457598,40.457271,40.4606263,40.464176,40.485645,40.474884,40.459747,40.4583902,40.4579265,40.4575612,40.4582381,40.458477,40.4638365,40.4584723,40.4592437,40.4617424,40.4605003,40.475405,40.4601614,40.4613612,40.4605159,40.464615,40.463935,40.457589,40.4641113,40.4582251,40.4573589,40.4585106474725,40.460997,40.459676,40.458522,40.4572607,40.4538201,40.458138,40.464485,40.4572935,40.4502135,40.4472949,40.4481991,40.4496169180659,40.447942,40.447942,40.4574605383472,40.457835,40.4484869,40.4148896,40.4407497519697,40.4115087,40.415053,40.4147064,40.4216159,40.4218925,40.3668,40.3926169,40.3923844,40.393115,40.391732,40.388311,40.39261,40.3923831,40.387167,40.4531335,40.4534167,40.455167,40.4541341,40.4535039,40.4521309,40.4959456,40.4489884,40.455833,40.4621686,40.455167,40.4643755,40.4457075,40.4435041,40.4546428,40.4566455,40.4566092,40.4566994,40.4509987,40.4542747,40.454859,40.4534984,40.4543344,40.455929,40.4531769,40.4480678,40.4527029402106,40.4535915,40.456259,40.4460204,40.4534946,40.4481509,40.4480946,40.464958,40.4484039,40.4730851446399,40.4846476,40.4702876,40.4812123,40.4851129,40.4810824,40.489973,40.4215177,40.3918758,40.3959923,40.3950481,40.3943248,40.3949331,40.3953119,40.409199,40.3996765,40.3992789,40.3971675,40.409125,40.394911,40.388562,40.38892,40.3953565,40.3942631,40.3954709,40.420335,40.412659,40.4025781,40.3885545,40.401054,40.395871,40.3958828,40.443213,40.390935,40.422068,40.3897336,40.397846,40.3959206,40.3966306,40.396132,40.388395,40.420335,40.420335,40.414716,40.409944,40.3886105,40.3886666};
double longitude[] = {-80.05998,-80.073426,-80.0889587402344,-79.9865459,-80.06235,-80.07249,-80.055464,-80.065652,-80.077006,-80.0575565,-79.931884,-79.920642,-79.9145,-79.926611,-79.922481,-79.924269,-79.921053,-79.924717,-79.9259794,-79.9251169,-79.9229971,-79.922447,-79.9148356,-79.9100009,-79.925517,-79.9238313,-79.9252199,-79.926487,-79.918862,-79.9185679,-79.9255146,-79.9180322,-79.9250618,-79.9251176,-79.921901,-79.9316767,-79.9187095,-79.9313671,-79.9251969,-79.9256896,-79.919627,-79.9274944,-79.9259052,-79.925241,-79.922397,-79.933126,-79.9254969,-79.9250911,-79.9251182,-79.9251969,-79.928830198608,-79.928355,-79.923615,-79.925436,-79.9336632,-79.9211464,-79.924797,-79.935388,-79.9252056,-79.9143225,-79.90508,-79.8954753,-79.898855609787,-79.895957,-79.895957,-79.9084721005249,-79.9275276,-79.9012971,-79.987783,-79.9996304512024,-79.9558863,-79.987206,-79.9877685,-79.9934656,-79.992815,-79.981359,-79.9866014,-79.9866275,-79.986911,-79.98718,-79.996225,-79.9968169,-79.9972486,-79.98224,-80.0013672,-79.9997426,-79.999815,-79.9981189,-79.9992711,-79.9981452,-79.9606482,-80.0088714,-80.006512,-80.0190648,-79.994957,-79.9821671,-80.018213,-79.9495881,-79.9907425,-80.0070383,-80.0015054,-80.0105349,-80.0009426,-80.0005142,-79.999162,-80.0012052,-80.0126074,-80.0065429,-80.001199,-80.0042395,-80.0066578388214,-80.0008071,-80.014446,-80.0153356,-79.9993338,-80.0040779,-80.0042488,-79.983936,-80.010841,-79.9621242834648,-80.0354937,-80.0302515,-80.0414427,-80.0416964,-80.0414027,-80.018177,-80.0297492,-80.037826,-80.0350352,-80.034704,-80.0464255,-80.0342686,-80.0343,-80.031761,-80.0434133,-80.0445647,-80.0294805,-80.024957,-80.0339862,-80.049448,-80.049921,-80.0345551,-80.0352133,-80.0347424,-80.030114,-80.030322,-80.041926,-80.0500275,-80.0433063,-80.033585,-80.0466445,-79.9534393,-80.039142,-80.029239,-80.0409102,-80.036197,-80.0348023,-80.0357966,-80.033232,-80.049821,-80.030114,-80.030114,-80.03063,-80.024985,-80.0499034,-80.049779};
String city = request.getParameter("city");
String category = request.getParameter("category");
//System.out.println("Got request for: "+city);
JSONArray array = new JSONArray();
for(int i=0; i<latitude.length; i++) {
JSONObject obj = new JSONObject();
obj.put(keys[0], latitude[i]);
obj.put(keys[1], longitude[i]);
array.add(obj);
}
JSONObject resultObject = new JSONObject();
resultObject.put("city", city);
resultObject.put("points", array);
resultObject.put("category", category);
response.setContentType("application/json");
try {
response.getWriter().println(resultObject.toString());
} catch (IOException e) {
e.printStackTrace();
}
} else {
try {
response.setContentType("text/plain");
response.getWriter().println("This is the response");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
|
[
"CWE-89"
] |
CVE-2015-10020
|
MEDIUM
| 5.2
|
ssn2013/cis450Project
|
doGet
|
HeatMapServer/src/com/datformers/servlet/HeatMapServlet.java
|
39b495011437a105c7670e17e071f99195b4922e
| 1
|
Analyze the following code function for security vulnerabilities
|
public static String escapeAttributeXML(String in) {
int leng = in.length();
StringBuilder sb = new StringBuilder(leng);
for (int i = 0; i < leng; i++) {
char c = in.charAt(i);
if (c == '&') {
sb.append("&");
} else if (c == '"') {
sb.append(""");
} else {
sb.append(c);
}
}
return sb.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: escapeAttributeXML
File: src/edu/stanford/nlp/util/XMLUtils.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-0239
|
HIGH
| 7.5
|
stanfordnlp/CoreNLP
|
escapeAttributeXML
|
src/edu/stanford/nlp/util/XMLUtils.java
|
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
| 0
|
Analyze the following code function for security vulnerabilities
|
@CalledByNative
public int getTopControlsHeightPix() {
return mTopControlsHeightPix;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTopControlsHeightPix
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
getTopControlsHeightPix
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
private ScanResult getScanResultInternal(WifiConfiguration config) {
ScanDetailCache scanDetailCache =
mWifiConfigManager.getScanDetailCacheForNetwork(config.networkId);
ScanResult scanResult = null;
if (mLastBssid != null) {
if (scanDetailCache != null) {
scanResult = scanDetailCache.getScanResult(mLastBssid);
}
// The cached scan result of connected network would be null at the first
// connection, try to check full scan result list again to look up matched
// scan result associated to the current BSSID.
if (scanResult == null) {
scanResult = mScanRequestProxy.getScanResult(mLastBssid);
}
}
return scanResult;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getScanResultInternal
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
|
getScanResultInternal
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public @WifiSecurity int getMinimumRequiredWifiSecurityLevel() {
throwIfParentInstance("getMinimumRequiredWifiSecurityLevel");
if (mService == null) {
return WIFI_SECURITY_OPEN;
}
try {
return mService.getMinimumRequiredWifiSecurityLevel();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMinimumRequiredWifiSecurityLevel
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getMinimumRequiredWifiSecurityLevel
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getContinueToURL(HttpServletRequest request)
{
String savedURL = request.getParameter("xredirect");
if (StringUtils.isEmpty(savedURL)) {
savedURL = SavedRequestManager.getOriginalUrl(request);
}
if (!StringUtils.isEmpty(savedURL)) {
return savedURL;
}
return request.getContextPath() + this.defaultPage;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContinueToURL
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/user/impl/xwiki/MyFormAuthenticator.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-601"
] |
CVE-2022-23618
|
MEDIUM
| 5.8
|
xwiki/xwiki-platform
|
getContinueToURL
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/user/impl/xwiki/MyFormAuthenticator.java
|
5251c02080466bf9fb55288f04a37671108f8096
| 0
|
Analyze the following code function for security vulnerabilities
|
public static NativeArray jsFunction_getSubscriptionsByApplication(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
throws ScriptException, APIManagementException, ApplicationNotFoundException {
NativeArray myn = new NativeArray(0);
if (args != null && isStringArray(args)) {
String applicationName = (String) args[0];
String username = (String) args[1];
String groupingId = (String) args[2];
boolean isTenantFlowStarted = false;
try {
String tenantDomain = MultitenantUtils.getTenantDomain(APIUtil.replaceEmailDomainBack(username));
if (tenantDomain != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
isTenantFlowStarted = true;
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
}
//check whether application exist prior to get subscription
if (!APIUtil.isApplicationExist(username, applicationName, groupingId)) {
String message = "Application " + applicationName + " does not exist for user " + username;
log.error(message);
throw new ApplicationNotFoundException(message);
}
Subscriber subscriber = new Subscriber(username);
APIConsumer apiConsumer = getAPIConsumer(thisObj);
Set<SubscribedAPI> subscribedAPIs = apiConsumer.getSubscribedAPIs(subscriber, applicationName, groupingId);
int i = 0;
for (SubscribedAPI subscribedAPI : subscribedAPIs) {
API api = null;
try {
api = apiConsumer.getLightweightAPI(subscribedAPI.getApiId());
} catch (APIManagementException e) {
if (APIUtil.isDueToAuthorizationFailure(e)) {
String message =
"user " + username + " failed to access the API " + subscribedAPI.getApiId()
+ " due to an authorization failure";
log.info(message);
continue;
} else {
//This is an unexpected failure
String message =
"Failed to retrieve the API " + subscribedAPI.getApiId() + " to check user "
+ username + " has access to the API";
throw new APIManagementException(message, e);
}
}
NativeObject row = new NativeObject();
row.put("apiName", row, subscribedAPI.getApiId().getApiName());
row.put("apiVersion", row, subscribedAPI.getApiId().getVersion());
row.put("apiProvider", row, APIUtil.replaceEmailDomainBack(subscribedAPI.getApiId().getProviderName()));
row.put("description", row, api.getDescription());
row.put("subscribedTier", row, subscribedAPI.getTier().getName());
row.put("status", row, api.getStatus());
row.put("subStatus", row, subscribedAPI.getSubStatus());
row.put("thumburl", row, APIUtil.prependWebContextRoot(api.getThumbnailUrl()));
myn.put(i, myn, row);
i++;
}
} finally {
if (isTenantFlowStarted) {
PrivilegedCarbonContext.endTenantFlow();
}
}
}
return myn;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jsFunction_getSubscriptionsByApplication
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-20736
|
LOW
| 3.5
|
wso2/carbon-apimgt
|
jsFunction_getSubscriptionsByApplication
|
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
|
490f2860822f89d745b7c04fa9570bd86bef4236
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isJsonMime
File: samples/client/petstore/java/okhttp-gson/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
|
isJsonMime
|
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public List getListValue(String fieldName)
{
BaseObject object = getFirstObject(fieldName, null);
if (object == null) {
return new ArrayList();
}
return object.getListValue(fieldName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getListValue
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getListValue
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private String readName() throws IOException {
if (current!='"') {
throw expected("name");
}
return readStringInternal();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readName
File: src/main/org/hjson/JsonParser.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/JsonParser.java
|
91bef056d56bf968451887421c89a44af1d692ff
| 0
|
Analyze the following code function for security vulnerabilities
|
public <T> List<T> getItems(Class<T> type) {
List<T> r = new ArrayList<T>();
for (TopLevelItem i : getItems())
if (type.isInstance(i))
r.add(type.cast(i));
return r;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getItems
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getItems
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public static int uncompressedLength(ByteBuffer compressed)
throws IOException
{
if (!compressed.isDirect()) {
throw new SnappyError(SnappyErrorCode.NOT_A_DIRECT_BUFFER, "input is not a direct buffer");
}
return impl.uncompressedLength(compressed, compressed.position(), compressed.remaining());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uncompressedLength
File: src/main/java/org/xerial/snappy/Snappy.java
Repository: xerial/snappy-java
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2023-34454
|
HIGH
| 7.5
|
xerial/snappy-java
|
uncompressedLength
|
src/main/java/org/xerial/snappy/Snappy.java
|
d0042551e4a3509a725038eb9b2ad1f683674d94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Class<T> getPresentationType() {
return presentationType;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPresentationType
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getPresentationType
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ResourceFactory getInstance() {
if (instance == null)
new ResourceFactory();
return instance;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInstance
File: api/src/main/java/org/openmrs/ui/framework/resource/ResourceFactory.java
Repository: openmrs/openmrs-module-uiframework
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-24621
|
MEDIUM
| 6.5
|
openmrs/openmrs-module-uiframework
|
getInstance
|
api/src/main/java/org/openmrs/ui/framework/resource/ResourceFactory.java
|
0422fa52c7eba3d96cce2936cb92897dca4b680a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setRefCursor(String refCursorName) {
this.refCursorName = refCursorName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRefCursor
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
setRefCursor
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void fatalError(final CSSParseException exception) throws CSSException {
errorDetected_ = true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fatalError
File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
Repository: HtmlUnit/htmlunit
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-2798
|
HIGH
| 7.5
|
HtmlUnit/htmlunit
|
fatalError
|
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
|
940dc7fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void closeSubChannels() {
for (Map.Entry<Integer, StreamHolder> e : currentStreams.entrySet()) {
StreamHolder holder = e.getValue();
AbstractHttp2StreamSourceChannel receiver = holder.sourceChannel;
if(receiver != null) {
receiver.markStreamBroken();
}
Http2StreamSinkChannel sink = holder.sinkChannel;
if(sink != null) {
if (sink.isWritesShutdown()) {
ChannelListeners.invokeChannelListener(sink.getIoThread(), sink, ((ChannelListener.SimpleSetter) sink.getWriteSetter()).get());
}
IoUtils.safeClose(sink);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: closeSubChannels
File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-214"
] |
CVE-2021-3859
|
HIGH
| 7.5
|
undertow-io/undertow
|
closeSubChannels
|
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
|
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getLocalePrefix(FacesContext context) {
String localePrefix = null;
localePrefix = context.getExternalContext().getRequestParameterMap().get("loc");
if(localePrefix != null && !nameContainsForbiddenSequence(localePrefix)){
return localePrefix;
}
String appBundleName = context.getApplication().getMessageBundle();
if (null != appBundleName) {
Locale locale = null;
if (context.getViewRoot() != null) {
locale = context.getViewRoot().getLocale();
} else {
locale = context.getApplication().getViewHandler().calculateLocale(context);
}
try {
ResourceBundle appBundle =
ResourceBundle.getBundle(appBundleName,
locale,
Util.getCurrentLoader(ResourceManager.class));
localePrefix =
appBundle
.getString(ResourceHandler.LOCALE_PREFIX);
} catch (MissingResourceException mre) {
if (LOGGER.isLoggable(Level.FINEST)) {
LOGGER.log(Level.FINEST, "Ignoring missing resource", mre);
}
}
}
return localePrefix;
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2020-6950
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Multiple Path Traversal security issues
Function: getLocalePrefix
File: impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
Repository: eclipse-ee4j/mojarra
Fixed Code:
private String getLocalePrefix(FacesContext context) {
String localePrefix = null;
localePrefix = context.getExternalContext().getRequestParameterMap().get("loc");
if(localePrefix != null && !nameContainsForbiddenSequence(localePrefix)){
return localePrefix;
} else {
localePrefix = null;
}
String appBundleName = context.getApplication().getMessageBundle();
if (null != appBundleName) {
Locale locale = null;
if (context.getViewRoot() != null) {
locale = context.getViewRoot().getLocale();
} else {
locale = context.getApplication().getViewHandler().calculateLocale(context);
}
try {
ResourceBundle appBundle =
ResourceBundle.getBundle(appBundleName,
locale,
Util.getCurrentLoader(ResourceManager.class));
localePrefix =
appBundle
.getString(ResourceHandler.LOCALE_PREFIX);
} catch (MissingResourceException mre) {
if (LOGGER.isLoggable(Level.FINEST)) {
LOGGER.log(Level.FINEST, "Ignoring missing resource", mre);
}
}
}
return localePrefix;
}
|
[
"CWE-22"
] |
CVE-2020-6950
|
MEDIUM
| 4.3
|
eclipse-ee4j/mojarra
|
getLocalePrefix
|
impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
|
cefbb9447e7be560e59da2da6bd7cb93776f7741
| 1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.