instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private Map convertRequestParamMap(Map params) {
Map result = new HashMap();
for (String key : (Set<String>) params.keySet()) {
key = StringEscapeUtils.escapeHtml(key);
String[] paramValue = (String[]) params.get(key);
if (paramValue.length == 1) {
result.put(key, paramValue[0]);
} else {
result.put(key, paramValue);
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertRequestParamMap
File: wflow-core/src/main/java/org/joget/apps/userview/service/UserviewService.java
Repository: jogetworkflow/jw-community
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-4560
|
MEDIUM
| 6.1
|
jogetworkflow/jw-community
|
convertRequestParamMap
|
wflow-core/src/main/java/org/joget/apps/userview/service/UserviewService.java
|
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
| 0
|
Analyze the following code function for security vulnerabilities
|
private Path prepareBundleSpoolDir() throws IOException {
final FileAttribute<Set<PosixFilePermission>> userOnlyPermission =
PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"));
Files.createDirectories(bundleDir, userOnlyPermission);
return Files.createTempDirectory(bundleDir, ".tmp." + nowTimestamp() + ".", userOnlyPermission);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: prepareBundleSpoolDir
File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-41044
|
LOW
| 3.8
|
Graylog2/graylog2-server
|
prepareBundleSpoolDir
|
graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
|
02b8792e6f4b829f0c1d87fcbf2d58b73458b938
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void warning(TransformerException exception) throws TransformerException {
throw exception;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: warning
File: hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-0265
|
HIGH
| 7.5
|
hazelcast
|
warning
|
hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java
|
4d6b666cd0291abd618c3b95cdbb51aa4208e748
| 0
|
Analyze the following code function for security vulnerabilities
|
public void stopAppSwitches() throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
reply.readException();
reply.recycle();
data.recycle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopAppSwitches
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
stopAppSwitches
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public WearableExtender setCancelLabel(CharSequence label) {
mCancelLabel = label;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCancelLabel
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setCancelLabel
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void drainWriterQueueToUnacknowledgedStanzas() {
List<Element> elements = new ArrayList<Element>(queue.size());
queue.drainTo(elements);
for (Element element : elements) {
if (element instanceof Stanza) {
unacknowledgedStanzas.add((Stanza) element);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: drainWriterQueueToUnacknowledgedStanzas
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
|
drainWriterQueueToUnacknowledgedStanzas
|
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public OnGoingLogicalCondition in(Collection<T> values) {
Condition conditionLocal = new InCondition<T>(selector, selector.generateParameter(values));
return getOnGoingLogicalCondition(conditionLocal);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: in
File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
Repository: xjodoin/torpedoquery
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2019-11343
|
HIGH
| 7.5
|
xjodoin/torpedoquery
|
in
|
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
|
3c20b874fba9cc2a78b9ace10208de1602b56c3f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateAdminCanGrantSensorsPermissionCache(@UserIdInt int userId) {
synchronized (getLockObject()) {
ActiveAdmin owner;
// If the user is affiliated the device (either a DO itself, or an affiliated PO),
// use mAdminCanGrantSensorsPermissions from the DO
if (isUserAffiliatedWithDeviceLocked(userId)) {
owner = getDeviceOwnerAdminLocked();
} else {
owner = getDeviceOrProfileOwnerAdminLocked(userId);
}
boolean canGrant = owner != null ? owner.mAdminCanGrantSensorsPermissions : false;
mPolicyCache.setAdminCanGrantSensorsPermissions(userId, canGrant);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateAdminCanGrantSensorsPermissionCache
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
|
updateAdminCanGrantSensorsPermissionCache
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
void addWindowLayoutReasons(@LayoutReason int reasons) {
mLayoutReasons |= reasons;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addWindowLayoutReasons
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
|
addWindowLayoutReasons
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public static final String fromMap(Map < String, String > params) {
StringBuilder strBulBuilder = new StringBuilder();
boolean first = true;
if (params != null && !params.isEmpty()) {
for (Entry<String, String> entry : params.entrySet()) {
if (!first) {
strBulBuilder.append(SEPARATOR);
}
strBulBuilder.append(entry.getKey() + "=" + entry.getValue());
first = false;
}
}
return strBulBuilder.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fromMap
File: ff4j-core/src/main/java/org/ff4j/utils/MappingUtil.java
Repository: ff4j
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-44262
|
CRITICAL
| 9.8
|
ff4j
|
fromMap
|
ff4j-core/src/main/java/org/ff4j/utils/MappingUtil.java
|
991df72725f78adbc413d9b0fbb676201f1882e0
| 0
|
Analyze the following code function for security vulnerabilities
|
private void execute(String[] sql, boolean stopOnError,
Handler<AsyncResult<List<String>>> replyHandler){
long s = System.nanoTime();
log.info("Executing multiple statements with id " + Arrays.hashCode(sql));
List<String> results = new ArrayList<>();
vertx.executeBlocking(dothis -> {
Connection connection = null;
Statement statement = null;
boolean error = false;
try {
/* this should be super user account that is in the config file */
connection = getStandaloneConnection(null, false);
connection.setAutoCommit(false);
statement = connection.createStatement();
for (int j = 0; j < sql.length; j++) {
try {
log.info("trying to execute: " + sql[j].substring(0, Math.min(sql[j].length()-1, 1000)));
if(sql[j].trim().toUpperCase().startsWith("COPY ")){
copyIn(sql[j], connection);
}
else{
statement.executeUpdate(sql[j]); //NOSONAR
}
log.info("Successfully executed: " + sql[j].substring(0, Math.min(sql[j].length()-1, 400)));
} catch (Exception e) {
results.add(sql[j]);
error = true;
log.error(e.getMessage(),e);
if(stopOnError){
break;
}
}
}
try {
if(error){
connection.rollback();
log.error("Rollback for: " + Arrays.hashCode(sql));
}
else{
connection.commit();
log.info("Successfully committed: " + Arrays.hashCode(sql));
}
} catch (Exception e) {
error = true;
log.error("Commit failed " + Arrays.hashCode(sql) + SPACE + e.getMessage(), e);
}
}
catch(Exception e){
log.error(e.getMessage(), e);
error = true;
}
finally {
try {
if(statement != null) statement.close();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
try {
if(connection != null) connection.close();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
if(error){
dothis.fail("error");
}
else{
dothis.complete();
}
}
}, done -> {
logTimer("execute", "" + Arrays.hashCode(sql), s);
replyHandler.handle(Future.succeededFuture(results));
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: execute
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
execute
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T> T unmarshal(final Class<T> clazz, final InputSource inputSource, final JAXBContext jaxbContext, boolean disableDOCTYPE) {
return unmarshal(clazz, inputSource, jaxbContext, VALIDATE_IF_POSSIBLE, disableDOCTYPE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unmarshal
File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-0871
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
unmarshal
|
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
|
3c17231714e3d55809efc580a05734ed530f9ad4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isRegisteredAttributionSource(@NonNull AttributionSourceState source) {
return mAttributionSourceRegistry
.isRegisteredAttributionSource(new AttributionSource(source));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRegisteredAttributionSource
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
isRegisteredAttributionSource
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setMeteredOverride(@MeteredOverride int meteredOverride) {
mMeteredOverride = meteredOverride;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMeteredOverride
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
|
setMeteredOverride
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private void copyFile(String source, File target) {
//Let's wrap the code to a runnable inner class to avoid NoClassDef on Option classes.
try {
new Runnable() {
@Override
public void run() {
File destination = target;
if (!destination.exists() && !destination.getParentFile().exists() && !destination.getParentFile().mkdirs()) {
throw KubernetesClientException.launderThrowable(new IOException("Failed to create directory: " + destination.getParentFile()));
}
if (destination.isDirectory()) {
String[] parts = source.split("\\/|\\\\");
String filename = parts[parts.length - 1];
destination = destination.toPath().resolve(filename).toFile();
}
try (InputStream is = readFile(source);
OutputStream os = new FileOutputStream(destination)) {
BlockingInputStreamPumper pumper = new BlockingInputStreamPumper(is, input -> {
try {
os.write(input);
} catch (IOException e) {
throw KubernetesClientException.launderThrowable(e);
}
}, () -> {
try {
os.flush();
} catch (Exception e) {
throw KubernetesClientException.launderThrowable(e);
}
});
pumper.run();
} catch (Exception e) {
throw KubernetesClientException.launderThrowable(e);
}
}
}.run();
} catch (NoClassDefFoundError e) {
throw new KubernetesClientException("Base64InputStream class is provided by commons-codec, an optional dependency. To use the read/copy functionality you must explicitly add this dependency to the classpath.");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyFile
File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
Repository: fabric8io/kubernetes-client
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-20218
|
MEDIUM
| 5.8
|
fabric8io/kubernetes-client
|
copyFile
|
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
|
325d67cc80b73f049a5d0cea4917c1f2709a8d86
| 0
|
Analyze the following code function for security vulnerabilities
|
private void abortExistingInflation(String key) {
if (mPendingNotifications.containsKey(key)) {
Entry entry = mPendingNotifications.get(key);
entry.abortTask();
mPendingNotifications.remove(key);
}
Entry addedEntry = mNotificationData.get(key);
if (addedEntry != null) {
addedEntry.abortTask();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: abortExistingInflation
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
|
abortExistingInflation
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
Info other = (Info) obj;
if (banner == null) {
if (other.banner != null)
return false;
} else if (!banner.equals(other.banner))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (version == null) {
if (other.version != null)
return false;
} else if (!version.equals(other.version))
return false;
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
File: base/common/src/main/java/org/dogtagpki/common/Info.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
equals
|
base/common/src/main/java/org/dogtagpki/common/Info.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isMarkedBlockedCandidate() {
return markedCandidate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isMarkedBlockedCandidate
File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
Repository: apache/activemq
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-3576
|
MEDIUM
| 5
|
apache/activemq
|
isMarkedBlockedCandidate
|
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
|
00921f2
| 0
|
Analyze the following code function for security vulnerabilities
|
private ObjectStreamClass readNewClassDesc(boolean unshared)
throws ClassNotFoundException, IOException {
// So read...() methods can be used by
// subclasses during readClassDescriptor()
primitiveData = input;
int oldHandle = descriptorHandle;
descriptorHandle = nextHandle();
ObjectStreamClass newClassDesc = readClassDescriptor();
registerObjectRead(newClassDesc, descriptorHandle, unshared);
descriptorHandle = oldHandle;
primitiveData = emptyStream;
// We need to map classDesc to class.
try {
newClassDesc.setClass(resolveClass(newClassDesc));
// Check SUIDs & base name of the class
verifyAndInit(newClassDesc);
} catch (ClassNotFoundException e) {
if (mustResolve) {
throw e;
// Just continue, the class may not be required
}
}
// Resolve the field signatures using the class loader of the
// resolved class
ObjectStreamField[] fields = newClassDesc.getLoadFields();
fields = (fields == null) ? ObjectStreamClass.NO_FIELDS : fields;
ClassLoader loader = newClassDesc.forClass() == null ? callerClassLoader
: newClassDesc.forClass().getClassLoader();
for (ObjectStreamField element : fields) {
element.resolve(loader);
}
// Consume unread class annotation data and TC_ENDBLOCKDATA
discardData();
checkedSetSuperClassDesc(newClassDesc, readClassDesc());
return newClassDesc;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readNewClassDesc
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
readNewClassDesc
|
luni/src/main/java/java/io/ObjectInputStream.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean removeListener(@NonNull OnMagnificationChangedListener listener) {
if (mListeners == null) {
return false;
}
synchronized (mLock) {
final int keyIndex = mListeners.indexOfKey(listener);
final boolean hasKey = keyIndex >= 0;
if (hasKey) {
mListeners.removeAt(keyIndex);
}
if (hasKey && mListeners.isEmpty()) {
// We just removed the last listener, so we don't need
// callbacks from the service anymore.
setMagnificationCallbackEnabled(false);
}
return hasKey;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeListener
File: core/java/android/accessibilityservice/AccessibilityService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3923
|
MEDIUM
| 4.3
|
android
|
removeListener
|
core/java/android/accessibilityservice/AccessibilityService.java
|
5f256310187b4ff2f13a7abb9afed9126facd7bc
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDebugApp(String packageName, boolean waitForDebugger,
boolean persistent) {
enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,
"setDebugApp()");
long ident = Binder.clearCallingIdentity();
try {
// Note that this is not really thread safe if there are multiple
// callers into it at the same time, but that's not a situation we
// care about.
if (persistent) {
final ContentResolver resolver = mContext.getContentResolver();
Settings.Global.putString(
resolver, Settings.Global.DEBUG_APP,
packageName);
Settings.Global.putInt(
resolver, Settings.Global.WAIT_FOR_DEBUGGER,
waitForDebugger ? 1 : 0);
}
synchronized (this) {
if (!persistent) {
mOrigDebugApp = mDebugApp;
mOrigWaitForDebugger = mWaitForDebugger;
}
mDebugApp = packageName;
mWaitForDebugger = waitForDebugger;
mDebugTransient = !persistent;
if (packageName != null) {
forceStopPackageLocked(packageName, -1, false, false, true, true,
false, UserHandle.USER_ALL, "set debug app");
}
}
} finally {
Binder.restoreCallingIdentity(ident);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDebugApp
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
|
setDebugApp
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void useAttributeFor(Class definedIn, String fieldName) {
if (attributeMapper == null) {
throw new com.thoughtworks.xstream.InitializationException("No "
+ AttributeMapper.class.getName()
+ " available");
}
attributeMapper.addAttributeFor(definedIn, fieldName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: useAttributeFor
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
useAttributeFor
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Node getFirstChild() {
return doc.getFirstChild();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFirstChild
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
|
getFirstChild
|
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
|
9b75694cedfa4825d4a2330abf2719d470c654cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onUnlockHintStarted() {
super.onUnlockHintStarted();
mNotificationStackScroller.setUnlockHintRunning(true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUnlockHintStarted
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
onUnlockHintStarted
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// Do nothing.
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTextChanged
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
onTextChanged
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getInputMethodWindowVisibleHeightLw() {
return mDockBottom - mCurBottom;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInputMethodWindowVisibleHeightLw
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
getInputMethodWindowVisibleHeightLw
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Alarms getAlarm(Integer scopeId, String keyword, int limit, int from, long startTB,
long endTB) throws IOException {
StringBuilder sql = new StringBuilder();
List<Object> parameters = new ArrayList<>(10);
sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where ");
sql.append(" 1=1 ");
if (Objects.nonNull(scopeId)) {
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
parameters.add(scopeId.intValue());
}
if (startTB != 0 && endTB != 0) {
sql.append(" and ").append(AlarmRecord.TIME_BUCKET).append(" >= ?");
parameters.add(startTB);
sql.append(" and ").append(AlarmRecord.TIME_BUCKET).append(" <= ?");
parameters.add(endTB);
}
if (!Strings.isNullOrEmpty(keyword)) {
sql.append(" and ").append(AlarmRecord.ALARM_MESSAGE).append(" like '%").append(keyword).append("%' ");
}
sql.append(" order by ").append(AlarmRecord.START_TIME).append(" desc ");
Alarms alarms = new Alarms();
try (Connection connection = client.getConnection()) {
try (ResultSet resultSet = client.executeQuery(connection, "select count(1) total from (select 1 " + sql.toString() + " )", parameters
.toArray(new Object[0]))) {
while (resultSet.next()) {
alarms.setTotal(resultSet.getInt("total"));
}
}
this.buildLimit(sql, from, limit);
try (ResultSet resultSet = client.executeQuery(connection, "select * " + sql.toString(), parameters.toArray(new Object[0]))) {
while (resultSet.next()) {
AlarmMessage message = new AlarmMessage();
message.setId(resultSet.getString(AlarmRecord.ID0));
message.setMessage(resultSet.getString(AlarmRecord.ALARM_MESSAGE));
message.setStartTime(resultSet.getLong(AlarmRecord.START_TIME));
message.setScope(Scope.Finder.valueOf(resultSet.getInt(AlarmRecord.SCOPE)));
message.setScopeId(resultSet.getInt(AlarmRecord.SCOPE));
alarms.getMsgs().add(message);
}
}
} catch (SQLException e) {
throw new IOException(e);
}
return alarms;
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2020-13921
- Severity: HIGH
- CVSS Score: 7.5
Description: fix fuzzy query sql injection
Function: getAlarm
File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2AlarmQueryDAO.java
Repository: apache/skywalking
Fixed Code:
@Override
public Alarms getAlarm(Integer scopeId, String keyword, int limit, int from, long startTB,
long endTB) throws IOException {
StringBuilder sql = new StringBuilder();
List<Object> parameters = new ArrayList<>(10);
sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where ");
sql.append(" 1=1 ");
if (Objects.nonNull(scopeId)) {
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
parameters.add(scopeId.intValue());
}
if (startTB != 0 && endTB != 0) {
sql.append(" and ").append(AlarmRecord.TIME_BUCKET).append(" >= ?");
parameters.add(startTB);
sql.append(" and ").append(AlarmRecord.TIME_BUCKET).append(" <= ?");
parameters.add(endTB);
}
if (!Strings.isNullOrEmpty(keyword)) {
sql.append(" and ").append(AlarmRecord.ALARM_MESSAGE).append(" like concat('%',?,'%') ");
parameters.add(keyword);
}
sql.append(" order by ").append(AlarmRecord.START_TIME).append(" desc ");
Alarms alarms = new Alarms();
try (Connection connection = client.getConnection()) {
try (ResultSet resultSet = client.executeQuery(connection, "select count(1) total from (select 1 " + sql.toString() + " )", parameters
.toArray(new Object[0]))) {
while (resultSet.next()) {
alarms.setTotal(resultSet.getInt("total"));
}
}
this.buildLimit(sql, from, limit);
try (ResultSet resultSet = client.executeQuery(connection, "select * " + sql.toString(), parameters.toArray(new Object[0]))) {
while (resultSet.next()) {
AlarmMessage message = new AlarmMessage();
message.setId(resultSet.getString(AlarmRecord.ID0));
message.setMessage(resultSet.getString(AlarmRecord.ALARM_MESSAGE));
message.setStartTime(resultSet.getLong(AlarmRecord.START_TIME));
message.setScope(Scope.Finder.valueOf(resultSet.getInt(AlarmRecord.SCOPE)));
message.setScopeId(resultSet.getInt(AlarmRecord.SCOPE));
alarms.getMsgs().add(message);
}
}
} catch (SQLException e) {
throw new IOException(e);
}
return alarms;
}
|
[
"CWE-89"
] |
CVE-2020-13921
|
HIGH
| 7.5
|
apache/skywalking
|
getAlarm
|
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2AlarmQueryDAO.java
|
ddb6d9a5019a9c1fe31c364485a4e4b5066fefc3
| 1
|
Analyze the following code function for security vulnerabilities
|
LibraryInfo findLibrary(String libraryName, String localePrefix, String contract, FacesContext ctx) {
LibraryInfo library = webappResourceHelper.findLibrary(libraryName, localePrefix, contract, ctx);
if (library == null) {
library = classpathResourceHelper.findLibrary(libraryName, localePrefix, contract, ctx);
}
if (library == null && contract == null) {
// FCAPUTO facelets in contracts should have been found by the webapphelper already
library = faceletWebappResourceHelper.findLibrary(libraryName, localePrefix, contract, ctx);
}
// if not library is found at this point, let the caller deal with it
return library;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findLibrary
File: impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-14371
|
MEDIUM
| 5
|
eclipse-ee4j/mojarra
|
findLibrary
|
impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
|
1b434748d9239f42eae8aa7d37d7a0930c061e24
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Collection find(Context context, UUID id) throws SQLException {
return collectionDAO.findByID(context, Collection.class, id);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: find
File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41189
|
HIGH
| 9
|
DSpace
|
find
|
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
|
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
| 0
|
Analyze the following code function for security vulnerabilities
|
public JSONObject put(String key, boolean value) throws JSONException {
return this.put(key, value ? Boolean.TRUE : Boolean.FALSE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: put
File: src/main/java/org/json/JSONObject.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-5072
|
HIGH
| 7.5
|
stleary/JSON-java
|
put
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public com.xpn.xwiki.api.Object addObjectFromRequest(String className) throws XWikiException
{
com.xpn.xwiki.api.Object obj = new com.xpn.xwiki.api.Object(
getDoc().addObjectFromRequest(className, getXWikiContext()), getXWikiContext());
updateAuthor();
return obj;
}
|
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/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
addObjectFromRequest
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setScenarioEnvGroupIdNull(String envGroupId) {
extApiScenarioMapper.setScenarioEnvGroupIdNull(envGroupId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setScenarioEnvGroupIdNull
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
|
setScenarioEnvGroupIdNull
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onSelectMenuInteraction(@NotNull SelectMenuInteractionEvent event) {
super.onSelectMenuInteraction(event);
if (event.getInteraction().getComponent().getId() == null ||
event.getGuild() == null)
return;
if (event.getMessage().getEmbeds().isEmpty() ||
event.getMessage().getEmbeds().get(0) == null ||
event.getInteraction().getSelectedOptions().isEmpty())
return;
if (event.getInteraction().getValues().isEmpty())
return;
switch (event.getInteraction().getComponent().getId()) {
case "setupActionMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "log" -> {
optionList.add(SelectOption.of("Setup", "logSetup"));
if (Main.getInstance().getSqlConnector().getSqlWorker().isLogSetup(event.getGuild().getId()))
optionList.add(SelectOption.of("Delete", "logDelete"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up our own Audit-Logging which provides all the Information over and Webhook into the Channel of your desire! " + "But ours is not the same as the default Auditions, ours gives your the ability to set what you want to be logged and what not! " + "We also allow you to log Voice Events!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupLogMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
case "welcome" -> {
optionList.add(SelectOption.of("Setup", "welcomeSetup"));
if (Main.getInstance().getSqlConnector().getSqlWorker().isWelcomeSetup(event.getGuild().getId()))
optionList.add(SelectOption.of("Delete", "welcomeDelete"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up our own Welcome-Messages!\nYou can choice the Welcome-Channel by your own and even configure the Message!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupWelcomeMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
case "news" -> {
optionList.add(SelectOption.of("Setup", "newsSetup"));
if (Main.getInstance().getSqlConnector().getSqlWorker().isNewsSetup(event.getGuild().getId()))
optionList.add(SelectOption.of("Delete", "newsDelete"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up our own Ree6-News!\nBy setting up Ree6-News on a specific channel you will get a Message in the given Channel, when ever Ree6 gets an update!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupNewsMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
case "autorole" -> {
embedBuilder.setDescription("You can set up our own Autorole-System!\nYou can select Roles that Users should get upon joining the Server!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(Button.link("https://cp.ree6.de", "Webinterface")).queue();
}
case "tempvoice" -> {
optionList.add(SelectOption.of("Setup", "tempVoiceSetup"));
if (Main.getInstance().getSqlConnector().getSqlWorker().isNewsSetup(event.getGuild().getId()))
optionList.add(SelectOption.of("Delete", "tempVoiceDelete"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up your own Temporal Voicechannel!\nBy setting up Temporal Voicechannel on a specific channel which will be used to create a new Voicechannel when ever someones joins into it!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupTempVoiceMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
case "statistics" -> {
optionList.add(SelectOption.of("Setup Member Statistics", "statisticsSetupMember"));
optionList.add(SelectOption.of("Setup Twitch Statistics", "statisticsSetupTwitch"));
optionList.add(SelectOption.of("Setup YouTube Statistics", "statisticsSetupYouTube"));
optionList.add(SelectOption.of("Setup Reddit Statistics", "statisticsSetupReddit"));
optionList.add(SelectOption.of("Setup Twitter Statistics", "statisticsSetupTwitter"));
optionList.add(SelectOption.of("Setup Instagram Statistics", "statisticsSetupInstagram"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up your own Statistic-channels!\nBy setting up Statistic-channels Ree6 will create new channels for each Statistic-Type that you setup!\nIf you want to get rid of a Statistic-Channel, just delete it!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupStatisticsMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
default -> {
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupStatisticsMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "statisticsSetupMember" -> {
embedBuilder.setDescription("Successfully setup the statistics channels for Member statistics!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
List<Category> categories = event.getGuild().getCategoriesByName("Statistics", true);
Category category;
if (categories.isEmpty()) {
category = event.getGuild().createCategory("Statistics").complete();
} else {
category = categories.get(0);
}
event.getGuild().loadMembers().onSuccess(members -> event.getGuild().createVoiceChannel("Overall Members: " + event.getGuild().getMemberCount(), category).queue(voiceChannel -> {
voiceChannel.getManager().setUserLimit(0).queue();
event.getGuild().createVoiceChannel("Real Members: " + members.stream().filter(member -> !member.getUser().isBot()).count(), category).queue(voiceChannel1 -> {
voiceChannel1.getManager().setUserLimit(0).queue();
event.getGuild().createVoiceChannel("Bot Members: " + members.stream().filter(member -> member.getUser().isBot()).count(), category).queue(voiceChannel2 -> {
voiceChannel2.getManager().setUserLimit(0).queue();
SQLResponse sqlResponse = Main.getInstance().getSqlConnector().getSqlWorker().getEntity(ChannelStats.class, "SELECT * FROM ChannelStats WHERE GID=?", event.getGuild().getId());
ChannelStats channelStats;
if (sqlResponse.isSuccess()) {
channelStats = (ChannelStats) sqlResponse.getEntity();
ChannelStats oldChannelStats = (ChannelStats) SQLUtil.cloneEntity(ChannelStats.class, channelStats);
if (channelStats.getMemberStatsChannelId() != null) {
VoiceChannel voiceChannel3 = event.getGuild().getVoiceChannelById(channelStats.getMemberStatsChannelId());
if (voiceChannel3 != null)
voiceChannel3.delete().queue();
}
if (channelStats.getRealMemberStatsChannelId() != null) {
VoiceChannel voiceChannel3 = event.getGuild().getVoiceChannelById(channelStats.getRealMemberStatsChannelId());
if (voiceChannel3 != null)
voiceChannel3.delete().queue();
}
if (channelStats.getBotMemberStatsChannelId() != null) {
VoiceChannel voiceChannel3 = event.getGuild().getVoiceChannelById(channelStats.getBotMemberStatsChannelId());
if (voiceChannel3 != null)
voiceChannel3.delete().queue();
}
channelStats.setMemberStatsChannelId(voiceChannel.getId());
channelStats.setRealMemberStatsChannelId(voiceChannel1.getId());
channelStats.setBotMemberStatsChannelId(voiceChannel2.getId());
Main.getInstance().getSqlConnector().getSqlWorker().updateEntity(oldChannelStats, channelStats, false);
} else {
channelStats = new ChannelStats(event.getGuild().getId(),
voiceChannel.getId(),
voiceChannel1.getId(),
voiceChannel2.getId(),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null);
Main.getInstance().getSqlConnector().getSqlWorker().saveEntity(channelStats);
}
});
});
}));
}
case "statisticsSetupTwitch" -> {
TextInput input = TextInput.create("twitchChannelName", "Twitch Channel Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the Twitch Channel name here!").build();
Modal modal = Modal.create("statisticsSetupTwitchModal", "Twitch Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
case "statisticsSetupYouTube" -> {
TextInput input = TextInput.create("youtubeChannelName", "YouTube Channel Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the YouTube Channel name here!").build();
Modal modal = Modal.create("statisticsSetupYouTubeModal", "YouTube Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
case "statisticsSetupReddit" -> {
TextInput input = TextInput.create("subredditName", "Subreddit Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the Subreddit name here!").build();
Modal modal = Modal.create("statisticsSetupRedditModal", "Reddit Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
case "statisticsSetupTwitter" -> {
TextInput input = TextInput.create("twitterName", "Twitter Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the Twitter name here!").build();
Modal modal = Modal.create("statisticsSetupTwitterModal", "Twitter Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
case "statisticsSetupInstagram" -> {
TextInput input = TextInput.create("instagramName", "Instagram Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the Instagram name here!").build();
Modal modal = Modal.create("statisticsSetupInstagramModal", "Instagram Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupTempVoicechannel" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
VoiceChannel voiceChannel = event.getGuild().getVoiceChannelById(event.getInteraction().getValues().get(0));
if (voiceChannel != null) {
Main.getInstance().getSqlConnector().getSqlWorker().saveEntity(new TemporalVoicechannel(event.getGuild().getId(), voiceChannel.getId()));
embedBuilder.setDescription("Successfully changed the Temporal Voicechannel, nice work!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
} else {
embedBuilder.setDescription("The given Channel doesn't exists, how did you select it? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
case "setupTempVoiceMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "tempVoiceSetup" -> {
for (VoiceChannel channel : event.getGuild().getVoiceChannels()) {
optionList.add(SelectOption.of(channel.getName(), channel.getId()));
}
embedBuilder.setDescription("Which Channel do you want to use as Temporal-Voicechannel?");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupTempVoicechannel", "Select a Channel!", 1, 1, false, optionList)).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupLogMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "logSetup" -> {
for (TextChannel channel : event.getGuild().getTextChannels()) {
optionList.add(SelectOption.of(channel.getName(), channel.getId()));
}
embedBuilder.setDescription("Which Channel do you want to use as Logging-Channel?");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupLogChannel", "Select a Channel!", 1, 1, false, optionList)).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupLogChannel" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
TextChannel textChannel = event.getGuild().getTextChannelById(event.getInteraction().getValues().get(0));
if (textChannel != null) {
textChannel.createWebhook("Ree6-Logs").queue(webhook -> {
Main.getInstance().getSqlConnector().getSqlWorker().setLogWebhook(event.getGuild().getId(), webhook.getId(), webhook.getToken());
embedBuilder.setDescription("Successfully changed the Logging Channel, nice work!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
});
} else {
embedBuilder.setDescription("The given Channel doesn't exists, how did you select it? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
case "setupWelcomeMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "welcomeSetup" -> {
for (TextChannel channel : event.getGuild().getTextChannels()) {
optionList.add(SelectOption.of(channel.getName(), channel.getId()));
}
embedBuilder.setDescription("Which Channel do you want to use as Welcome-Channel?");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupWelcomeChannel", "Select a Channel!", 1, 1, false, optionList)).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupWelcomeChannel" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
TextChannel textChannel = event.getGuild().getTextChannelById(event.getInteraction().getValues().get(0));
if (textChannel != null) {
textChannel.createWebhook("Ree6-Welcome").queue(webhook -> {
Main.getInstance().getSqlConnector().getSqlWorker().setWelcomeWebhook(event.getGuild().getId(), webhook.getId(), webhook.getToken());
embedBuilder.setDescription("Successfully changed the Welcome-Channel, nice work!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
});
} else {
embedBuilder.setDescription("The given Channel doesn't exists, how did you select it? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
case "setupNewsMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "newsSetup" -> {
for (TextChannel channel : event.getGuild().getTextChannels()) {
optionList.add(SelectOption.of(channel.getName(), channel.getId()));
}
embedBuilder.setDescription("Which Channel do you want to use as News-Channel?");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupNewsChannel", "Select a Channel!", 1, 1, false, optionList)).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupNewsChannel" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
TextChannel textChannel = event.getGuild().getTextChannelById(event.getInteraction().getValues().get(0));
if (textChannel != null) {
textChannel.createWebhook("Ree6-News").queue(webhook -> {
Main.getInstance().getSqlConnector().getSqlWorker().setNewsWebhook(event.getGuild().getId(), webhook.getId(), webhook.getToken());
embedBuilder.setDescription("Successfully changed the News-Channel, nice work!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
});
} else {
embedBuilder.setDescription("The given Channel doesn't exists, how did you select it? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null) return;
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
|
Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2022-39302
- Severity: MEDIUM
- CVSS Score: 5.4
Description: Removed News-Channel.
Fixed Cross-Server Channel Exploit.
Fixed Temporal-Voice setup.
Function: onSelectMenuInteraction
File: src/main/java/de/presti/ree6/events/OtherEvents.java
Repository: Ree6-Applications/Ree6
Fixed Code:
@Override
public void onSelectMenuInteraction(@NotNull SelectMenuInteractionEvent event) {
super.onSelectMenuInteraction(event);
if (event.getInteraction().getComponent().getId() == null ||
event.getGuild() == null)
return;
if (event.getMessage().getEmbeds().isEmpty() ||
event.getMessage().getEmbeds().get(0) == null ||
event.getInteraction().getSelectedOptions().isEmpty())
return;
if (event.getInteraction().getValues().isEmpty())
return;
switch (event.getInteraction().getComponent().getId()) {
case "setupActionMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "log" -> {
optionList.add(SelectOption.of("Setup", "logSetup"));
if (Main.getInstance().getSqlConnector().getSqlWorker().isLogSetup(event.getGuild().getId()))
optionList.add(SelectOption.of("Delete", "logDelete"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up our own Audit-Logging which provides all the Information over and Webhook into the Channel of your desire! " + "But ours is not the same as the default Auditions, ours gives your the ability to set what you want to be logged and what not! " + "We also allow you to log Voice Events!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupLogMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
case "welcome" -> {
optionList.add(SelectOption.of("Setup", "welcomeSetup"));
if (Main.getInstance().getSqlConnector().getSqlWorker().isWelcomeSetup(event.getGuild().getId()))
optionList.add(SelectOption.of("Delete", "welcomeDelete"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up our own Welcome-Messages!\nYou can choice the Welcome-Channel by your own and even configure the Message!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupWelcomeMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
case "autorole" -> {
embedBuilder.setDescription("You can set up our own Autorole-System!\nYou can select Roles that Users should get upon joining the Server!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(Button.link("https://cp.ree6.de", "Webinterface")).queue();
}
case "tempvoice" -> {
optionList.add(SelectOption.of("Setup", "tempVoiceSetup"));
if (Main.getInstance().getSqlConnector().getSqlWorker().getEntity(TemporalVoicechannel.class, "SELECT * FROM TemporalVoicechannel WHERE GID=?", event.getGuild().getId()).isSuccess())
optionList.add(SelectOption.of("Delete", "tempVoiceDelete"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up your own Temporal Voicechannel!\nBy setting up Temporal Voicechannel on a specific channel which will be used to create a new Voicechannel when ever someones joins into it!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupTempVoiceMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
case "statistics" -> {
optionList.add(SelectOption.of("Setup Member Statistics", "statisticsSetupMember"));
optionList.add(SelectOption.of("Setup Twitch Statistics", "statisticsSetupTwitch"));
optionList.add(SelectOption.of("Setup YouTube Statistics", "statisticsSetupYouTube"));
optionList.add(SelectOption.of("Setup Reddit Statistics", "statisticsSetupReddit"));
optionList.add(SelectOption.of("Setup Twitter Statistics", "statisticsSetupTwitter"));
optionList.add(SelectOption.of("Setup Instagram Statistics", "statisticsSetupInstagram"));
optionList.add(SelectOption.of("Back to Menu", "backToSetupMenu"));
embedBuilder.setDescription("You can set up your own Statistic-channels!\nBy setting up Statistic-channels Ree6 will create new channels for each Statistic-Type that you setup!\nIf you want to get rid of a Statistic-Channel, just delete it!");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupStatisticsMenu", "Select your Action", 1, 1, false, optionList)).queue();
}
default -> {
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupStatisticsMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "statisticsSetupMember" -> {
embedBuilder.setDescription("Successfully setup the statistics channels for Member statistics!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
List<Category> categories = event.getGuild().getCategoriesByName("Statistics", true);
Category category;
if (categories.isEmpty()) {
category = event.getGuild().createCategory("Statistics").complete();
} else {
category = categories.get(0);
}
event.getGuild().loadMembers().onSuccess(members -> event.getGuild().createVoiceChannel("Overall Members: " + event.getGuild().getMemberCount(), category).queue(voiceChannel -> {
voiceChannel.getManager().setUserLimit(0).queue();
event.getGuild().createVoiceChannel("Real Members: " + members.stream().filter(member -> !member.getUser().isBot()).count(), category).queue(voiceChannel1 -> {
voiceChannel1.getManager().setUserLimit(0).queue();
event.getGuild().createVoiceChannel("Bot Members: " + members.stream().filter(member -> member.getUser().isBot()).count(), category).queue(voiceChannel2 -> {
voiceChannel2.getManager().setUserLimit(0).queue();
SQLResponse sqlResponse = Main.getInstance().getSqlConnector().getSqlWorker().getEntity(ChannelStats.class, "SELECT * FROM ChannelStats WHERE GID=?", event.getGuild().getId());
ChannelStats channelStats;
if (sqlResponse.isSuccess()) {
channelStats = (ChannelStats) sqlResponse.getEntity();
ChannelStats oldChannelStats = (ChannelStats) SQLUtil.cloneEntity(ChannelStats.class, channelStats);
if (channelStats.getMemberStatsChannelId() != null) {
VoiceChannel voiceChannel3 = event.getGuild().getVoiceChannelById(channelStats.getMemberStatsChannelId());
if (voiceChannel3 != null)
voiceChannel3.delete().queue();
}
if (channelStats.getRealMemberStatsChannelId() != null) {
VoiceChannel voiceChannel3 = event.getGuild().getVoiceChannelById(channelStats.getRealMemberStatsChannelId());
if (voiceChannel3 != null)
voiceChannel3.delete().queue();
}
if (channelStats.getBotMemberStatsChannelId() != null) {
VoiceChannel voiceChannel3 = event.getGuild().getVoiceChannelById(channelStats.getBotMemberStatsChannelId());
if (voiceChannel3 != null)
voiceChannel3.delete().queue();
}
channelStats.setMemberStatsChannelId(voiceChannel.getId());
channelStats.setRealMemberStatsChannelId(voiceChannel1.getId());
channelStats.setBotMemberStatsChannelId(voiceChannel2.getId());
Main.getInstance().getSqlConnector().getSqlWorker().updateEntity(oldChannelStats, channelStats, false);
} else {
channelStats = new ChannelStats(event.getGuild().getId(),
voiceChannel.getId(),
voiceChannel1.getId(),
voiceChannel2.getId(),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null);
Main.getInstance().getSqlConnector().getSqlWorker().saveEntity(channelStats);
}
});
});
}));
}
case "statisticsSetupTwitch" -> {
TextInput input = TextInput.create("twitchChannelName", "Twitch Channel Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the Twitch Channel name here!").build();
Modal modal = Modal.create("statisticsSetupTwitchModal", "Twitch Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
case "statisticsSetupYouTube" -> {
TextInput input = TextInput.create("youtubeChannelName", "YouTube Channel Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the YouTube Channel name here!").build();
Modal modal = Modal.create("statisticsSetupYouTubeModal", "YouTube Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
case "statisticsSetupReddit" -> {
TextInput input = TextInput.create("subredditName", "Subreddit Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the Subreddit name here!").build();
Modal modal = Modal.create("statisticsSetupRedditModal", "Reddit Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
case "statisticsSetupTwitter" -> {
TextInput input = TextInput.create("twitterName", "Twitter Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the Twitter name here!").build();
Modal modal = Modal.create("statisticsSetupTwitterModal", "Twitter Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
case "statisticsSetupInstagram" -> {
TextInput input = TextInput.create("instagramName", "Instagram Name", TextInputStyle.SHORT).setMinLength(1).setMaxLength(50).setRequired(true).setPlaceholder("Enter the Instagram name here!").build();
Modal modal = Modal.create("statisticsSetupInstagramModal", "Instagram Statistic Channel").addActionRow(input).build();
event.replyModal(modal).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupTempVoicechannel" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
VoiceChannel voiceChannel = event.getGuild().getVoiceChannelById(event.getInteraction().getValues().get(0));
if (voiceChannel != null) {
Main.getInstance().getSqlConnector().getSqlWorker().saveEntity(new TemporalVoicechannel(event.getGuild().getId(), voiceChannel.getId()));
embedBuilder.setDescription("Successfully changed the Temporal Voicechannel, nice work!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
} else {
embedBuilder.setDescription("The given Channel doesn't exists, how did you select it? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
case "setupTempVoiceMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "tempVoiceSetup" -> {
for (VoiceChannel channel : event.getGuild().getVoiceChannels()) {
optionList.add(SelectOption.of(channel.getName(), channel.getId()));
}
embedBuilder.setDescription("Which Channel do you want to use as Temporal-Voicechannel?");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupTempVoicechannel", "Select a Channel!", 1, 1, false, optionList)).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupLogMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "logSetup" -> {
for (TextChannel channel : event.getGuild().getTextChannels()) {
optionList.add(SelectOption.of(channel.getName(), channel.getId()));
}
embedBuilder.setDescription("Which Channel do you want to use as Logging-Channel?");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupLogChannel", "Select a Channel!", 1, 1, false, optionList)).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupLogChannel" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
TextChannel textChannel = event.getGuild().getTextChannelById(event.getInteraction().getValues().get(0));
if (textChannel != null) {
textChannel.createWebhook("Ree6-Logs").queue(webhook -> {
Main.getInstance().getSqlConnector().getSqlWorker().setLogWebhook(event.getGuild().getId(), webhook.getId(), webhook.getToken());
embedBuilder.setDescription("Successfully changed the Logging Channel, nice work!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
});
} else {
embedBuilder.setDescription("The given Channel doesn't exists, how did you select it? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
case "setupWelcomeMenu" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
List<SelectOption> optionList = new ArrayList<>();
switch (event.getInteraction().getValues().get(0)) {
case "backToSetupMenu" -> sendDefaultChoice(event);
case "welcomeSetup" -> {
for (TextChannel channel : event.getGuild().getTextChannels()) {
optionList.add(SelectOption.of(channel.getName(), channel.getId()));
}
embedBuilder.setDescription("Which Channel do you want to use as Welcome-Channel?");
event.editMessageEmbeds(embedBuilder.build()).setActionRow(new SelectMenuImpl("setupWelcomeChannel", "Select a Channel!", 1, 1, false, optionList)).queue();
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null)
return;
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
case "setupWelcomeChannel" -> {
if (checkPerms(event.getMember(), event.getChannel())) {
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
TextChannel textChannel = event.getGuild().getTextChannelById(event.getInteraction().getValues().get(0));
if (textChannel != null) {
textChannel.createWebhook("Ree6-Welcome").queue(webhook -> {
Main.getInstance().getSqlConnector().getSqlWorker().setWelcomeWebhook(event.getGuild().getId(), webhook.getId(), webhook.getToken());
embedBuilder.setDescription("Successfully changed the Welcome-Channel, nice work!");
embedBuilder.setColor(Color.GREEN);
event.editMessageEmbeds(embedBuilder.build()).setComponents(new ArrayList<>()).queue();
});
} else {
embedBuilder.setDescription("The given Channel doesn't exists, how did you select it? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
default -> {
if (event.getMessage().getEmbeds().isEmpty() || event.getMessage().getEmbeds().get(0) == null) return;
EmbedBuilder embedBuilder = new EmbedBuilder(event.getMessage().getEmbeds().get(0));
embedBuilder.setDescription("You somehow selected a Invalid Option? Are you a Wizard?");
event.editMessageEmbeds(embedBuilder.build()).queue();
}
}
}
|
[
"CWE-863"
] |
CVE-2022-39302
|
MEDIUM
| 5.4
|
Ree6-Applications/Ree6
|
onSelectMenuInteraction
|
src/main/java/de/presti/ree6/events/OtherEvents.java
|
459b5bc24f0ea27e50031f563373926e94b9aa0a
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void appNotRespondingViaProvider(IBinder connection) {
enforceCallingPermission(
android.Manifest.permission.REMOVE_TASKS, "appNotRespondingViaProvider()");
final ContentProviderConnection conn = (ContentProviderConnection) connection;
if (conn == null) {
Slog.w(TAG, "ContentProviderConnection is null");
return;
}
final ProcessRecord host = conn.provider.proc;
if (host == null) {
Slog.w(TAG, "Failed to find hosting ProcessRecord");
return;
}
final long token = Binder.clearCallingIdentity();
try {
appNotResponding(host, null, null, false, "ContentProvider not responding");
} finally {
Binder.restoreCallingIdentity(token);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appNotRespondingViaProvider
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
appNotRespondingViaProvider
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@IntRange(from = -1)
public int getLookasideSlotSize() {
return mLookasideSlotSize;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLookasideSlotSize
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
|
getLookasideSlotSize
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setClientKeyEntry(PrivateKey privateKey, X509Certificate clientCertificate) {
if (clientCertificate != null) {
if (clientCertificate.getBasicConstraints() != -1) {
throw new IllegalArgumentException("Cannot be a CA certificate");
}
if (privateKey == null) {
throw new IllegalArgumentException("Client cert without a private key");
}
if (privateKey.getEncoded() == null) {
throw new IllegalArgumentException("Private key cannot be encoded");
}
}
mClientPrivateKey = privateKey;
mClientCertificate = clientCertificate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setClientKeyEntry
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3897
|
MEDIUM
| 4.3
|
android
|
setClientKeyEntry
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
public AdministrativeMonitor getAdministrativeMonitor(String id) {
for (AdministrativeMonitor m : administrativeMonitors)
if(m.id.equals(id))
return m;
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAdministrativeMonitor
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getAdministrativeMonitor
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private void onUserConnectChoiceRemove(String choiceKey) {
mProviders.values().stream()
.filter(provider -> TextUtils.equals(provider.getConnectChoice(), choiceKey))
.forEach(provider -> {
provider.setUserConnectChoice(null, 0);
});
mWifiConfigManager.saveToStore(true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserConnectChoiceRemove
File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
onUserConnectChoiceRemove
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
public DataKeyMapper<T> getKeyMapper() {
return keyMapper;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getKeyMapper
File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2021-33609
|
MEDIUM
| 4
|
vaadin/framework
|
getKeyMapper
|
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
|
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public URL getTemplate(String name) {
return classLoader.getResource(templateRoot + name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTemplate
File: services/src/main/java/org/keycloak/theme/ClassLoaderTheme.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-3856
|
MEDIUM
| 4.3
|
keycloak
|
getTemplate
|
services/src/main/java/org/keycloak/theme/ClassLoaderTheme.java
|
73f0474008e1bebd0733e62a22aceda9e5de6743
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public long getDuration() {
return mDuration;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDuration
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
|
getDuration
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String display(String fieldname, String type, BaseObject obj, String wrappingSyntaxId, XWikiContext context)
{
return display(fieldname, type, "", obj, wrappingSyntaxId, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: display
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
|
display
|
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 static int getBitmaskForTech(int radioTech) {
if (radioTech >= 1) {
return (1 << (radioTech - 1));
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBitmaskForTech
File: src/com/android/settings/network/apn/ApnEditor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40125
|
HIGH
| 7.8
|
android
|
getBitmaskForTech
|
src/com/android/settings/network/apn/ApnEditor.java
|
63d464c3fa5c7b9900448fef3844790756e557eb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public long getPacketReplyTimeout() {
return packetReplyTimeout;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPacketReplyTimeout
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
|
getPacketReplyTimeout
|
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<StackInfo> getAllStackInfos() throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllStackInfos
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getAllStackInfos
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setReadTimeout(int readTimeout) {
this.readTimeout = readTimeout;
httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setReadTimeout
File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setReadTimeout
|
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setServerVariables(Map<String, String> serverVariables) {
this.serverVariables = serverVariables;
updateBasePath();
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setServerVariables
File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setServerVariables
|
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public UserHandle getCurrentUserHandle() {
return new UserHandle(mCurrentUserId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentUserHandle
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
|
getCurrentUserHandle
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<Void> internalRemoveMaxConsumers() {
return getTopicPoliciesAsyncWithRetry(topicName)
.thenCompose(op -> {
if (!op.isPresent()) {
return CompletableFuture.completedFuture(null);
}
op.get().setMaxConsumerPerTopic(null);
return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, op.get());
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalRemoveMaxConsumers
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalRemoveMaxConsumers
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
public void doScriptText(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
doScript(req, rsp, req.getView(this, "_scriptText.jelly"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doScriptText
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
doScriptText
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setPackageAskScreenCompat(String packageName, boolean ask) {
mAmInternal.enforceCallingPermission(android.Manifest.permission.SET_SCREEN_COMPATIBILITY,
"setPackageAskScreenCompat");
synchronized (mGlobalLock) {
mCompatModePackages.setPackageAskCompatModeLocked(packageName, ask);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPackageAskScreenCompat
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
|
setPackageAskScreenCompat
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Object createCollection(Class type) {
return super.createCollection(this.type != null ? this.type : type);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createCollection
File: xstream/src/java/com/thoughtworks/xstream/converters/collections/CollectionConverter.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
createCollection
|
xstream/src/java/com/thoughtworks/xstream/converters/collections/CollectionConverter.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ArrayList<Field> getTagsFields(String structureInode) {
ArrayList<Field> tagFields = new ArrayList<Field>();
List<Field> listFields = FieldsCache.getFieldsByStructureInode(structureInode);
for (Field f : listFields) {
if (f.getFieldType().equals(Field.FieldType.TAG.toString())) {
tagFields.add(f);
}
}
return tagFields;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTagsFields
File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
getTagsFields
|
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequestMapping({ "/", "/user" })
public String getUser(Model model)
{
// search for the user and put the user entry and attributes into the model
String username = SecurityContextHolder.getContext().getAuthentication()
.getName();
try
{
Entry entry = getUserEntry();
populateUserModel(username, entry, model);
// insert password requirements to use in the user view
model.addAttribute("passwordRequirements",
getPasswordRequirements(entry.getDN()));
return "user";
}
catch(LDAPException e)
{
// if we can't get the entry, just display the error page
model.addAttribute("error", e.getMessage());
return "error";
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUser
File: src/main/java/com/unboundid/webapp/ssam/SSAMController.java
Repository: pingidentity/ssam
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-25084
|
MEDIUM
| 4
|
pingidentity/ssam
|
getUser
|
src/main/java/com/unboundid/webapp/ssam/SSAMController.java
|
f64b10d63bb19ca2228b0c2d561a1a6e5a3bf251
| 0
|
Analyze the following code function for security vulnerabilities
|
private String useValueOfVarRecord(String value) {
if (varRecord == null || StringUtils.isBlank(value)) return value;
if (!value.matches(PATT_FIELDVAR)) return value;
String fieldName = value.substring(2, value.length() - 1);
Field field = MetadataHelper.getLastJoinField(rootEntity, fieldName);
if (field == null) {
log.warn("Invalid var-field : {} in {}", value, rootEntity.getName());
return StringUtils.EMPTY;
}
Object[] o = Application.getQueryFactory().uniqueNoFilter(varRecord, fieldName);
if (o == null || o[0] == null) return StringUtils.EMPTY;
Object v = o[0];
if (v instanceof Date) {
v = CalendarUtils.getUTCDateFormat().format(v);
} else {
v = String.valueOf(v);
}
return (String) v;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: useValueOfVarRecord
File: src/main/java/com/rebuild/core/service/query/AdvFilterParser.java
Repository: getrebuild/rebuild
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-1495
|
MEDIUM
| 6.5
|
getrebuild/rebuild
|
useValueOfVarRecord
|
src/main/java/com/rebuild/core/service/query/AdvFilterParser.java
|
c9474f84e5f376dd2ade2078e3039961a9425da7
| 0
|
Analyze the following code function for security vulnerabilities
|
private int readRotation(int resID) {
try {
int rotation = mContext.getResources().getInteger(resID);
switch (rotation) {
case 0:
return Surface.ROTATION_0;
case 90:
return Surface.ROTATION_90;
case 180:
return Surface.ROTATION_180;
case 270:
return Surface.ROTATION_270;
}
} catch (Resources.NotFoundException e) {
// fall through
}
return -1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readRotation
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
readRotation
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
public XWikiDocumentArchive loadDocumentArchive()
{
XWikiDocumentArchive arch = getDocumentArchive();
if (arch != null) {
return arch;
}
// A document not comming from the database cannot have an archive stored in the database
if (this.isNew()) {
arch = new XWikiDocumentArchive(getDocumentReference().getWikiReference(), getId());
setDocumentArchive(arch);
return arch;
}
XWikiContext xcontext = getXWikiContext();
try {
arch = getVersioningStore(xcontext).getXWikiDocumentArchive(this, xcontext);
// Put a copy of the archive in the soft reference for later use if needed.
setDocumentArchive(arch);
return arch;
} catch (Exception e) {
// VersioningStore.getXWikiDocumentArchive may throw an XWikiException, and xcontext or VersioningStore
// may be null (tests)
// To maintain the behavior of this method we can't throw an exception.
// Formerly, null was returned if there was no SoftReference.
LOGGER.warn("Could not get document archive", e);
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadDocumentArchive
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
|
loadDocumentArchive
|
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 int setErrorParameter(BeforeEnterEvent event,
ErrorParameter<NotFoundException> parameter) {
String path = event.getLocation().getPath();
String additionalInfo = "";
if (parameter.hasCustomMessage()) {
additionalInfo = "Reason: " + parameter.getCustomMessage();
}
path = Jsoup.clean(path, Whitelist.none());
additionalInfo = Jsoup.clean(additionalInfo, Whitelist.none());
boolean productionMode = event.getUI().getSession().getConfiguration()
.isProductionMode();
String template = getErrorHtml(productionMode);
template = template.replace("{{path}}", path);
template = template.replace("{{additionalInfo}}", additionalInfo);
if (template.contains("{{routes}}")) {
template = template.replace("{{routes}}", getRoutes(event));
}
getElement().appendChild(new Html(template).getElement());
return HttpServletResponse.SC_NOT_FOUND;
}
|
Vulnerability Classification:
- CWE: CWE-20
- CVE: CVE-2021-31412
- Severity: MEDIUM
- CVSS Score: 4.3
Description: fix: set routes first into the template
fixes psi#26
Function: setErrorParameter
File: flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java
Repository: vaadin/flow
Fixed Code:
@Override
public int setErrorParameter(BeforeEnterEvent event,
ErrorParameter<NotFoundException> parameter) {
String path = event.getLocation().getPath();
String additionalInfo = "";
if (parameter.hasCustomMessage()) {
additionalInfo = "Reason: " + parameter.getCustomMessage();
}
path = Jsoup.clean(path, Whitelist.none());
additionalInfo = Jsoup.clean(additionalInfo, Whitelist.none());
boolean productionMode = event.getUI().getSession().getConfiguration()
.isProductionMode();
String template = getErrorHtml(productionMode);
if (template.contains("{{routes}}")) {
template = template.replace("{{routes}}", getRoutes(event));
}
template = template.replace("{{additionalInfo}}", additionalInfo);
template = template.replace("{{path}}", path);
getElement().appendChild(new Html(template).getElement());
return HttpServletResponse.SC_NOT_FOUND;
}
|
[
"CWE-20"
] |
CVE-2021-31412
|
MEDIUM
| 4.3
|
vaadin/flow
|
setErrorParameter
|
flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java
|
c79a7a8dbe1a494ff99a591d2e85b1100fc0aa15
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void terminateRequestChannel(HttpServerExchange exchange) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: terminateRequestChannel
File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10184
|
MEDIUM
| 5
|
undertow-io/undertow
|
terminateRequestChannel
|
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
|
d2715e3afa13f50deaa19643676816ce391551e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ManagedSubscriptionsPolicy getManagedSubscriptionsPolicy() {
synchronized (getLockObject()) {
ActiveAdmin admin = getProfileOwnerOfOrganizationOwnedDeviceLocked();
if (admin != null && admin.mManagedSubscriptionsPolicy != null) {
return admin.mManagedSubscriptionsPolicy;
}
}
return new ManagedSubscriptionsPolicy(
ManagedSubscriptionsPolicy.TYPE_ALL_PERSONAL_SUBSCRIPTIONS);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getManagedSubscriptionsPolicy
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getManagedSubscriptionsPolicy
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@UnsupportedAppUsage
@Nullable String getResourcePackageName(@AnyRes int resId) {
synchronized (this) {
ensureValidLocked();
return nativeGetResourcePackageName(mObject, resId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResourcePackageName
File: core/java/android/content/res/AssetManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
getResourcePackageName
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
void sendCloseSystemWindows() {
sendCloseSystemWindows(mContext, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendCloseSystemWindows
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
sendCloseSystemWindows
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public XMLBuilder element(String name) {
String namespaceURI = super.lookupNamespaceURIImpl(name);
return element(name, namespaceURI);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: element
File: src/main/java/com/jamesmurty/utils/XMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
element
|
src/main/java/com/jamesmurty/utils/XMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
private void doActionHistory(HttpServletRequest theReq, HomeRequest theRequest, BindingResult theBindingResult, ModelMap theModel, String theMethod, String theMethodDescription) {
addCommonParams(theReq, theRequest, theModel);
CaptureInterceptor interceptor = new CaptureInterceptor();
GenericClient client = theRequest.newClient(theReq, getContext(theRequest), myConfig, interceptor);
String id = null;
Class<? extends IBaseResource> type = null; // def.getImplementingClass();
if ("history-type".equals(theMethod)) {
RuntimeResourceDefinition def = getContext(theRequest).getResourceDefinition(theRequest.getResource());
type = def.getImplementingClass();
id = StringUtils.defaultString(theReq.getParameter("resource-history-id"));
}
DateTimeDt since = null;
String sinceStr = theReq.getParameter("since");
if (isNotBlank(sinceStr)) {
since = new DateTimeDt(sinceStr);
}
Integer limit = null;
String limitStr = theReq.getParameter("limit");
if (isNotBlank(limitStr)) {
limit = Integer.parseInt(limitStr);
}
ResultType returnsResource = ResultType.BUNDLE;
long start = System.currentTimeMillis();
try {
ourLog.info(logPrefix(theModel) + "Retrieving history for type {} ID {} since {}", new Object[] { type, id, since });
IHistory hist0 = client.history();
IHistoryUntyped hist1;
if (isNotBlank(id)) {
hist1 = hist0.onInstance(new IdDt(theRequest.getResource(), id));
} else if (type != null) {
hist1 = hist0.onType(type);
} else {
hist1 = hist0.onServer();
}
IHistoryTyped<?> hist2;
hist2 = hist1.andReturnBundle(client.getFhirContext().getResourceDefinition("Bundle").getImplementingClass(IBaseBundle.class));
if (since != null) {
hist2.since(since);
}
if (limit != null) {
hist2.count(limit);
}
hist2.execute();
} catch (Exception e) {
returnsResource = handleClientException(client, e, theModel);
}
long delay = System.currentTimeMillis() - start;
processAndAddLastClientInvocation(client, returnsResource, theModel, delay, theMethodDescription, interceptor, theRequest);
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2020-24301
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Resolve XSS vulnerability
Function: doActionHistory
File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
Repository: hapifhir/hapi-fhir
Fixed Code:
private void doActionHistory(HttpServletRequest theReq, HomeRequest theRequest, BindingResult theBindingResult, ModelMap theModel, String theMethod, String theMethodDescription) {
addCommonParams(theReq, theRequest, theModel);
CaptureInterceptor interceptor = new CaptureInterceptor();
GenericClient client = theRequest.newClient(theReq, getContext(theRequest), myConfig, interceptor);
String id = null;
Class<? extends IBaseResource> type = null; // def.getImplementingClass();
if ("history-type".equals(theMethod)) {
RuntimeResourceDefinition def = getContext(theRequest).getResourceDefinition(theRequest.getResource());
type = def.getImplementingClass();
id = sanitizeUrlPart(defaultString(theReq.getParameter("resource-history-id")));
}
DateTimeDt since = null;
String sinceStr = sanitizeUrlPart(theReq.getParameter("since"));
if (isNotBlank(sinceStr)) {
since = new DateTimeDt(sinceStr);
}
Integer limit = null;
String limitStr = sanitizeUrlPart(theReq.getParameter("limit"));
if (isNotBlank(limitStr)) {
limit = Integer.parseInt(limitStr);
}
ResultType returnsResource = ResultType.BUNDLE;
long start = System.currentTimeMillis();
try {
ourLog.info(logPrefix(theModel) + "Retrieving history for type {} ID {} since {}", new Object[] { type, id, since });
IHistory hist0 = client.history();
IHistoryUntyped hist1;
if (isNotBlank(id)) {
hist1 = hist0.onInstance(new IdDt(theRequest.getResource(), id));
} else if (type != null) {
hist1 = hist0.onType(type);
} else {
hist1 = hist0.onServer();
}
IHistoryTyped<?> hist2;
hist2 = hist1.andReturnBundle(client.getFhirContext().getResourceDefinition("Bundle").getImplementingClass(IBaseBundle.class));
if (since != null) {
hist2.since(since);
}
if (limit != null) {
hist2.count(limit);
}
hist2.execute();
} catch (Exception e) {
returnsResource = handleClientException(client, e, theModel);
}
long delay = System.currentTimeMillis() - start;
processAndAddLastClientInvocation(client, returnsResource, theModel, delay, theMethodDescription, interceptor, theRequest);
}
|
[
"CWE-79"
] |
CVE-2020-24301
|
MEDIUM
| 4.3
|
hapifhir/hapi-fhir
|
doActionHistory
|
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
|
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean setWakeAlarm(long delayMillis, boolean shouldWake) {
synchronized (this) {
if (mPendingAlarm != null) {
mAlarmManager.cancel(mPendingAlarm);
}
long wakeupTime = SystemClock.elapsedRealtime() + delayMillis;
int type = shouldWake
? AlarmManager.ELAPSED_REALTIME_WAKEUP
: AlarmManager.ELAPSED_REALTIME;
Intent intent = new Intent(ACTION_ALARM_WAKEUP);
mPendingAlarm = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
mAlarmManager.setExact(type, wakeupTime, mPendingAlarm);
return true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setWakeAlarm
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
setWakeAlarm
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void enqueueAsyncRpc(Method method, CompletableFuture<Command> future) {
doEnqueueRpc(() -> new CompletableFutureRpcWrapper(method, future));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enqueueAsyncRpc
File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
enqueueAsyncRpc
|
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void destroy() {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroy
File: web/src/main/java/org/openmrs/web/filter/StartupFilter.java
Repository: openmrs/openmrs-core
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-23612
|
MEDIUM
| 5
|
openmrs/openmrs-core
|
destroy
|
web/src/main/java/org/openmrs/web/filter/StartupFilter.java
|
db8454bf19a092a78d53ee4dba2af628b730a6e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setCommandName(String commandName) {
this.modelAttribute = commandName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCommandName
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
|
setCommandName
|
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
|
741b4b229ae032bd17175b46f98673ce0bd2d485
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
public static String color2html(@Nullable final Color color, final boolean hasAlpha) {
String result = null;
if (color != null) {
final StringBuilder buffer = new StringBuilder();
buffer.append('#');
final int[] components;
if (hasAlpha) {
components = new int[] {color.getAlpha(), color.getRed(), color.getGreen(), color.getBlue()};
} else {
components = new int[] {color.getRed(), color.getGreen(), color.getBlue()};
}
for (final int c : components) {
final String str = Integer.toHexString(c & 0xFF).toUpperCase(Locale.ENGLISH);
if (str.length() < 2) {
buffer.append('0');
}
buffer.append(str);
}
result = buffer.toString();
}
return result;
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2018-1000542
- Severity: MEDIUM
- CVSS Score: 6.8
Description: #45 activated FEATURE_SECURE_PROCESSING for XML parsing
Function: color2html
File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
Repository: raydac/netbeans-mmd-plugin
Fixed Code:
@Nullable
public static String color2html(@Nullable final Color color, final boolean hasAlpha) {
String result = null;
if (color != null) {
final StringBuilder buffer = new StringBuilder();
buffer.append('#');
final int[] components;
if (hasAlpha) {
components = new int[]{color.getAlpha(), color.getRed(), color.getGreen(), color.getBlue()};
} else {
components = new int[]{color.getRed(), color.getGreen(), color.getBlue()};
}
for (final int c : components) {
final String str = Integer.toHexString(c & 0xFF).toUpperCase(Locale.ENGLISH);
if (str.length() < 2) {
buffer.append('0');
}
buffer.append(str);
}
result = buffer.toString();
}
return result;
}
|
[
"CWE-611"
] |
CVE-2018-1000542
|
MEDIUM
| 6.8
|
raydac/netbeans-mmd-plugin
|
color2html
|
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
|
9fba652bf06e649186b8f9e612d60e9cc15097e9
| 1
|
Analyze the following code function for security vulnerabilities
|
public void appendText(String text) {
if (text == null) {
return;
}
String previous = this.binding.textinput.getText().toString();
if (UIHelper.isLastLineQuote(previous)) {
text = '\n' + text;
} else if (previous.length() != 0 && !Character.isWhitespace(previous.charAt(previous.length() - 1))) {
text = " " + text;
}
this.binding.textinput.append(text);
}
|
Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2018-18467
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Do not insert text shared over XMPP uri when already drafting message
XMPP uris in the style of `xmpp:test@domain.tld?body=Something` can be used to
directly share a message with a specific contact. Previously the text was
always appended to the message currently in draft. The message was never send
automatically. Essentially those links where treated like normal text share
intents (for example when sharing a URL from the browser) but without the
contact selection.
There is a concern (CVE-2018-18467) that when this URI is invoked automatically
and the user is currently drafting a long message to that particular contact
the text could be inserted in the draft field (input box) without the user
noticing.
To circumvent that the text shared over XMPP uris that contain a particular
contact is now appended only if the draft box is currently empty.
Sharing text normally (**with** manual contact selection) is still treated the
same; meaning the shared text will be appended to the current draft. This is
intended behaviour to make the
'Hey I have this cool link here;' *open browser*, *share link* - secenario
work.
Function: appendText
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
Fixed Code:
public void appendText(String text, final boolean doNotAppend) {
if (text == null) {
return;
}
final Editable editable = this.binding.textinput.getText();
String previous = editable == null ? "" : editable.toString();
if (doNotAppend && !TextUtils.isEmpty(previous)) {
Toast.makeText(getActivity(),R.string.already_drafting_message, Toast.LENGTH_LONG).show();
return;
}
if (UIHelper.isLastLineQuote(previous)) {
text = '\n' + text;
} else if (previous.length() != 0 && !Character.isWhitespace(previous.charAt(previous.length() - 1))) {
text = " " + text;
}
this.binding.textinput.append(text);
}
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
appendText
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 1
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_LOCK_TASK, conditional = true)
@SupportsCoexistence
public void setLockTaskFeatures(@Nullable ComponentName admin, @LockTaskFeature int flags) {
throwIfParentInstance("setLockTaskFeatures");
if (mService != null) {
try {
mService.setLockTaskFeatures(admin, mContext.getPackageName(), flags);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLockTaskFeatures
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
|
setLockTaskFeatures
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String prepend(String prefix, String body) {
if(body!=null && body.length()>0)
return prefix+body;
return body;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: prepend
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
|
prepend
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<IntentFilter> getAllIntentFilters(String packageName) {
if (TextUtils.isEmpty(packageName)) {
return Collections.<IntentFilter>emptyList();
}
synchronized (mPackages) {
PackageParser.Package pkg = mPackages.get(packageName);
if (pkg == null || pkg.activities == null) {
return Collections.<IntentFilter>emptyList();
}
final int count = pkg.activities.size();
ArrayList<IntentFilter> result = new ArrayList<>();
for (int n=0; n<count; n++) {
PackageParser.Activity activity = pkg.activities.get(n);
if (activity.intents != null || activity.intents.size() > 0) {
result.addAll(activity.intents);
}
}
return result;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllIntentFilters
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
getAllIntentFilters
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
private static <T> boolean isCollectionCompatible(Collection<T> c1, Collection<T> c2, ConfigChecker<T> checker) {
if (c1 == c2) {
return true;
}
if (c1 == null || c2 == null || c1.size() != c2.size()) {
return false;
}
Iterator<T> i1 = c1.iterator();
Iterator<T> i2 = c2.iterator();
while (i1.hasNext() && i2.hasNext()) {
T config1 = i1.next();
T config2 = i2.next();
if (!checker.check(config1, config2)) {
return false;
}
}
return !(i1.hasNext() || i2.hasNext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCollectionCompatible
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
|
isCollectionCompatible
|
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public void deleteSpace(EntityReference space)
{
getDriver().get(getURLToDeleteSpace(space));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteSpace
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
deleteSpace
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addConnectionServiceAdapter(IConnectionServiceAdapter adapter,
Session.Info info) throws RemoteException {
if (!mConnectionServiceAdapters.add(adapter)) {
throw new RuntimeException("Adapter already added: " + adapter);
}
mConnectionServiceDelegateAdapter.addConnectionServiceAdapter(adapter,
null /*Session.Info*/);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addConnectionServiceAdapter
File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
addConnectionServiceAdapter
|
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onProfileServiceStateChanged(String serviceName, int state) {
Message m = mHandler.obtainMessage(MESSAGE_PROFILE_SERVICE_STATE_CHANGED);
m.obj=serviceName;
m.arg1 = state;
mHandler.sendMessage(m);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onProfileServiceStateChanged
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
onProfileServiceStateChanged
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getContentOfSection(int sectionNumber) throws XWikiException
{
String content = null;
if (is10Syntax()) {
content = getContentOfSection10(sectionNumber);
} else {
List<HeaderBlock> headers = getFilteredHeaders();
if (headers.size() >= sectionNumber) {
SectionBlock section = headers.get(sectionNumber - 1).getSection();
content = renderXDOM(new XDOM(Collections.<Block>singletonList(section)), getSyntax());
}
}
return content;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentOfSection
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
|
getContentOfSection
|
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
|
@Test
public void deleteById(TestContext context) {
String id = randomUuid();
String id2 = randomUuid();
PostgresClient postgresClient = insertXAndSingleQuotePojo(context, new JsonArray().add(id).add(id2));
postgresClient.delete(FOO, id, context.asyncAssertSuccess(delete -> {
context.assertEquals(1, delete.getUpdated(), "number of records deleted");
postgresClient.selectSingle("SELECT count(*) FROM " + FOO, context.asyncAssertSuccess(select -> {
context.assertEquals(1, select.getInteger(0), "remaining records");
postgresClient.delete(FOO, id, context.asyncAssertSuccess(delete2 -> {
context.assertEquals(0, delete2.getUpdated(), "number of records deleted");
}));
}));
}));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteById
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
deleteById
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressLint("InflateParams")
protected void clearHistoryDialog(final Conversation conversation) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(getString(R.string.clear_conversation_history));
final View dialogView = getActivity().getLayoutInflater().inflate(R.layout.dialog_clear_history, null);
final CheckBox endConversationCheckBox = dialogView.findViewById(R.id.end_conversation_checkbox);
builder.setView(dialogView);
builder.setNegativeButton(getString(R.string.cancel), null);
builder.setPositiveButton(getString(R.string.confirm), (dialog, which) -> {
this.activity.xmppConnectionService.clearConversationHistory(conversation);
if (endConversationCheckBox.isChecked()) {
this.activity.xmppConnectionService.archiveConversation(conversation);
this.activity.onConversationArchived(conversation);
} else {
activity.onConversationsListItemUpdated();
refresh();
}
});
builder.create().show();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearHistoryDialog
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
clearHistoryDialog
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public static VaadinRequest getCurrentRequest() {
return VaadinRequest.getCurrent();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentRequest
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
getCurrentRequest
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
public void toWriter(Writer writer, Properties outputProperties)
throws TransformerException {
this.toWriter(true, writer, outputProperties);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toWriter
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
toWriter
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public Set<Label> getRelevantLabels() {
return Collections.singleton(getAssignedLabel());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRelevantLabels
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
getRelevantLabels
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void scrollTo(Object itemId, ScrollDestination destination)
throws IllegalArgumentException {
int row = datasource.indexOfId(itemId);
if (row == -1) {
throw new IllegalArgumentException(
"Item with specified ID does not exist in data source");
}
GridClientRpc clientRPC = getRpcProxy(GridClientRpc.class);
clientRPC.scrollToRow(row, destination);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scrollTo
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
|
scrollTo
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final double _parseDoublePrimitive(JsonParser p, DeserializationContext ctxt, String text)
throws IOException
{
try {
return _parseDouble(text, p.isEnabled(StreamReadFeature.USE_FAST_DOUBLE_PARSER));
} catch (IllegalArgumentException iae) { }
Number v = (Number) ctxt.handleWeirdStringValue(Double.TYPE, text,
"not a valid `double` value (as String to convert)");
return _nonNullNumber(v).doubleValue();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _parseDoublePrimitive
File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-42003
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_parseDoublePrimitive
|
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
|
d78d00ee7b5245b93103fef3187f70543d67ca33
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public SSLSession getSession() {
return session;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSession
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
getSession
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
setOauthBasePath(basePath);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBasePath
File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setBasePath
|
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void handleCommand(AMQCommand command) {
_blocker.setValue(transformReply(command));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleCommand
File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
handleCommand
|
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getDefaultEditMode() throws XWikiException
{
return this.doc.getDefaultEditMode(getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultEditMode
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
getDefaultEditMode
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean action(XWikiContext context) throws XWikiException
{
// CSRF prevention
if (!csrfTokenCheck(context, true)) {
return false;
}
if (save(context)) {
return true;
}
// forward to view
if (Utils.isAjaxRequest(context)) {
Map<String, String> jsonAnswer = new LinkedHashMap<>();
Version newVersion = (Version) context.get(SAVED_OBJECT_VERSION_KEY);
jsonAnswer.put("newVersion", newVersion.toString());
if ("true".equals(context.get(MERGED_DOCUMENTS))) {
jsonAnswer.put("mergedDocument", "true");
}
answerJSON(context, HttpStatus.SC_OK, jsonAnswer);
} else {
sendRedirect(context.getResponse(), Utils.getRedirect("view", context));
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: action
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SaveAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2022-23617
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
action
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SaveAction.java
|
30c52b01559b8ef5ed1035dac7c34aaf805764d5
| 0
|
Analyze the following code function for security vulnerabilities
|
public ModalDialog setLazyBinding()
{
this.lazyBinding = true;
mainSubContainer.setVisible(false);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLazyBinding
File: src/main/java/org/projectforge/web/dialog/ModalDialog.java
Repository: micromata/projectforge-webapp
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2013-7251
|
MEDIUM
| 6.8
|
micromata/projectforge-webapp
|
setLazyBinding
|
src/main/java/org/projectforge/web/dialog/ModalDialog.java
|
422de35e3c3141e418a73bfb39b430d5fd74077e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void doDispose() {
//
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doDispose
File: src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41152
|
MEDIUM
| 4
|
OpenOLAT
|
doDispose
|
src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
|
418bb509ffcb0e25ab4390563c6c47f0458583eb
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getRequestUri() {
return mUri;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestUri
File: src/com/android/exchange/eas/EasAutoDiscover.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2415
|
HIGH
| 7.1
|
android
|
getRequestUri
|
src/com/android/exchange/eas/EasAutoDiscover.java
|
0d1a38b1755efe7ed4e8d7302a24186616bba9b2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String unzip(File zipfile) throws IOException {
return unzip(zipfile, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unzip
File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31195
|
HIGH
| 7.2
|
DSpace
|
unzip
|
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
|
56e76049185bbd87c994128a9d77735ad7af0199
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean rowInserted() throws SQLException {
checkClosed();
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: rowInserted
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
|
rowInserted
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((descriptor == null) ? 0 : descriptor.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hashCode
File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
hashCode
|
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public AwTestContainerView createAwTestContainerViewOnMainSync(
final AwContentsClient client, final boolean supportsLegacyQuirks) {
return ThreadUtils.runOnUiThreadBlockingNoException(new Callable<AwTestContainerView>() {
@Override
public AwTestContainerView call() {
return createAwTestContainerView(client, supportsLegacyQuirks);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createAwTestContainerViewOnMainSync
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5155
|
MEDIUM
| 4.3
|
chromium
|
createAwTestContainerViewOnMainSync
|
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "2.2M1")
@Override
public String getSpaceName()
{
return this.getSpace();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSpaceName
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
|
getSpaceName
|
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
|
private boolean isWebServiceRequested(HttpServletRequest request) {
return request.getRequestURI().contains(getApplicationURL() + "/services/");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isWebServiceRequested
File: core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
isWebServiceRequested
|
core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermissions("user:delete")
@GetMapping("/delete")
@ResponseBody
public Result delete(Integer id) {
userService.deleteUser(id);
return success();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: src/main/java/co/yiiu/pybbs/controller/admin/UserAdminController.java
Repository: atjiu/pybbs
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-23391
|
MEDIUM
| 4.3
|
atjiu/pybbs
|
delete
|
src/main/java/co/yiiu/pybbs/controller/admin/UserAdminController.java
|
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.