instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
public OnGoingLogicalCondition startsWith(String toMatch) {
return getOnGoingLogicalCondition(createLike(LikeCondition.Type.STARTSWITH, toMatch));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startsWith
File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
Repository: xjodoin/torpedoquery
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2019-11343
|
HIGH
| 7.5
|
xjodoin/torpedoquery
|
startsWith
|
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
|
3c20b874fba9cc2a78b9ace10208de1602b56c3f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void unlockKeystore(String password, int userHandle) {
final UserManager um = (UserManager) mContext.getSystemService(USER_SERVICE);
final KeyStore ks = KeyStore.getInstance();
final List<UserInfo> profiles = um.getProfiles(userHandle);
for (UserInfo pi : profiles) {
ks.unlock(pi.id, password);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unlockKeystore
File: services/core/java/com/android/server/LockSettingsService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-255"
] |
CVE-2016-3749
|
MEDIUM
| 4.6
|
android
|
unlockKeystore
|
services/core/java/com/android/server/LockSettingsService.java
|
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean removeTaskByIdLocked(int taskId, boolean killProcess) {
TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId, false);
if (tr != null) {
tr.removeTaskActivitiesLocked();
cleanUpRemovedTaskLocked(tr, killProcess);
if (tr.isPersistable) {
notifyTaskPersisterLocked(null, true);
}
return true;
}
Slog.w(TAG, "Request to remove task ignored for non-existent task " + taskId);
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeTaskByIdLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
removeTaskByIdLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void pullExternalCall(String callId, Session.Info info) throws RemoteException { }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pullExternalCall
File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
pullExternalCall
|
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateConsumers(final String eventId, final NodeId nodeId) {
dbCollection.updateById(eventId, DBUpdate.addToSet("consumers", nodeId.getNodeId()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateConsumers
File: graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2024-24824
|
HIGH
| 8.8
|
Graylog2/graylog2-server
|
updateConsumers
|
graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java
|
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isTargetOp(int code) {
// null permissions means all ops are targeted
if (mPermissions == null) {
return true;
}
// no permission for the op means the op is targeted
final String permission = AppOpsManager.opToPermission(code);
if (permission == null) {
return true;
}
return isTargetPermission(permission);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isTargetOp
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
|
isTargetOp
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isFilsSha256Supported() {
return (getSupportedFeatures() & WIFI_FEATURE_FILS_SHA256) != 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFilsSha256Supported
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
isFilsSha256Supported
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public static FactoryResetProtectionWarningDialog newInstance(
int titleRes, int messageRes, String unlockMethodToSet) {
FactoryResetProtectionWarningDialog frag =
new FactoryResetProtectionWarningDialog();
Bundle args = new Bundle();
args.putInt(ARG_TITLE_RES, titleRes);
args.putInt(ARG_MESSAGE_RES, messageRes);
args.putString(ARG_UNLOCK_METHOD_TO_SET, unlockMethodToSet);
frag.setArguments(args);
return frag;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newInstance
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
|
newInstance
|
src/com/android/settings/password/ChooseLockGeneric.java
|
5e43341b8c7eddce88f79c9a5068362927c05b54
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isModelWithContextMenu(Object o) {
return o instanceof ModelObjectWithContextMenu;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isModelWithContextMenu
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2014-2061
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
isModelWithContextMenu
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setVariableWithName(EnvironmentVariableContext environmentVariableContext, String value, String propertyName) {
String materialNameForEnvironmentVariable = getMaterialNameForEnvironmentVariable();
if (StringUtils.isNotBlank(materialNameForEnvironmentVariable)) {
environmentVariableContext.setProperty(propertyName + "_" + materialNameForEnvironmentVariable, value, false);
} else {
environmentVariableContext.setProperty(propertyName, value, false);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setVariableWithName
File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
setVariableWithName
|
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isHomeSid(int sid) {
if (mHomeSystemId != null) {
for (int i=0; i < mHomeSystemId.length; i++) {
if (sid == mHomeSystemId[i]) {
return true;
}
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isHomeSid
File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
isHomeSid
|
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
public ROWTYPE appendRow() {
return addRowAt(rows.size());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendRow
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
|
appendRow
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public EvaluatedDlsFlsConfig getDlsFls(User user, boolean dfmEmptyOverwritesAll, IndexNameExpressionResolver resolver, ClusterService cs,
NamedXContentRegistry namedXContentRegistry) {
if (!containsDlsFlsConfig()) {
if(log.isDebugEnabled()) {
log.debug("No fls or dls found for {} in {} security roles", user, roles.size());
}
return EvaluatedDlsFlsConfig.EMPTY;
}
Map<String, Set<String>> dlsQueriesByIndex = new HashMap<String, Set<String>>();
Map<String, Set<String>> flsFields = new HashMap<String, Set<String>>();
Map<String, Set<String>> maskedFieldsMap = new HashMap<String, Set<String>>();
// we capture all concrete indices that do not have any
// DLS/FLS/Masked Fields restrictions. If the dfm_empty_overwrites_all
// switch is enabled, this trumps any restrictions on those indices
// that may be imposed by other roles.
Set<String> noDlsConcreteIndices = new HashSet<>();
Set<String> noFlsConcreteIndices = new HashSet<>();
Set<String> noMaskedFieldConcreteIndices = new HashSet<>();
for (SecurityRole role : roles) {
for (IndexPattern ip : role.getIpatterns()) {
final Set<String> concreteIndices = ip.concreteIndexNames(user, resolver, cs);
String dls = ip.getDlsQuery(user);
if (dls != null && dls.length() > 0) {
for (String concreteIndex : concreteIndices) {
dlsQueriesByIndex.computeIfAbsent(concreteIndex, (key) -> new HashSet<String>()).add(dls);
}
} else if (dfmEmptyOverwritesAll) {
noDlsConcreteIndices.addAll(concreteIndices);
}
Set<String> fls = ip.getFls();
if (fls != null && fls.size() > 0) {
for (String concreteIndex : concreteIndices) {
if (flsFields.containsKey(concreteIndex)) {
flsFields.get(concreteIndex).addAll(Sets.newHashSet(fls));
} else {
flsFields.put(concreteIndex, new HashSet<String>());
flsFields.get(concreteIndex).addAll(Sets.newHashSet(fls));
}
}
} else if (dfmEmptyOverwritesAll) {
noFlsConcreteIndices.addAll(concreteIndices);
}
Set<String> maskedFields = ip.getMaskedFields();
if (maskedFields != null && maskedFields.size() > 0) {
for (String concreteIndex : concreteIndices) {
if (maskedFieldsMap.containsKey(concreteIndex)) {
maskedFieldsMap.get(concreteIndex).addAll(Sets.newHashSet(maskedFields));
} else {
maskedFieldsMap.put(concreteIndex, new HashSet<String>());
maskedFieldsMap.get(concreteIndex).addAll(Sets.newHashSet(maskedFields));
}
}
} else if (dfmEmptyOverwritesAll) {
noMaskedFieldConcreteIndices.addAll(concreteIndices);
}
}
}
if (dfmEmptyOverwritesAll) {
if (log.isDebugEnabled()) {
log.debug("Index patterns with no dls queries attached: {} - They will be removed from {}", noDlsConcreteIndices,
dlsQueriesByIndex.keySet());
log.debug("Index patterns with no fls fields attached: {} - They will be removed from {}", noFlsConcreteIndices,
flsFields.keySet());
log.debug("Index patterns with no masked fields attached: {} - They will be removed from {}", noMaskedFieldConcreteIndices,
maskedFieldsMap.keySet());
}
// removing the indices that do not have D/M/F restrictions
// from the keySet will also modify the underlying map
dlsQueriesByIndex.keySet().removeAll(noDlsConcreteIndices);
flsFields.keySet().removeAll(noFlsConcreteIndices);
maskedFieldsMap.keySet().removeAll(noMaskedFieldConcreteIndices);
}
return new EvaluatedDlsFlsConfig(dlsQueriesByIndex, flsFields, maskedFieldsMap);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDlsFls
File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
Repository: opensearch-project/security
The code follows secure coding practices.
|
[
"CWE-612",
"CWE-863"
] |
CVE-2022-41918
|
MEDIUM
| 6.3
|
opensearch-project/security
|
getDlsFls
|
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
|
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
| 0
|
Analyze the following code function for security vulnerabilities
|
public AwSettings createAwSettings(Context context, boolean supportsLegacyQuirks) {
return new AwSettings(context, false /* isAccessFromFileURLsGrantedByDefault */,
supportsLegacyQuirks, false /* allowEmptyDocumentPersistence */,
true /* allowGeolocationOnInsecureOrigins */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createAwSettings
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5155
|
MEDIUM
| 4.3
|
chromium
|
createAwSettings
|
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setLightweightMode(boolean l) {
doSetVisibility(!l);
if (lightweightMode == l) {
return;
}
lightweightMode = l;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLightweightMode
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
|
setLightweightMode
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isChecked() {
return mWifiManager.isScanAlwaysAvailable();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isChecked
File: src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21247
|
HIGH
| 7.8
|
android
|
isChecked
|
src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java
|
edd4023805bc7fa54ae31de222cde02b9012bbc4
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addPackageFile(LocalDocumentReference reference, int action)
{
this.packageFiles.put(reference, new XarEntry(reference, null, action));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addPackageFile
File: xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-27480
|
HIGH
| 7.7
|
xwiki/xwiki-platform
|
addPackageFile
|
xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
|
e3527b98fdd8dc8179c24dc55e662b2c55199434
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setSlow(boolean slow) {
this.slow = slow;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSlow
File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
Repository: apache/activemq
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-3576
|
MEDIUM
| 5
|
apache/activemq
|
setSlow
|
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
|
00921f2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAnonymityEnabled(Boolean anonymityEnabled) {
this.anonymityEnabled = anonymityEnabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAnonymityEnabled
File: src/main/java/com/erudika/scoold/core/Profile.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
setAnonymityEnabled
|
src/main/java/com/erudika/scoold/core/Profile.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public WebContents getWebContents() {
return mWebContents;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWebContents
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
getWebContents
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isUidPrivileged(int uid) {
uid = UserHandle.getAppId(uid);
// reader
synchronized (mPackages) {
Object obj = mSettings.getUserIdLPr(uid);
if (obj instanceof SharedUserSetting) {
final SharedUserSetting sus = (SharedUserSetting) obj;
final Iterator<PackageSetting> it = sus.packages.iterator();
while (it.hasNext()) {
if (it.next().isPrivileged()) {
return true;
}
}
} else if (obj instanceof PackageSetting) {
final PackageSetting ps = (PackageSetting) obj;
return ps.isPrivileged();
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isUidPrivileged
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
isUidPrivileged
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
void postDialContinue(Call call, boolean proceed) {
if (!mCalls.contains(call)) {
Log.i(this, "Request to continue post-dial string in a non-existent call %s", call);
} else {
call.postDialContinue(proceed);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: postDialContinue
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2423
|
MEDIUM
| 6.6
|
android
|
postDialContinue
|
src/com/android/server/telecom/CallsManager.java
|
a06c9a4aef69ae27b951523cf72bf72412bf48fa
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("this")
private void update(int len) throws IOException {
if (memory != null && (memory.getCount() + len > fileThreshold)) {
File temp = File.createTempFile("FileBackedOutputStream", null, parentDirectory);
if (resetOnFinalize) {
// Finalizers are not guaranteed to be called on system shutdown;
// this is insurance.
temp.deleteOnExit();
}
try {
FileOutputStream transfer = new FileOutputStream(temp);
transfer.write(memory.getBuffer(), 0, memory.getCount());
transfer.flush();
// We've successfully transferred the data; switch to writing to file
out = transfer;
} catch (IOException e) {
temp.delete();
throw e;
}
file = temp;
memory = null;
}
}
|
Vulnerability Classification:
- CWE: CWE-552
- CVE: CVE-2023-2976
- Severity: HIGH
- CVSS Score: 7.1
Description: Restrict permissions when creating temporary files and directories, or fail if that's not possible.
(Also, check that the provided `fileThreshold` is non-negative.)
- Fixes https://github.com/google/guava/issues/2575
- Fixes https://github.com/google/guava/issues/4011
RELNOTES=Reimplemented `Files.createTempDir` and `FileBackedOutputStream` to further address [CVE-2020-8908](https://github.com/google/guava/issues/4011) and [Guava issue #2575](https://github.com/google/guava/issues/2575) (CVE forthcoming).
PiperOrigin-RevId: 535359233
Function: update
File: guava/src/com/google/common/io/FileBackedOutputStream.java
Repository: google/guava
Fixed Code:
@GuardedBy("this")
private void update(int len) throws IOException {
if (memory != null && (memory.getCount() + len > fileThreshold)) {
File temp = TempFileCreator.INSTANCE.createTempFile("FileBackedOutputStream");
if (resetOnFinalize) {
// Finalizers are not guaranteed to be called on system shutdown;
// this is insurance.
temp.deleteOnExit();
}
try {
FileOutputStream transfer = new FileOutputStream(temp);
transfer.write(memory.getBuffer(), 0, memory.getCount());
transfer.flush();
// We've successfully transferred the data; switch to writing to file
out = transfer;
} catch (IOException e) {
temp.delete();
throw e;
}
file = temp;
memory = null;
}
}
|
[
"CWE-552"
] |
CVE-2023-2976
|
HIGH
| 7.1
|
google/guava
|
update
|
guava/src/com/google/common/io/FileBackedOutputStream.java
|
feb83a1c8fd2e7670b244d5afd23cba5aca43284
| 1
|
Analyze the following code function for security vulnerabilities
|
public static byte[] deflate(String inString) throws IOException
{
Deflater deflater = new Deflater(Deflater.DEFAULT_COMPRESSION, true);
byte[] inBytes = inString.getBytes("UTF-8");
deflater.setInput(inBytes);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(
inBytes.length);
deflater.finish();
byte[] buffer = new byte[IO_BUFFER_SIZE];
while (!deflater.finished())
{
int count = deflater.deflate(buffer); // returns the generated code... index
outputStream.write(buffer, 0, count);
}
outputStream.close();
byte[] output = outputStream.toByteArray();
return output;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deflate
File: src/main/java/com/mxgraph/online/Utils.java
Repository: jgraph/drawio
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-3398
|
HIGH
| 7.5
|
jgraph/drawio
|
deflate
|
src/main/java/com/mxgraph/online/Utils.java
|
064729fec4262f9373d9fdcafda0be47cd18dd50
| 0
|
Analyze the following code function for security vulnerabilities
|
public void stopListening() {
try {
sService.stopListening(mContextOpPackageName, mHostId);
}
catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
}
// This is here because keyguard needs it since it'll be switching users after this call.
// If it turns out other apps need to call this often, we should re-think how this works.
clearViews();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopListening
File: core/java/android/appwidget/AppWidgetHost.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
stopListening
|
core/java/android/appwidget/AppWidgetHost.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getUserAvatar(User user, String avatarSize) {
return getAvatar(user,avatarSize);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserAvatar
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2014-2061
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
getUserAvatar
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onOptionsItemSelected
File: src/com/android/phone/settings/VoicemailSettingsActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-862"
] |
CVE-2023-35665
|
HIGH
| 7.8
|
android
|
onOptionsItemSelected
|
src/com/android/phone/settings/VoicemailSettingsActivity.java
|
674039e70e1c5bf29b808899ac80c709acc82290
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_LOCK_TASK, conditional = true)
public @NonNull String[] getLockTaskPackages(@Nullable ComponentName admin) {
throwIfParentInstance("getLockTaskPackages");
if (mService != null) {
try {
return mService.getLockTaskPackages(admin, mContext.getPackageName());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return new String[0];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLockTaskPackages
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getLockTaskPackages
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean shouldFilterInvalidJars() {
if (file instanceof PluginBridge) {
PluginBridge pluginBridge = (PluginBridge) file;
/*Ignore on applet, ie !useJNLPHref*/
return !pluginBridge.useJNLPHref();
}
return false;//Error is default behaviour
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldFilterInvalidJars
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
shouldFilterInvalidJars
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
private final boolean checkHoldingPermissionsInternalLocked(IPackageManager pm, ProviderInfo pi,
GrantUri grantUri, int uid, final int modeFlags, boolean considerUidPermissions) {
if (pi.applicationInfo.uid == uid) {
return true;
} else if (!pi.exported) {
return false;
}
boolean readMet = (modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) == 0;
boolean writeMet = (modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == 0;
try {
// check if target holds top-level <provider> permissions
if (!readMet && pi.readPermission != null && considerUidPermissions
&& (pm.checkUidPermission(pi.readPermission, uid) == PERMISSION_GRANTED)) {
readMet = true;
}
if (!writeMet && pi.writePermission != null && considerUidPermissions
&& (pm.checkUidPermission(pi.writePermission, uid) == PERMISSION_GRANTED)) {
writeMet = true;
}
// track if unprotected read/write is allowed; any denied
// <path-permission> below removes this ability
boolean allowDefaultRead = pi.readPermission == null;
boolean allowDefaultWrite = pi.writePermission == null;
// check if target holds any <path-permission> that match uri
final PathPermission[] pps = pi.pathPermissions;
if (pps != null) {
final String path = grantUri.uri.getPath();
int i = pps.length;
while (i > 0 && (!readMet || !writeMet)) {
i--;
PathPermission pp = pps[i];
if (pp.match(path)) {
if (!readMet) {
final String pprperm = pp.getReadPermission();
if (DEBUG_URI_PERMISSION) Slog.v(TAG, "Checking read perm for "
+ pprperm + " for " + pp.getPath()
+ ": match=" + pp.match(path)
+ " check=" + pm.checkUidPermission(pprperm, uid));
if (pprperm != null) {
if (considerUidPermissions && pm.checkUidPermission(pprperm, uid)
== PERMISSION_GRANTED) {
readMet = true;
} else {
allowDefaultRead = false;
}
}
}
if (!writeMet) {
final String ppwperm = pp.getWritePermission();
if (DEBUG_URI_PERMISSION) Slog.v(TAG, "Checking write perm "
+ ppwperm + " for " + pp.getPath()
+ ": match=" + pp.match(path)
+ " check=" + pm.checkUidPermission(ppwperm, uid));
if (ppwperm != null) {
if (considerUidPermissions && pm.checkUidPermission(ppwperm, uid)
== PERMISSION_GRANTED) {
writeMet = true;
} else {
allowDefaultWrite = false;
}
}
}
}
}
}
// grant unprotected <provider> read/write, if not blocked by
// <path-permission> above
if (allowDefaultRead) readMet = true;
if (allowDefaultWrite) writeMet = true;
} catch (RemoteException e) {
return false;
}
return readMet && writeMet;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkHoldingPermissionsInternalLocked
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
|
checkHoldingPermissionsInternalLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Authenticated authenticate(UsernamePasswordToken token) {
String fullName = null;
String email = null;
Collection<String> groupNames = null;
Collection<String> sshKeys = null;
Name userSearchBase;
try {
userSearchBase = new CompositeName().add(getUserSearchBase());
} catch (InvalidNameException e) {
throw new RuntimeException(e);
}
String userSearchFilter = StringUtils.replace(getUserSearchFilter(), "{0}", token.getUsername());
userSearchFilter = StringUtils.replace(userSearchFilter, "\\", "\\\\");
logger.debug("Evaluated user search filter: " + userSearchFilter);
SearchControls searchControls = new SearchControls();
searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
List<String> attributeNames = new ArrayList<String>();
if (getUserFullNameAttribute() != null)
attributeNames.add(getUserFullNameAttribute());
if (getUserSshKeyAttribute() != null)
attributeNames.add(getUserSshKeyAttribute());
attributeNames.add(getUserEmailAttribute());
if (getGroupRetrieval() instanceof GetGroupsUsingAttribute) {
GetGroupsUsingAttribute groupRetrieval = (GetGroupsUsingAttribute)getGroupRetrieval();
attributeNames.add(groupRetrieval.getUserGroupsAttribute());
}
searchControls.setReturningAttributes((String[]) attributeNames.toArray(new String[0]));
searchControls.setReturningObjFlag(true);
Hashtable<String, String> ldapEnv = new Hashtable<>();
ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
ldapEnv.put(Context.PROVIDER_URL, getLdapUrl());
ldapEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
ldapEnv.put("com.sun.jndi.ldap.connect.timeout", String.valueOf(getTimeout()*1000L));
ldapEnv.put("com.sun.jndi.ldap.read.timeout", String.valueOf(getTimeout()*1000L));
ldapEnv.put(Context.REFERRAL, "follow");
ldapEnv.put(Context.SECURITY_PRINCIPAL, getManagerDN());
ldapEnv.put(Context.SECURITY_CREDENTIALS, getManagerPassword());
DirContext ctx = null;
DirContext referralCtx = null;
try {
logger.debug("Binding to ldap url '" + getLdapUrl() + "'...");
try {
ctx = new InitialDirContext(ldapEnv);
} catch (AuthenticationException e) {
throw new RuntimeException("Can not bind to ldap server '" + getLdapUrl() + "': " + e.getMessage());
}
NamingEnumeration<SearchResult> results = ctx.search(userSearchBase, userSearchFilter, searchControls);
if (results == null || !results.hasMore())
throw new UnknownAccountException("Unknown account");
SearchResult searchResult = (SearchResult) results.next();
String userDN = searchResult.getNameInNamespace();
if (!searchResult.isRelative()) {
StringBuffer buffer = new StringBuffer();
buffer.append(StringUtils.substringBefore(searchResult.getName(), "//"));
buffer.append("//");
buffer.append(StringUtils.substringBefore(
StringUtils.substringAfter(searchResult.getName(), "//"), "/"));
ldapEnv.put(Context.PROVIDER_URL, buffer.toString());
logger.debug("Binding to referral ldap url '" + buffer.toString() + "'...");
referralCtx = new InitialDirContext(ldapEnv);
}
if (userDN.startsWith("ldap")) {
userDN = StringUtils.substringAfter(userDN, "//");
userDN = StringUtils.substringAfter(userDN, "/");
}
ldapEnv.put(Context.SECURITY_PRINCIPAL, userDN);
ldapEnv.put(Context.SECURITY_CREDENTIALS, new String(token.getPassword()));
DirContext userCtx = null;
try {
logger.debug("Authenticating user by binding as '" + userDN + "'...");
userCtx = new InitialDirContext(ldapEnv);
} catch (AuthenticationException e) {
throw new org.apache.shiro.authc.AuthenticationException("Unable to bind as '" + userDN + "'", e);
} finally {
if (userCtx != null) {
try {
userCtx.close();
} catch (NamingException e) {
}
}
}
Attributes searchResultAttributes = searchResult.getAttributes();
if (searchResultAttributes != null) {
if (getUserFullNameAttribute() != null) {
Attribute attribute = searchResultAttributes.get(getUserFullNameAttribute());
if (attribute != null && attribute.get() != null)
fullName = (String) attribute.get();
}
Attribute attribute = searchResultAttributes.get(getUserEmailAttribute());
if (attribute != null && attribute.get() != null)
email = (String) attribute.get();
if (getGroupRetrieval() instanceof GetGroupsUsingAttribute)
groupNames = retrieveGroupsByAttribute(ctx, referralCtx, searchResultAttributes);
if (getUserSshKeyAttribute() != null)
sshKeys = retrieveSshKeys(searchResultAttributes);
}
if (getGroupRetrieval() instanceof SearchGroupsUsingFilter)
groupNames = retrieveGroupsByFilter(ctx, referralCtx, userDN);
if (StringUtils.isBlank(email))
throw new AccountException("Email is required but not available in ldap directory");
else
return new Authenticated(email, fullName, groupNames, sshKeys);
} catch (NamingException e) {
throw new RuntimeException(e);
} finally {
if (ctx != null) {
try {
ctx.close();
} catch (NamingException e) {
}
}
if (referralCtx != null) {
try {
referralCtx.close();
} catch (NamingException e) {
}
}
}
}
|
Vulnerability Classification:
- CWE: CWE-90
- CVE: CVE-2021-32651
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Fix issue #304 - Potential information leak via Ldap injection when ldap
authenticator is enabled
Function: authenticate
File: server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
Repository: theonedev/onedev
Fixed Code:
@Override
public Authenticated authenticate(UsernamePasswordToken token) {
String fullName = null;
String email = null;
Collection<String> groupNames = null;
Collection<String> sshKeys = null;
Name userSearchBase;
try {
userSearchBase = new CompositeName().add(getUserSearchBase());
} catch (InvalidNameException e) {
throw new RuntimeException(e);
}
String userSearchFilter = StringUtils.replace(getUserSearchFilter(), "{0}",
escape(token.getUsername()));
userSearchFilter = StringUtils.replace(userSearchFilter, "\\", "\\\\");
logger.debug("Evaluated user search filter: " + userSearchFilter);
SearchControls searchControls = new SearchControls();
searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
List<String> attributeNames = new ArrayList<String>();
if (getUserFullNameAttribute() != null)
attributeNames.add(getUserFullNameAttribute());
if (getUserSshKeyAttribute() != null)
attributeNames.add(getUserSshKeyAttribute());
attributeNames.add(getUserEmailAttribute());
if (getGroupRetrieval() instanceof GetGroupsUsingAttribute) {
GetGroupsUsingAttribute groupRetrieval = (GetGroupsUsingAttribute)getGroupRetrieval();
attributeNames.add(groupRetrieval.getUserGroupsAttribute());
}
searchControls.setReturningAttributes((String[]) attributeNames.toArray(new String[0]));
searchControls.setReturningObjFlag(true);
Hashtable<String, String> ldapEnv = new Hashtable<>();
ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
ldapEnv.put(Context.PROVIDER_URL, getLdapUrl());
ldapEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
ldapEnv.put("com.sun.jndi.ldap.connect.timeout", String.valueOf(getTimeout()*1000L));
ldapEnv.put("com.sun.jndi.ldap.read.timeout", String.valueOf(getTimeout()*1000L));
ldapEnv.put(Context.REFERRAL, "follow");
ldapEnv.put(Context.SECURITY_PRINCIPAL, getManagerDN());
ldapEnv.put(Context.SECURITY_CREDENTIALS, getManagerPassword());
DirContext ctx = null;
DirContext referralCtx = null;
try {
logger.debug("Binding to ldap url '" + getLdapUrl() + "'...");
try {
ctx = new InitialDirContext(ldapEnv);
} catch (AuthenticationException e) {
throw new RuntimeException("Can not bind to ldap server '" + getLdapUrl() + "': " + e.getMessage());
}
NamingEnumeration<SearchResult> results = ctx.search(userSearchBase, userSearchFilter, searchControls);
if (results == null || !results.hasMore())
throw new UnknownAccountException("Unknown account");
SearchResult searchResult = (SearchResult) results.next();
String userDN = searchResult.getNameInNamespace();
if (!searchResult.isRelative()) {
StringBuffer buffer = new StringBuffer();
buffer.append(StringUtils.substringBefore(searchResult.getName(), "//"));
buffer.append("//");
buffer.append(StringUtils.substringBefore(
StringUtils.substringAfter(searchResult.getName(), "//"), "/"));
ldapEnv.put(Context.PROVIDER_URL, buffer.toString());
logger.debug("Binding to referral ldap url '" + buffer.toString() + "'...");
referralCtx = new InitialDirContext(ldapEnv);
}
if (userDN.startsWith("ldap")) {
userDN = StringUtils.substringAfter(userDN, "//");
userDN = StringUtils.substringAfter(userDN, "/");
}
ldapEnv.put(Context.SECURITY_PRINCIPAL, userDN);
ldapEnv.put(Context.SECURITY_CREDENTIALS, new String(token.getPassword()));
DirContext userCtx = null;
try {
logger.debug("Authenticating user by binding as '" + userDN + "'...");
userCtx = new InitialDirContext(ldapEnv);
} catch (AuthenticationException e) {
throw new org.apache.shiro.authc.AuthenticationException("Unable to bind as '" + userDN + "'", e);
} finally {
if (userCtx != null) {
try {
userCtx.close();
} catch (NamingException e) {
}
}
}
Attributes searchResultAttributes = searchResult.getAttributes();
if (searchResultAttributes != null) {
if (getUserFullNameAttribute() != null) {
Attribute attribute = searchResultAttributes.get(getUserFullNameAttribute());
if (attribute != null && attribute.get() != null)
fullName = (String) attribute.get();
}
Attribute attribute = searchResultAttributes.get(getUserEmailAttribute());
if (attribute != null && attribute.get() != null)
email = (String) attribute.get();
if (getGroupRetrieval() instanceof GetGroupsUsingAttribute)
groupNames = retrieveGroupsByAttribute(ctx, referralCtx, searchResultAttributes);
if (getUserSshKeyAttribute() != null)
sshKeys = retrieveSshKeys(searchResultAttributes);
}
if (getGroupRetrieval() instanceof SearchGroupsUsingFilter)
groupNames = retrieveGroupsByFilter(ctx, referralCtx, userDN);
if (StringUtils.isBlank(email))
throw new AccountException("Email is required but not available in ldap directory");
else
return new Authenticated(email, fullName, groupNames, sshKeys);
} catch (NamingException e) {
throw new RuntimeException(e);
} finally {
if (ctx != null) {
try {
ctx.close();
} catch (NamingException e) {
}
}
if (referralCtx != null) {
try {
referralCtx.close();
} catch (NamingException e) {
}
}
}
}
|
[
"CWE-90"
] |
CVE-2021-32651
|
MEDIUM
| 4.3
|
theonedev/onedev
|
authenticate
|
server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
|
4440f0c57e440488d7e653417b2547eaae8ad19c
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isTouchDevice() {
return getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isTouchDevice
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
|
isTouchDevice
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean hasMethodReadObject() {
return (methodReadObject != null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasMethodReadObject
File: luni/src/main/java/java/io/ObjectStreamClass.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
hasMethodReadObject
|
luni/src/main/java/java/io/ObjectStreamClass.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onSelect(AjaxRequestTarget target, BlobIdent blobIdent, @Nullable String position) {
String prevPosition = state.position;
state.position = position;
if (!blobIdent.revision.equals(state.blobIdent.revision)) {
state.blobIdent = blobIdent;
state.mode = Mode.VIEW;
state.commentId = null;
state.requestId = null;
newSearchResult(target, null);
onResolvedRevisionChange(target);
resizeWindow(target);
} else if (!Objects.equal(state.blobIdent.path, blobIdent.path)) {
state.blobIdent.path = blobIdent.path;
state.blobIdent.mode = blobIdent.mode;
state.mode = Mode.VIEW;
state.commentId = null;
newBlobNavigator(target);
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
resizeWindow(target);
OneDev.getInstance(WebSocketManager.class).observe(this);
} else if (state.position != null) {
if (get(BLOB_CONTENT_ID) instanceof Positionable) {
// This logic is added for performance reason, we do not want to
// reload the file if go to different mark positions in same file
((Positionable)get(BLOB_CONTENT_ID)).position(target, state.position);
} else {
state.mode = Mode.VIEW;
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
resizeWindow(target);
}
} else if (prevPosition != null) {
state.mode = Mode.VIEW;
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
resizeWindow(target);
}
pushState(target);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSelect
File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2021-21245
|
HIGH
| 7.5
|
theonedev/onedev
|
onSelect
|
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
|
0c060153fb97c0288a1917efdb17cc426934dacb
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean freezeRecentTasksReordering() {
return mFreezeRecentTasksReordering;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: freezeRecentTasksReordering
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
freezeRecentTasksReordering
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
public Identity getIdentity() {
return identity;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIdentity
File: src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41152
|
MEDIUM
| 4
|
OpenOLAT
|
getIdentity
|
src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
|
418bb509ffcb0e25ab4390563c6c47f0458583eb
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean recursiveDelete(File file) {
// Try deleting file before assuming file is a directory
// to prevent following symbolic links.
if (file.delete()) {
return true;
}
File[] files = file.listFiles();
if (files != null) {
for (File each : files) {
if (!recursiveDelete(each)) {
return false;
}
}
}
return file.delete();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: recursiveDelete
File: src/main/java/org/junit/rules/TemporaryFolder.java
Repository: junit-team/junit4
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2020-15250
|
LOW
| 1.9
|
junit-team/junit4
|
recursiveDelete
|
src/main/java/org/junit/rules/TemporaryFolder.java
|
610155b8c22138329f0723eec22521627dbc52ae
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTitle()
{
return this.doc.getTitle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTitle
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
getTitle
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void deleteFileIfEmpty(final String path) {
final File file = new File(path);
if (file.length() <= 0) {
file.delete();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteFileIfEmpty
File: src/tsd/GraphHandler.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2023-25826
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
deleteFileIfEmpty
|
src/tsd/GraphHandler.java
|
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
| 0
|
Analyze the following code function for security vulnerabilities
|
@JsonProperty(FIELD_LOOKUP_TYPE)
public abstract Builder lookupType(DnsLookupType lookupType);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: lookupType
File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2023-41045
|
MEDIUM
| 5.3
|
Graylog2/graylog2-server
|
lookupType
|
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
|
466af814523cffae9fbc7e77bab7472988f03c3e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void validate(Context context) {
super.validate(context);
if (context.getApplicationInfo().targetSdkVersion
>= Build.VERSION_CODES.P && (mUser == null || mUser.getName() == null)) {
throw new RuntimeException("User must be valid and have a name.");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validate
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
validate
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean removeKeyPair(ComponentName who, String callerPackage, String alias) {
final CallerIdentity caller = getCallerIdentity(who, callerPackage);
final boolean isCallerDelegate = isCallerDelegate(caller, DELEGATION_CERT_INSTALL);
final boolean isCredentialManagementApp = isCredentialManagementApp(caller);
if (isPermissionCheckFlagEnabled()) {
Preconditions.checkCallAuthorization(
hasPermission(MANAGE_DEVICE_POLICY_CERTIFICATES,
caller.getPackageName(), caller.getUserId())
|| isCredentialManagementApp);
} else {
Preconditions.checkCallAuthorization((caller.hasAdminComponent()
&& (isProfileOwner(caller) || isDefaultDeviceOwner(caller)))
|| (caller.hasPackage() && (isCallerDelegate || isCredentialManagementApp)));
}
if (isCredentialManagementApp) {
Preconditions.checkCallAuthorization(
isAliasInCredentialManagementAppPolicy(caller, alias),
CREDENTIAL_MANAGEMENT_APP_INVALID_ALIAS_MSG);
}
checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_REMOVE_KEY_PAIR);
final long id = Binder.clearCallingIdentity();
try {
final KeyChainConnection keyChainConnection =
KeyChain.bindAsUser(mContext, caller.getUserHandle());
try {
IKeyChainService keyChain = keyChainConnection.getService();
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.REMOVE_KEY_PAIR)
.setAdmin(caller.getPackageName())
.setBoolean(/* isDelegate */ isCallerDelegate)
.setStrings(isCredentialManagementApp
? CREDENTIAL_MANAGEMENT_APP : NOT_CREDENTIAL_MANAGEMENT_APP)
.write();
return keyChain.removeKeyPair(alias);
} catch (RemoteException e) {
Slogf.e(LOG_TAG, "Removing keypair", e);
} finally {
keyChainConnection.close();
}
} catch (InterruptedException e) {
Slogf.w(LOG_TAG, "Interrupted while removing keypair", e);
Thread.currentThread().interrupt();
} finally {
Binder.restoreCallingIdentity(id);
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeKeyPair
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
|
removeKeyPair
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getAttributeResourceValue(int idx, int defaultValue) {
final int t = nativeGetAttributeDataType(mParseState, idx);
if (t == ERROR_NULL_DOCUMENT) {
throw new NullPointerException("Null document");
}
// Note: don't attempt to convert any other types, because
// we want to count on aapt doing the conversion for us.
if (t == TypedValue.TYPE_REFERENCE) {
final int v = nativeGetAttributeData(mParseState, idx);
if (v == ERROR_NULL_DOCUMENT) {
throw new NullPointerException("Null document");
}
return v;
}
return defaultValue;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttributeResourceValue
File: core/java/android/content/res/XmlBlock.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
getAttributeResourceValue
|
core/java/android/content/res/XmlBlock.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isNotJsonWebToken(String jwt) {
if (jwt == null || "".equals(jwt)) {
return true;
}
// base64url_encode(Header) + '.' + base64url_encode(Claims) + '.' + base64url_encode(Signature)
String[] jwtArr = jwt.split("\\.");
if (jwtArr.length != COUNT_3) {
return true;
}
for (String jwtTmp : jwtArr) {
if (!BASE64_PATTERN.matcher(jwtTmp).matches()) {
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNotJsonWebToken
File: core/src/main/java/com/usthe/sureness/util/JsonWebTokenUtil.java
Repository: dromara/sureness
The code follows secure coding practices.
|
[
"CWE-798"
] |
CVE-2023-31581
|
CRITICAL
| 9.8
|
dromara/sureness
|
isNotJsonWebToken
|
core/src/main/java/com/usthe/sureness/util/JsonWebTokenUtil.java
|
4f5fefaf673168d74820020a191fab2904629742
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isDisconnected() {
return getCurrentState() == mDisconnectedState;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDisconnected
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
isDisconnected
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unused")
@CalledByNative
private void onSingleTapEventAck(boolean consumed, int x, int y) {
for (mGestureStateListenersIterator.rewind();
mGestureStateListenersIterator.hasNext();) {
mGestureStateListenersIterator.next().onSingleTap(consumed, x, y);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSingleTapEventAck
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
onSingleTapEventAck
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@Transactional( readOnly = true )
public List<Program> getUserPrograms()
{
return getUserPrograms( currentUserService.getCurrentUser() );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserPrograms
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
Repository: dhis2/dhis2-core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24848
|
MEDIUM
| 6.5
|
dhis2/dhis2-core
|
getUserPrograms
|
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
|
ef04483a9b177d62e48dcf4e498b302a11f95e7d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRecordings2x(List<String> idList, List<String> states, Map<String, String> metadataFilters) {
List<RecordingMetadata> recsList = getRecordingsMetadata(idList, states);
ArrayList<RecordingMetadata> recs = filterRecordingsByMetadata(recsList, metadataFilters);
return recordingServiceHelper.getRecordings2x(recs);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRecordings2x
File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
Repository: bigbluebutton
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-12443
|
HIGH
| 7.5
|
bigbluebutton
|
getRecordings2x
|
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
|
b21ca8355a57286a1e6df96984b3a4c57679a463
| 0
|
Analyze the following code function for security vulnerabilities
|
void logStartActivity(int tag, Task task) {
final Uri data = intent.getData();
final String strData = data != null ? data.toSafeString() : null;
EventLog.writeEvent(tag,
mUserId, System.identityHashCode(this), task.mTaskId,
shortComponentName, intent.getAction(),
intent.getType(), strData, intent.getFlags());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logStartActivity
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
|
logStartActivity
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private void reset() {
owner = NullOwner.get();
id = -1;
wasAttached = false;
hasBeenAttached = false;
hasBeenDetached = false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reset
File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
reset
|
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getUploadStartMessage() {
return FileUploader.class.getName() + UPLOAD_START_MESSAGE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUploadStartMessage
File: src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2022-24886
|
LOW
| 2.1
|
nextcloud/android
|
getUploadStartMessage
|
src/main/java/com/owncloud/android/files/services/FileUploader.java
|
c01fa0b17050cdcf77a468cc22f4071eae29d464
| 0
|
Analyze the following code function for security vulnerabilities
|
public Class<P> getPrimitiveClass() {
return primitiveClass;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPrimitiveClass
File: java_src/src/main/java/com/google/crypto/tink/PrimitiveSet.java
Repository: tink-crypto/tink
The code follows secure coding practices.
|
[
"CWE-176"
] |
CVE-2020-8929
|
MEDIUM
| 5
|
tink-crypto/tink
|
getPrimitiveClass
|
java_src/src/main/java/com/google/crypto/tink/PrimitiveSet.java
|
93d839a5865b9d950dffdc9d0bc99b71280a8899
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean zoomIn() {
if (!canZoomIn()) {
return false;
}
return pinchByDelta(1.25f);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: zoomIn
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
zoomIn
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
protected ContextualAuthorizationManager getContextualAuthorizationManager()
{
return this.autorization;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContextualAuthorizationManager
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-29208
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getContextualAuthorizationManager
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
|
d9e947559077e947315bf700c5703dfc7dd8a8d7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getOrExprConditionSQL(Condition[] conditions) {
return _getLogicalExprConditionSQL(conditions, "OR");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOrExprConditionSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4999
|
HIGH
| 7.5
|
dashbuilder
|
getOrExprConditionSQL
|
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
|
8574899e3b6455547b534f570b2330ff772e524b
| 0
|
Analyze the following code function for security vulnerabilities
|
private static List<String> getSchemaFilesFor(final Class<?> clazz) {
final List<String> schemaFiles = new ArrayList<>();
for (final Class<?> c : getAllRelatedClasses(clazz)) {
final ValidateUsing annotation = c.getAnnotation(ValidateUsing.class);
if (annotation == null || annotation.value() == null) {
LOG.debug("@ValidateUsing is missing from class {}", c);
continue;
} else {
schemaFiles.add(annotation.value());
}
}
return schemaFiles;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSchemaFilesFor
File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-0871
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
getSchemaFilesFor
|
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
|
3c17231714e3d55809efc580a05734ed530f9ad4
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<String> getFileNameList() {
ArrayList<String> fileNameList = new ArrayList<>(workUnitList.size());
for (WorkUnit workUnit : workUnitList) {
fileNameList.add(workUnit.getFileName());
}
return fileNameList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFileNameList
File: src/main/java/emissary/pickup/WorkBundle.java
Repository: NationalSecurityAgency/emissary
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-32634
|
MEDIUM
| 6.5
|
NationalSecurityAgency/emissary
|
getFileNameList
|
src/main/java/emissary/pickup/WorkBundle.java
|
40260b1ec1f76cc92361702cc14fa1e4388e19d7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public XWikiDocument getParentDoc()
{
return new XWikiDocument(getParentReference());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParentDoc
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
|
getParentDoc
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isForwardCheckingSupported() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isForwardCheckingSupported
File: src/platform/java/org/conscrypt/TrustManagerImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-254",
"CWE-345"
] |
CVE-2016-0818
|
MEDIUM
| 4.3
|
android
|
isForwardCheckingSupported
|
src/platform/java/org/conscrypt/TrustManagerImpl.java
|
c4ab1b959280413fb11bf4fd7f6b4c2ba38bd779
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isDatabaseCustomPathSupported() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDatabaseCustomPathSupported
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
|
isDatabaseCustomPathSupported
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setConversationActivationEnabled(boolean conversationActivationEnabled) {
this.conversationActivationEnabled = conversationActivationEnabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setConversationActivationEnabled
File: impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java
Repository: weld/core
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2014-8122
|
MEDIUM
| 4.3
|
weld/core
|
setConversationActivationEnabled
|
impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java
|
8e413202fa1af08c09c580f444e4fd16874f9c65
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removeToGcByBatch(ApiScenarioBatchRequest request) {
ServiceUtils.getSelectAllIds(request, request.getCondition(),
(query) -> extApiScenarioMapper.selectIdsByQuery(query));
this.removeToGc(request.getIds());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeToGcByBatch
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
removeToGcByBatch
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
private void disableFields(String[] apnFields) {
for (String apnField : apnFields) {
final Preference preference = getPreferenceFromFieldName(apnField);
if (preference != null) {
preference.setEnabled(false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disableFields
File: src/com/android/settings/network/apn/ApnEditor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40125
|
HIGH
| 7.8
|
android
|
disableFields
|
src/com/android/settings/network/apn/ApnEditor.java
|
63d464c3fa5c7b9900448fef3844790756e557eb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isPluginApplet() {
return classLoader.file instanceof PluginBridge;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPluginApplet
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
isPluginApplet
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected synchronized void loginInternal(String username, String password, Resourcepart resource) throws XMPPException,
SmackException, IOException, InterruptedException {
// Authenticate using SASL
saslAuthentication.authenticate(username, password, config.getAuthzid());
// If compression is enabled then request the server to use stream compression. XEP-170
// recommends to perform stream compression before resource binding.
maybeEnableCompression();
if (isSmResumptionPossible()) {
smResumedSyncPoint.sendAndWaitForResponse(new Resume(clientHandledStanzasCount, smSessionId));
if (smResumedSyncPoint.wasSuccessful()) {
// We successfully resumed the stream, be done here
afterSuccessfulLogin(true);
return;
}
// SM resumption failed, what Smack does here is to report success of
// lastFeaturesReceived in case of sm resumption was answered with 'failed' so that
// normal resource binding can be tried.
LOGGER.fine("Stream resumption failed, continuing with normal stream establishment process");
}
List<Stanza> previouslyUnackedStanzas = new LinkedList<Stanza>();
if (unacknowledgedStanzas != null) {
// There was a previous connection with SM enabled but that was either not resumable or
// failed to resume. Make sure that we (re-)send the unacknowledged stanzas.
unacknowledgedStanzas.drainTo(previouslyUnackedStanzas);
// Reset unacknowledged stanzas to 'null' to signal that we never send 'enable' in this
// XMPP session (There maybe was an enabled in a previous XMPP session of this
// connection instance though). This is used in writePackets to decide if stanzas should
// be added to the unacknowledged stanzas queue, because they have to be added right
// after the 'enable' stream element has been sent.
dropSmState();
}
// Now bind the resource. It is important to do this *after* we dropped an eventually
// existing Stream Management state. As otherwise <bind/> and <session/> may end up in
// unacknowledgedStanzas and become duplicated on reconnect. See SMACK-706.
bindResourceAndEstablishSession(resource);
if (isSmAvailable() && useSm) {
// Remove what is maybe left from previously stream managed sessions
serverHandledStanzasCount = 0;
// XEP-198 3. Enabling Stream Management. If the server response to 'Enable' is 'Failed'
// then this is a non recoverable error and we therefore throw an exception.
smEnabledSyncPoint.sendAndWaitForResponseOrThrow(new Enable(useSmResumption, smClientMaxResumptionTime));
synchronized (requestAckPredicates) {
if (requestAckPredicates.isEmpty()) {
// Assure that we have at lest one predicate set up that so that we request acks
// for the server and eventually flush some stanzas from the unacknowledged
// stanza queue
requestAckPredicates.add(Predicate.forMessagesOrAfter5Stanzas());
}
}
}
// (Re-)send the stanzas *after* we tried to enable SM
for (Stanza stanza : previouslyUnackedStanzas) {
sendStanzaInternal(stanza);
}
afterSuccessfulLogin(false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loginInternal
File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
loginInternal
|
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getRowCount() {
return rows.size();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRowCount
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
|
getRowCount
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
int doPreInstall(int status) {
if (status != PackageManager.INSTALL_SUCCEEDED) {
cleanUp(move.toUuid);
}
return status;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doPreInstall
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
doPreInstall
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getPassword() {
return getFieldValue(PASSWORD_KEY, "");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPassword
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3897
|
MEDIUM
| 4.3
|
android
|
getPassword
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
public void attachApplication(IApplicationThread app) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attachApplication
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
attachApplication
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public void reconnect(WorkSource workSource) {
sendMessage(CMD_RECONNECT, workSource);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reconnect
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
reconnect
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setReadTimeout(int readTimeout) {
this.readTimeout = readTimeout;
httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setReadTimeout
File: samples/openapi3/client/petstore/java/jersey2-java8/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
|
setReadTimeout
|
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private static DashboardCategory getCategory(List<DashboardCategory> target,
String categoryKey) {
for (DashboardCategory category : target) {
if (categoryKey.equals(category.key)) {
return category;
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCategory
File: packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3889
|
HIGH
| 7.2
|
android
|
getCategory
|
packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
|
e206f02d46ae5e38c74d138b51f6e1637e261abe
| 0
|
Analyze the following code function for security vulnerabilities
|
Ringer getRinger() {
return mRinger;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRinger
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2423
|
MEDIUM
| 6.6
|
android
|
getRinger
|
src/com/android/server/telecom/CallsManager.java
|
a06c9a4aef69ae27b951523cf72bf72412bf48fa
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setWifiPasspointEnabled(boolean enabled) {
if (enabled != mEnabled) {
clearAnqpRequestsAndFlushCache();
mEnabled = enabled;
mSettingsStore.handleWifiPasspointEnabled(enabled);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setWifiPasspointEnabled
File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
setWifiPasspointEnabled
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private ParaObject checkApiAuth(HttpServletRequest req) {
if (req.getRequestURI().equals(CONF.serverContextPath() + "/api")) {
return null;
}
String apiKeyJWT = StringUtils.removeStart(req.getHeader(HttpHeaders.AUTHORIZATION), "Bearer ");
if (req.getRequestURI().equals(CONF.serverContextPath() + "/api/ping")) {
return API_USER;
} else if (req.getRequestURI().equals(CONF.serverContextPath() + "/api/stats") && isValidJWToken(apiKeyJWT)) {
return API_USER;
} else if (!isApiEnabled() || StringUtils.isBlank(apiKeyJWT) || !isValidJWToken(apiKeyJWT)) {
throw new UnauthorizedException();
}
return API_USER;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkApiAuth
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
checkApiAuth
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
private void forEachShortcutStopWhen(
@NonNull final Function<ShortcutInfo, Boolean> cb) {
synchronized (mLock) {
for (int i = mShortcuts.size() - 1; i >= 0; i--) {
final ShortcutInfo si = mShortcuts.valueAt(i);
if (cb.apply(si)) {
return;
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: forEachShortcutStopWhen
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
forEachShortcutStopWhen
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
public static WorkBundle buildWorkBundle(String xml) {
Document jdoc;
try {
jdoc = JDOMUtil.createDocument(xml, false);
return buildWorkBundle(jdoc);
} catch (Exception ex) {
logger.error("Cannot make WorkBundle from " + xml, ex);
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildWorkBundle
File: src/main/java/emissary/pickup/WorkBundle.java
Repository: NationalSecurityAgency/emissary
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-32634
|
MEDIUM
| 6.5
|
NationalSecurityAgency/emissary
|
buildWorkBundle
|
src/main/java/emissary/pickup/WorkBundle.java
|
40260b1ec1f76cc92361702cc14fa1e4388e19d7
| 0
|
Analyze the following code function for security vulnerabilities
|
public Realm getRealm() {
return realm;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRealm
File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2013-7397
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
getRealm
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isStandardClass(Class<?> clazz) {
return String.class.equals(clazz) ||
BigInteger.class.isAssignableFrom(clazz) ||
BigDecimal.class.isAssignableFrom(clazz) ||
Calendar.class.isAssignableFrom(clazz) ||
Date.class.isAssignableFrom(clazz) ||
QName.class.isAssignableFrom(clazz) ||
URI.class.equals(clazz) ||
XMLGregorianCalendar.class.isAssignableFrom(clazz) ||
Duration.class.isAssignableFrom(clazz) ||
Image.class.equals(clazz) ||
DataHandler.class.equals(clazz) ||
// Source and subclasses should be supported according to the JAXB2 spec, but aren't in the RI
// Source.class.isAssignableFrom(clazz) ||
UUID.class.equals(clazz);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isStandardClass
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
|
isStandardClass
|
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
|
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void main(String[] args) {
LicenseInfo info = retrieveNamedSlow();
System.err.println("valid=" + info.isValid());
System.err.println("info=" + info.owner);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: main
File: src/net/sourceforge/plantuml/version/LicenseInfo.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
main
|
src/net/sourceforge/plantuml/version/LicenseInfo.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void bootAnimationComplete() {
if (DEBUG_ALL) Slog.d(TAG, "bootAnimationComplete: Callers=" + Debug.getCallers(4));
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-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
bootAnimationComplete
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRenderedContent(String text, Syntax sourceSyntaxId, XWikiDocument sDocument, boolean isolated,
XWikiContext context)
{
return getRenderedContent(text, sourceSyntaxId, getOutputSyntax(), false, sDocument, isolated, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRenderedContent
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
|
getRenderedContent
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public byte[] getSessionId() {
// return a clone to avoid anyone changing the internal value
return NumberUtils.isEmpty(sessionId) ? sessionId : sessionId.clone();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSessionId
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
apache/mina-sshd
|
getSessionId
|
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
|
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void crashApplicationWithTypeWithExtras(int uid, int initialPid, String packageName,
int userId, String message, boolean force, int exceptionTypeId,
@Nullable Bundle extras) {
if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)
!= PackageManager.PERMISSION_GRANTED) {
String msg = "Permission Denial: crashApplication() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ " requires " + android.Manifest.permission.FORCE_STOP_PACKAGES;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
synchronized(this) {
mAppErrors.scheduleAppCrashLocked(uid, initialPid, packageName, userId,
message, force, exceptionTypeId, extras);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: crashApplicationWithTypeWithExtras
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
|
crashApplicationWithTypeWithExtras
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@ProxyFromPrimaryToCurrentUser
public void onPreloadRecents() {
if (mSystemServicesProxy.isForegroundUserOwner()) {
preloadRecents();
} else {
Intent intent = createLocalBroadcastIntent(mContext,
RecentsUserEventProxyReceiver.ACTION_PROXY_PRELOAD_RECENTS_TO_USER);
mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT);
}
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2016-0813
- Severity: MEDIUM
- CVSS Score: 6.6
Description: DO NOT MERGE Ensure that the device is provisioned before showing Recents.
Bug: 25476219
Change-Id: I5bb9cca74790521de71c0037b4f2421c3d21b3f6
Function: onPreloadRecents
File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
Repository: android
Fixed Code:
@ProxyFromPrimaryToCurrentUser
public void onPreloadRecents() {
// Ensure the device has been provisioned before allowing the user to interact with
// recents
if (!isDeviceProvisioned()) {
return;
}
if (mSystemServicesProxy.isForegroundUserOwner()) {
preloadRecents();
} else {
Intent intent = createLocalBroadcastIntent(mContext,
RecentsUserEventProxyReceiver.ACTION_PROXY_PRELOAD_RECENTS_TO_USER);
mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT);
}
}
|
[
"CWE-264"
] |
CVE-2016-0813
|
MEDIUM
| 6.6
|
android
|
onPreloadRecents
|
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
|
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public WaitResult createFromParcel(Parcel source) {
return new WaitResult(source);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createFromParcel
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
createFromParcel
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setTestDefaultDialer(String packageName) {
try {
Log.startSession("TSI.sTDD");
enforceModifyPermission();
if (Binder.getCallingUid() != Process.SHELL_UID
&& Binder.getCallingUid() != Process.ROOT_UID) {
throw new SecurityException("Shell-only API.");
}
synchronized (mLock) {
long token = Binder.clearCallingIdentity();
try {
mCallsManager.getRoleManagerAdapter().setTestDefaultDialer(packageName);
} finally {
Binder.restoreCallingIdentity(token);
}
}
} finally {
Log.endSession();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTestDefaultDialer
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
|
setTestDefaultDialer
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
68dca62035c49e14ad26a54f614199cb29a3393f
| 0
|
Analyze the following code function for security vulnerabilities
|
protected AnnotatedMethod constructFactoryCreator(Method m, Method mixin)
{
final int paramCount = m.getParameterTypes().length;
if (_intr == null) { // when annotation processing is disabled
return new AnnotatedMethod(_typeContext, m, _emptyAnnotationMap(),
_emptyAnnotationMaps(paramCount));
}
if (paramCount == 0) { // common enough we can slightly optimize
return new AnnotatedMethod(_typeContext, m, collectAnnotations(m, mixin),
NO_ANNOTATION_MAPS);
}
return new AnnotatedMethod(_typeContext, m, collectAnnotations(m, mixin),
collectAnnotations(m.getParameterAnnotations(),
(mixin == null) ? null : mixin.getParameterAnnotations()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: constructFactoryCreator
File: src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
constructFactoryCreator
|
src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
public FormValidation doCheckAdminAddress(@QueryParameter String value) {
try {
new InternetAddress(value);
return FormValidation.ok();
} catch (AddressException e) {
return FormValidation.error(e.getMessage());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doCheckAdminAddress
File: core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2014-9634
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
doCheckAdminAddress
|
core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
|
582128b9ac179a788d43c1478be8a5224dc19710
| 0
|
Analyze the following code function for security vulnerabilities
|
public void maybeHandlePendingLock() {
if (mPendingLock) {
// The screen off animation is playing, so if we lock now, the foreground app will
// vanish and the keyguard will jump-cut in. Delay it, until either:
// - The screen off animation ends. We will call maybeHandlePendingLock from
// the end action in UnlockedScreenOffAnimationController#animateInKeyguard.
// - The screen off animation is cancelled by the device waking back up. We will call
// maybeHandlePendingLock from KeyguardViewMediator#onStartedWakingUp.
if (mScreenOffAnimationController.isKeyguardShowDelayed()) {
if (DEBUG) {
Log.d(TAG, "#maybeHandlePendingLock: not handling because the screen off "
+ "animation's isKeyguardShowDelayed() returned true. This should be "
+ "handled soon by #onStartedWakingUp, or by the end actions of the "
+ "screen off animation.");
}
return;
}
// The device was re-locked while in the process of unlocking. If we lock now, callbacks
// in the unlock sequence might end up re-unlocking the device. Delay the lock until the
// keyguard is done going away. We'll call maybeHandlePendingLock again in
// StatusBar#finishKeyguardFadingAway, which is always responsible for setting
// isKeyguardGoingAway to false.
if (mKeyguardStateController.isKeyguardGoingAway()) {
if (DEBUG) {
Log.d(TAG, "#maybeHandlePendingLock: not handling because the keyguard is "
+ "going away. This should be handled shortly by "
+ "StatusBar#finishKeyguardFadingAway.");
}
return;
}
if (DEBUG) {
Log.d(TAG, "#maybeHandlePendingLock: handling pending lock; locking keyguard.");
}
doKeyguardLocked(null);
setPendingLock(false);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybeHandlePendingLock
File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21267
|
MEDIUM
| 5.5
|
android
|
maybeHandlePendingLock
|
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
|
d18d8b350756b0e89e051736c1f28744ed31e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void doPostCredential(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
Hudson.getInstance().checkPermission(Item.CONFIGURE);
MultipartFormDataParser parser = new MultipartFormDataParser(req);
// we'll record what credential we are trying here.
StringWriter log = new StringWriter();
PrintWriter logWriter = new PrintWriter(log);
UserProvidedCredential upc = UserProvidedCredential.fromForm(req,parser);
try {
postCredential(parser.get("url"), upc, logWriter);
rsp.sendRedirect("credentialOK");
} catch (SVNException e) {
logWriter.println("FAILED: "+e.getErrorMessage());
req.setAttribute("message",log.toString());
req.setAttribute("pre",true);
req.setAttribute("exception",e);
rsp.forward(Hudson.getInstance(),"error",req);
} finally {
upc.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doPostCredential
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices.
|
[
"CWE-255"
] |
CVE-2013-6372
|
LOW
| 2.1
|
jenkinsci/subversion-plugin
|
doPostCredential
|
src/main/java/hudson/scm/SubversionSCM.java
|
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean mayBeDisplayed() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: mayBeDisplayed
File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
Repository: HtmlUnit/htmlunit
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-2798
|
HIGH
| 7.5
|
HtmlUnit/htmlunit
|
mayBeDisplayed
|
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
|
940dc7fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private ServletFileUpload getServletFileUpload() {
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setHeaderEncoding("UTF-8");
return upload;
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2014-8114
- Severity: MEDIUM
- CVSS Score: 6.8
Description: BZ(1169544,1169556, 1169557,1169559,1169560): improvements on security related to file access
Function: getServletFileUpload
File: uberfire-server/src/main/java/org/uberfire/server/FileUploadServlet.java
Repository: AppFormer/uberfire
Fixed Code:
private ServletFileUpload getServletFileUpload() {
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload( factory );
upload.setHeaderEncoding( "UTF-8" );
return upload;
}
|
[
"CWE-264"
] |
CVE-2014-8114
|
MEDIUM
| 6.8
|
AppFormer/uberfire
|
getServletFileUpload
|
uberfire-server/src/main/java/org/uberfire/server/FileUploadServlet.java
|
21ec50eb15
| 1
|
Analyze the following code function for security vulnerabilities
|
public static String generateValidVHDLLabel(String initialLabel) {
return (generateValidVHDLLabel(initialLabel, UUID.randomUUID()
.toString().substring(0, 8)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateValidVHDLLabel
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
|
generateValidVHDLLabel
|
src/com/cburch/logisim/file/XmlReader.java
|
90aee8f8ceef463884cc400af4f6d1f109fb0972
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String render(XWikiContext context) throws XWikiException
{
CreateActionRequestHandler handler = new CreateActionRequestHandler(context);
// Read the request and extract the passed information.
handler.processRequest();
// Save the determined values so we have them available in the action template.
ScriptContext scontext = getCurrentScriptContext();
scontext.setAttribute(SPACE_REFERENCE, handler.getSpaceReference(), ScriptContext.ENGINE_SCOPE);
scontext.setAttribute(NAME, handler.getName(), ScriptContext.ENGINE_SCOPE);
scontext.setAttribute(IS_SPACE, handler.isSpace(), ScriptContext.ENGINE_SCOPE);
// put the available templates on the context, for the .vm to not compute them again
scontext.setAttribute("availableTemplateProviders", handler.getAvailableTemplateProviders(),
ScriptContext.ENGINE_SCOPE);
scontext.setAttribute("recommendedTemplateProviders", handler.getRecommendedTemplateProviders(),
ScriptContext.ENGINE_SCOPE);
DocumentReference newDocumentReference = handler.getNewDocumentReference();
if (newDocumentReference == null) {
// There is information still missing, go back to the template and fill it.
return CREATE_TEMPLATE;
}
// Check if the creation in the spaceReference is allowed.
if (!handler.isTemplateProviderAllowedToCreateInCurrentSpace()) {
// The selected template provider is not usable in the selected location. Go back to the template and pick
// something else.
return CREATE_TEMPLATE;
}
// Checking the rights to create the new document.
// Note: Note checking the logical spaceReference, but the space of the final actual document reference, since
// that is where we are creating the new document.
checkRights(newDocumentReference.getLastSpaceReference(), context);
// Check if the document to create already exists and if it respects the name strategy
XWikiDocument newDocument = context.getWiki().getDocument(newDocumentReference, context);
if (handler.isDocumentAlreadyExisting(newDocument) || handler.isDocumentPathTooLong(newDocumentReference)
|| !this.isEntityReferenceNameValid(newDocumentReference)) {
return CREATE_TEMPLATE;
}
// Verify if the "type" of document to create has been set, even if we currently do not use it in the action.
// The goal is let the user be able to chose it, which have some consequences in the UI (thanks to javascript).
// See: https://jira.xwiki.org/browse/XWIKI-12580
// Note: we do not need the "type" if we have a template provider: the type of the new document will be the type
// of the template.
// TODO: handle this type in doCreate() that we call above (see: https://jira.xwiki.org/browse/XWIKI-12585).
if (StringUtils.isBlank(handler.getType()) && !handler.hasTemplate()) {
return CREATE_TEMPLATE;
}
// create is finally valid, can be executed
doCreate(context, newDocument, handler.isSpace(), handler.getTemplateProvider());
return null;
}
|
Vulnerability Classification:
- CWE: CWE-352
- CVE: CVE-2023-40572
- Severity: HIGH
- CVSS Score: 8.0
Description: XWIKI-20849: Require a CSRF token in the create action
Function: render
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/CreateAction.java
Repository: xwiki/xwiki-platform
Fixed Code:
@Override
public String render(XWikiContext context) throws XWikiException
{
CreateActionRequestHandler handler = new CreateActionRequestHandler(context);
// Read the request and extract the passed information.
handler.processRequest();
// Save the determined values so we have them available in the action template.
ScriptContext scontext = getCurrentScriptContext();
scontext.setAttribute(SPACE_REFERENCE, handler.getSpaceReference(), ScriptContext.ENGINE_SCOPE);
scontext.setAttribute(NAME, handler.getName(), ScriptContext.ENGINE_SCOPE);
scontext.setAttribute(IS_SPACE, handler.isSpace(), ScriptContext.ENGINE_SCOPE);
// put the available templates on the context, for the .vm to not compute them again
scontext.setAttribute("availableTemplateProviders", handler.getAvailableTemplateProviders(),
ScriptContext.ENGINE_SCOPE);
scontext.setAttribute("recommendedTemplateProviders", handler.getRecommendedTemplateProviders(),
ScriptContext.ENGINE_SCOPE);
DocumentReference newDocumentReference = handler.getNewDocumentReference();
if (newDocumentReference == null) {
// There is information still missing, go back to the template and fill it.
return CREATE_TEMPLATE;
}
// Check if the creation in the spaceReference is allowed.
if (!handler.isTemplateProviderAllowedToCreateInCurrentSpace()) {
// The selected template provider is not usable in the selected location. Go back to the template and pick
// something else.
return CREATE_TEMPLATE;
}
// Checking the rights to create the new document.
// Note: Note checking the logical spaceReference, but the space of the final actual document reference, since
// that is where we are creating the new document.
checkRights(newDocumentReference.getLastSpaceReference(), context);
// Check if the document to create already exists and if it respects the name strategy
// Also check the CSRF token.
XWikiDocument newDocument = context.getWiki().getDocument(newDocumentReference, context);
if (handler.isDocumentAlreadyExisting(newDocument) || handler.isDocumentPathTooLong(newDocumentReference)
|| !this.isEntityReferenceNameValid(newDocumentReference)
|| !this.csrf.isTokenValid(context.getRequest().getParameter("form_token")))
{
return CREATE_TEMPLATE;
}
// Verify if the "type" of document to create has been set, even if we currently do not use it in the action.
// The goal is let the user be able to chose it, which have some consequences in the UI (thanks to javascript).
// See: https://jira.xwiki.org/browse/XWIKI-12580
// Note: we do not need the "type" if we have a template provider: the type of the new document will be the type
// of the template.
// TODO: handle this type in doCreate() that we call above (see: https://jira.xwiki.org/browse/XWIKI-12585).
if (StringUtils.isBlank(handler.getType()) && !handler.hasTemplate()) {
return CREATE_TEMPLATE;
}
// create is finally valid, can be executed
doCreate(context, newDocument, handler.isSpace(), handler.getTemplateProvider());
return null;
}
|
[
"CWE-352"
] |
CVE-2023-40572
|
HIGH
| 8
|
xwiki/xwiki-platform
|
render
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/CreateAction.java
|
4b20528808d0c311290b0d9ab2cfc44063380ef7
| 1
|
Analyze the following code function for security vulnerabilities
|
protected void checkColumnIsAttached() throws IllegalStateException {
if (getGrid() == null) {
throw new IllegalStateException(
"Column is no longer attached to a grid.");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkColumnIsAttached
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
|
checkColumnIsAttached
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public String displayDocument(Syntax targetSyntax) throws XWikiException
{
return this.doc.displayDocument(targetSyntax, getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: displayDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
displayDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void setKeyParams() throws Exception {
assertPlotParam("key", "out");
assertPlotParam("key", "left");
assertPlotParam("key", "top");
assertPlotParam("key", "center");
assertPlotParam("key", "right");
assertPlotParam("key", "horiz");
assertPlotParam("key", "box");
assertPlotParam("key", "bottom");
assertInvalidPlotParam("yrange", "out%20right%20top%0aset%20yrange%20[33:system(%20");
}
|
Vulnerability Classification:
- CWE: CWE-74
- CVE: CVE-2023-36812
- Severity: CRITICAL
- CVSS Score: 9.8
Description: Improved fix for #2261.
Regular expressions wouldn't catch the newlines or possibly other
control characters. Now we'll use the TAG validation code to make
sure the inputs are only plain ASCII printables first.
Fixes CVE-2018-12972, CVE-2020-35476
Function: setKeyParams
File: test/tsd/TestGraphHandler.java
Repository: OpenTSDB/opentsdb
Fixed Code:
@Test
public void setKeyParams() throws Exception {
assertPlotParam("key", "out");
assertPlotParam("key", "left");
assertPlotParam("key", "top");
assertPlotParam("key", "center");
assertPlotParam("key", "right");
assertPlotParam("key", "horiz");
assertPlotParam("key", "box");
assertPlotParam("key", "bottom");
assertInvalidPlotParam("key", "out%20right%20top%0aset%20yrange%20[33:system(%20");
assertInvalidPlotParam("key", "%3Bsystem%20%22cat%20/home/ubuntuvm/secret.txt%20%3E/tmp/secret.txt%22%20%22");
}
|
[
"CWE-74"
] |
CVE-2023-36812
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
setKeyParams
|
test/tsd/TestGraphHandler.java
|
07c4641471c6f5c2ab5aab615969e97211eb50d9
| 1
|
Analyze the following code function for security vulnerabilities
|
private void deleteFollows(String id) {
ApiScenarioFollowExample example = new ApiScenarioFollowExample();
example.createCriteria().andScenarioIdEqualTo(id);
apiScenarioFollowMapper.deleteByExample(example);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteFollows
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
deleteFollows
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean areLightsOn() {
return 0 == (mSystemUiVisibility & View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: areLightsOn
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
areLightsOn
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.