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
|
@Nullable ActivityRecord getLaunchIntoPipHostActivity() {
return mLaunchIntoPipHostActivity;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLaunchIntoPipHostActivity
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
|
getLaunchIntoPipHostActivity
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void defaultReadObject() throws IOException, ClassNotFoundException,
NotActiveException {
if (currentObject != null || !mustResolve) {
readFieldValues(currentObject, currentClass);
} else {
throw new NotActiveException();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: defaultReadObject
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
defaultReadObject
|
luni/src/main/java/java/io/ObjectInputStream.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private String calculateInputSpecHash(File inputSpecFile) throws IOException {
URL inputSpecRemoteUrl = inputSpecRemoteUrl();
File inputSpecTempFile = inputSpecFile;
if (inputSpecRemoteUrl != null) {
inputSpecTempFile = File.createTempFile("openapi-spec", ".tmp");
URLConnection conn = inputSpecRemoteUrl.openConnection();
if (isNotEmpty(auth)) {
List<AuthorizationValue> authList = AuthParser.parse(auth);
for (AuthorizationValue a : authList) {
conn.setRequestProperty(a.getKeyName(), a.getValue());
}
}
try (ReadableByteChannel readableByteChannel = Channels.newChannel(conn.getInputStream())) {
FileChannel fileChannel;
try (FileOutputStream fileOutputStream = new FileOutputStream(inputSpecTempFile)) {
fileChannel = fileOutputStream.getChannel();
fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
}
}
}
ByteSource inputSpecByteSource =
inputSpecTempFile.exists()
? Files.asByteSource(inputSpecTempFile)
: CharSource.wrap(ClasspathHelper.loadFileFromClasspath(inputSpecTempFile.toString().replaceAll("\\\\","/")))
.asByteSource(StandardCharsets.UTF_8);
return inputSpecByteSource.hash(Hashing.sha256()).toString();
}
|
Vulnerability Classification:
- CWE: CWE-552
- CVE: CVE-2021-21429
- Severity: LOW
- CVSS Score: 2.1
Description: use Files.createTempFile in maven plugin to avoid security issues
Function: calculateInputSpecHash
File: modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
Repository: OpenAPITools/openapi-generator
Fixed Code:
private String calculateInputSpecHash(File inputSpecFile) throws IOException {
URL inputSpecRemoteUrl = inputSpecRemoteUrl();
File inputSpecTempFile = inputSpecFile;
if (inputSpecRemoteUrl != null) {
inputSpecTempFile = java.nio.file.Files.createTempFile("openapi-spec", ".tmp").toFile();
URLConnection conn = inputSpecRemoteUrl.openConnection();
if (isNotEmpty(auth)) {
List<AuthorizationValue> authList = AuthParser.parse(auth);
for (AuthorizationValue a : authList) {
conn.setRequestProperty(a.getKeyName(), a.getValue());
}
}
try (ReadableByteChannel readableByteChannel = Channels.newChannel(conn.getInputStream())) {
FileChannel fileChannel;
try (FileOutputStream fileOutputStream = new FileOutputStream(inputSpecTempFile)) {
fileChannel = fileOutputStream.getChannel();
fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
}
}
}
ByteSource inputSpecByteSource =
inputSpecTempFile.exists()
? Files.asByteSource(inputSpecTempFile)
: CharSource.wrap(ClasspathHelper.loadFileFromClasspath(inputSpecTempFile.toString().replaceAll("\\\\","/")))
.asByteSource(StandardCharsets.UTF_8);
return inputSpecByteSource.hash(Hashing.sha256()).toString();
}
|
[
"CWE-552"
] |
CVE-2021-21429
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
calculateInputSpecHash
|
modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
|
34002dc1d4b1f9e1c741cab32f9249b361ead6df
| 1
|
Analyze the following code function for security vulnerabilities
|
public <T> T[] getSpans(int start, int end, Class<T> type) {
return mSpanned.getSpans(start, end, type);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSpans
File: core/java/android/text/Layout.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-9452
|
MEDIUM
| 4.3
|
android
|
getSpans
|
core/java/android/text/Layout.java
|
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
| 0
|
Analyze the following code function for security vulnerabilities
|
public void doLoginEntry( StaplerRequest req, StaplerResponse rsp ) throws IOException {
if(req.getUserPrincipal()==null) {
rsp.sendRedirect2("noPrincipal");
return;
}
String from = req.getParameter("from");
if(from!=null && from.startsWith("/") && !from.equals("/loginError")) {
rsp.sendRedirect2(from); // I'm bit uncomfortable letting users redircted to other sites, make sure the URL falls into this domain
return;
}
String url = AbstractProcessingFilter.obtainFullRequestUrl(req);
if(url!=null) {
// if the login redirect is initiated by Acegi
// this should send the user back to where s/he was from.
rsp.sendRedirect2(url);
return;
}
rsp.sendRedirect2(".");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doLoginEntry
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
|
doLoginEntry
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
protected int getRandomizedMacAddressMappingSize() {
return mRandomizedMacAddressMapping.size();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRandomizedMacAddressMappingSize
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
getRandomizedMacAddressMappingSize
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean hasAnyValidWepKey(String[] wepKeys) {
for (int i = 0; i < wepKeys.length; i++) {
if (wepKeys[i] != null) {
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasAnyValidWepKey
File: service/java/com/android/server/wifi/WifiConfigurationUtil.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21252
|
MEDIUM
| 5.5
|
android
|
hasAnyValidWepKey
|
service/java/com/android/server/wifi/WifiConfigurationUtil.java
|
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setCrossProfileCallerIdDisabled(ComponentName who, boolean disabled) {
if (!mHasFeature) {
return;
}
Objects.requireNonNull(who, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(isProfileOwner(caller));
synchronized (getLockObject()) {
ActiveAdmin admin = getProfileOwnerLocked(caller.getUserId());
if (disabled) {
admin.mManagedProfileCallerIdAccess =
new PackagePolicy(PackagePolicy.PACKAGE_POLICY_ALLOWLIST);
} else {
admin.mManagedProfileCallerIdAccess =
new PackagePolicy(PackagePolicy.PACKAGE_POLICY_BLOCKLIST);
}
saveSettingsLocked(caller.getUserId());
}
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_CROSS_PROFILE_CALLER_ID_DISABLED)
.setAdmin(who)
.setBoolean(disabled)
.write();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCrossProfileCallerIdDisabled
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
|
setCrossProfileCallerIdDisabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private ChannelBuffer unwrap(
ChannelHandlerContext ctx, Channel channel,
ChannelBuffer nettyInNetBuf, ByteBuffer nioInNetBuf,
int initialNettyOutAppBufCapacity) throws SSLException {
final int nettyInNetBufStartOffset = nettyInNetBuf.readerIndex();
final int nioInNetBufStartOffset = nioInNetBuf.position();
final ByteBuffer nioOutAppBuf = bufferPool.acquireBuffer();
ChannelBuffer nettyOutAppBuf = null;
try {
boolean needsWrap = false;
for (;;) {
SSLEngineResult result;
boolean needsHandshake = false;
synchronized (handshakeLock) {
if (!handshaken && !handshaking &&
!engine.getUseClientMode() &&
!engine.isInboundDone() && !engine.isOutboundDone()) {
needsHandshake = true;
}
}
if (needsHandshake) {
handshake();
}
synchronized (handshakeLock) {
// Decrypt at least one record in the inbound network buffer.
// It is impossible to consume no record here because we made sure the inbound network buffer
// always contain at least one record in decode(). Therefore, if SSLEngine.unwrap() returns
// BUFFER_OVERFLOW, it is always resolved by retrying after emptying the application buffer.
for (;;) {
try {
result = engine.unwrap(nioInNetBuf, nioOutAppBuf);
switch (result.getStatus()) {
case CLOSED:
// notify about the CLOSED state of the SSLEngine. See #137
sslEngineCloseFuture.setClosed();
break;
case BUFFER_OVERFLOW:
// Flush the unwrapped data in the outAppBuf into frame and try again.
// See the finally block.
continue;
}
break;
} finally {
nioOutAppBuf.flip();
// Sync the offset of the inbound buffer.
nettyInNetBuf.readerIndex(
nettyInNetBufStartOffset + nioInNetBuf.position() - nioInNetBufStartOffset);
// Copy the unwrapped data into a smaller buffer.
if (nioOutAppBuf.hasRemaining()) {
if (nettyOutAppBuf == null) {
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
nettyOutAppBuf = factory.getBuffer(initialNettyOutAppBufCapacity);
}
nettyOutAppBuf.writeBytes(nioOutAppBuf);
}
nioOutAppBuf.clear();
}
}
final HandshakeStatus handshakeStatus = result.getHandshakeStatus();
handleRenegotiation(handshakeStatus);
switch (handshakeStatus) {
case NEED_UNWRAP:
break;
case NEED_WRAP:
wrapNonAppData(ctx, channel);
break;
case NEED_TASK:
runDelegatedTasks();
break;
case FINISHED:
setHandshakeSuccess(channel);
needsWrap = true;
continue;
case NOT_HANDSHAKING:
if (setHandshakeSuccessIfStillHandshaking(channel)) {
needsWrap = true;
continue;
}
if (writeBeforeHandshakeDone) {
// We need to call wrap(...) in case there was a flush done before the handshake completed.
//
// See https://github.com/netty/netty/pull/2437
writeBeforeHandshakeDone = false;
needsWrap = true;
}
break;
default:
throw new IllegalStateException(
"Unknown handshake status: " + handshakeStatus);
}
if (result.getStatus() == Status.BUFFER_UNDERFLOW ||
result.bytesConsumed() == 0 && result.bytesProduced() == 0) {
break;
}
}
}
if (needsWrap) {
// wrap() acquires pendingUnencryptedWrites first and then
// handshakeLock. If handshakeLock is already hold by the
// current thread, calling wrap() will lead to a dead lock
// i.e. pendingUnencryptedWrites -> handshakeLock vs.
// handshakeLock -> pendingUnencryptedLock -> handshakeLock
//
// There is also the same issue between pendingEncryptedWrites
// and pendingUnencryptedWrites.
if (!Thread.holdsLock(handshakeLock) && !pendingEncryptedWritesLock.isHeldByCurrentThread()) {
wrap(ctx, channel);
}
}
} catch (SSLException e) {
setHandshakeFailure(channel, e);
throw e;
} finally {
bufferPool.releaseBuffer(nioOutAppBuf);
}
if (nettyOutAppBuf != null && nettyOutAppBuf.readable()) {
return nettyOutAppBuf;
} else {
return null;
}
}
|
Vulnerability Classification:
- CWE: CWE-119
- CVE: CVE-2014-3488
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Fix a bug where SslHandler does not handle SSLv2Hello correctly
Motivation:
When a SSLv2Hello message is received, SSLEngine expects the application buffer size to be more than 30KB which is larger than what SslBufferPool can provide. SSLEngine will always return with BUFFER_OVERFLOW status, blocking the SSL session from continuing the handshake.
Modifications:
When SSLEngine.getSession().getApplicationBufferSize() returns a value larger than what SslBufferPool provides, allocate a temporary heap buffer.
Result:
SSLv2Hello is handled correctly.
Function: unwrap
File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
Repository: netty
Fixed Code:
private ChannelBuffer unwrap(
ChannelHandlerContext ctx, Channel channel,
ChannelBuffer nettyInNetBuf, ByteBuffer nioInNetBuf,
int initialNettyOutAppBufCapacity) throws SSLException {
final int nettyInNetBufStartOffset = nettyInNetBuf.readerIndex();
final int nioInNetBufStartOffset = nioInNetBuf.position();
final ByteBuffer nioOutAppBuf = bufferPool.acquireBuffer();
ChannelBuffer nettyOutAppBuf = null;
try {
boolean needsWrap = false;
for (;;) {
SSLEngineResult result;
boolean needsHandshake = false;
synchronized (handshakeLock) {
if (!handshaken && !handshaking &&
!engine.getUseClientMode() &&
!engine.isInboundDone() && !engine.isOutboundDone()) {
needsHandshake = true;
}
}
if (needsHandshake) {
handshake();
}
synchronized (handshakeLock) {
// Decrypt at least one record in the inbound network buffer.
// It is impossible to consume no record here because we made sure the inbound network buffer
// always contain at least one record in decode(). Therefore, if SSLEngine.unwrap() returns
// BUFFER_OVERFLOW, it is always resolved by retrying after emptying the application buffer.
for (;;) {
final int outAppBufSize = engine.getSession().getApplicationBufferSize();
final ByteBuffer outAppBuf;
if (nioOutAppBuf.capacity() < outAppBufSize) {
// SSLEngine wants a buffer larger than what the pool can provide.
// Allocate a temporary heap buffer.
outAppBuf = ByteBuffer.allocate(outAppBufSize);
} else {
outAppBuf = nioOutAppBuf;
}
try {
result = engine.unwrap(nioInNetBuf, outAppBuf);
switch (result.getStatus()) {
case CLOSED:
// notify about the CLOSED state of the SSLEngine. See #137
sslEngineCloseFuture.setClosed();
break;
case BUFFER_OVERFLOW:
// Flush the unwrapped data in the outAppBuf into frame and try again.
// See the finally block.
continue;
}
break;
} finally {
outAppBuf.flip();
// Sync the offset of the inbound buffer.
nettyInNetBuf.readerIndex(
nettyInNetBufStartOffset + nioInNetBuf.position() - nioInNetBufStartOffset);
// Copy the unwrapped data into a smaller buffer.
if (outAppBuf.hasRemaining()) {
if (nettyOutAppBuf == null) {
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
nettyOutAppBuf = factory.getBuffer(initialNettyOutAppBufCapacity);
}
nettyOutAppBuf.writeBytes(outAppBuf);
}
outAppBuf.clear();
}
}
final HandshakeStatus handshakeStatus = result.getHandshakeStatus();
handleRenegotiation(handshakeStatus);
switch (handshakeStatus) {
case NEED_UNWRAP:
break;
case NEED_WRAP:
wrapNonAppData(ctx, channel);
break;
case NEED_TASK:
runDelegatedTasks();
break;
case FINISHED:
setHandshakeSuccess(channel);
needsWrap = true;
continue;
case NOT_HANDSHAKING:
if (setHandshakeSuccessIfStillHandshaking(channel)) {
needsWrap = true;
continue;
}
if (writeBeforeHandshakeDone) {
// We need to call wrap(...) in case there was a flush done before the handshake completed.
//
// See https://github.com/netty/netty/pull/2437
writeBeforeHandshakeDone = false;
needsWrap = true;
}
break;
default:
throw new IllegalStateException(
"Unknown handshake status: " + handshakeStatus);
}
if (result.getStatus() == Status.BUFFER_UNDERFLOW ||
result.bytesConsumed() == 0 && result.bytesProduced() == 0) {
break;
}
}
}
if (needsWrap) {
// wrap() acquires pendingUnencryptedWrites first and then
// handshakeLock. If handshakeLock is already hold by the
// current thread, calling wrap() will lead to a dead lock
// i.e. pendingUnencryptedWrites -> handshakeLock vs.
// handshakeLock -> pendingUnencryptedLock -> handshakeLock
//
// There is also the same issue between pendingEncryptedWrites
// and pendingUnencryptedWrites.
if (!Thread.holdsLock(handshakeLock) && !pendingEncryptedWritesLock.isHeldByCurrentThread()) {
wrap(ctx, channel);
}
}
} catch (SSLException e) {
setHandshakeFailure(channel, e);
throw e;
} finally {
bufferPool.releaseBuffer(nioOutAppBuf);
}
if (nettyOutAppBuf != null && nettyOutAppBuf.readable()) {
return nettyOutAppBuf;
} else {
return null;
}
}
|
[
"CWE-119"
] |
CVE-2014-3488
|
MEDIUM
| 5
|
netty
|
unwrap
|
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
|
2fa9400a59d0563a66908aba55c41e7285a04994
| 1
|
Analyze the following code function for security vulnerabilities
|
public String getProviderMimeType(Uri uri, int userId) {
enforceNotIsolatedCaller("getProviderMimeType");
final String name = uri.getAuthority();
int callingUid = Binder.getCallingUid();
int callingPid = Binder.getCallingPid();
long ident = 0;
boolean clearedIdentity = false;
userId = unsafeConvertIncomingUser(userId);
if (canClearIdentity(callingPid, callingUid, userId)) {
clearedIdentity = true;
ident = Binder.clearCallingIdentity();
}
ContentProviderHolder holder = null;
try {
holder = getContentProviderExternalUnchecked(name, null, userId);
if (holder != null) {
return holder.provider.getType(uri);
}
} catch (RemoteException e) {
Log.w(TAG, "Content provider dead retrieving " + uri, e);
return null;
} finally {
// We need to clear the identity to call removeContentProviderExternalUnchecked
if (!clearedIdentity) {
ident = Binder.clearCallingIdentity();
}
try {
if (holder != null) {
removeContentProviderExternalUnchecked(name, null, userId);
}
} finally {
Binder.restoreCallingIdentity(ident);
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProviderMimeType
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
getProviderMimeType
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void choosePrivateKeyAlias(final int uid, final Uri uri, final String alias,
final IBinder response) {
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(isSystemUid(caller),
String.format(NOT_SYSTEM_CALLER_MSG, "choose private key alias"));
// If there is a profile owner, redirect to that; otherwise query the device owner.
ComponentName aliasChooser = getProfileOwnerAsUser(caller.getUserId());
if (aliasChooser == null && caller.getUserHandle().isSystem()) {
synchronized (getLockObject()) {
final ActiveAdmin deviceOwnerAdmin = getDeviceOwnerAdminLocked();
if (deviceOwnerAdmin != null) {
aliasChooser = deviceOwnerAdmin.info.getComponent();
}
}
}
if (aliasChooser == null) {
sendPrivateKeyAliasResponse(null, response);
return;
}
Intent intent = new Intent(DeviceAdminReceiver.ACTION_CHOOSE_PRIVATE_KEY_ALIAS);
intent.putExtra(DeviceAdminReceiver.EXTRA_CHOOSE_PRIVATE_KEY_SENDER_UID, uid);
intent.putExtra(DeviceAdminReceiver.EXTRA_CHOOSE_PRIVATE_KEY_URI, uri);
intent.putExtra(DeviceAdminReceiver.EXTRA_CHOOSE_PRIVATE_KEY_ALIAS, alias);
intent.putExtra(DeviceAdminReceiver.EXTRA_CHOOSE_PRIVATE_KEY_RESPONSE, response);
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
final ComponentName delegateReceiver;
delegateReceiver = resolveDelegateReceiver(DELEGATION_CERT_SELECTION,
DeviceAdminReceiver.ACTION_CHOOSE_PRIVATE_KEY_ALIAS, caller.getUserId());
final boolean isDelegate;
if (delegateReceiver != null) {
intent.setComponent(delegateReceiver);
isDelegate = true;
} else {
intent.setComponent(aliasChooser);
isDelegate = false;
}
mInjector.binderWithCleanCallingIdentity(() -> {
mContext.sendOrderedBroadcastAsUser(intent, caller.getUserHandle(), null,
new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String chosenAlias = getResultData();
sendPrivateKeyAliasResponse(chosenAlias, response);
}
}, null, Activity.RESULT_OK, null, null);
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.CHOOSE_PRIVATE_KEY_ALIAS)
.setAdmin(intent.getComponent())
.setBoolean(isDelegate)
.write();
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: choosePrivateKeyAlias
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
|
choosePrivateKeyAlias
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public void getUpdatedSiteMetadata(int parentStudyId, int studyId, MetaDataVersionBean metadata, String odmVersion) {
HashMap<Integer, Integer> cvIdPoses = new HashMap<Integer, Integer>();
this.setStudyEventAndFormMetaTypesExpected();
ArrayList rows = this.select(this.getStudyEventAndFormMetaSql(parentStudyId, studyId, true));
Iterator it = rows.iterator();
String sedprev = "";
MetaDataVersionProtocolBean protocol = metadata.getProtocol();
while (it.hasNext()) {
HashMap row = (HashMap) it.next();
Integer sedOrder = (Integer) row.get("definition_order");
Integer cvId = (Integer) row.get("crf_version_id");
String sedOID = (String) row.get("definition_oid");
String sedName = (String) row.get("definition_name");
Boolean sedRepeat = (Boolean) row.get("definition_repeating");
String sedType = (String) row.get("definition_type");
String cvOID = (String) row.get("cv_oid");
String cvName = (String) row.get("cv_name");
Boolean cvRequired = (Boolean) row.get("cv_required");
String nullValue = (String) row.get("null_values");
String crfName = (String) row.get("crf_name");
StudyEventDefBean sedef = new StudyEventDefBean();
if (sedprev.equals(sedOID)) {
int p = metadata.getStudyEventDefs().size() - 1;
sedef = metadata.getStudyEventDefs().get(p);
} else {
sedprev = sedOID;
ElementRefBean sedref = new ElementRefBean();
sedref.setElementDefOID(sedOID);
sedref.setMandatory("Yes");
sedref.setOrderNumber(sedOrder);
protocol.getStudyEventRefs().add(sedref);
sedef.setOid(sedOID);
sedef.setName(sedName);
sedef.setRepeating(sedRepeat ? "Yes" : "No");
String type = sedType.toLowerCase();
type = type.substring(0, 1).toUpperCase() + type.substring(1);
sedef.setType(type);
metadata.getStudyEventDefs().add(sedef);
}
ElementRefBean formref = new ElementRefBean();
formref.setElementDefOID(cvOID);
formref.setMandatory(cvRequired ? "Yes" : "No");
sedef.getFormRefs().add(formref);
if (!cvIdPoses.containsKey(cvId)) {
FormDefBean formdef = new FormDefBean();
formdef.setOid(cvOID);
formdef.setName(crfName + " - " + cvName);
formdef.setRepeating("No");
metadata.getFormDefs().add(formdef);
cvIdPoses.put(cvId, metadata.getFormDefs().size() - 1);
if (nullValue != null && nullValue.length() > 0) {
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUpdatedSiteMetadata
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
getUpdatedSiteMetadata
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void engineInit(
Key key,
AlgorithmParameterSpec params,
SecureRandom random)
throws InvalidKeyException, InvalidAlgorithmParameterException
{
if (!(key instanceof DHPrivateKey))
{
throw new InvalidKeyException("DHKeyAgreement requires DHPrivateKey for initialisation");
}
DHPrivateKey privKey = (DHPrivateKey)key;
if (params != null)
{
if (params instanceof DHParameterSpec) // p, g override.
{
DHParameterSpec p = (DHParameterSpec)params;
this.p = p.getP();
this.g = p.getG();
}
else if (params instanceof UserKeyingMaterialSpec)
{
this.p = privKey.getParams().getP();
this.g = privKey.getParams().getG();
this.ukmParameters = ((UserKeyingMaterialSpec)params).getUserKeyingMaterial();
}
else
{
throw new InvalidAlgorithmParameterException("DHKeyAgreement only accepts DHParameterSpec");
}
}
else
{
this.p = privKey.getParams().getP();
this.g = privKey.getParams().getG();
}
this.x = this.result = privKey.getX();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: engineInit
File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyAgreementSpi.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-320"
] |
CVE-2016-1000346
|
MEDIUM
| 4.3
|
bcgit/bc-java
|
engineInit
|
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyAgreementSpi.java
|
1127131c89021612c6eefa26dbe5714c194e7495
| 0
|
Analyze the following code function for security vulnerabilities
|
public static NativeArray jsFunction_getAPIsWithTag(Context cx, Scriptable thisObj, Object[] args, Function funObj)
throws ScriptException, APIManagementException {
NativeArray apiArray = new NativeArray(0);
if (args != null && isStringArray(args)) {
String tagName = args[0].toString();
String tenant;
if (args[1] != null) {
tenant = (String) args[1];
} else {
tenant = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
}
Set<API> apiSet;
APIConsumer apiConsumer = getAPIConsumer(thisObj);
try {
apiSet = apiConsumer.getAPIsWithTag(tagName, tenant);
} catch (APIManagementException e) {
log.error("Error from Registry API while getting APIs With Tag Information", e);
return apiArray;
} catch (Exception e) {
log.error("Error while getting APIs With Tag Information", e);
return apiArray;
}
if (apiSet != null) {
Iterator it = apiSet.iterator();
int i = 0;
while (it.hasNext()) {
NativeObject currentApi = new NativeObject();
Object apiObject = it.next();
API api = (API) apiObject;
APIIdentifier apiIdentifier = api.getId();
currentApi.put("name", currentApi, apiIdentifier.getApiName());
currentApi.put("provider", currentApi,
APIUtil.replaceEmailDomainBack(apiIdentifier.getProviderName()));
currentApi.put("version", currentApi,
apiIdentifier.getVersion());
currentApi.put("description", currentApi, api.getDescription());
currentApi.put("rates", currentApi, api.getRating());
if (api.getThumbnailUrl() == null) {
currentApi.put("thumbnailurl", currentApi,
"images/api-default.png");
} else {
currentApi.put("thumbnailurl", currentApi,
APIUtil.prependWebContextRoot(api.getThumbnailUrl()));
}
currentApi.put("isAdvertiseOnly",currentApi,api.isAdvertiseOnly());
if(api.isAdvertiseOnly()){
currentApi.put("apiOwner",currentApi,APIUtil.replaceEmailDomainBack(api.getApiOwner()));
}
currentApi.put("apiBusinessOwner", currentApi,
APIUtil.replaceEmailDomainBack(api.getBusinessOwner()));
currentApi.put("visibility", currentApi, api.getVisibility());
currentApi.put("visibleRoles", currentApi, api.getVisibleRoles());
currentApi.put("description", currentApi, api.getDescription());
apiArray.put(i, apiArray, currentApi);
i++;
}
}
}// end of the if
return apiArray;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jsFunction_getAPIsWithTag
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_getAPIsWithTag
|
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
|
private static void addClassifier(Set<String> allowed, Set<String> dest, String... maybeClassifiers) {
for (String id : maybeClassifiers) {
if (allowed.contains(id)) {
dest.add(id);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addClassifier
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
addClassifier
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void receiveRemotePresence(Map<String, Object> presence) {
String oortURL = (String)presence.get(SetiPresence.OORT_URL_FIELD);
boolean present = (Boolean)presence.get(SetiPresence.PRESENCE_FIELD);
boolean replace = presence.get(SetiPresence.REPLACE_FIELD) == Boolean.TRUE;
Set<String> userIds = convertPresenceUsers(presence);
if (_logger.isDebugEnabled()) {
_logger.debug("Received remote presence message from comet {} for {}", oortURL, userIds);
}
Set<String> added = new HashSet<>();
Set<String> removed = new HashSet<>();
synchronized (_uid2Location) {
if (replace) {
removed.addAll(removeRemotePresences(oortURL));
}
for (String userId : userIds) {
SetiLocation location = new SetiLocation(userId, oortURL);
if (present) {
if (associateRemote(userId, location)) {
added.add(userId);
}
} else {
if (disassociate(userId, location)) {
removed.add(userId);
}
}
}
}
Set<String> toRemove = new HashSet<>(removed);
toRemove.removeAll(added);
for (String userId : toRemove) {
notifyPresenceRemoved(oortURL, userId);
}
added.removeAll(removed);
for (String userId : added) {
notifyPresenceAdded(oortURL, userId);
}
if (presence.get(SetiPresence.ALIVE_FIELD) == Boolean.TRUE) {
// Message sent on startup by the remote Seti, push our associations
OortComet oortComet = _oort.findComet(oortURL);
if (oortComet != null) {
Set<String> associatedUserIds = getAssociatedUserIds();
if (_logger.isDebugEnabled()) {
_logger.debug("Pushing associated users {} to comet {}", associatedUserIds, oortURL);
}
ClientSessionChannel channel = oortComet.getChannel(generateSetiChannel(generateSetiId(oortURL)));
channel.publish(new SetiPresence(associatedUserIds));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: receiveRemotePresence
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
Repository: cometd
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
receiveRemotePresence
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getText() {
return text;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getText
File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyDefault.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getText
|
base/common/src/main/java/com/netscape/certsrv/profile/PolicyDefault.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public HttpResponse doDoDelete() throws IOException {
throw HttpResponses.status(SC_BAD_REQUEST);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doDoDelete
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
|
doDoDelete
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setUserKeyProtection(int userId, String credential, VerifyCredentialResponse vcr)
throws RemoteException {
if (vcr == null) {
throw new RemoteException("Null response verifying a credential we just set");
}
if (vcr.getResponseCode() != VerifyCredentialResponse.RESPONSE_OK) {
throw new RemoteException("Non-OK response verifying a credential we just set: "
+ vcr.getResponseCode());
}
byte[] token = vcr.getPayload();
if (token == null) {
throw new RemoteException("Empty payload verifying a credential we just set");
}
addUserKeyAuth(userId, token, secretFromCredential(credential));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUserKeyProtection
File: services/core/java/com/android/server/LockSettingsService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
setUserKeyProtection
|
services/core/java/com/android/server/LockSettingsService.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void killForegroundAppsForUser(@UserIdInt int userId) {
final ArrayList<ProcessRecord> procs = new ArrayList<>();
synchronized (mProcLock) {
final int numOfProcs = mProcessList.getProcessNamesLOSP().getMap().size();
for (int ip = 0; ip < numOfProcs; ip++) {
final SparseArray<ProcessRecord> apps =
mProcessList.getProcessNamesLOSP().getMap().valueAt(ip);
final int NA = apps.size();
for (int ia = 0; ia < NA; ia++) {
final ProcessRecord app = apps.valueAt(ia);
if (app.isPersistent()) {
// We don't kill persistent processes.
continue;
}
if (app.isRemoved()
|| (app.userId == userId && app.mState.hasForegroundActivities())) {
procs.add(app);
}
}
}
}
final int numOfProcs = procs.size();
if (numOfProcs > 0) {
synchronized (ActivityManagerService.this) {
for (int i = 0; i < numOfProcs; i++) {
mProcessList.removeProcessLocked(procs.get(i), false, true,
ApplicationExitInfo.REASON_OTHER,
ApplicationExitInfo.SUBREASON_KILL_ALL_FG,
"kill all fg");
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: killForegroundAppsForUser
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
killForegroundAppsForUser
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkActiveAdminPrecondition(ComponentName adminReceiver, DeviceAdminInfo info,
DevicePolicyData policy) {
if (info == null) {
throw new IllegalArgumentException("Bad admin: " + adminReceiver);
}
if (!info.getActivityInfo().applicationInfo.isInternal()) {
throw new IllegalArgumentException("Only apps in internal storage can be active admin: "
+ adminReceiver);
}
if (info.getActivityInfo().applicationInfo.isInstantApp()) {
throw new IllegalArgumentException("Instant apps cannot be device admins: "
+ adminReceiver);
}
if (policy.mRemovingAdmins.contains(adminReceiver)) {
throw new IllegalArgumentException(
"Trying to set an admin which is being removed");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkActiveAdminPrecondition
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
|
checkActiveAdminPrecondition
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("deprecation") // AbsoluteLayout
private void doSetAnchorViewPosition(
View view, float x, float y, float width, float height) {
if (view.getParent() == null) {
// Ignore. setAnchorViewPosition has been called after the anchor view has
// already been released.
return;
}
assert view.getParent() == mCurrentContainerView;
float scale = (float) DeviceDisplayInfo.create(mContext).getDIPScale();
// The anchor view should not go outside the bounds of the ContainerView.
int leftMargin = Math.round(x * scale);
int topMargin = Math.round(mRenderCoordinates.getContentOffsetYPix() + y * scale);
int scaledWidth = Math.round(width * scale);
// ContentViewCore currently only supports these two container view types.
if (mCurrentContainerView instanceof FrameLayout) {
int startMargin;
if (ApiCompatibilityUtils.isLayoutRtl(mCurrentContainerView)) {
startMargin = mCurrentContainerView.getMeasuredWidth()
- Math.round((width + x) * scale);
} else {
startMargin = leftMargin;
}
if (scaledWidth + startMargin > mCurrentContainerView.getWidth()) {
scaledWidth = mCurrentContainerView.getWidth() - startMargin;
}
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
scaledWidth, Math.round(height * scale));
ApiCompatibilityUtils.setMarginStart(lp, startMargin);
lp.topMargin = topMargin;
view.setLayoutParams(lp);
} else if (mCurrentContainerView instanceof android.widget.AbsoluteLayout) {
// This fixes the offset due to a difference in
// scrolling model of WebView vs. Chrome.
// TODO(sgurun) fix this to use mContainerViewAtCreation.getScroll[X/Y]()
// as it naturally accounts for scroll differences between
// these models.
leftMargin += mRenderCoordinates.getScrollXPixInt();
topMargin += mRenderCoordinates.getScrollYPixInt();
android.widget.AbsoluteLayout.LayoutParams lp =
new android.widget.AbsoluteLayout.LayoutParams(
scaledWidth, (int) (height * scale), leftMargin, topMargin);
view.setLayoutParams(lp);
} else {
Log.e(TAG, "Unknown layout " + mCurrentContainerView.getClass().getName());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doSetAnchorViewPosition
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
|
doSetAnchorViewPosition
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String loadVeniceFile(final File file) {
if (file == null) {
return null;
}
else {
final String path = file.getPath();
final String vncFile = path.endsWith(".venice") ? path : path + ".venice";
final ByteBuffer data = load(new File(vncFile));
return data == null
? null
: new String(data.array(), getCharset("UTF-8"));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadVeniceFile
File: src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java
Repository: jlangch/venice
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-36007
|
LOW
| 3.3
|
jlangch/venice
|
loadVeniceFile
|
src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java
|
c942c73136333bc493050910f171a48e6f575b23
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String convertToJsSafeString(final String str){
return str
.replace("\\", "\\\\")
.replace("\"", "\\\"")
.replace("\t", "\\t")
.replace("\r", "\\r")
.replace("\n", "\\n")
.replace("\b", "\\b");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertToJsSafeString
File: opennms-web-api/src/main/java/org/opennms/web/api/Util.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-0869
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
convertToJsSafeString
|
opennms-web-api/src/main/java/org/opennms/web/api/Util.java
|
66b4ba96a18b9952f25a350bbccc2a7e206238d1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void pointerPressed(final int x, final int y) {
super.pointerPressed(x, y);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pointerPressed
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
|
pointerPressed
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void toXML(Object obj, OutputStream out) {
HierarchicalStreamWriter writer = hierarchicalStreamDriver.createWriter(out);
try {
marshal(obj, writer);
} finally {
writer.flush();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toXML
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
toXML
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setKeyAlgorithm(String algorithm) {
attributes.put(KEY_ALGORITHM, algorithm);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setKeyAlgorithm
File: base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setKeyAlgorithm
|
base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isUserSelectionAllowed() {
return getState(false).userSelectionAllowed;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isUserSelectionAllowed
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
|
isUserSelectionAllowed
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isLetterboxedForDisplayCutout() {
if (mActivityRecord == null) {
// Only windows with an ActivityRecord are letterboxed.
return false;
}
if (!mWindowFrames.parentFrameWasClippedByDisplayCutout()) {
// Cutout didn't make a difference, no letterbox
return false;
}
if (mAttrs.layoutInDisplayCutoutMode == LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS) {
// Layout in cutout, no letterbox.
return false;
}
if (!mAttrs.isFullscreen()) {
// Not filling the parent frame, no letterbox
return false;
}
// Otherwise we need a letterbox if the layout was smaller than the app window token allowed
// it to be.
return !frameCoversEntireAppTokenBounds();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isLetterboxedForDisplayCutout
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
isLetterboxedForDisplayCutout
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void switchToContactDetails(Contact contact) {
switchToContactDetails(contact, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: switchToContactDetails
File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
switchToContactDetails
|
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getXrefSize() {
return xrefObj.size();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXrefSize
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
getXrefSize
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
9b0cbb76c8434a8505f02ada02a94263dcae9247
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean validateToken(String authToken, UserDetails userDetails) {
String[] parts = authToken.split(":");
long expires = Long.parseLong(parts[1]);
String signature = parts[2];
String signatureToMatch = computeSignature(userDetails, expires);
return expires >= System.currentTimeMillis() && signature.equals(signatureToMatch);
}
|
Vulnerability Classification:
- CWE: CWE-307
- CVE: CVE-2015-20110
- Severity: HIGH
- CVSS Score: 7.5
Description: fixed timing attack vulnerability in TokenProvider #2095
Function: validateToken
File: app/templates/src/main/java/package/security/xauth/_TokenProvider.java
Repository: jhipster/generator-jhipster
Fixed Code:
public boolean validateToken(String authToken, UserDetails userDetails) {
String[] parts = authToken.split(":");
long expires = Long.parseLong(parts[1]);
String signature = parts[2];
String signatureToMatch = computeSignature(userDetails, expires);
return expires >= System.currentTimeMillis() && constantTimeEquals(signature, signatureToMatch));
}
|
[
"CWE-307"
] |
CVE-2015-20110
|
HIGH
| 7.5
|
jhipster/generator-jhipster
|
validateToken
|
app/templates/src/main/java/package/security/xauth/_TokenProvider.java
|
79fe5626cb1bb80f9ac86cf46980748e65d2bdbc
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<SysUser> queryLogicDeleted() {
return this.queryLogicDeleted(null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: queryLogicDeleted
File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
Repository: jeecgboot/jeecg-boot
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-45208
|
MEDIUM
| 4.3
|
jeecgboot/jeecg-boot
|
queryLogicDeleted
|
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
|
51e2227bfe54f5d67b09411ee9a336750164e73d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void enforcePhoneAccountHandleMatchesCaller(PhoneAccountHandle phoneAccountHandle,
String callingPackage) {
if (!callingPackage.equals(phoneAccountHandle.getComponentName().getPackageName())) {
throw new SecurityException("Caller does not own the PhoneAccountHandle");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforcePhoneAccountHandleMatchesCaller
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21394
|
MEDIUM
| 5.5
|
android
|
enforcePhoneAccountHandleMatchesCaller
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
68dca62035c49e14ad26a54f614199cb29a3393f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleExceptionDuringRequest(VaadinRequest request,
VaadinResponse response, VaadinSession vaadinSession, Exception t)
throws ServiceException {
if (vaadinSession != null) {
vaadinSession.lock();
}
try {
if (vaadinSession != null) {
vaadinSession.getErrorHandler().error(new ErrorEvent(t));
}
// if this was an UIDL request, send UIDL back to the client
if (HandlerHelper.isRequestType(request, RequestType.UIDL)) {
SystemMessages ci = getSystemMessages(
HandlerHelper.findLocale(vaadinSession, request),
request);
try {
writeUncachedStringResponse(response,
JsonConstants.JSON_CONTENT_TYPE,
createCriticalNotificationJSON(
ci.getInternalErrorCaption(),
ci.getInternalErrorMessage(), null,
ci.getInternalErrorURL()));
} catch (IOException e) {
// An exception occurred while writing the response. Log
// it and continue handling only the original error.
getLogger().warn(
"Failed to write critical notification response to the client",
e);
}
} else {
// Re-throw other exceptions
throw new ServiceException(t);
}
} finally {
if (vaadinSession != null) {
vaadinSession.unlock();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleExceptionDuringRequest
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
handleExceptionDuringRequest
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
private void showFactoryResetProtectionWarningDialog(String unlockMethodToSet) {
int title = getResIdForFactoryResetProtectionWarningTitle();
int message = getResIdForFactoryResetProtectionWarningMessage();
FactoryResetProtectionWarningDialog dialog =
FactoryResetProtectionWarningDialog.newInstance(
title, message, unlockMethodToSet);
dialog.show(getChildFragmentManager(), TAG_FRP_WARNING_DIALOG);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showFactoryResetProtectionWarningDialog
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2018-9501
|
HIGH
| 7.2
|
android
|
showFactoryResetProtectionWarningDialog
|
src/com/android/settings/password/ChooseLockGeneric.java
|
5e43341b8c7eddce88f79c9a5068362927c05b54
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void _reportFailedNullCoerce(DeserializationContext ctxt, boolean state, Enum<?> feature,
String inputDesc) throws JsonMappingException
{
String enableDesc = state ? "enable" : "disable";
ctxt.reportInputMismatch(this, "Cannot coerce %s to Null value as %s (%s `%s.%s` to allow)",
inputDesc, _coercedTypeDesc(), enableDesc, feature.getDeclaringClass().getSimpleName(), feature.name());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _reportFailedNullCoerce
File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-42003
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_reportFailedNullCoerce
|
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
|
d78d00ee7b5245b93103fef3187f70543d67ca33
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<WorkflowTask> findAllTasks(WorkflowSearcher searcher) throws DotDataException {
List<WorkflowTask> list = APILocator.getWorkflowAPI().searchAllTasks(searcher);
totalCount = (APILocator.getWorkflowAPI().searchAllTasks(null)).size();
return list;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findAllTasks
File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4040
|
MEDIUM
| 6.5
|
dotCMS/core
|
findAllTasks
|
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
|
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
| 0
|
Analyze the following code function for security vulnerabilities
|
public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAuthentication
File: samples/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
|
getAuthentication
|
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
|
private boolean setPasswordPrivileged(@NonNull String password, int flags,
CallerIdentity caller) {
// Only allow setting password on an unsecured user
if (isLockScreenSecureUnchecked(caller.getUserId())) {
throw new SecurityException("Cannot change current password");
}
return resetPasswordInternal(password, 0, null, flags, caller);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPasswordPrivileged
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
|
setPasswordPrivileged
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private void computeLaunchParams(ActivityRecord r, ActivityRecord sourceRecord,
Task targetTask) {
mSupervisor.getLaunchParamsController().calculate(targetTask, r.info.windowLayout, r,
sourceRecord, mOptions, mRequest, PHASE_BOUNDS, mLaunchParams);
mPreferredTaskDisplayArea = mLaunchParams.hasPreferredTaskDisplayArea()
? mLaunchParams.mPreferredTaskDisplayArea
: mRootWindowContainer.getDefaultTaskDisplayArea();
mPreferredWindowingMode = mLaunchParams.mWindowingMode;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: computeLaunchParams
File: services/core/java/com/android/server/wm/ActivityStarter.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-269"
] |
CVE-2023-21269
|
HIGH
| 7.8
|
android
|
computeLaunchParams
|
services/core/java/com/android/server/wm/ActivityStarter.java
|
70ec64dc5a2a816d6aa324190a726a85fd749b30
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void internalDeleteSubscriptionForcefully(AsyncResponse asyncResponse,
String subName, boolean authoritative) {
if (topicName.isGlobal()) {
try {
validateGlobalNamespaceOwnership(namespaceName);
} catch (Exception e) {
log.error("[{}] Failed to delete subscription forcefully {} from topic {}",
clientAppId(), subName, topicName, e);
resumeAsyncResponseExceptionally(asyncResponse, e);
return;
}
}
// If the topic name is a partition name, no need to get partition topic metadata again
if (topicName.isPartitioned()) {
internalDeleteSubscriptionForNonPartitionedTopicForcefully(asyncResponse, subName, authoritative);
} else {
getPartitionedTopicMetadataAsync(topicName,
authoritative, false).thenAccept(partitionMetadata -> {
if (partitionMetadata.partitions > 0) {
final List<CompletableFuture<Void>> futures = Lists.newArrayList();
for (int i = 0; i < partitionMetadata.partitions; i++) {
TopicName topicNamePartition = topicName.getPartition(i);
try {
futures.add(pulsar().getAdminClient().topics()
.deleteSubscriptionAsync(topicNamePartition.toString(), subName, true));
} catch (Exception e) {
log.error("[{}] Failed to delete subscription forcefully {} {}",
clientAppId(), topicNamePartition, subName,
e);
asyncResponse.resume(new RestException(e));
return;
}
}
FutureUtil.waitForAll(futures).handle((result, exception) -> {
if (exception != null) {
Throwable t = exception.getCause();
if (t instanceof NotFoundException) {
asyncResponse.resume(new RestException(Status.NOT_FOUND, "Subscription not found"));
return null;
} else {
log.error("[{}] Failed to delete subscription forcefully {} {}",
clientAppId(), topicName, subName, t);
asyncResponse.resume(new RestException(t));
return null;
}
}
asyncResponse.resume(Response.noContent().build());
return null;
});
} else {
internalDeleteSubscriptionForNonPartitionedTopicForcefully(asyncResponse, subName, authoritative);
}
}).exceptionally(ex -> {
log.error("[{}] Failed to delete subscription forcefully {} from topic {}",
clientAppId(), subName, topicName, ex);
resumeAsyncResponseExceptionally(asyncResponse, ex);
return null;
});
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalDeleteSubscriptionForcefully
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
|
internalDeleteSubscriptionForcefully
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
private VerifyCredentialResponse doVerifyPattern(String pattern, CredentialHash storedHash,
boolean hasChallenge, long challenge, int userId) throws RemoteException {
boolean shouldReEnrollBaseZero = storedHash != null && storedHash.isBaseZeroPattern;
String patternToVerify;
if (shouldReEnrollBaseZero) {
patternToVerify = LockPatternUtils.patternStringToBaseZero(pattern);
} else {
patternToVerify = pattern;
}
VerifyCredentialResponse response = verifyCredential(userId, storedHash, patternToVerify,
hasChallenge, challenge,
new CredentialUtil() {
@Override
public void setCredential(String pattern, String oldPattern, int userId)
throws RemoteException {
setLockPatternInternal(pattern, oldPattern, userId);
}
@Override
public byte[] toHash(String pattern, int userId) {
return LockPatternUtils.patternToHash(
LockPatternUtils.stringToPattern(pattern));
}
@Override
public String adjustForKeystore(String pattern) {
return LockPatternUtils.patternStringToBaseZero(pattern);
}
}
);
if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK
&& shouldReEnrollBaseZero) {
setLockPatternInternal(pattern, patternToVerify, userId);
}
return response;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doVerifyPattern
File: services/core/java/com/android/server/LockSettingsService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
doVerifyPattern
|
services/core/java/com/android/server/LockSettingsService.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void bundleChanged(BundleEvent event) {
if ((event.getType() & BundleEvent.STOPPED) != 0) {
stop();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bundleChanged
File: flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
Repository: vaadin/osgi
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-31407
|
MEDIUM
| 5
|
vaadin/osgi
|
bundleChanged
|
flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
|
3e17674c2e3f88b6e682872c42b7d0ad7d9c4ad8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override // binder call
public void onError(long deviceId, int error) {
mHandler.obtainMessage(MSG_ERROR, error, 0, deviceId).sendToTarget();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onError
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
|
onError
|
core/java/android/hardware/fingerprint/FingerprintManager.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public BaseObject getObject(String className, int nb)
{
return getXObject(resolveClassReference(className), nb);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getObject
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
|
getObject
|
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 Map<Element, Component> loadKnownComponents(Element elt) {
Map<Element, Component> known = new HashMap<Element, Component>();
for (Element sub : XmlIterator.forChildElements(elt, "comp")) {
try {
Component comp = XmlCircuitReader.getComponent(sub, this);
if (comp != null)
known.put(sub, comp);
} catch (XmlReaderException e) {
}
}
return known;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadKnownComponents
File: src/com/cburch/logisim/file/XmlReader.java
Repository: logisim-evolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000889
|
MEDIUM
| 6.8
|
logisim-evolution
|
loadKnownComponents
|
src/com/cburch/logisim/file/XmlReader.java
|
90aee8f8ceef463884cc400af4f6d1f109fb0972
| 0
|
Analyze the following code function for security vulnerabilities
|
BDSStateMap getBDSState()
{
return bdsState;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBDSState
File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-470"
] |
CVE-2018-1000613
|
HIGH
| 7.5
|
bcgit/bc-java
|
getBDSState
|
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
|
4092ede58da51af9a21e4825fbad0d9a3ef5a223
| 0
|
Analyze the following code function for security vulnerabilities
|
public void checkConnection(UrlArgument repoUrl) {
final String ref = fullUpstreamRef();
final CommandLine commandLine = git().withArgs("ls-remote").withArg(repoUrl).withArg(ref);
final ConsoleResult result = commandLine.runOrBomb(new NamedProcessTag(repoUrl.forDisplay()));
if (!hasExactlyOneMatchingBranch(result)) {
throw new CommandLineException(format("The ref %s could not be found.", ref));
}
}
|
Vulnerability Classification:
- CWE: CWE-77
- CVE: CVE-2021-43286
- Severity: MEDIUM
- CVSS Score: 6.5
Description: #000 - Validate URLs provided
- Disallow URLs which are obviously not URLs.
Function: checkConnection
File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
Repository: gocd
Fixed Code:
public void checkConnection(UrlArgument repoUrl) {
final String ref = fullUpstreamRef();
final CommandLine commandLine = git().withArgs("ls-remote", "--").withArg(repoUrl).withArg(ref);
final ConsoleResult result = commandLine.runOrBomb(new NamedProcessTag(repoUrl.forDisplay()));
if (!hasExactlyOneMatchingBranch(result)) {
throw new CommandLineException(format("The ref %s could not be found.", ref));
}
}
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
checkConnection
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 1
|
Analyze the following code function for security vulnerabilities
|
public static String getUser() {
return System.getProperty(KieServerConstants.CFG_KIE_USER, "kieserver");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUser
File: kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
Repository: kiegroup/droolsjbpm-integration
The code follows secure coding practices.
|
[
"CWE-260"
] |
CVE-2016-7043
|
MEDIUM
| 5
|
kiegroup/droolsjbpm-integration
|
getUser
|
kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
|
e916032edd47aa46d15f3a11909b4804ee20a7e8
| 0
|
Analyze the following code function for security vulnerabilities
|
final Intent verifyBroadcastLocked(Intent intent) {
// Refuse possible leaked file descriptors
if (intent != null && intent.hasFileDescriptors() == true) {
throw new IllegalArgumentException("File descriptors passed in Intent");
}
int flags = intent.getFlags();
if (!mProcessesReady) {
// if the caller really truly claims to know what they're doing, go
// ahead and allow the broadcast without launching any receivers
if ((flags&Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT) != 0) {
intent = new Intent(intent);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
} else if ((flags&Intent.FLAG_RECEIVER_REGISTERED_ONLY) == 0) {
Slog.e(TAG, "Attempt to launch receivers of broadcast intent " + intent
+ " before boot completion");
throw new IllegalStateException("Cannot broadcast before boot completed");
}
}
if ((flags&Intent.FLAG_RECEIVER_BOOT_UPGRADE) != 0) {
throw new IllegalArgumentException(
"Can't use FLAG_RECEIVER_BOOT_UPGRADE here");
}
return intent;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: verifyBroadcastLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
verifyBroadcastLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void checkExec(String cmd) {
try {
if (enterPublicInterface())
return;
throw new SecurityException(localized("security.error_execute")); //$NON-NLS-1$
} finally {
exitPublicInterface();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkExec
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
|
checkExec
|
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
|
af4f28a56e2fe600d8750b3b415352a0a3217392
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
boolean check(ServicesConfig c1, ServicesConfig c2) {
return c1 == c2 || !(c1 == null || c2 == null)
&& nullSafeEqual(c1.isEnableDefaults(), c2.isEnableDefaults())
&& isCompatible(c1.getServiceConfigs(), c2.getServiceConfigs());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: check
File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
check
|
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
final void doStopUidLocked(int uid, final UidRecord uidRec) {
mServices.stopInBackgroundLocked(uid);
enqueueUidChangeLocked(uidRec, uid, UidRecord.CHANGE_IDLE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doStopUidLocked
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
|
doStopUidLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Document parseDocument(InputSource source) throws XMLException {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder xmlBuilder = dbf.newDocumentBuilder();
return xmlBuilder.parse(source);
} catch (Exception er) {
throw new XMLException("Error parsing XML document", er);
}
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2021-3836
- Severity: MEDIUM
- CVSS Score: 4.3
Description: dbeaver/dbeaver-ee#1166 prevent XXE
Function: parseDocument
File: bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
Repository: dbeaver
Fixed Code:
public static Document parseDocument(InputSource source) throws XMLException {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder xmlBuilder = dbf.newDocumentBuilder();
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
return xmlBuilder.parse(source);
} catch (Exception er) {
throw new XMLException("Error parsing XML document", er);
}
}
|
[
"CWE-611"
] |
CVE-2021-3836
|
MEDIUM
| 4.3
|
dbeaver
|
parseDocument
|
bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
|
4debf8f25184b7283681ed3fb5e9e887d9d4fe22
| 1
|
Analyze the following code function for security vulnerabilities
|
@TestOnly
public void commitOnDate(String message, Date commitDate) {
HashMap<String, String> env = new HashMap<>();
env.put("GIT_AUTHOR_DATE", formatRFC822(commitDate));
CommandLine gitCmd = gitWd().withArgs("commit", "-m", message).withEnv(env);
runOrBomb(gitCmd);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: commitOnDate
File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
commitOnDate
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
void resetContentChanged() {
mWindowFrames.setContentChanged(false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetContentChanged
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
resetContentChanged
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testExtractNanosecondDecimal06()
{
BigDecimal value = new BigDecimal("19827342231.999999999");
long seconds = value.longValue();
assertEquals("The second part is not correct.", 19827342231L, seconds);
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
assertEquals("The nanosecond part is not correct.", 999999999, nanoseconds);
}
|
Vulnerability Classification:
- CWE: CWE-20
- CVE: CVE-2018-1000873
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Refactor TestDecimalUtils to reduce repetition.
Function: testExtractNanosecondDecimal06
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDecimalUtils.java
Repository: FasterXML/jackson-modules-java8
Fixed Code:
@Test
public void testExtractNanosecondDecimal06()
{
BigDecimal value = new BigDecimal("19827342231.999999999");
checkExtractNanos(19827342231L, 999999999, value);
}
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testExtractNanosecondDecimal06
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDecimalUtils.java
|
103f5678fe104cd6934f07f1158fe92a1e2393a7
| 1
|
Analyze the following code function for security vulnerabilities
|
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound)
{
int iterations = getNumberOfIterations(bitlength, param.getCertainty());
for (int i = 0; i != 5 * bitlength; i++)
{
BigInteger p = new BigInteger(bitlength, 1, param.getRandom());
if (p.mod(e).equals(ONE))
{
continue;
}
if (p.multiply(p).compareTo(sqrdBound) < 0)
{
continue;
}
if (!isProbablePrime(p, iterations))
{
continue;
}
if (!e.gcd(p.subtract(ONE)).equals(ONE))
{
continue;
}
return p;
}
throw new IllegalStateException("unable to generate prime number for RSA key");
}
|
Vulnerability Classification:
- CWE: CWE-327
- CVE: CVE-2018-1000180
- Severity: MEDIUM
- CVSS Score: 5.0
Description: BJA-694 minor tweak to avoid method signature change
Function: chooseRandomPrime
File: core/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java
Repository: bcgit/bc-java
Fixed Code:
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound)
{
for (int i = 0; i != 5 * bitlength; i++)
{
BigInteger p = new BigInteger(bitlength, 1, param.getRandom());
if (p.mod(e).equals(ONE))
{
continue;
}
if (p.multiply(p).compareTo(sqrdBound) < 0)
{
continue;
}
if (!isProbablePrime(p))
{
continue;
}
if (!e.gcd(p.subtract(ONE)).equals(ONE))
{
continue;
}
return p;
}
throw new IllegalStateException("unable to generate prime number for RSA key");
}
|
[
"CWE-327"
] |
CVE-2018-1000180
|
MEDIUM
| 5
|
bcgit/bc-java
|
chooseRandomPrime
|
core/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java
|
22467b6e8fe19717ecdf201c0cf91bacf04a55ad
| 1
|
Analyze the following code function for security vulnerabilities
|
public PdfDictionary getTrailer() {
return trailer;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTrailer
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
getTrailer
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
9b0cbb76c8434a8505f02ada02a94263dcae9247
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void handleConfirmShortCode(boolean isPremium, SmsTracker tracker) {
if (denyIfQueueLimitReached(tracker)) {
return; // queue limit reached; error was returned to caller
}
int detailsId;
if (isPremium) {
detailsId = R.string.sms_premium_short_code_details;
} else {
detailsId = R.string.sms_short_code_details;
}
CharSequence appLabel = getAppLabel(tracker.mAppInfo.packageName);
Resources r = Resources.getSystem();
Spanned messageText = Html.fromHtml(r.getString(R.string.sms_short_code_confirm_message,
appLabel, tracker.mDestAddress));
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.sms_short_code_confirmation_dialog, null);
ConfirmDialogListener listener = new ConfirmDialogListener(tracker,
(TextView)layout.findViewById(R.id.sms_short_code_remember_undo_instruction));
TextView messageView = (TextView) layout.findViewById(R.id.sms_short_code_confirm_message);
messageView.setText(messageText);
ViewGroup detailsLayout = (ViewGroup) layout.findViewById(
R.id.sms_short_code_detail_layout);
TextView detailsView = (TextView) detailsLayout.findViewById(
R.id.sms_short_code_detail_message);
detailsView.setText(detailsId);
CheckBox rememberChoice = (CheckBox) layout.findViewById(
R.id.sms_short_code_remember_choice_checkbox);
rememberChoice.setOnCheckedChangeListener(listener);
AlertDialog d = new AlertDialog.Builder(mContext)
.setView(layout)
.setPositiveButton(r.getString(R.string.sms_short_code_confirm_allow), listener)
.setNegativeButton(r.getString(R.string.sms_short_code_confirm_deny), listener)
.setOnCancelListener(listener)
.create();
d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
d.show();
listener.setPositiveButton(d.getButton(DialogInterface.BUTTON_POSITIVE));
listener.setNegativeButton(d.getButton(DialogInterface.BUTTON_NEGATIVE));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleConfirmShortCode
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
handleConfirmShortCode
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
public StandardTemplateParams titleViewId(int titleViewId) {
mTitleViewId = titleViewId;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: titleViewId
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
titleViewId
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setSchemas(Resource[] schemaResources) {
this.schemaResources = schemaResources;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSchemas
File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-4152
|
MEDIUM
| 6.8
|
spring-projects/spring-framework
|
setSchemas
|
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
|
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
| 0
|
Analyze the following code function for security vulnerabilities
|
private String serializePropertyValue(PropertyInterface property,
com.xpn.xwiki.objects.classes.PropertyClass propertyClass, XWikiContext context)
{
if (propertyClass instanceof ComputedFieldClass) {
// TODO: the XWikiDocument needs to be explicitely set in the context, otherwise method
// PropertyClass.renderInContext fires a null pointer exception: bug?
XWikiDocument document = context.getDoc();
try {
context.setDoc(property.getObject().getOwnerDocument());
ComputedFieldClass computedFieldClass = (ComputedFieldClass) propertyClass;
return computedFieldClass.getComputedValue(propertyClass.getName(), "", property.getObject(), context);
} catch (Exception e) {
logger.error("Error while computing property value [{}] of [{}]", propertyClass.getName(),
property.getObject(), e);
return serializePropertyValue(property);
} finally {
// Reset the context document to its original value, even if an exception is raised.
context.setDoc(document);
}
} else {
return serializePropertyValue(property);
}
}
|
Vulnerability Classification:
- CWE: CWE-668
- CVE: CVE-2023-35151
- Severity: HIGH
- CVSS Score: 7.5
Description: XWIKI-16138: Improved REST properties cleanup
Function: serializePropertyValue
File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
Repository: xwiki/xwiki-platform
Fixed Code:
private String serializePropertyValue(PropertyInterface property,
com.xpn.xwiki.objects.classes.PropertyClass propertyClass, XWikiContext context)
{
if (propertyClass instanceof ComputedFieldClass) {
// TODO: the XWikiDocument needs to be explicitely set in the context, otherwise method
// PropertyClass.renderInContext fires a null pointer exception: bug?
XWikiDocument document = context.getDoc();
try {
context.setDoc(property.getObject().getOwnerDocument());
ComputedFieldClass computedFieldClass = (ComputedFieldClass) propertyClass;
return computedFieldClass.getComputedValue(propertyClass.getName(), "", property.getObject(), context);
} catch (Exception e) {
logger.error("Error while computing property value [{}] of [{}]", propertyClass.getName(),
property.getObject(), e);
return serializePropertyValue(property);
} finally {
// Reset the context document to its original value, even if an exception is raised.
context.setDoc(document);
}
} else {
return cleanupBeforeMakingPublic(propertyClass.getClassType(), property);
}
}
|
[
"CWE-668"
] |
CVE-2023-35151
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
serializePropertyValue
|
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
|
824cd742ecf5439971247da11bfe7e0ad2b10ede
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getUid() {
return mSession.mUid;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUid
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
getUid
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isVoipSupported(Context context) {
return SipManager.isVoipSupported(context) &&
context.getResources().getBoolean(
com.android.internal.R.bool.config_built_in_sip_phone) &&
context.getResources().getBoolean(
com.android.internal.R.bool.config_voice_capable);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isVoipSupported
File: sip/src/com/android/services/telephony/sip/SipUtil.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0847
|
HIGH
| 7.2
|
android
|
isVoipSupported
|
sip/src/com/android/services/telephony/sip/SipUtil.java
|
a294ae5342410431a568126183efe86261668b5d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Transactional
@Override
public void onDeleteBranch(Project project, String branchName) {
for (Iterator<BranchProtection> it = project.getBranchProtections().iterator(); it.hasNext();) {
BranchProtection protection = it.next();
PatternSet patternSet = PatternSet.parse(protection.getBranches());
patternSet.getIncludes().remove(branchName);
patternSet.getExcludes().remove(branchName);
protection.setBranches(patternSet.toString());
if (protection.getBranches().length() == 0)
it.remove();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onDeleteBranch
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
onDeleteBranch
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int intValueExact() {
return bigDecimalValue().intValueExact();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: intValueExact
File: impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
Repository: eclipse-ee4j/parsson
The code follows secure coding practices.
|
[
"CWE-834"
] |
CVE-2023-4043
|
HIGH
| 7.5
|
eclipse-ee4j/parsson
|
intValueExact
|
impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
|
84764ffbe3d0376da242b27a9a526138d0dfb8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected boolean isLastFrameSent() {
return thisGoneAway;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isLastFrameSent
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
|
isLastFrameSent
|
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
|
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public V get(K name) {
checkNotNull(name, "name");
int h = hashingStrategy.hashCode(name);
int i = index(h);
HeaderEntry<K, V> e = entries[i];
V value = null;
// loop until the first header was found
while (e != null) {
if (e.hash == h && hashingStrategy.equals(name, e.key)) {
value = e.value;
}
e = e.next;
}
return value;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
get
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean login() throws LoginException
{
Object result = null;
AuthorizeAction action = new AuthorizeAction();
if (AUTH_TYPE_GSSAPI.equals(bindAuthentication))
{
log.trace("Using GSSAPI to connect to LDAP");
LoginContext lc = new LoginContext(jaasSecurityDomain);
lc.login();
Subject serverSubject = lc.getSubject();
if (log.isDebugEnabled())
{
log.debug("Subject = " + serverSubject);
log.debug("Logged in '" + lc + "' LoginContext");
}
result = Subject.doAs(serverSubject, action);
lc.logout();
}
else
{
result = action.run();
}
if (result instanceof LoginException)
{
throw (LoginException) result;
}
return ((Boolean) result).booleanValue();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: login
File: jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java
Repository: wildfly-security/jboss-negotiation
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2015-1849
|
MEDIUM
| 4.3
|
wildfly-security/jboss-negotiation
|
login
|
jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java
|
0dc9d191b6eb1d13b8f0189c5b02ba6576f4722e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void executeGetConnectionFails(TestContext context) throws Exception {
postgresClientGetConnectionFails().execute("SELECT 1", context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeGetConnectionFails
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
executeGetConnectionFails
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
protected XHTMLWikiPrinter getXHTMLWikiPrinter()
{
if (this.xhtmlWikiPrinter == null) {
this.xhtmlWikiPrinter = new XHTMLWikiPrinter(getPrinter());
}
return this.xhtmlWikiPrinter;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-32070
- Severity: MEDIUM
- CVSS Score: 6.1
Description: XRENDERING-663: Restrict allowed attributes in HTML rendering
* Change HTML renderers to only print allowed attributes and elements.
* Add prefix to forbidden attributes to preserve them in XWiki syntax.
* Adapt tests to expect that invalid attributes get a prefix.
Function: getXHTMLWikiPrinter
File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
Repository: xwiki/xwiki-rendering
Fixed Code:
protected XHTMLWikiPrinter getXHTMLWikiPrinter()
{
if (this.xhtmlWikiPrinter == null) {
this.xhtmlWikiPrinter = new XHTMLWikiPrinter(getPrinter(), getHtmlElementSanitizer());
}
return this.xhtmlWikiPrinter;
}
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
getXHTMLWikiPrinter
|
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void bootAnimationComplete() {
final boolean callFinishBooting;
synchronized (this) {
callFinishBooting = mCallFinishBooting;
mBootAnimationComplete = true;
}
if (callFinishBooting) {
finishBooting();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bootAnimationComplete
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
bootAnimationComplete
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public LocalFileHeader getLocalFileHeader() {
return localFileHeader;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocalFileHeader
File: src/main/java/net/lingala/zip4j/io/inputstream/CipherInputStream.java
Repository: srikanth-lingala/zip4j
The code follows secure coding practices.
|
[
"CWE-346"
] |
CVE-2023-22899
|
MEDIUM
| 5.9
|
srikanth-lingala/zip4j
|
getLocalFileHeader
|
src/main/java/net/lingala/zip4j/io/inputstream/CipherInputStream.java
|
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Set<GetSourceValue> getReadPositions(String script, List<String> sourceImageNames)
throws JiffleException {
Jiffle.Result<ParseTree> parseResult = parseScript(script);
if (parseResult.messages.isError()) {
reportMessages(parseResult);
return Collections.emptySet();
}
// If image var parameters were provided by the caller we ignore any in the script.
// Otherwise, we look for an images block in the script.
ParseTree tree = parseResult.result;
if (sourceImageNames == null) {
Jiffle.Result<Map<String, Jiffle.ImageRole>> r = getScriptImageParams(tree);
sourceImageNames =
r.result
.entrySet()
.stream()
.filter(k -> k.getValue() == ImageRole.SOURCE)
.map(k -> k.getKey())
.collect(Collectors.toList());
}
if (sourceImageNames.isEmpty()) {
return Collections.emptySet();
}
SourcePositionsWorker worker = new SourcePositionsWorker(tree, sourceImageNames);
Set<GetSourceValue> positions = worker.getPositions();
return positions;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getReadPositions
File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
Repository: geosolutions-it/jai-ext
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-24816
|
HIGH
| 7.5
|
geosolutions-it/jai-ext
|
getReadPositions
|
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
|
cb1d6565d38954676b0a366da4f965fef38da1cb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
public static MappedByteBuffer map(File file, MapMode mode) throws IOException {
return mapInternal(file, mode, -1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: map
File: android/guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2020-8908
|
LOW
| 2.1
|
google/guava
|
map
|
android/guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public IBinder getHomeActivityToken() throws RemoteException {
enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS,
"getHomeActivityToken()");
synchronized (this) {
return mStackSupervisor.getHomeActivityToken();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHomeActivityToken
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
getHomeActivityToken
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static VaadinResponse getCurrentResponse() {
return VaadinResponse.getCurrent();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentResponse
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
getCurrentResponse
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public List<CmsContent> check(short siteId, SysUser user, Serializable[] ids) {
List<CmsContent> entityList = new ArrayList<>();
for (CmsContent entity : getEntitys(ids)) {
if (null != entity && siteId == entity.getSiteId() && STATUS_PEND == entity.getStatus()
&& (user.isOwnsAllContent() || entity.getUserId() == user.getId())) {
entity.setStatus(STATUS_NORMAL);
entity.setCheckUserId(user.getId());
entity.setCheckDate(CommonUtils.getDate());
for (CmsContent quote : (List<CmsContent>) getPage(new CmsContentQuery(siteId, null, null, null, null, null, null,
null, entity.getId(), null, null, null, null, null, null, null, null, null, null), null, null, null, null,
null).getList()) {
quote.setStatus(STATUS_NORMAL);
}
entityList.add(entity);
}
}
return entityList;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2020-21333
- Severity: LOW
- CVSS Score: 3.5
Description: https://github.com/sanluan/PublicCMS/issues/26
https://github.com/sanluan/PublicCMS/issues/27
Function: check
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
Repository: sanluan/PublicCMS
Fixed Code:
@SuppressWarnings("unchecked")
public List<CmsContent> check(short siteId, SysUser user, Serializable[] ids) {
List<CmsContent> entityList = new ArrayList<>();
for (CmsContent entity : getEntitys(ids)) {
if (null != entity && siteId == entity.getSiteId() && STATUS_DRAFT != entity.getStatus()
&& STATUS_NORMAL != entity.getStatus() && (user.isOwnsAllContent() || entity.getUserId() == user.getId())) {
entity.setStatus(STATUS_NORMAL);
entity.setCheckUserId(user.getId());
entity.setCheckDate(CommonUtils.getDate());
for (CmsContent quote : (List<CmsContent>) getPage(new CmsContentQuery(siteId, null, null, null, null, null, null,
null, entity.getId(), null, null, null, null, null, null, null, null, null, null), null, null, null, null,
null).getList()) {
quote.setStatus(STATUS_NORMAL);
}
entityList.add(entity);
}
}
return entityList;
}
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
check
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 1
|
Analyze the following code function for security vulnerabilities
|
private static Object[] decodeArgs(Component instance, Method method,
JsonArray argsFromClient) {
int methodArgs = method.getParameterCount();
int clientValuesCount = argsFromClient.length();
JsonArray argValues;
if (method.isVarArgs()) {
if (clientValuesCount >= methodArgs - 1) {
argValues = unwrapVarArgs(argsFromClient, method);
} else {
String msg = String.format(
"The number of received values (%d) is not enough "
+ "to call the method '%s' declared in '%s' which "
+ "has vararg parameter and the number of arguments %d",
argsFromClient.length(), method.getName(),
method.getDeclaringClass().getName(),
method.getParameterCount());
throw new IllegalArgumentException(msg);
}
} else {
if (methodArgs == clientValuesCount) {
argValues = argsFromClient;
} else {
String msg = String.format(
"The number of received values (%d) is not equal "
+ "to the number of arguments (%d) in the method '%s' "
+ "declared in '%s'",
argsFromClient.length(), method.getParameterCount(),
method.getName(), method.getDeclaringClass().getName());
throw new IllegalArgumentException(msg);
}
}
List<Object> decoded = new ArrayList<>(method.getParameterCount());
Class<?>[] methodParameterTypes = method.getParameterTypes();
for (int i = 0; i < argValues.length(); i++) {
Class<?> type = methodParameterTypes[i];
decoded.add(decodeArg(instance, method, type, i, argValues.get(i)));
}
return decoded.toArray(new Object[method.getParameterCount()]);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: decodeArgs
File: flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25500
|
MEDIUM
| 4.3
|
vaadin/flow
|
decodeArgs
|
flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
|
1fa4976902a117455bf2f98b191f8c80692b53c8
| 0
|
Analyze the following code function for security vulnerabilities
|
private void dumpForUser(int userId, PrintWriter pw) {
if (userId == UserHandle.USER_SYSTEM) {
pw.println("GLOBAL SETTINGS (user " + userId + ")");
Cursor globalCursor = getAllGlobalSettings(ALL_COLUMNS);
dumpSettings(globalCursor, pw);
pw.println();
}
pw.println("SECURE SETTINGS (user " + userId + ")");
Cursor secureCursor = getAllSecureSettings(userId, ALL_COLUMNS);
dumpSettings(secureCursor, pw);
pw.println();
pw.println("SYSTEM SETTINGS (user " + userId + ")");
Cursor systemCursor = getAllSystemSettings(userId, ALL_COLUMNS);
dumpSettings(systemCursor, pw);
pw.println();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpForUser
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
dumpForUser
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
throws JsonMappingException
{
ObjectNode o = createSchemaNode("object", true);
// [JACKSON-813]: Add optional JSON Schema id attribute, if found
// NOTE: not optimal, does NOT go through AnnotationIntrospector etc:
JsonSerializableSchema ann = _handledType.getAnnotation(JsonSerializableSchema.class);
if (ann != null) {
String id = ann.id();
if (id != null && id.length() > 0) {
o.put("id", id);
}
}
//todo: should the classname go in the title?
//o.put("title", _className);
ObjectNode propertiesNode = o.objectNode();
final PropertyFilter filter;
if (_propertyFilterId != null) {
filter = findPropertyFilter(provider, _propertyFilterId, null);
} else {
filter = null;
}
for (int i = 0; i < _props.length; i++) {
BeanPropertyWriter prop = _props[i];
if (filter == null) {
prop.depositSchemaProperty(propertiesNode, provider);
} else {
filter.depositSchemaProperty(prop, propertiesNode, provider);
}
}
o.set("properties", propertiesNode);
return o;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSchema
File: src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
getSchema
|
src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void wakeUp(long time, @WakeReason int reason, String details) {
service.mPowerManager.wakeUp(time, reason, details);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: wakeUp
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
wakeUp
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void configure(ConfigurableProvider provider)
{
provider.addAlgorithm("SecureRandom.DEFAULT", PREFIX + "$Default");
provider.addAlgorithm("SecureRandom.NONCEANDIV", PREFIX + "$NonceAndIV");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: configure
File: prov/src/main/java/org/bouncycastle/jcajce/provider/drbg/DRBG.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2016-1000339
|
MEDIUM
| 5
|
bcgit/bc-java
|
configure
|
prov/src/main/java/org/bouncycastle/jcajce/provider/drbg/DRBG.java
|
8a73f08931450c17c749af067b6a8185abdfd2c0
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Set<String> getOutputEntryNames(List<SignerConfig> signerConfigs) {
Set<String> result = new HashSet<>(2 * signerConfigs.size() + 1);
for (SignerConfig signerConfig : signerConfigs) {
String signerName = signerConfig.name;
result.add("META-INF/" + signerName + ".SF");
PublicKey publicKey = signerConfig.certificates.get(0).getPublicKey();
String signatureBlockFileName =
"META-INF/" + signerName + "."
+ publicKey.getAlgorithm().toUpperCase(Locale.US);
result.add(signatureBlockFileName);
}
result.add(V1SchemeConstants.MANIFEST_ENTRY_NAME);
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOutputEntryNames
File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
getOutputEntryNames
|
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java
|
41d882324288085fd32ae0bb70dc85f5fd0e2be7
| 0
|
Analyze the following code function for security vulnerabilities
|
private CompletableFuture<Path> downloadResource(final String resourceURI, Path resourceCachePath) {
return CompletableFuture.supplyAsync(() -> {
LOGGER.info("Downloading " + resourceURI + " to " + resourceCachePath + "...");
long start = System.currentTimeMillis();
URLConnection conn = null;
try {
String actualURI = resourceURI;
URL url = new URL(actualURI);
conn = url.openConnection();
/* XXX: This should really be implemented using HttpClient or similar */
int allowedRedirects = 5;
while (conn.getHeaderField("Location") != null && allowedRedirects > 0) //$NON-NLS-1$
{
allowedRedirects--;
url = new URL(actualURI = conn.getHeaderField("Location")); //$NON-NLS-1$
conn = url.openConnection();
}
// Download resource in a temporary file
Path path = Files.createTempFile(resourceCachePath.getFileName().toString(), ".lsp4xml");
try (ReadableByteChannel rbc = Channels.newChannel(conn.getInputStream());
FileOutputStream fos = new FileOutputStream(path.toFile())) {
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
}
// Move the temporary file in the lsp4xml cache folder.
Path dir = resourceCachePath.getParent();
if (!Files.exists(dir)) {
Files.createDirectories(dir);
}
Files.move(path, resourceCachePath);
long elapsed = System.currentTimeMillis() - start;
LOGGER.info("Downloaded " + resourceURI + " to " + resourceCachePath + " in " + elapsed + "ms");
} catch (Exception e) {
// Do nothing
unavailableURICache.put(resourceURI, true);
Throwable rootCause = getRootCause(e);
String error = "[" + rootCause.getClass().getTypeName() + "] " + rootCause.getMessage();
LOGGER.log(Level.SEVERE,
"Error while downloading " + resourceURI + " to " + resourceCachePath + " : " + error);
throw new CacheResourceDownloadedException("Error while downloading '" + resourceURI + "' to " + resourceCachePath + ".", e);
} finally {
synchronized (resourcesLoading) {
resourcesLoading.remove(resourceURI);
}
if (conn != null && conn instanceof HttpURLConnection) {
((HttpURLConnection) conn).disconnect();
}
}
return resourceCachePath;
});
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2019-18212
- Severity: MEDIUM
- CVSS Score: 4.0
Description: Reject download of resource which are not in the cache folder (url which
uses several ../../).
Signed-off-by: azerr <azerr@redhat.com>
Function: downloadResource
File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/uriresolver/CacheResourcesManager.java
Repository: eclipse/lemminx
Fixed Code:
private CompletableFuture<Path> downloadResource(final String resourceURI, Path resourceCachePath) {
return CompletableFuture.supplyAsync(() -> {
LOGGER.info("Downloading " + resourceURI + " to " + resourceCachePath + "...");
long start = System.currentTimeMillis();
URLConnection conn = null;
try {
String actualURI = resourceURI;
URL url = new URL(actualURI);
conn = url.openConnection();
/* XXX: This should really be implemented using HttpClient or similar */
int allowedRedirects = 5;
while (conn.getHeaderField("Location") != null && allowedRedirects > 0) //$NON-NLS-1$
{
allowedRedirects--;
url = new URL(actualURI = conn.getHeaderField("Location")); //$NON-NLS-1$
conn = url.openConnection();
}
// Download resource in a temporary file
Path path = Files.createTempFile(resourceCachePath.getFileName().toString(), ".lsp4xml");
try (ReadableByteChannel rbc = Channels.newChannel(conn.getInputStream());
FileOutputStream fos = new FileOutputStream(path.toFile())) {
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
}
// Move the temporary file in the lsp4xml cache folder.
Path dir = resourceCachePath.getParent();
if (!Files.exists(dir)) {
Files.createDirectories(dir);
}
Files.move(path, resourceCachePath);
long elapsed = System.currentTimeMillis() - start;
LOGGER.info("Downloaded " + resourceURI + " to " + resourceCachePath + " in " + elapsed + "ms");
} catch (Exception e) {
// Do nothing
unavailableURICache.put(resourceURI, true);
Throwable rootCause = getRootCause(e);
String error = "[" + rootCause.getClass().getTypeName() + "] " + rootCause.getMessage();
LOGGER.log(Level.SEVERE,
"Error while downloading " + resourceURI + " to " + resourceCachePath + " : " + error);
throw new CacheResourceDownloadedException(
"Error while downloading '" + resourceURI + "' to " + resourceCachePath + ".", e);
} finally {
synchronized (resourcesLoading) {
resourcesLoading.remove(resourceURI);
}
if (conn != null && conn instanceof HttpURLConnection) {
((HttpURLConnection) conn).disconnect();
}
}
return resourceCachePath;
});
}
|
[
"CWE-22"
] |
CVE-2019-18212
|
MEDIUM
| 4
|
eclipse/lemminx
|
downloadResource
|
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/uriresolver/CacheResourcesManager.java
|
e37c399aa266be1b7a43061d4afc43dc230410d2
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public Filter getFilter() {
return new Filter() {
@Override
protected FilterResults performFiltering(CharSequence filterText) {
// No locking needed as mAllItems is final an immutable
final List<ViewItem> filtered = mAllItems.stream()
.filter((item) -> item.matches(filterText))
.collect(Collectors.toList());
final FilterResults results = new FilterResults();
results.values = filtered;
results.count = filtered.size();
return results;
}
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
final boolean resultCountChanged;
final int oldItemCount = mFilteredItems.size();
mFilteredItems.clear();
if (results.count > 0) {
@SuppressWarnings("unchecked") final List<ViewItem> items =
(List<ViewItem>) results.values;
mFilteredItems.addAll(items);
}
resultCountChanged = (oldItemCount != mFilteredItems.size());
if (resultCountChanged) {
announceSearchResultIfNeeded();
}
notifyDataSetChanged();
}
};
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFilter
File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-610"
] |
CVE-2023-40133
|
MEDIUM
| 5.5
|
android
|
getFilter
|
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
|
08becc8c600f14c5529115cc1a1e0c97cd503f33
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<String> searchSpacesNames(String parametrizedSqlClause, int nb, int start, List<?> parameterValues)
throws XWikiException
{
return this.xwiki.getStore().search("select distinct doc.space from XWikiDocument doc " + parametrizedSqlClause,
nb, start, parameterValues, this.context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: searchSpacesNames
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
searchSpacesNames
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean directBufferPreferred() {
return DIRECT_BUFFER_PREFERRED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: directBufferPreferred
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
directBufferPreferred
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
public void destroy() {
entityCache.removeCache(KBTemplateImpl.class.getName());
finderCache.removeCache(FINDER_CLASS_NAME_ENTITY);
finderCache.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroy
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
|
destroy
|
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
|
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void saveSubmissionInfo(HttpServletRequest request,
SubmissionInfo si)
{
// save to request
request.setAttribute("submission.info", si);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveSubmissionInfo
File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31194
|
HIGH
| 7.2
|
DSpace
|
saveSubmissionInfo
|
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
|
d1dd7d23329ef055069759df15cfa200c8e3
| 0
|
Analyze the following code function for security vulnerabilities
|
private void doSend() {
sendOrSaveWithSanityChecks(false, true, false, false);
logSendOrSave(false /* save */);
mPerformedSendOrDiscard = true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doSend
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
|
doSend
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
public Long getLastUpdated() {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLastUpdated
File: varexport/src/main/java/com/indeed/util/varexport/Variable.java
Repository: indeedeng/util
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-36634
|
MEDIUM
| 5.4
|
indeedeng/util
|
getLastUpdated
|
varexport/src/main/java/com/indeed/util/varexport/Variable.java
|
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateMaxHeadsUpTranslation() {
mNotificationStackScroller.setHeadsUpBoundaries(getHeight(), mNavigationBarBottomHeight);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateMaxHeadsUpTranslation
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
|
updateMaxHeadsUpTranslation
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
Type getType();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getType
File: service-api/src/main/java/com/nexblocks/authguard/service/model/UserIdentifier.java
Repository: AuthGuard
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2021-45890
|
HIGH
| 7.5
|
AuthGuard
|
getType
|
service-api/src/main/java/com/nexblocks/authguard/service/model/UserIdentifier.java
|
9783b1143da6576028de23e15a1f198b1f937b82
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isKeyguardLocked() {
return keyguardOn();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isKeyguardLocked
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
isKeyguardLocked
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
private XWikiDocument getEditedDocument(XWikiContext context) throws XWikiException
{
XWikiDocument doc = context.getDoc();
boolean hasTranslation = doc != context.get("tdoc");
// We have to clone the context document because it is cached and the changes we are going to make are valid
// only for the duration of the current request.
doc = doc.clone();
context.put("doc", doc);
EditForm editForm = (EditForm) context.getForm();
doc.readDocMetaFromForm(editForm, context);
String language = context.getWiki().getLanguagePreference(context);
if (doc.isNew() && doc.getDefaultLanguage().equals("")) {
doc.setDefaultLanguage(language);
}
String languageToEdit = StringUtils.isEmpty(editForm.getLanguage()) ? language : editForm.getLanguage();
// If no specific language is set or if it is "default" then we edit the current doc.
if (languageToEdit == null || languageToEdit.equals("default")) {
languageToEdit = "";
}
// If the document is new or if the language to edit is the default language then we edit the default
// translation.
if (doc.isNew() || doc.getDefaultLanguage().equals(languageToEdit)) {
languageToEdit = "";
}
// If the doc does not exist in the language to edit and the language was not explicitly set in the URL then
// we edit the default document translation. This prevents use from creating unneeded translations.
if (!hasTranslation && StringUtils.isEmpty(editForm.getLanguage())) {
languageToEdit = "";
}
// Initialize the translated document.
XWikiDocument tdoc;
if (languageToEdit.equals("")) {
// Edit the default document translation (default language).
tdoc = doc;
if (doc.isNew()) {
doc.setDefaultLanguage(language);
doc.setLanguage("");
}
} else if (!hasTranslation && context.getWiki().isMultiLingual(context)) {
// Edit a new translation.
tdoc = new XWikiDocument(doc.getDocumentReference());
tdoc.setLanguage(languageToEdit);
tdoc.setDefaultLocale(doc.getDefaultLocale());
// Mark the translation. It's important to know whether a document is a translation or not, especially
// for the sheet manager which needs to access the objects using the default document not one of its
// translations.
tdoc.setTitle(doc.getTitle());
tdoc.setContent(doc.getContent());
tdoc.setSyntax(doc.getSyntax());
tdoc.setAuthorReference(context.getUserReference());
tdoc.setStore(doc.getStore());
} else {
// Edit an existing translation. Clone the translated document object to be sure that the changes we are
// going to make will last only for the duration of the current request.
tdoc = ((XWikiDocument) context.get("tdoc")).clone();
}
return tdoc;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEditedDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/EditAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2023-46242
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getEditedDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/EditAction.java
|
cf8eb861998ea423c3645d2e5e974420b0e882be
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addProperty(JobProperty<? super P> jobProp) throws IOException {
super.addProperty(jobProp);
updateTransientActions();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addProperty
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
addProperty
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
private String sanitizeString(String stringToSanitize) {
return lookupTranslator.translate(stringToSanitize);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sanitizeString
File: src/main/java/org/bonitasoft/connectors/ws/SecureWSConnector.java
Repository: bonitasoft/bonita-connector-webservice
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2020-36640
|
MEDIUM
| 4.9
|
bonitasoft/bonita-connector-webservice
|
sanitizeString
|
src/main/java/org/bonitasoft/connectors/ws/SecureWSConnector.java
|
a12ad691c05af19e9061d7949b6b828ce48815d5
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.