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
|
protected String getMethod() {
return this.method;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMethod
File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-1904
|
MEDIUM
| 4.3
|
spring-projects/spring-framework
|
getMethod
|
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
|
741b4b229ae032bd17175b46f98673ce0bd2d485
| 0
|
Analyze the following code function for security vulnerabilities
|
private void folderCopy() {
finish(copyFolder(inputFile.get(getBuildContext()), outputFile.get(getBuildContext()), vacuousSuccess));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: folderCopy
File: APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java
Repository: Calsign/APDE
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36628
|
CRITICAL
| 9.8
|
Calsign/APDE
|
folderCopy
|
APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java
|
c6d64cbe465348c1bfd211122d89e3117afadecf
| 0
|
Analyze the following code function for security vulnerabilities
|
@Exported
public boolean isIgnoreDirPropChanges() {
return ignoreDirPropChanges;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isIgnoreDirPropChanges
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
|
isIgnoreDirPropChanges
|
src/main/java/hudson/scm/SubversionSCM.java
|
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
| 0
|
Analyze the following code function for security vulnerabilities
|
public Boolean getBearerOnly() {
return bearerOnly;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBearerOnly
File: services/src/main/java/org/keycloak/services/managers/ClientManager.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-798"
] |
CVE-2019-14837
|
MEDIUM
| 6.4
|
keycloak
|
getBearerOnly
|
services/src/main/java/org/keycloak/services/managers/ClientManager.java
|
9a7c1a91a59ab85e7f8889a505be04a71580777f
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isMainThreadAndInactive() {
return !isActive && Thread.currentThread() == SecurityConstants.MAIN_THREAD;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isMainThreadAndInactive
File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
Repository: ls1intum/Ares
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2024-23683
|
HIGH
| 8.2
|
ls1intum/Ares
|
isMainThreadAndInactive
|
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
|
af4f28a56e2fe600d8750b3b415352a0a3217392
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setFooterRowHeight(double rowHeight) {
getState().footerRowHeight = rowHeight;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFooterRowHeight
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
|
setFooterRowHeight
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Rect getMaxBounds() {
final Rect maxBounds = mToken.getFixedRotationTransformMaxBounds();
if (maxBounds != null) {
return maxBounds;
}
return super.getMaxBounds();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMaxBounds
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
getMaxBounds
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void reportKeyguardDismissed(int userHandle) {
if (mService != null) {
try {
mService.reportKeyguardDismissed(userHandle);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportKeyguardDismissed
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
|
reportKeyguardDismissed
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public WearableExtender addActions(List<Action> actions) {
mActions.addAll(actions);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addActions
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
addActions
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public static int clearAppCacheDirectories() {
int status = 0;
Log.i(TAG, "Clearing cache for all apps");
final File rootDataDir = buildPath(Environment.getExternalStorageDirectory(),
"Android", "data");
for (File appDataDir : rootDataDir.listFiles()) {
try {
final File appCacheDir = new File(appDataDir, "cache");
if (appCacheDir.isDirectory()) {
FileUtils.deleteContents(appCacheDir);
}
} catch (Exception e) {
// We want to avoid crashing MediaProvider at all costs, so we handle all "generic"
// exceptions here, and just report to the caller that an IO exception has occurred.
// We still try to clear the rest of the directories.
Log.e(TAG, "Couldn't delete all app cache dirs!", e);
status = OsConstants.EIO;
}
}
return status;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearAppCacheDirectories
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
clearAppCacheDirectories
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
public void updateConfiguration(Configuration values) throws RemoteException
{
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
values.writeToParcel(data, 0);
mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
reply.readException();
data.recycle();
reply.recycle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateConfiguration
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
updateConfiguration
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public InboxStyle setBigContentTitle(CharSequence title) {
internalSetBigContentTitle(safeCharSequence(title));
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBigContentTitle
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setBigContentTitle
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void createIconController() {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createIconController
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
|
createIconController
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public Setting getSettingLocked(int type, int userId, String name) {
final int key = makeKey(type, userId);
SettingsState settingsState = peekSettingsStateLocked(key);
return settingsState.getSettingLocked(name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSettingLocked
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
getSettingLocked
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void load(String originalName, ClassLoader loader) {
// Adjust expected name to support shading of native libraries.
String packagePrefix = calculatePackagePrefix().replace('.', '_');
String name = packagePrefix + originalName;
List<Throwable> suppressed = new ArrayList<Throwable>();
try {
// first try to load from java.library.path
loadLibrary(loader, name, false);
return;
} catch (Throwable ex) {
suppressed.add(ex);
}
String libname = System.mapLibraryName(name);
String path = NATIVE_RESOURCE_HOME + libname;
InputStream in = null;
OutputStream out = null;
File tmpFile = null;
URL url;
if (loader == null) {
url = ClassLoader.getSystemResource(path);
} else {
url = loader.getResource(path);
}
try {
if (url == null) {
if (PlatformDependent.isOsx()) {
String fileName = path.endsWith(".jnilib") ? NATIVE_RESOURCE_HOME + "lib" + name + ".dynlib" :
NATIVE_RESOURCE_HOME + "lib" + name + ".jnilib";
if (loader == null) {
url = ClassLoader.getSystemResource(fileName);
} else {
url = loader.getResource(fileName);
}
if (url == null) {
FileNotFoundException fnf = new FileNotFoundException(fileName);
ThrowableUtil.addSuppressedAndClear(fnf, suppressed);
throw fnf;
}
} else {
FileNotFoundException fnf = new FileNotFoundException(path);
ThrowableUtil.addSuppressedAndClear(fnf, suppressed);
throw fnf;
}
}
int index = libname.lastIndexOf('.');
String prefix = libname.substring(0, index);
String suffix = libname.substring(index);
tmpFile = File.createTempFile(prefix, suffix, WORKDIR);
in = url.openStream();
out = new FileOutputStream(tmpFile);
if (shouldShadedLibraryIdBePatched(packagePrefix)) {
patchShadedLibraryId(in, out, originalName, name);
} else {
byte[] buffer = new byte[8192];
int length;
while ((length = in.read(buffer)) > 0) {
out.write(buffer, 0, length);
}
}
out.flush();
// Close the output stream before loading the unpacked library,
// because otherwise Windows will refuse to load it when it's in use by other process.
closeQuietly(out);
out = null;
loadLibrary(loader, tmpFile.getPath(), true);
} catch (UnsatisfiedLinkError e) {
try {
if (tmpFile != null && tmpFile.isFile() && tmpFile.canRead() &&
!NoexecVolumeDetector.canExecuteExecutable(tmpFile)) {
// Pass "io.netty.native.workdir" as an argument to allow shading tools to see
// the string. Since this is printed out to users to tell them what to do next,
// we want the value to be correct even when shading.
logger.info("{} exists but cannot be executed even when execute permissions set; " +
"check volume for \"noexec\" flag; use -D{}=[path] " +
"to set native working directory separately.",
tmpFile.getPath(), "io.netty.native.workdir");
}
} catch (Throwable t) {
suppressed.add(t);
logger.debug("Error checking if {} is on a file store mounted with noexec", tmpFile, t);
}
// Re-throw to fail the load
ThrowableUtil.addSuppressedAndClear(e, suppressed);
throw e;
} catch (Exception e) {
UnsatisfiedLinkError ule = new UnsatisfiedLinkError("could not load a native library: " + name);
ule.initCause(e);
ThrowableUtil.addSuppressedAndClear(ule, suppressed);
throw ule;
} finally {
closeQuietly(in);
closeQuietly(out);
// After we load the library it is safe to delete the file.
// We delete the file immediately to free up resources as soon as possible,
// and if this fails fallback to deleting on JVM exit.
if (tmpFile != null && (!DELETE_NATIVE_LIB_AFTER_LOADING || !tmpFile.delete())) {
tmpFile.deleteOnExit();
}
}
}
|
Vulnerability Classification:
- CWE: CWE-378, CWE-379
- CVE: CVE-2021-21290
- Severity: LOW
- CVSS Score: 1.9
Description: Use Files.createTempFile(...) to ensure the file is created with proper permissions
Motivation:
File.createTempFile(String, String)` will create a temporary file in the system temporary directory if the 'java.io.tmpdir'. The permissions on that file utilize the umask. In a majority of cases, this means that the file that java creates has the permissions: `-rw-r--r--`, thus, any other local user on that system can read the contents of that file.
This can be a security concern if any sensitive data is stored in this file.
This was reported by Jonathan Leitschuh <jonathan.leitschuh@gmail.com> as a security problem.
Modifications:
Use Files.createTempFile(...) which will use safe-defaults when running on java 7 and later. If running on java 6 there isnt much we can do, which is fair enough as java 6 shouldnt be considered "safe" anyway.
Result:
Create temporary files with sane permissions by default.
Function: load
File: common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java
Repository: netty
Fixed Code:
public static void load(String originalName, ClassLoader loader) {
// Adjust expected name to support shading of native libraries.
String packagePrefix = calculatePackagePrefix().replace('.', '_');
String name = packagePrefix + originalName;
List<Throwable> suppressed = new ArrayList<Throwable>();
try {
// first try to load from java.library.path
loadLibrary(loader, name, false);
return;
} catch (Throwable ex) {
suppressed.add(ex);
}
String libname = System.mapLibraryName(name);
String path = NATIVE_RESOURCE_HOME + libname;
InputStream in = null;
OutputStream out = null;
File tmpFile = null;
URL url;
if (loader == null) {
url = ClassLoader.getSystemResource(path);
} else {
url = loader.getResource(path);
}
try {
if (url == null) {
if (PlatformDependent.isOsx()) {
String fileName = path.endsWith(".jnilib") ? NATIVE_RESOURCE_HOME + "lib" + name + ".dynlib" :
NATIVE_RESOURCE_HOME + "lib" + name + ".jnilib";
if (loader == null) {
url = ClassLoader.getSystemResource(fileName);
} else {
url = loader.getResource(fileName);
}
if (url == null) {
FileNotFoundException fnf = new FileNotFoundException(fileName);
ThrowableUtil.addSuppressedAndClear(fnf, suppressed);
throw fnf;
}
} else {
FileNotFoundException fnf = new FileNotFoundException(path);
ThrowableUtil.addSuppressedAndClear(fnf, suppressed);
throw fnf;
}
}
int index = libname.lastIndexOf('.');
String prefix = libname.substring(0, index);
String suffix = libname.substring(index);
tmpFile = PlatformDependent.createTempFile(prefix, suffix, WORKDIR);
in = url.openStream();
out = new FileOutputStream(tmpFile);
if (shouldShadedLibraryIdBePatched(packagePrefix)) {
patchShadedLibraryId(in, out, originalName, name);
} else {
byte[] buffer = new byte[8192];
int length;
while ((length = in.read(buffer)) > 0) {
out.write(buffer, 0, length);
}
}
out.flush();
// Close the output stream before loading the unpacked library,
// because otherwise Windows will refuse to load it when it's in use by other process.
closeQuietly(out);
out = null;
loadLibrary(loader, tmpFile.getPath(), true);
} catch (UnsatisfiedLinkError e) {
try {
if (tmpFile != null && tmpFile.isFile() && tmpFile.canRead() &&
!NoexecVolumeDetector.canExecuteExecutable(tmpFile)) {
// Pass "io.netty.native.workdir" as an argument to allow shading tools to see
// the string. Since this is printed out to users to tell them what to do next,
// we want the value to be correct even when shading.
logger.info("{} exists but cannot be executed even when execute permissions set; " +
"check volume for \"noexec\" flag; use -D{}=[path] " +
"to set native working directory separately.",
tmpFile.getPath(), "io.netty.native.workdir");
}
} catch (Throwable t) {
suppressed.add(t);
logger.debug("Error checking if {} is on a file store mounted with noexec", tmpFile, t);
}
// Re-throw to fail the load
ThrowableUtil.addSuppressedAndClear(e, suppressed);
throw e;
} catch (Exception e) {
UnsatisfiedLinkError ule = new UnsatisfiedLinkError("could not load a native library: " + name);
ule.initCause(e);
ThrowableUtil.addSuppressedAndClear(ule, suppressed);
throw ule;
} finally {
closeQuietly(in);
closeQuietly(out);
// After we load the library it is safe to delete the file.
// We delete the file immediately to free up resources as soon as possible,
// and if this fails fallback to deleting on JVM exit.
if (tmpFile != null && (!DELETE_NATIVE_LIB_AFTER_LOADING || !tmpFile.delete())) {
tmpFile.deleteOnExit();
}
}
}
|
[
"CWE-378",
"CWE-379"
] |
CVE-2021-21290
|
LOW
| 1.9
|
netty
|
load
|
common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java
|
c735357bf29d07856ad171c6611a2e1a0e0000ec
| 1
|
Analyze the following code function for security vulnerabilities
|
protected void _reportInvalidOther(int mask) throws JsonParseException {
_reportError("Invalid UTF-8 middle byte 0x"+Integer.toHexString(mask));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _reportInvalidOther
File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
Repository: FasterXML/jackson-dataformats-binary
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2020-28491
|
MEDIUM
| 5
|
FasterXML/jackson-dataformats-binary
|
_reportInvalidOther
|
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
|
de072d314af8f5f269c8abec6930652af67bc8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
private Map<String, List<IssueCommentDTO>> getCommentMap(List<IssuesDao> issues) {
List<String> issueIds = issues.stream().map(IssuesDao::getId).collect(Collectors.toList());
List<IssueCommentDTO> comments = extIssueCommentMapper.getCommentsByIssueIds(issueIds);
Map<String, List<IssueCommentDTO>> commentMap = comments.stream().collect(Collectors.groupingBy(IssueCommentDTO::getIssueId));
return commentMap;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCommentMap
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
getCommentMap
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setTaskResizeable(int taskId, int resizeableMode) {
synchronized (mGlobalLock) {
final Task task = mRootWindowContainer.anyTaskForId(
taskId, MATCH_ATTACHED_TASK_OR_RECENT_TASKS);
if (task == null) {
Slog.w(TAG, "setTaskResizeable: taskId=" + taskId + " not found");
return;
}
task.setResizeMode(resizeableMode);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTaskResizeable
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
setTaskResizeable
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void clearArguments()
{
shellArgs.clear();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearArguments
File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2017-1000487
|
HIGH
| 7.5
|
codehaus-plexus/plexus-utils
|
clearArguments
|
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
public void sendReply(final HttpResponseStatus status,
final StringBuilder buf) {
sendBuffer(status, ChannelBuffers.copiedBuffer(buf.toString(),
CharsetUtil.UTF_8));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendReply
File: src/tsd/HttpQuery.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
sendReply
|
src/tsd/HttpQuery.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public java.util.Collection<String> getHeaders(String name) {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHeaders
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
getHeaders
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
private static DocumentReferenceResolver<String> getCurrentDocumentReferenceResolver()
{
return Utils.getComponent(DocumentReferenceResolver.TYPE_STRING, "current");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentDocumentReferenceResolver
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
|
getCurrentDocumentReferenceResolver
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isInSizeCompatModeForBounds(final Rect appBounds, final Rect containerBounds) {
final int appWidth = appBounds.width();
final int appHeight = appBounds.height();
final int containerAppWidth = containerBounds.width();
final int containerAppHeight = containerBounds.height();
if (containerAppWidth == appWidth && containerAppHeight == appHeight) {
// Matched the container bounds.
return false;
}
if (containerAppWidth > appWidth && containerAppHeight > appHeight) {
// Both sides are smaller than the container.
return true;
}
if (containerAppWidth < appWidth || containerAppHeight < appHeight) {
// One side is larger than the container.
return true;
}
// The rest of the condition is that only one side is smaller than the container, but it
// still needs to exclude the cases where the size is limited by the fixed aspect ratio.
if (info.getMaxAspectRatio() > 0) {
final float aspectRatio = (0.5f + Math.max(appWidth, appHeight))
/ Math.min(appWidth, appHeight);
if (aspectRatio >= info.getMaxAspectRatio()) {
// The current size has reached the max aspect ratio.
return false;
}
}
final float minAspectRatio = getMinAspectRatio();
if (minAspectRatio > 0) {
// The activity should have at least the min aspect ratio, so this checks if the
// container still has available space to provide larger aspect ratio.
final float containerAspectRatio =
(0.5f + Math.max(containerAppWidth, containerAppHeight))
/ Math.min(containerAppWidth, containerAppHeight);
if (containerAspectRatio <= minAspectRatio) {
// The long side has reached the parent.
return false;
}
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isInSizeCompatModeForBounds
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
|
isInSizeCompatModeForBounds
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static VersionedYamlDoc fromYaml(String yaml) {
return new VersionedYamlDoc((MappingNode) new OneYaml().compose(new StringReader(yaml)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fromYaml
File: server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-21249
|
MEDIUM
| 6.5
|
theonedev/onedev
|
fromYaml
|
server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
|
d6fc4212b1ac1e9bbe3ce444e95f9af1e3ab8b66
| 0
|
Analyze the following code function for security vulnerabilities
|
@ParameterizedTest
@MethodSource("testsParameters")
@Order(7)
void registerInvalidEmail(boolean useLiveValidation, boolean isModal, TestUtils testUtils) throws Exception
{
AbstractRegistrationPage registrationPage = setUp(testUtils, useLiveValidation, isModal);
registrationPage.fillRegisterForm(null, null, null, null, null, "not an email address");
assertFalse(validateAndRegister(testUtils, useLiveValidation, isModal, registrationPage));
assertTrue(registrationPage.validationFailureMessagesInclude("Please enter a valid email address."));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerInvalidEmail
File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2024-21650
|
CRITICAL
| 9.8
|
xwiki/xwiki-platform
|
registerInvalidEmail
|
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
|
b290bfd573c6f7db6cc15a88dd4111d9fcad0d31
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCrossProfileWidgetProvidersChanged(int userId, List<String> packages) {
final int parentId = mSecurityPolicy.getProfileParent(userId);
// We care only if the white-listed package is in a profile of
// the group parent as only the parent can add widgets from the
// profile and not the other way around.
if (parentId != userId) {
synchronized (mLock) {
boolean providersChanged = false;
final int packageCount = packages.size();
for (int i = 0; i < packageCount; i++) {
String packageName = packages.get(i);
providersChanged |= updateProvidersForPackageLocked(packageName,
userId, null);
}
if (providersChanged) {
saveGroupStateAsync(userId);
scheduleNotifyGroupHostsForProvidersChangedLocked(userId);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCrossProfileWidgetProvidersChanged
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
onCrossProfileWidgetProvidersChanged
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void write(ObjectDataOutput out, Enum obj) throws IOException {
String name = obj.getDeclaringClass().getName();
out.writeUTF(name);
out.writeUTF(obj.name());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: write
File: hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
write
|
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
void updateTapExcludeRegion(Region region) {
final DisplayContent currentDisplay = getDisplayContent();
if (currentDisplay == null) {
throw new IllegalStateException("Trying to update window not attached to any display.");
}
// Clear the tap excluded region if the region passed in is null or empty.
if (region == null || region.isEmpty()) {
mTapExcludeRegion.setEmpty();
// Remove this window from mTapExcludeProvidingWindows since it won't be providing
// tap exclude regions.
currentDisplay.mTapExcludeProvidingWindows.remove(this);
} else {
mTapExcludeRegion.set(region);
// Make sure that this window is registered as one that provides a tap exclude region
// for its containing display.
currentDisplay.mTapExcludeProvidingWindows.add(this);
}
// Trigger touch exclude region update on current display.
currentDisplay.updateTouchExcludeRegion();
// Trigger touchable region update for this window.
currentDisplay.getInputMonitor().updateInputWindowsLw(true /* force */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateTapExcludeRegion
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
updateTapExcludeRegion
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setServers(List<ServerConfiguration> servers) {
this.servers = servers;
updateBasePath();
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setServers
File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setServers
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private static APIAuthenticationServiceClient getAPIKeyManagementClient() throws APIManagementException {
APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration();
String url = config.getFirstProperty(APIConstants.API_KEY_VALIDATOR_URL);
if (url == null) {
handleException("API key manager URL unspecified");
}
String username = config.getFirstProperty(APIConstants.API_KEY_VALIDATOR_USERNAME);
String password = config.getFirstProperty(APIConstants.API_KEY_VALIDATOR_PASSWORD);
if (username == null || password == null) {
handleException("Authentication credentials for API key manager unspecified");
}
try {
return new APIAuthenticationServiceClient(url, username, password);
} catch (Exception e) {
handleException("Error while initializing the subscriber key management client", e);
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAPIKeyManagementClient
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-20736
|
LOW
| 3.5
|
wso2/carbon-apimgt
|
getAPIKeyManagementClient
|
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
|
490f2860822f89d745b7c04fa9570bd86bef4236
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void enterPost(Post post){
Driver driver = new SQLServerDriver();
String connectionUrl = "jdbc:sqlserver://n8bu1j6855.database.windows.net:1433;database=VoyagerDB;user=VoyageLogin@n8bu1j6855;password={GroupP@ssword};encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;";
try {
Connection con = driver.connect(connectionUrl, new Properties());
PreparedStatement statement = con.prepareStatement("Insert INTO PostTable (postTitle, postAuthorId, postTime, postContent) "
+ "VALUES ('" + post.getTitle() + "', '" + this.getUserId(post.getAuthor()) + "', CURRENT_TIMESTAMP, '" + post.getMessage() + "');");
statement.execute();
System.out.println("Successful post");
} catch (SQLException e) {
e.printStackTrace();
}
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2014-125074
- Severity: MEDIUM
- CVSS Score: 5.2
Description: fixed problems in register controller, and worked at preventing sql-injection in database access
Function: enterPost
File: Voyager/src/models/DatabaseAccess.java
Repository: Nayshlok/Voyager
Fixed Code:
@Override
public void enterPost(Post post){
Driver driver = new SQLServerDriver();
try {
Connection con = driver.connect(connectionUrl, new Properties());
PreparedStatement statement = con.prepareStatement("Insert INTO PostTable (postTitle, postAuthorId, postTime, postContent) "
+ "VALUES ('" + post.getTitle() + "', '" + this.getUserId(post.getAuthor()) + "', CURRENT_TIMESTAMP, '" + post.getMessage() + "');");
statement.setString(1, post.getTitle());
statement.setInt(2, this.getUserId(post.getAuthor()));
statement.setString(3, post.getMessage());
statement.execute();
System.out.println("Successful post");
} catch (SQLException e) {
e.printStackTrace();
}
}
|
[
"CWE-89"
] |
CVE-2014-125074
|
MEDIUM
| 5.2
|
Nayshlok/Voyager
|
enterPost
|
Voyager/src/models/DatabaseAccess.java
|
f1249f438cd8c39e7ef2f6c8f2ab76b239a02fae
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onStart() {
publishBinderService(Context.FINGERPRINT_SERVICE, new FingerprintServiceWrapper());
IFingerprintDaemon daemon = getFingerprintDaemon();
if (DEBUG) Slog.v(TAG, "Fingerprint HAL id: " + mHalDeviceId);
listenForUserSwitches();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStart
File: services/core/java/com/android/server/fingerprint/FingerprintService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
onStart
|
services/core/java/com/android/server/fingerprint/FingerprintService.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isCompressionEnabled() {
return compressionEnabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCompressionEnabled
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
|
isCompressionEnabled
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void appendSerializationFactory(XmlGenerator gen, String elementName, Map<Integer, ?> factoryMap) {
if (MapUtil.isNullOrEmpty(factoryMap)) {
return;
}
for (Entry<Integer, ?> factory : factoryMap.entrySet()) {
Object value = factory.getValue();
String className = value instanceof String ? (String) value : value.getClass().getName();
gen.node(elementName, className, "factory-id", factory.getKey().toString());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendSerializationFactory
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
appendSerializationFactory
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public ClientConfig getClientConfig() {
return clientConfig;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClientConfig
File: samples/client/petstore/java/retrofit2-play26/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
|
getClientConfig
|
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public DateTime unmarshal(String v) throws Exception {
if (isNullOrEmpty(v)) {
return null;
} else {
return new DateTime(v);
}
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2023-52096
- Severity: HIGH
- CVSS Score: 7.5
Description: change DateTimeFormatter (closes #13)
Function: unmarshal
File: src/main/java/de/rwth/idsg/ocpp/jaxb/JodaDateTimeConverter.java
Repository: steve-community/ocpp-jaxb
Fixed Code:
@Override
public DateTime unmarshal(String v) throws Exception {
if (isNullOrEmpty(v)) {
return null;
} else {
return DateTime.parse(v, formatter);
}
}
|
[
"CWE-89"
] |
CVE-2023-52096
|
HIGH
| 7.5
|
steve-community/ocpp-jaxb
|
unmarshal
|
src/main/java/de/rwth/idsg/ocpp/jaxb/JodaDateTimeConverter.java
|
13667036f7a30c5e7aca796ef6e2a3b0926c679a
| 1
|
Analyze the following code function for security vulnerabilities
|
public String convertRequestParam(String param) {
if (param != null) {
//如果可以正常读取到中文的情况,直接跳过转换
if(containsHanScript(param)){
return param;
}
try {
return URLDecoder.decode(new String(param.getBytes(StandardCharsets.ISO_8859_1)), "UTF-8");
} catch (UnsupportedEncodingException e) {
LOGGER.error("request convert to UTF-8 error ", e);
}
}
return "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertRequestParam
File: web/src/main/java/com/zrlog/web/controller/BaseController.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-16643
|
LOW
| 3.5
|
94fzb/zrlog
|
convertRequestParam
|
web/src/main/java/com/zrlog/web/controller/BaseController.java
|
4a91c83af669e31a22297c14f089d8911d353fa1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void dispose() throws ComponentLifecycleException
{
// Mark the component as disposed
this.disposed = true;
// Stop the resolve thread. Clear the queue and send the stop signal without blocking. We know that the resolve
// queue will remain empty after the clear call because we set the disposed flag above.
this.resolveQueue.clear();
this.resolveQueue.offer(RESOLVE_QUEUE_ENTRY_STOP);
// Stop the index thread. Clear the queue and send the stop signal without blocking. There should be enough
// space in the index queue before the special stop entry is added as long the the index queue capacity is
// greater than 1. In the worse case, the clear call will unblock the resolve thread (which was waiting because
// the index queue was full) and just one entry will be added to the queue before the special stop entry.
this.indexQueue.clear();
this.indexQueue.offer(INDEX_QUEUE_ENTRY_STOP);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dispose
File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-312",
"CWE-200"
] |
CVE-2023-50719
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
dispose
|
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java
|
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removeActiveSync(SyncInfo syncInfo, int userId) {
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "removeActiveSync: account=" + syncInfo.account
+ " user=" + userId
+ " auth=" + syncInfo.authority);
}
getCurrentSyncs(userId).remove(syncInfo);
}
reportActiveChange();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeActiveSync
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
removeActiveSync
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "9.0RC1")
public Document toXMLDocument(boolean bWithObjects, boolean bWithRendering, boolean bWithAttachmentContent,
boolean bWithVersions, XWikiContext context) throws XWikiException
{
Document doc = new DOMDocument();
DOMXMLWriter wr = new DOMXMLWriter(doc, new OutputFormat("", true, context.getWiki().getEncoding()));
try {
toXML(wr, bWithObjects, bWithRendering, bWithAttachmentContent, bWithVersions, context);
return doc;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toXMLDocument
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-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
toXMLDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
@ManagedOperation(value = "Deobserves the given channel", impact = "ACTION")
public void deobserveChannel(@Name(value = "channel", description = "The channel to deobserve") String channelId) {
if (_channels.remove(channelId) != null) {
_membership.deobserveChannel(channelId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deobserveChannel
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
Repository: cometd
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
deobserveChannel
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
private static Iterable<File> fileTreeChildren(File file) {
// check isDirectory() just because it may be faster than listFiles() on a non-directory
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null) {
return Collections.unmodifiableList(Arrays.asList(files));
}
}
return Collections.emptyList();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fileTreeChildren
File: guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2020-8908
|
LOW
| 2.1
|
google/guava
|
fileTreeChildren
|
guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
static void dumpApps(IndentingPrintWriter pw, String name, List apps) {
if (apps == null || apps.isEmpty()) {
pw.printf("%s: empty\n", name);
return;
}
int size = apps.size();
pw.printf("%s: %d app%s\n", name, size, size == 1 ? "" : "s");
pw.increaseIndent();
for (int i = 0; i < size; i++) {
pw.printf("%d: %s\n", i, apps.get(i));
}
pw.decreaseIndent();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpApps
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
dumpApps
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void pushState(AjaxRequestTarget target, BlobIdent blobIdent, @Nullable String position) {
state.blobIdent = blobIdent;
state.position = position;
pushState(target);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pushState
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
|
pushState
|
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
|
0c060153fb97c0288a1917efdb17cc426934dacb
| 0
|
Analyze the following code function for security vulnerabilities
|
private UserDTO loginLdapMode(String userId) {
// LDAP验证通过之后,如果用户存在且用户类型是LDAP或LOCAL,返回用户
UserDTO loginUser = getLoginUser(userId, Arrays.asList(UserSource.LDAP.name(), UserSource.LOCAL.name()));
if (loginUser == null) {
MSException.throwException(Translator.get("user_not_found_or_not_unique"));
}
return loginUser;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loginLdapMode
File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-32699
|
MEDIUM
| 6.5
|
metersphere
|
loginLdapMode
|
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
|
c59e381d368990214813085a1a4877c5ef865411
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void sendStanzaInternal(Stanza packet) throws NotConnectedException, InterruptedException {
packetWriter.sendStreamElement(packet);
if (isSmEnabled()) {
for (StanzaFilter requestAckPredicate : requestAckPredicates) {
if (requestAckPredicate.accept(packet)) {
requestSmAcknowledgementInternal();
break;
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendStanzaInternal
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
|
sendStanzaInternal
|
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setAgentApp(@NonNull String packageName, @Nullable String agent) {
synchronized (this) {
// note: hijacking SET_ACTIVITY_WATCHER, but should be changed to
// its own permission.
if (checkCallingPermission(
android.Manifest.permission.SET_ACTIVITY_WATCHER) !=
PackageManager.PERMISSION_GRANTED) {
throw new SecurityException(
"Requires permission " + android.Manifest.permission.SET_ACTIVITY_WATCHER);
}
if (agent == null) {
if (mAppAgentMap != null) {
mAppAgentMap.remove(packageName);
if (mAppAgentMap.isEmpty()) {
mAppAgentMap = null;
}
}
} else {
if (mAppAgentMap == null) {
mAppAgentMap = new HashMap<>();
}
if (mAppAgentMap.size() >= 100) {
// Limit the size of the map, to avoid OOMEs.
Slog.e(TAG, "App agent map has too many entries, cannot add " + packageName
+ "/" + agent);
return;
}
mAppAgentMap.put(packageName, agent);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAgentApp
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2018-9492
|
HIGH
| 7.2
|
android
|
setAgentApp
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public XWikiAttachment removeAttachment(XWikiAttachment attachmentToRemove, boolean toRecycleBin)
{
if (this.attachmentList.remove(attachmentToRemove)) {
this.attachmentsToRemove.add(new XWikiAttachmentToRemove(attachmentToRemove, toRecycleBin));
setMetaDataDirty(true);
} else {
attachmentToRemove = null;
}
return attachmentToRemove;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeAttachment
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
|
removeAttachment
|
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
|
@Deprecated(since = "2.2M2")
public BaseObject addObjectFromRequest(String className, int num, XWikiContext context) throws XWikiException
{
return addObjectFromRequest(className, "", num, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addObjectFromRequest
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-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
addObjectFromRequest
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void drawPolygon(Object graphics, int[] xPoints, int[] yPoints, int nPoints) {
((AndroidGraphics) graphics).drawPolygon(xPoints, yPoints, nPoints);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: drawPolygon
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
|
drawPolygon
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean areEqual(@Nullable Bundle a, @Nullable Bundle b) {
if (a == b) {
return true;
}
if (isEmpty(a)) {
return isEmpty(b);
}
if (isEmpty(b)) {
return false;
}
for (String key : a.keySet()) {
if (a.getBoolean(key) != b.getBoolean(key)) {
return false;
}
}
for (String key : b.keySet()) {
if (a.getBoolean(key) != b.getBoolean(key)) {
return false;
}
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: areEqual
File: services/core/java/com/android/server/pm/UserRestrictionsUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
areEqual
|
services/core/java/com/android/server/pm/UserRestrictionsUtils.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getScope() {
return this.scope;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getScope
File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
Repository: pac4j
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-44878
|
MEDIUM
| 5
|
pac4j
|
getScope
|
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
|
22b82ffd702a132d9f09da60362fc6264fc281ae
| 0
|
Analyze the following code function for security vulnerabilities
|
public java.net.URL getURL(@Positive int columnIndex) throws SQLException {
connection.getLogger().log(Level.FINEST, " getURL columnIndex: {0}", columnIndex);
checkClosed();
throw org.postgresql.Driver.notImplemented(this.getClass(), "getURL(int)");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURL
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
getURL
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public static void writeLines(Collection<String> lines, File file) throws IOException {
writeLines(lines, file.toPath());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeLines
File: pf4j/src/main/java/org/pf4j/util/FileUtils.java
Repository: pf4j
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-40827
|
HIGH
| 7.5
|
pf4j
|
writeLines
|
pf4j/src/main/java/org/pf4j/util/FileUtils.java
|
ed9392069fe14c6c30d9f876710e5ad40f7ea8c1
| 0
|
Analyze the following code function for security vulnerabilities
|
public void changeRecvCompression(ICompressor comp) {
tc.changeRecvCompression(comp);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: changeRecvCompression
File: src/main/java/com/trilead/ssh2/transport/TransportManager.java
Repository: connectbot/sshlib
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
connectbot/sshlib
|
changeRecvCompression
|
src/main/java/com/trilead/ssh2/transport/TransportManager.java
|
5c8b534f6e97db7ac0e0e579331213aa25c173ab
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testDeserializationFromStringWithZeroZoneOffset02() throws Exception {
Instant date = Instant.now();
String json = formatWithZeroZoneOffset(date, "+0000");
Instant result = MAPPER.readValue(json, Instant.class);
assertEquals("The value is not correct.", date, result);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testDeserializationFromStringWithZeroZoneOffset02
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testDeserializationFromStringWithZeroZoneOffset02
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void rename(DocumentReference newDocumentReference, List<DocumentReference> backlinkDocumentReferences,
XWikiContext context) throws XWikiException
{
rename(newDocumentReference, backlinkDocumentReferences, getChildrenReferences(context), context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: rename
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
|
rename
|
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
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_PACKAGE_STATE, conditional = true)
public boolean setApplicationHidden(@Nullable ComponentName admin, String packageName,
boolean hidden) {
if (mService != null) {
try {
return mService.setApplicationHidden(admin, mContext.getPackageName(), packageName,
hidden, mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setApplicationHidden
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
|
setApplicationHidden
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Short getShortAndRemove(K name) {
V v = getAndRemove(name);
try {
return v != null ? toShort(name, v) : null;
} catch (RuntimeException ignore) {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getShortAndRemove
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
getShortAndRemove
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void log(final LogRecord record) {
record.setSourceClassName(ThreadedEpsgFactory.class.getName());
record.setSourceMethodName("createBackingStore"); // The public caller.
record.setLoggerName(LOGGER.getName());
LOGGER.log(record);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: log
File: modules/library/referencing/src/main/java/org/geotools/referencing/factory/epsg/ThreadedEpsgFactory.java
Repository: geotools
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2022-24818
|
HIGH
| 7.5
|
geotools
|
log
|
modules/library/referencing/src/main/java/org/geotools/referencing/factory/epsg/ThreadedEpsgFactory.java
|
4f70fa3234391dd0cda883a20ab0ec75688cba49
| 0
|
Analyze the following code function for security vulnerabilities
|
private void doGraph(final TSDB tsdb, final HttpQuery query)
throws IOException {
final String basepath = getGnuplotBasePath(tsdb, query);
long start_time = DateTime.parseDateTimeString(
query.getRequiredQueryStringParam("start"),
query.getQueryStringParam("tz"));
final boolean nocache = query.hasQueryStringParam("nocache");
if (start_time == -1) {
throw BadRequestException.missingParameter("start");
} else {
// temp fixup to seconds from ms until the rest of TSDB supports ms
// Note you can't append this to the DateTime.parseDateTimeString() call as
// it clobbers -1 results
start_time /= 1000;
}
long end_time = DateTime.parseDateTimeString(
query.getQueryStringParam("end"),
query.getQueryStringParam("tz"));
final long now = System.currentTimeMillis() / 1000;
if (end_time == -1) {
end_time = now;
} else {
// temp fixup to seconds from ms until the rest of TSDB supports ms
// Note you can't append this to the DateTime.parseDateTimeString() call as
// it clobbers -1 results
end_time /= 1000;
}
final int max_age = computeMaxAge(query, start_time, end_time, now);
if (!nocache && isDiskCacheHit(query, end_time, max_age, basepath)) {
return;
}
// Parse TSQuery from HTTP query
final TSQuery tsquery = QueryRpc.parseQuery(tsdb, query);
tsquery.validateAndSetQuery();
// Build the queries for the parsed TSQuery
Query[] tsdbqueries = tsquery.buildQueries(tsdb);
List<String> options = query.getQueryStringParams("o");
if (options == null) {
options = new ArrayList<String>(tsdbqueries.length);
for (int i = 0; i < tsdbqueries.length; i++) {
options.add("");
}
} else if (options.size() != tsdbqueries.length) {
throw new BadRequestException(options.size() + " `o' parameters, but "
+ tsdbqueries.length + " `m' parameters.");
} else {
for (final String option : options) {
// TODO - far from perfect, should help a little.
if (option.contains("`") || option.contains("%60") ||
option.contains("`")) {
throw new BadRequestException("Option contained a back-tick. "
+ "That's a no-no.");
}
}
}
for (final Query tsdbquery : tsdbqueries) {
try {
tsdbquery.setStartTime(start_time);
} catch (IllegalArgumentException e) {
throw new BadRequestException("start time: " + e.getMessage());
}
try {
tsdbquery.setEndTime(end_time);
} catch (IllegalArgumentException e) {
throw new BadRequestException("end time: " + e.getMessage());
}
}
final Plot plot = new Plot(start_time, end_time,
DateTime.timezones.get(query.getQueryStringParam("tz")));
setPlotDimensions(query, plot);
setPlotParams(query, plot);
final int nqueries = tsdbqueries.length;
@SuppressWarnings("unchecked")
final HashSet<String>[] aggregated_tags = new HashSet[nqueries];
int npoints = 0;
for (int i = 0; i < nqueries; i++) {
try { // execute the TSDB query!
// XXX This is slow and will block Netty. TODO(tsuna): Don't block.
// TODO(tsuna): Optimization: run each query in parallel.
final DataPoints[] series = tsdbqueries[i].run();
for (final DataPoints datapoints : series) {
plot.add(datapoints, options.get(i));
aggregated_tags[i] = new HashSet<String>();
aggregated_tags[i].addAll(datapoints.getAggregatedTags());
npoints += datapoints.aggregatedSize();
}
} catch (RuntimeException e) {
logInfo(query, "Query failed (stack trace coming): "
+ tsdbqueries[i]);
throw e;
}
tsdbqueries[i] = null; // free()
}
tsdbqueries = null; // free()
if (query.hasQueryStringParam("ascii")) {
respondAsciiQuery(query, max_age, basepath, plot);
return;
}
final RunGnuplot rungnuplot = new RunGnuplot(query, max_age, plot, basepath,
aggregated_tags, npoints);
class ErrorCB implements Callback<Object, Exception> {
public Object call(final Exception e) throws Exception {
LOG.warn("Failed to retrieve global annotations: ", e);
throw e;
}
}
class GlobalCB implements Callback<Object, List<Annotation>> {
public Object call(final List<Annotation> global_annotations) throws Exception {
rungnuplot.plot.setGlobals(global_annotations);
execGnuplot(rungnuplot, query);
return null;
}
}
// Fetch global annotations, if needed
if (!tsquery.getNoAnnotations() && tsquery.getGlobalAnnotations()) {
Annotation.getGlobalAnnotations(tsdb, start_time, end_time)
.addCallback(new GlobalCB()).addErrback(new ErrorCB());
} else {
execGnuplot(rungnuplot, query);
}
}
|
Vulnerability Classification:
- CWE: CWE-78
- CVE: CVE-2020-35476
- Severity: HIGH
- CVSS Score: 7.5
Description: Fix remote code execution #2051 by adding regex validators for the
Gnuplot params and introducting the tsd.gnuplot.options.allowlist
setting that is a strict matching allow list of o= values from the
query string that will be allowed through. By default tihs is empty
so if folks are using this query param, they'll different graphs
until they add the options they need.
Function: doGraph
File: src/tsd/GraphHandler.java
Repository: OpenTSDB/opentsdb
Fixed Code:
private void doGraph(final TSDB tsdb, final HttpQuery query)
throws IOException {
final String basepath = getGnuplotBasePath(tsdb, query);
long start_time = DateTime.parseDateTimeString(
query.getRequiredQueryStringParam("start"),
query.getQueryStringParam("tz"));
final boolean nocache = query.hasQueryStringParam("nocache");
if (start_time == -1) {
throw BadRequestException.missingParameter("start");
} else {
// temp fixup to seconds from ms until the rest of TSDB supports ms
// Note you can't append this to the DateTime.parseDateTimeString() call as
// it clobbers -1 results
start_time /= 1000;
}
long end_time = DateTime.parseDateTimeString(
query.getQueryStringParam("end"),
query.getQueryStringParam("tz"));
final long now = System.currentTimeMillis() / 1000;
if (end_time == -1) {
end_time = now;
} else {
// temp fixup to seconds from ms until the rest of TSDB supports ms
// Note you can't append this to the DateTime.parseDateTimeString() call as
// it clobbers -1 results
end_time /= 1000;
}
final int max_age = computeMaxAge(query, start_time, end_time, now);
if (!nocache && isDiskCacheHit(query, end_time, max_age, basepath)) {
return;
}
// Parse TSQuery from HTTP query
final TSQuery tsquery = QueryRpc.parseQuery(tsdb, query);
tsquery.validateAndSetQuery();
// Build the queries for the parsed TSQuery
Query[] tsdbqueries = tsquery.buildQueries(tsdb);
List<String> options = null;
final String options_allow_list = tsdb.getConfig().getString(
"tsd.gnuplot.options.allowlist");
if (!Strings.isNullOrEmpty(options_allow_list)) {
String[] allow_list_strings = options_allow_list.split(";");
Set<String> allow_list = Sets.newHashSet();
for (int i = 0; i < allow_list_strings.length; i++) {
String allow = allow_list_strings[i];
if (allow != null) {
allow = URLDecoder.decode(allow.trim());
allow_list.add(allow);
}
}
options = query.getQueryStringParams("o");
for (int i = 0; i < options.size(); i++) {
if (!allow_list.contains(options.get(i))) {
throw new BadRequestException("Query option at index " + i
+ " was not in the allow list.");
}
}
}
if (options == null) {
options = new ArrayList<String>(tsdbqueries.length);
for (int i = 0; i < tsdbqueries.length; i++) {
options.add("");
}
} else if (options.size() != tsdbqueries.length) {
throw new BadRequestException(options.size() + " `o' parameters, but "
+ tsdbqueries.length + " `m' parameters.");
}
for (final Query tsdbquery : tsdbqueries) {
try {
tsdbquery.setStartTime(start_time);
} catch (IllegalArgumentException e) {
throw new BadRequestException("start time: " + e.getMessage());
}
try {
tsdbquery.setEndTime(end_time);
} catch (IllegalArgumentException e) {
throw new BadRequestException("end time: " + e.getMessage());
}
}
final Plot plot = new Plot(start_time, end_time,
DateTime.timezones.get(query.getQueryStringParam("tz")));
setPlotDimensions(query, plot);
setPlotParams(query, plot);
final int nqueries = tsdbqueries.length;
@SuppressWarnings("unchecked")
final HashSet<String>[] aggregated_tags = new HashSet[nqueries];
int npoints = 0;
for (int i = 0; i < nqueries; i++) {
try { // execute the TSDB query!
// XXX This is slow and will block Netty. TODO(tsuna): Don't block.
// TODO(tsuna): Optimization: run each query in parallel.
final DataPoints[] series = tsdbqueries[i].run();
for (final DataPoints datapoints : series) {
plot.add(datapoints, options.get(i));
aggregated_tags[i] = new HashSet<String>();
aggregated_tags[i].addAll(datapoints.getAggregatedTags());
npoints += datapoints.aggregatedSize();
}
} catch (RuntimeException e) {
logInfo(query, "Query failed (stack trace coming): "
+ tsdbqueries[i]);
throw e;
}
tsdbqueries[i] = null; // free()
}
tsdbqueries = null; // free()
if (query.hasQueryStringParam("ascii")) {
respondAsciiQuery(query, max_age, basepath, plot);
return;
}
final RunGnuplot rungnuplot = new RunGnuplot(query, max_age, plot, basepath,
aggregated_tags, npoints);
class ErrorCB implements Callback<Object, Exception> {
public Object call(final Exception e) throws Exception {
LOG.warn("Failed to retrieve global annotations: ", e);
throw e;
}
}
class GlobalCB implements Callback<Object, List<Annotation>> {
public Object call(final List<Annotation> global_annotations) throws Exception {
rungnuplot.plot.setGlobals(global_annotations);
execGnuplot(rungnuplot, query);
return null;
}
}
// Fetch global annotations, if needed
if (!tsquery.getNoAnnotations() && tsquery.getGlobalAnnotations()) {
Annotation.getGlobalAnnotations(tsdb, start_time, end_time)
.addCallback(new GlobalCB()).addErrback(new ErrorCB());
} else {
execGnuplot(rungnuplot, query);
}
}
|
[
"CWE-78"
] |
CVE-2020-35476
|
HIGH
| 7.5
|
OpenTSDB/opentsdb
|
doGraph
|
src/tsd/GraphHandler.java
|
b762338664c3ee6e3f773bc04da2a8af24a5c486
| 1
|
Analyze the following code function for security vulnerabilities
|
private void setHashTree(JSONArray hashTree) {
// 将引用转成复制
if (CollectionUtils.isNotEmpty(hashTree)) {
for (int i = 0; i < hashTree.size(); i++) {
JSONObject object = (JSONObject) hashTree.get(i);
String referenced = object.getString("referenced");
if (StringUtils.isNotBlank(referenced) && StringUtils.equals(referenced, "REF")) {
// 检测引用对象是否存在,若果不存在则改成复制对象
String refType = object.getString("refType");
if (StringUtils.isNotEmpty(refType)) {
if (refType.equals("CASE")) {
ApiTestCaseWithBLOBs bloBs = apiTestCaseService.get(object.getString("id"));
if (bloBs != null) {
object = JSON.parseObject(bloBs.getRequest());
object.put("id", bloBs.getId());
object.put("name", bloBs.getName());
hashTree.set(i, object);
}
} else {
ApiScenarioWithBLOBs bloBs = apiScenarioMapper.selectByPrimaryKey(object.getString("id"));
if (bloBs != null) {
object = JSON.parseObject(bloBs.getScenarioDefinition());
hashTree.set(i, object);
}
}
} else if ("scenario".equals(object.getString("type"))) {
ApiScenarioWithBLOBs bloBs = apiScenarioMapper.selectByPrimaryKey(object.getString("id"));
if (bloBs != null) {
object = JSON.parseObject(bloBs.getScenarioDefinition());
hashTree.set(i, object);
}
}
}
if (object != null && CollectionUtils.isNotEmpty(object.getJSONArray("hashTree"))) {
setHashTree(object.getJSONArray("hashTree"));
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHashTree
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
|
setHashTree
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
protected PropertyMetadata _getSetterInfo(DeserializationContext ctxt,
BeanProperty prop, PropertyMetadata metadata)
{
final AnnotationIntrospector intr = ctxt.getAnnotationIntrospector();
final DeserializationConfig config = ctxt.getConfig();
boolean needMerge = true;
Nulls valueNulls = null;
Nulls contentNulls = null;
// NOTE: compared to `POJOPropertyBuilder`, we only have access to creator
// parameter, not other accessors, so code bit simpler
AnnotatedMember prim = prop.getMember();
if (prim != null) {
// Ok, first: does property itself have something to say?
if (intr != null) {
JsonSetter.Value setterInfo = intr.findSetterInfo(prim);
if (setterInfo != null) {
valueNulls = setterInfo.nonDefaultValueNulls();
contentNulls = setterInfo.nonDefaultContentNulls();
}
}
// If not, config override?
// 25-Oct-2016, tatu: Either this, or type of accessor...
if (needMerge || (valueNulls == null) || (contentNulls == null)) {
ConfigOverride co = config.getConfigOverride(prop.getType().getRawClass());
JsonSetter.Value setterInfo = co.getSetterInfo();
if (setterInfo != null) {
if (valueNulls == null) {
valueNulls = setterInfo.nonDefaultValueNulls();
}
if (contentNulls == null) {
contentNulls = setterInfo.nonDefaultContentNulls();
}
}
}
}
if (needMerge || (valueNulls == null) || (contentNulls == null)) {
JsonSetter.Value setterInfo = config.getDefaultSetterInfo();
if (valueNulls == null) {
valueNulls = setterInfo.nonDefaultValueNulls();
}
if (contentNulls == null) {
contentNulls = setterInfo.nonDefaultContentNulls();
}
}
if ((valueNulls != null) || (contentNulls != null)) {
metadata = metadata.withNulls(valueNulls, contentNulls);
}
return metadata;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _getSetterInfo
File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_getSetterInfo
|
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
int getMaxIconDimensionForTest() {
return mMaxIconDimension;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMaxIconDimensionForTest
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
getMaxIconDimensionForTest
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCreate(Bundle savedInstanceState) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreate
File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
onCreate
|
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private void extrasToXml(XmlSerializer out, Bundle extras) throws java.io.IOException {
for (String key : extras.keySet()) {
out.startTag(null, "extra");
out.attribute(null, "name", key);
final Object value = extras.get(key);
if (value instanceof Long) {
out.attribute(null, "type", "long");
out.attribute(null, "value1", value.toString());
} else if (value instanceof Integer) {
out.attribute(null, "type", "integer");
out.attribute(null, "value1", value.toString());
} else if (value instanceof Boolean) {
out.attribute(null, "type", "boolean");
out.attribute(null, "value1", value.toString());
} else if (value instanceof Float) {
out.attribute(null, "type", "float");
out.attribute(null, "value1", value.toString());
} else if (value instanceof Double) {
out.attribute(null, "type", "double");
out.attribute(null, "value1", value.toString());
} else if (value instanceof String) {
out.attribute(null, "type", "string");
out.attribute(null, "value1", value.toString());
} else if (value instanceof Account) {
out.attribute(null, "type", "account");
out.attribute(null, "value1", ((Account)value).name);
out.attribute(null, "value2", ((Account)value).type);
}
out.endTag(null, "extra");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: extrasToXml
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
extrasToXml
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
private XDOM getStaticTitle(DocumentModelBridge document)
{
String documentName = document.getDocumentReference().getName();
if (defaultEntityReferenceProvider.getDefaultReference(EntityType.DOCUMENT).getName().equals(documentName)) {
// This document represents a space (it is the home page of a space). Use the space name instead.
documentName = document.getDocumentReference().getParent().getName();
}
return parseTitle(documentName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStaticTitle
File: xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/AbstractDocumentTitleDisplayer.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-46244
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getStaticTitle
|
xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/AbstractDocumentTitleDisplayer.java
|
11a9170dfe63e59f4066db67f84dbfce4ed619c6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean startNextMatchingActivity(IBinder callingActivity, Intent intent,
Bundle bOptions) {
// Refuse possible leaked file descriptors
if (intent != null && intent.hasFileDescriptors()) {
throw new IllegalArgumentException("File descriptors passed in Intent");
}
SafeActivityOptions options = SafeActivityOptions.fromBundle(bOptions);
synchronized (mGlobalLock) {
final ActivityRecord r = ActivityRecord.isInRootTaskLocked(callingActivity);
if (r == null) {
SafeActivityOptions.abort(options);
return false;
}
if (!r.attachedToProcess()) {
// The caller is not running... d'oh!
SafeActivityOptions.abort(options);
return false;
}
intent = new Intent(intent);
// The caller is not allowed to change the data.
intent.setDataAndType(r.intent.getData(), r.intent.getType());
// And we are resetting to find the next component...
intent.setComponent(null);
final boolean debug = ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);
ActivityInfo aInfo = null;
try {
List<ResolveInfo> resolves =
AppGlobals.getPackageManager().queryIntentActivities(
intent, r.resolvedType,
PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS,
UserHandle.getCallingUserId()).getList();
// Look for the original activity in the list...
final int N = resolves != null ? resolves.size() : 0;
for (int i = 0; i < N; i++) {
ResolveInfo rInfo = resolves.get(i);
if (rInfo.activityInfo.packageName.equals(r.packageName)
&& rInfo.activityInfo.name.equals(r.info.name)) {
// We found the current one... the next matching is
// after it.
i++;
if (i < N) {
aInfo = resolves.get(i).activityInfo;
}
if (debug) {
Slog.v(TAG, "Next matching activity: found current " + r.packageName
+ "/" + r.info.name);
Slog.v(TAG, "Next matching activity: next is " + ((aInfo == null)
? "null" : aInfo.packageName + "/" + aInfo.name));
}
break;
}
}
} catch (RemoteException e) {
}
if (aInfo == null) {
// Nobody who is next!
SafeActivityOptions.abort(options);
if (debug) Slog.d(TAG, "Next matching activity: nothing found");
return false;
}
intent.setComponent(new ComponentName(
aInfo.applicationInfo.packageName, aInfo.name));
intent.setFlags(intent.getFlags() & ~(Intent.FLAG_ACTIVITY_FORWARD_RESULT
| Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_MULTIPLE_TASK
| FLAG_ACTIVITY_NEW_TASK));
// Okay now we need to start the new activity, replacing the currently running activity.
// This is a little tricky because we want to start the new one as if the current one is
// finished, but not finish the current one first so that there is no flicker.
// And thus...
final boolean wasFinishing = r.finishing;
r.finishing = true;
// Propagate reply information over to the new activity.
final ActivityRecord resultTo = r.resultTo;
final String resultWho = r.resultWho;
final int requestCode = r.requestCode;
r.resultTo = null;
if (resultTo != null) {
resultTo.removeResultsLocked(r, resultWho, requestCode);
}
final long origId = Binder.clearCallingIdentity();
// TODO(b/64750076): Check if calling pid should really be -1.
final int res = getActivityStartController()
.obtainStarter(intent, "startNextMatchingActivity")
.setCaller(r.app.getThread())
.setResolvedType(r.resolvedType)
.setActivityInfo(aInfo)
.setResultTo(resultTo != null ? resultTo.token : null)
.setResultWho(resultWho)
.setRequestCode(requestCode)
.setCallingPid(-1)
.setCallingUid(r.launchedFromUid)
.setCallingPackage(r.launchedFromPackage)
.setCallingFeatureId(r.launchedFromFeatureId)
.setRealCallingPid(-1)
.setRealCallingUid(r.launchedFromUid)
.setActivityOptions(options)
.execute();
Binder.restoreCallingIdentity(origId);
r.finishing = wasFinishing;
if (res != ActivityManager.START_SUCCESS) {
return false;
}
return true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startNextMatchingActivity
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
startNextMatchingActivity
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
boolean check(TopicConfig c1, TopicConfig c2) {
return c1 == c2 || !(c1 == null || c2 == null)
&& nullSafeEqual(c1.getName(), c2.getName())
&& nullSafeEqual(c1.isGlobalOrderingEnabled(), c2.isGlobalOrderingEnabled())
&& nullSafeEqual(c1.isStatisticsEnabled(), c2.isStatisticsEnabled())
&& nullSafeEqual(c1.isMultiThreadingEnabled(), c2.isMultiThreadingEnabled())
&& nullSafeEqual(c1.getMessageListenerConfigs(), c2.getMessageListenerConfigs());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: check
File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
check
|
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void updateStage(Stage stage) {
final Stage previousStage = mUiStage;
mUiStage = stage;
updateUi();
// If the stage changed, announce the header for accessibility. This
// is a no-op when accessibility is disabled.
if (previousStage != stage) {
mLayout.announceForAccessibility(mLayout.getHeaderText());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateStage
File: src/com/android/settings/password/ChooseLockPassword.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
updateStage
|
src/com/android/settings/password/ChooseLockPassword.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getOnlineHelpUriCustom() {
if (m_onlineHelpUriCustom == null) {
return null;
}
StringBuffer result = new StringBuffer(m_onlineHelpUriCustom.length() + 4);
result.append("\"");
result.append(m_onlineHelpUriCustom);
result.append("\"");
return result.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOnlineHelpUriCustom
File: src/org/opencms/workplace/CmsDialog.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-4600
|
MEDIUM
| 4.3
|
alkacon/opencms-core
|
getOnlineHelpUriCustom
|
src/org/opencms/workplace/CmsDialog.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void destroy(ChannelSession channel) throws Exception {
if (future != null)
future.cancel(true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroy
File: server-core/src/main/java/io/onedev/server/git/GitSshCommand.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
destroy
|
server-core/src/main/java/io/onedev/server/git/GitSshCommand.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return mPackageName + "/" + mTag + " (userId=" + mUserId + ")";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21280
|
MEDIUM
| 5.5
|
android
|
toString
|
services/core/java/com/android/server/media/MediaSessionRecord.java
|
06e772e05514af4aa427641784c5eec39a892ed3
| 0
|
Analyze the following code function for security vulnerabilities
|
public BigTextStyle bigText(CharSequence cs) {
mBigText = safeCharSequence(cs);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bigText
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
bigText
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void cancelBroadcasts(Provider provider) {
if (DEBUG) {
Slog.i(TAG, "cancelBroadcasts() for " + provider);
}
if (provider.broadcast != null) {
mAlarmManager.cancel(provider.broadcast);
long token = Binder.clearCallingIdentity();
try {
provider.broadcast.cancel();
} finally {
Binder.restoreCallingIdentity(token);
}
provider.broadcast = null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancelBroadcasts
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
cancelBroadcasts
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(app.asBinder());
mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
reply.readException();
data.recycle();
reply.recycle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: releaseSomeActivities
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
releaseSomeActivities
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
final void setTimeMillis(CharSequence name, long value) {
set(name, fromTimeMillis(value));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTimeMillis
File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2019-16771
|
MEDIUM
| 5
|
line/armeria
|
setTimeMillis
|
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<Event> getEvents()
{
return this.events;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEvents
File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractDocumentSkinExtensionPlugin.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29206
|
MEDIUM
| 5.4
|
xwiki/xwiki-platform
|
getEvents
|
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractDocumentSkinExtensionPlugin.java
|
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLockPatternUtils = new LockPatternUtils(getActivity());
Intent intent = getActivity().getIntent();
if (!(getActivity() instanceof ChooseLockPassword)) {
throw new SecurityException("Fragment contained in wrong activity");
}
// Only take this argument into account if it belongs to the current profile.
mUserId = Utils.getUserIdFromBundle(getActivity(), intent.getExtras());
mIsManagedProfile = UserManager.get(getActivity()).isManagedProfile(mUserId);
mForFingerprint = intent.getBooleanExtra(
ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, false);
mForFace = intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FACE, false);
mForBiometrics = intent.getBooleanExtra(
ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS, false);
mPasswordType = intent.getIntExtra(
LockPatternUtils.PASSWORD_TYPE_KEY, PASSWORD_QUALITY_NUMERIC);
mUnificationProfileId = intent.getIntExtra(
EXTRA_KEY_UNIFICATION_PROFILE_ID, UserHandle.USER_NULL);
mMinComplexity = intent.getIntExtra(EXTRA_KEY_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_NONE);
mMinMetrics = intent.getParcelableExtra(EXTRA_KEY_MIN_METRICS);
if (mMinMetrics == null) mMinMetrics = new PasswordMetrics(CREDENTIAL_TYPE_NONE);
if (intent.getBooleanExtra(
ChooseLockSettingsHelper.EXTRA_KEY_FOR_CHANGE_CRED_REQUIRED_FOR_BOOT, false)) {
SaveAndFinishWorker w = new SaveAndFinishWorker();
final boolean required = getActivity().getIntent().getBooleanExtra(
EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true);
LockscreenCredential currentCredential = intent.getParcelableExtra(
ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD);
final LockPatternUtils utils = new LockPatternUtils(getActivity());
w.setBlocking(true);
w.setListener(this);
w.start(utils, required, false /* requestGatekeeperPassword */, currentCredential,
currentCredential, mUserId);
}
mTextChangedHandler = new TextChangedHandler();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreate
File: src/com/android/settings/password/ChooseLockPassword.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
onCreate
|
src/com/android/settings/password/ChooseLockPassword.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setUsageLimitDataLimit(long usageLimitDataLimit) {
mUsageLimitDataLimit = usageLimitDataLimit;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUsageLimitDataLimit
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
setUsageLimitDataLimit
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
LocusId getLocusId() {
return mLocusId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocusId
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
|
getLocusId
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private Subscriber<Object> buildSubscriber(NettyHttpRequest<?> request,
ChannelHandlerContext context,
RouteMatch<?> finalRoute) {
return new CompletionAwareSubscriber<Object>() {
Boolean alwaysAddContent = request.getContentType()
.map(type -> type.equals(MediaType.APPLICATION_FORM_URLENCODED_TYPE))
.orElse(false);
RouteMatch<?> routeMatch = finalRoute;
AtomicBoolean executed = new AtomicBoolean(false);
AtomicLong pressureRequested = new AtomicLong(0);
ConcurrentHashMap<String, UnicastProcessor> subjects = new ConcurrentHashMap<>();
ConcurrentHashMap<Integer, HttpDataReference> dataReferences = new ConcurrentHashMap<>();
ConversionService conversionService = ConversionService.SHARED;
Subscription s;
LongConsumer onRequest = (num) -> pressureRequested.updateAndGet((p) -> {
long newVal = p - num;
if (newVal < 0) {
s.request(num - p);
return 0;
} else {
return newVal;
}
});
Flowable processFlowable(Flowable flowable, Integer dataKey, boolean controlsFlow) {
if (controlsFlow) {
flowable = flowable.doOnRequest(onRequest);
}
return flowable
.doAfterTerminate(() -> {
if (controlsFlow) {
HttpDataReference dataReference = dataReferences.get(dataKey);
dataReference.destroy();
}
});
}
@Override
protected void doOnSubscribe(Subscription subscription) {
this.s = subscription;
subscription.request(1);
}
@Override
protected void doOnNext(Object message) {
boolean executed = this.executed.get();
if (message instanceof ByteBufHolder) {
if (message instanceof HttpData) {
HttpData data = (HttpData) message;
if (LOG.isTraceEnabled()) {
LOG.trace("Received HTTP Data for request [{}]: {}", request, message);
}
String name = data.getName();
Optional<Argument<?>> requiredInput = routeMatch.getRequiredInput(name);
if (requiredInput.isPresent()) {
Argument<?> argument = requiredInput.get();
Supplier<Object> value;
boolean isPublisher = Publishers.isConvertibleToPublisher(argument.getType());
boolean chunkedProcessing = false;
if (isPublisher) {
Integer dataKey = System.identityHashCode(data);
HttpDataReference dataReference = dataReferences.computeIfAbsent(dataKey, (key) -> {
return new HttpDataReference(data);
});
Argument typeVariable;
if (StreamingFileUpload.class.isAssignableFrom(argument.getType())) {
typeVariable = Argument.of(PartData.class);
} else {
typeVariable = argument.getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT);
}
Class typeVariableType = typeVariable.getType();
UnicastProcessor namedSubject = subjects.computeIfAbsent(name, (key) -> UnicastProcessor.create());
chunkedProcessing = PartData.class.equals(typeVariableType) ||
Publishers.isConvertibleToPublisher(typeVariableType) ||
ClassUtils.isJavaLangType(typeVariableType);
if (Publishers.isConvertibleToPublisher(typeVariableType)) {
boolean streamingFileUpload = StreamingFileUpload.class.isAssignableFrom(typeVariableType);
if (streamingFileUpload) {
typeVariable = Argument.of(PartData.class);
} else {
typeVariable = typeVariable.getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT);
}
dataReference.subject.getAndUpdate(subject -> {
if (subject == null) {
UnicastProcessor childSubject = UnicastProcessor.create();
Flowable flowable = processFlowable(childSubject, dataKey, true);
if (streamingFileUpload && data instanceof FileUpload) {
namedSubject.onNext(new NettyStreamingFileUpload(
(FileUpload) data,
serverConfiguration.getMultipart(),
ioExecutor,
flowable));
} else {
namedSubject.onNext(flowable);
}
return childSubject;
}
return subject;
});
}
UnicastProcessor subject = Optional.ofNullable(dataReference.subject.get()).orElse(namedSubject);
Object part = data;
if (chunkedProcessing) {
HttpDataReference.Component component = dataReference.addComponent((e) -> {
subject.onError(e);
s.cancel();
});
if (component == null) {
return;
}
part = new NettyPartData(dataReference, component);
}
if (data instanceof FileUpload &&
StreamingFileUpload.class.isAssignableFrom(argument.getType())) {
dataReference.upload.getAndUpdate(upload -> {
if (upload == null) {
return new NettyStreamingFileUpload(
(FileUpload) data,
serverConfiguration.getMultipart(),
ioExecutor,
processFlowable(subject, dataKey, true));
}
return upload;
});
}
Optional<?> converted = conversionService.convert(part, typeVariable);
converted.ifPresent(subject::onNext);
if (data.isCompleted() && chunkedProcessing) {
subject.onComplete();
}
value = () -> {
StreamingFileUpload upload = dataReference.upload.get();
if (upload != null) {
return upload;
} else {
return processFlowable(namedSubject, dataKey, dataReference.subject.get() == null);
}
};
} else {
if (data instanceof Attribute && !data.isCompleted()) {
request.addContent(data);
s.request(1);
return;
} else {
value = () -> {
if (data.refCnt() > 0) {
return data;
} else {
return null;
}
};
}
}
if (!executed) {
String argumentName = argument.getName();
if (!routeMatch.isSatisfied(argumentName)) {
routeMatch = routeMatch.fulfill(Collections.singletonMap(argumentName, value.get()));
}
if (isPublisher && chunkedProcessing) {
//accounting for the previous request
pressureRequested.incrementAndGet();
}
if (routeMatch.isExecutable() || message instanceof LastHttpContent) {
executeRoute();
executed = true;
}
}
if (alwaysAddContent) {
request.addContent(data);
}
if (!executed || !chunkedProcessing) {
s.request(1);
}
} else {
request.addContent(data);
s.request(1);
}
} else {
request.addContent((ByteBufHolder) message);
s.request(1);
}
} else {
((NettyHttpRequest) request).setBody(message);
s.request(1);
}
}
@Override
protected void doOnError(Throwable t) {
try {
s.cancel();
exceptionCaught(context, t);
} catch (Exception e) {
// should never happen
writeDefaultErrorResponse(context, request, e);
}
}
@Override
protected void doOnComplete() {
for (UnicastProcessor subject: subjects.values()) {
if (!subject.hasComplete()) {
subject.onComplete();
}
}
executeRoute();
}
private void executeRoute() {
if (executed.compareAndSet(false, true)) {
try {
routeMatch = prepareRouteForExecution(routeMatch, request);
routeMatch.execute();
} catch (Exception e) {
context.pipeline().fireExceptionCaught(e);
}
}
}
};
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2022-21700
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Use ConversionContext constants where possible instead of class (#2356)
Changes
-------
* Added ArgumentConversionContext constants in ConversionContext
* Replaced Argument.of and use of argument classes with
ConversionContext constants where possible
* Added getFirst method in ConvertibleMultiValues that accepts
ArgumentConversionContent parameter
Partially addresses issue #2355
Function: buildSubscriber
File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
Repository: micronaut-projects/micronaut-core
Fixed Code:
private Subscriber<Object> buildSubscriber(NettyHttpRequest<?> request,
ChannelHandlerContext context,
RouteMatch<?> finalRoute) {
return new CompletionAwareSubscriber<Object>() {
Boolean alwaysAddContent = request.getContentType()
.map(type -> type.equals(MediaType.APPLICATION_FORM_URLENCODED_TYPE))
.orElse(false);
RouteMatch<?> routeMatch = finalRoute;
AtomicBoolean executed = new AtomicBoolean(false);
AtomicLong pressureRequested = new AtomicLong(0);
ConcurrentHashMap<String, UnicastProcessor> subjects = new ConcurrentHashMap<>();
ConcurrentHashMap<Integer, HttpDataReference> dataReferences = new ConcurrentHashMap<>();
ConversionService conversionService = ConversionService.SHARED;
Subscription s;
LongConsumer onRequest = (num) -> pressureRequested.updateAndGet((p) -> {
long newVal = p - num;
if (newVal < 0) {
s.request(num - p);
return 0;
} else {
return newVal;
}
});
Flowable processFlowable(Flowable flowable, Integer dataKey, boolean controlsFlow) {
if (controlsFlow) {
flowable = flowable.doOnRequest(onRequest);
}
return flowable
.doAfterTerminate(() -> {
if (controlsFlow) {
HttpDataReference dataReference = dataReferences.get(dataKey);
dataReference.destroy();
}
});
}
@Override
protected void doOnSubscribe(Subscription subscription) {
this.s = subscription;
subscription.request(1);
}
@Override
protected void doOnNext(Object message) {
boolean executed = this.executed.get();
if (message instanceof ByteBufHolder) {
if (message instanceof HttpData) {
HttpData data = (HttpData) message;
if (LOG.isTraceEnabled()) {
LOG.trace("Received HTTP Data for request [{}]: {}", request, message);
}
String name = data.getName();
Optional<Argument<?>> requiredInput = routeMatch.getRequiredInput(name);
if (requiredInput.isPresent()) {
Argument<?> argument = requiredInput.get();
Supplier<Object> value;
boolean isPublisher = Publishers.isConvertibleToPublisher(argument.getType());
boolean chunkedProcessing = false;
if (isPublisher) {
Integer dataKey = System.identityHashCode(data);
HttpDataReference dataReference = dataReferences.computeIfAbsent(dataKey, (key) -> {
return new HttpDataReference(data);
});
Argument typeVariable;
if (StreamingFileUpload.class.isAssignableFrom(argument.getType())) {
typeVariable = ARGUMENT_PART_DATA;
} else {
typeVariable = argument.getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT);
}
Class typeVariableType = typeVariable.getType();
UnicastProcessor namedSubject = subjects.computeIfAbsent(name, (key) -> UnicastProcessor.create());
chunkedProcessing = PartData.class.equals(typeVariableType) ||
Publishers.isConvertibleToPublisher(typeVariableType) ||
ClassUtils.isJavaLangType(typeVariableType);
if (Publishers.isConvertibleToPublisher(typeVariableType)) {
boolean streamingFileUpload = StreamingFileUpload.class.isAssignableFrom(typeVariableType);
if (streamingFileUpload) {
typeVariable = ARGUMENT_PART_DATA;
} else {
typeVariable = typeVariable.getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT);
}
dataReference.subject.getAndUpdate(subject -> {
if (subject == null) {
UnicastProcessor childSubject = UnicastProcessor.create();
Flowable flowable = processFlowable(childSubject, dataKey, true);
if (streamingFileUpload && data instanceof FileUpload) {
namedSubject.onNext(new NettyStreamingFileUpload(
(FileUpload) data,
serverConfiguration.getMultipart(),
ioExecutor,
flowable));
} else {
namedSubject.onNext(flowable);
}
return childSubject;
}
return subject;
});
}
UnicastProcessor subject = Optional.ofNullable(dataReference.subject.get()).orElse(namedSubject);
Object part = data;
if (chunkedProcessing) {
HttpDataReference.Component component = dataReference.addComponent((e) -> {
subject.onError(e);
s.cancel();
});
if (component == null) {
return;
}
part = new NettyPartData(dataReference, component);
}
if (data instanceof FileUpload &&
StreamingFileUpload.class.isAssignableFrom(argument.getType())) {
dataReference.upload.getAndUpdate(upload -> {
if (upload == null) {
return new NettyStreamingFileUpload(
(FileUpload) data,
serverConfiguration.getMultipart(),
ioExecutor,
processFlowable(subject, dataKey, true));
}
return upload;
});
}
Optional<?> converted = conversionService.convert(part, typeVariable);
converted.ifPresent(subject::onNext);
if (data.isCompleted() && chunkedProcessing) {
subject.onComplete();
}
value = () -> {
StreamingFileUpload upload = dataReference.upload.get();
if (upload != null) {
return upload;
} else {
return processFlowable(namedSubject, dataKey, dataReference.subject.get() == null);
}
};
} else {
if (data instanceof Attribute && !data.isCompleted()) {
request.addContent(data);
s.request(1);
return;
} else {
value = () -> {
if (data.refCnt() > 0) {
return data;
} else {
return null;
}
};
}
}
if (!executed) {
String argumentName = argument.getName();
if (!routeMatch.isSatisfied(argumentName)) {
routeMatch = routeMatch.fulfill(Collections.singletonMap(argumentName, value.get()));
}
if (isPublisher && chunkedProcessing) {
//accounting for the previous request
pressureRequested.incrementAndGet();
}
if (routeMatch.isExecutable() || message instanceof LastHttpContent) {
executeRoute();
executed = true;
}
}
if (alwaysAddContent) {
request.addContent(data);
}
if (!executed || !chunkedProcessing) {
s.request(1);
}
} else {
request.addContent(data);
s.request(1);
}
} else {
request.addContent((ByteBufHolder) message);
s.request(1);
}
} else {
((NettyHttpRequest) request).setBody(message);
s.request(1);
}
}
@Override
protected void doOnError(Throwable t) {
try {
s.cancel();
exceptionCaught(context, t);
} catch (Exception e) {
// should never happen
writeDefaultErrorResponse(context, request, e);
}
}
@Override
protected void doOnComplete() {
for (UnicastProcessor subject: subjects.values()) {
if (!subject.hasComplete()) {
subject.onComplete();
}
}
executeRoute();
}
private void executeRoute() {
if (executed.compareAndSet(false, true)) {
try {
routeMatch = prepareRouteForExecution(routeMatch, request);
routeMatch.execute();
} catch (Exception e) {
context.pipeline().fireExceptionCaught(e);
}
}
}
};
}
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
buildSubscriber
|
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public HttpHeaders add(String name, Iterable<?> values) {
headers.addObject(name, values);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: add
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
add
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
public char next() throws JSONException {
int c;
if (this.usePrevious) {
this.usePrevious = false;
c = this.previous;
} else {
try {
c = this.reader.read();
} catch (IOException exception) {
throw new JSONException(exception);
}
}
if (c <= 0) { // End of stream
this.eof = true;
return 0;
}
this.incrementIndexes(c);
this.previous = (char) c;
return this.previous;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: next
File: src/main/java/org/json/JSONTokener.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2022-45690
|
HIGH
| 7.5
|
stleary/JSON-java
|
next
|
src/main/java/org/json/JSONTokener.java
|
7a124d857dc8da1165c87fa788e53359a317d0f7
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isNativeTitle() {
if(com.codename1.ui.Toolbar.isGlobalToolbar()) {
return false;
}
Form f = getCurrentForm();
boolean nativeCommand;
if(f != null){
nativeCommand = f.getMenuBar().getCommandBehavior() == Display.COMMAND_BEHAVIOR_NATIVE;
}else{
nativeCommand = getCommandBehavior() == Display.COMMAND_BEHAVIOR_NATIVE;
}
return hasActionBar() && nativeCommand;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNativeTitle
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
|
isNativeTitle
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public DocumentType getDoctype() {
return doc.getDoctype();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDoctype
File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
Repository: LoboEvolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000540
|
MEDIUM
| 6.8
|
LoboEvolution
|
getDoctype
|
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
|
9b75694cedfa4825d4a2330abf2719d470c654cd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseSubAnnotations(Method method, String classPath) {
final GetMapping getMapping = method.getAnnotation(GetMapping.class);
final PostMapping postMapping = method.getAnnotation(PostMapping.class);
final PutMapping putMapping = method.getAnnotation(PutMapping.class);
final DeleteMapping deleteMapping = method.getAnnotation(DeleteMapping.class);
final PatchMapping patchMapping = method.getAnnotation(PatchMapping.class);
if (getMapping != null) {
put(RequestMethod.GET, classPath, getMapping.value(), getMapping.params(), method);
}
if (postMapping != null) {
put(RequestMethod.POST, classPath, postMapping.value(), postMapping.params(), method);
}
if (putMapping != null) {
put(RequestMethod.PUT, classPath, putMapping.value(), putMapping.params(), method);
}
if (deleteMapping != null) {
put(RequestMethod.DELETE, classPath, deleteMapping.value(), deleteMapping.params(), method);
}
if (patchMapping != null) {
put(RequestMethod.PATCH, classPath, patchMapping.value(), patchMapping.params(), method);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseSubAnnotations
File: core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java
Repository: alibaba/nacos
The code follows secure coding practices.
|
[
"CWE-290"
] |
CVE-2021-29441
|
HIGH
| 7.5
|
alibaba/nacos
|
parseSubAnnotations
|
core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java
|
91d16023d91ea21a5e58722c751485a0b9bbeeb3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String capitalize(String s) {
if(s==null || s.length()==0) return s;
return Character.toUpperCase(s.charAt(0))+s.substring(1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: capitalize
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
|
capitalize
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate18(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
if (element.elementTextTrim("key").equals("LICENSE"))
element.detach();
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate18
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
migrate18
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public IQRequestHandler unregisterIQRequestHandler(String element, String namespace, IQ.Type type) {
final String key = XmppStringUtils.generateKey(element, namespace);
switch (type) {
case set:
synchronized (setIqRequestHandler) {
return setIqRequestHandler.remove(key);
}
case get:
synchronized (getIqRequestHandler) {
return getIqRequestHandler.remove(key);
}
default:
throw new IllegalArgumentException("Only IQ type of 'get' and 'set' allowed");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unregisterIQRequestHandler
File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
unregisterIQRequestHandler
|
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
public void loadArchive(XWikiContext context) throws XWikiException
{
if ((this.archive == null || this.archive.get() == null)) {
XWikiDocumentArchive arch;
// A document not comming from the database cannot have an archive stored in the database
if (this.isNew()) {
arch = new XWikiDocumentArchive(getId());
} else {
arch = getVersioningStore(context).getXWikiDocumentArchive(this, context);
}
// We are using a SoftReference which will allow the archive to be
// discarded by the Garbage collector as long as the context is closed (usually during
// the request)
this.archive = new SoftReference<>(arch);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadArchive
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
|
loadArchive
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getKeyguardDisabledFeatures(@Nullable ComponentName admin) {
return getKeyguardDisabledFeatures(admin, myUserId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getKeyguardDisabledFeatures
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
|
getKeyguardDisabledFeatures
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public Cursor rawQuery(String sql, String[] selectionArgs) {
return rawQueryWithFactory(null, sql, selectionArgs, null, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: rawQuery
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
rawQuery
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return "ChooserTargetServiceConnection{service="
+ mConnectedComponent + ", activity="
+ mOriginalTarget.getResolveInfo().activityInfo.toString() + "}";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: core/java/com/android/internal/app/ChooserActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-254",
"CWE-19"
] |
CVE-2016-3752
|
HIGH
| 7.5
|
android
|
toString
|
core/java/com/android/internal/app/ChooserActivity.java
|
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getNumberFromTextField() {
return mNumberField.getText().toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNumberFromTextField
File: src/com/android/phone/settings/fdn/EditFdnContactScreen.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-862"
] |
CVE-2023-35665
|
HIGH
| 7.8
|
android
|
getNumberFromTextField
|
src/com/android/phone/settings/fdn/EditFdnContactScreen.java
|
674039e70e1c5bf29b808899ac80c709acc82290
| 0
|
Analyze the following code function for security vulnerabilities
|
public Integer getYearlyVotes() {
if (yearlyVotes < 0) {
yearlyVotes = 0;
}
return yearlyVotes;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getYearlyVotes
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
|
getYearlyVotes
|
src/main/java/com/erudika/scoold/core/Profile.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<ActionReturnValue> runMultipleActions(ActionType actionType,
ArrayList<ActionParametersBase> multipleParams, boolean isRunOnlyIfAllValidationPass, boolean isWaitForResult) {
log.debug("Server: RunMultipleAction invoked! [amount of actions: {}]", multipleParams.size()); //$NON-NLS-1$
String correlationId = CorrelationIdTracker.getCorrelationId();
for (ActionParametersBase params : multipleParams) {
params.setSessionId(getEngineSessionId());
if (params.getCorrelationId() == null) {
params.setCorrelationId(correlationId);
}
}
List<ActionReturnValue> returnValues =
getBackend().runMultipleActions(actionType, multipleParams, isRunOnlyIfAllValidationPass, isWaitForResult);
return returnValues;
}
|
Vulnerability Classification:
- CWE: CWE-287
- CVE: CVE-2024-0822
- Severity: HIGH
- CVSS Score: 7.5
Description: Disable execution of CreateUserSession from GWT code
CreateUserSesssion should be executed only as a part of login flow, so
explicitly disable execution from GWT code.
Signed-off-by: Martin Perina <mperina@redhat.com>
Function: runMultipleActions
File: frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
Repository: oVirt/ovirt-engine
Fixed Code:
@Override
public List<ActionReturnValue> runMultipleActions(ActionType actionType,
ArrayList<ActionParametersBase> multipleParams, boolean isRunOnlyIfAllValidationPass, boolean isWaitForResult) {
log.debug("Server: RunMultipleAction invoked! [amount of actions: {}]", multipleParams.size()); //$NON-NLS-1$
// CreateUserSession should never be invoked from GWT code
if (actionType == ActionType.CreateUserSession) {
ActionReturnValue error = new ActionReturnValue();
error.setSucceeded(false);
error.setFault(new EngineFault(new RuntimeException("Command cannot be executed from client"))); //$NON-NLS-1$
return Arrays.asList(error);
}
String correlationId = CorrelationIdTracker.getCorrelationId();
for (ActionParametersBase params : multipleParams) {
params.setSessionId(getEngineSessionId());
if (params.getCorrelationId() == null) {
params.setCorrelationId(correlationId);
}
}
List<ActionReturnValue> returnValues =
getBackend().runMultipleActions(actionType, multipleParams, isRunOnlyIfAllValidationPass, isWaitForResult);
return returnValues;
}
|
[
"CWE-287"
] |
CVE-2024-0822
|
HIGH
| 7.5
|
oVirt/ovirt-engine
|
runMultipleActions
|
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
|
036f617316f6d7077cd213eb613eb4816e33d1fc
| 1
|
Analyze the following code function for security vulnerabilities
|
public void onBootCompleted() {
mBootCompleted = true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onBootCompleted
File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0813
|
MEDIUM
| 6.6
|
android
|
onBootCompleted
|
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
|
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
| 0
|
Analyze the following code function for security vulnerabilities
|
public View getIndicationArea() {
return mIndicationArea;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIndicationArea
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
getIndicationArea
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setRotationAnimationHint(int hint) {
mRotationAnimationHint = hint;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRotationAnimationHint
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
setRotationAnimationHint
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.