instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public void join(int timeout, TimeUnit unit) throws TransportException { close.await(timeout, unit); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: join File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
join
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting static void writeApplicationRestrictionsLocked(Bundle restrictions, AtomicFile restrictionsFile) { FileOutputStream fos = null; try { fos = restrictionsFile.startWrite(); final BufferedOutputStream bos = new BufferedOutputStream(fos); final XmlSerializer serializer = new FastXmlSerializer(); serializer.setOutput(bos, StandardCharsets.UTF_8.name()); serializer.startDocument(null, true); serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true); serializer.startTag(null, TAG_RESTRICTIONS); writeBundle(restrictions, serializer); serializer.endTag(null, TAG_RESTRICTIONS); serializer.endDocument(); restrictionsFile.finishWrite(fos); } catch (Exception e) { restrictionsFile.failWrite(fos); Slog.e(LOG_TAG, "Error writing application restrictions list", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeApplicationRestrictionsLocked File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
writeApplicationRestrictionsLocked
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public synchronized void cancel() { synchronized (mCancelWaiter) { mCanceled = true; mCancelWaiter.notify(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancel File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
cancel
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
public Arg createArg() { return this.createArg( false ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createArg File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
createArg
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
public CompletionList doComplete(DOMDocument xmlDocument, Position position, SharedSettings settings, CancelChecker cancelChecker) { return completions.doComplete(xmlDocument, position, settings, cancelChecker); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doComplete File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
doComplete
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
@Override public void onPause() { //super.onPause(); if( RemoteControlCallback.isPlaying()) { //mMediaPlayer.pause(); RemoteControlCallback.pause(); setMediaPlaybackState(PlaybackStateCompat.STATE_PAUSED); showPausedNotification(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPause File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onPause
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
void userAuth(UserDTO.PlatformInfo userInfo);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: userAuth File: framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
userAuth
framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public void toggleDownloadImageModal() { downloadImageModalVisible = !downloadImageModalVisible; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toggleDownloadImageModal File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
toggleDownloadImageModal
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
public abstract String getContextRootRelativePath(VaadinRequest request);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContextRootRelativePath 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
getContextRootRelativePath
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
void addNewUnknownCall(PhoneAccountHandle phoneAccountHandle, Bundle extras) { Uri handle = extras.getParcelable(TelecomManager.EXTRA_UNKNOWN_CALL_HANDLE); Log.i(this, "addNewUnknownCall with handle: %s", Log.pii(handle)); Call call = new Call( mContext, mConnectionServiceRepository, handle, null /* gatewayInfo */, null /* connectionManagerPhoneAccount */, phoneAccountHandle, // Use onCreateIncomingConnection in TelephonyConnectionService, so that we attach // to the existing connection instead of trying to create a new one. true /* isIncoming */, false /* isConference */); call.setIsUnknown(true); call.setExtras(extras); call.addListener(this); call.startCreateConnection(mPhoneAccountRegistrar); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addNewUnknownCall File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
addNewUnknownCall
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
@Override // Binder call public void cancelEnrollment(final IBinder token) { checkPermission(MANAGE_FINGERPRINT); mHandler.post(new Runnable() { @Override public void run() { ClientMonitor client = mCurrentClient; if (client instanceof EnrollClient && client.getToken() == token) { client.stop(client.getToken() == token); } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelEnrollment File: services/core/java/com/android/server/fingerprint/FingerprintService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
cancelEnrollment
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public void setSwitchingUser(boolean switching) { mUpdateMonitor.setSwitchingUser(switching); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSwitchingUser File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
setSwitchingUser
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public void shutdown() { if (connection != null) { try { connection.close(); } catch (SQLException e) { logger.warn("Non-Managed connection could not be closed. Whoops!", e); } } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2023-41886 - Severity: HIGH - CVSS Score: 7.5 Description: Merge pull request from GHSA-qqh2-wvmv-h72m Function: shutdown File: extensions/database/src/com/google/refine/extension/database/mariadb/MariaDBConnectionManager.java Repository: OpenRefine Fixed Code: public void shutdown() { if (connection != null) { try { connection.close(); } catch (SQLException e) { logger.warn("Non-Managed connection could not be closed. Whoops!", e); } } }
[ "CWE-89" ]
CVE-2023-41886
HIGH
7.5
OpenRefine
shutdown
extensions/database/src/com/google/refine/extension/database/mariadb/MariaDBConnectionManager.java
2de1439f5be63d9d0e89bbacbd24fa28c8c3e29d
1
Analyze the following code function for security vulnerabilities
public int getSendMaxConcurrentStreams() { return sendMaxConcurrentStreams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSendMaxConcurrentStreams File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
getSendMaxConcurrentStreams
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@Override public OnGoingLogicalCondition notIn(Query<T> subQuery) { return getOnGoingLogicalCondition(new NotInSubQueryCondition<T>(selector, (QueryBuilder) subQuery)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notIn 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
notIn
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
3c20b874fba9cc2a78b9ace10208de1602b56c3f
0
Analyze the following code function for security vulnerabilities
void setSuperclass(ObjectStreamClass c) { superclass = c; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSuperclass File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
setSuperclass
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public static ClickHouseNode of(String uri, Map<?, ?> options) { URI normalizedUri = normalize(uri, null); Map<String, String> params = new LinkedHashMap<>(); parseDatabase(normalizedUri.getPath(), params); ClickHouseUtils.extractParameters(normalizedUri.getRawQuery(), params); Set<String> tags = new LinkedHashSet<>(); parseTags(normalizedUri.getRawFragment(), tags); if (options != null && !options.isEmpty()) { for (Entry<?, ?> entry : options.entrySet()) { if (entry.getKey() != null) { if (entry.getValue() != null) { params.put(entry.getKey().toString(), entry.getValue().toString()); } else { params.remove(entry.getKey().toString()); } } } } String scheme = normalizedUri.getScheme(); ClickHouseProtocol protocol = ClickHouseProtocol.fromUriScheme(scheme); int port = extract(scheme, normalizedUri.getPort(), protocol, params); ClickHouseCredentials credentials = extract(normalizedUri.getRawUserInfo(), params, null); return new ClickHouseNode(normalizedUri.getHost(), protocol, port, credentials, params, tags); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: of File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
of
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
void registerTagObject(TagEndpoint tag) { synchronized (this) { mObjectMap.put(tag.getHandle(), tag); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerTagObject File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
registerTagObject
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
@Override public boolean supports(Type genericType) { if (genericType instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) genericType; if (JAXBElement.class.equals(parameterizedType.getRawType()) && parameterizedType.getActualTypeArguments().length == 1) { Type typeArgument = parameterizedType.getActualTypeArguments()[0]; if (typeArgument instanceof Class) { Class<?> classArgument = (Class<?>) typeArgument; if (JdkVersion.getMajorJavaVersion() >= JdkVersion.JAVA_17 && classArgument.isArray()) { return classArgument.getComponentType().equals(Byte.TYPE); } else { return (isPrimitiveWrapper(classArgument) || isStandardClass(classArgument) || supportsInternal(classArgument, false)); } } else if (JdkVersion.getMajorJavaVersion() <= JdkVersion.JAVA_16 && typeArgument instanceof GenericArrayType) { // see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041784 GenericArrayType arrayType = (GenericArrayType) typeArgument; return arrayType.getGenericComponentType().equals(Byte.TYPE); } } } else if (genericType instanceof Class) { Class<?> clazz = (Class<?>) genericType; return supportsInternal(clazz, this.checkForXmlRootElement); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: supports File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
supports
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
void register() { mStrongAuth.registerStrongAuthTracker(this.mStub); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: register File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
register
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Override public void onAttachmentAdded() { mQuotedTextView.setUpperDividerVisible(mAttachmentsView.getAttachments().size() > 0); mAttachmentsView.focusLastAttachment(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAttachmentAdded 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
onAttachmentAdded
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private void dataChangedImpl(String packageName) { HashSet<String> targets = dataChangedTargets(packageName); dataChangedImpl(packageName, targets); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dataChangedImpl File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
dataChangedImpl
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private boolean doValueHighlight(Map<String, Object> options, String value) { if (options.containsKey(Printer.VALUE_STYLE_ALL) || value.matches("\"(\\.|[^\"])*\"|'(\\.|[^'])*'") || (value.startsWith("[") && value.endsWith("]")) || (value.startsWith("(") && value.endsWith(")")) || (value.startsWith("{") && value.endsWith("}")) || (value.startsWith("<") && value.endsWith(">"))) { return true; } else { return !value.contains(" ") && !value.contains("\t"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doValueHighlight File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java Repository: jline/jline3 The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-50572
MEDIUM
5.5
jline/jline3
doValueHighlight
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInLockTaskMode() { return getLockTaskModeState() != ActivityManager.LOCK_TASK_MODE_NONE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInLockTaskMode File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
isInLockTaskMode
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public void stopAppSwitches() throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopAppSwitches File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
stopAppSwitches
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private static <T> CiphertextHeaderV2 decodeInternal( final T source, final Function<String, SecretKey> keyLookup, final Function<T, Integer> readIntFn, final Function<T, Byte> readByteFn, final BiConsumer<T, byte[]> readBytesConsumer) { final SecretKey key; final String keyName; final byte[] nonce; final byte[] hmac; try { final int version = readIntFn.apply(source); if (version != VERSION) { throw new EncodingException("Unsupported ciphertext header version"); } final ByteArrayOutputStream out = new ByteArrayOutputStream(100); byte b = 0; int count = 0; while ((b = readByteFn.apply(source)) != 0) { out.write(b); if (out.size() > MAX_KEYNAME_LEN) { throw new EncodingException("Bad ciphertext header: maximum nonce length exceeded"); } count++; } keyName = ByteUtil.toString(out.toByteArray(), 0, count); key = keyLookup.apply(keyName); if (key == null) { throw new IllegalStateException("Symbolic key name mentioned in header was not found"); } final int nonceLen = ByteUtil.toInt(readByteFn.apply(source)); nonce = new byte[nonceLen]; readBytesConsumer.accept(source, nonce); hmac = new byte[HMAC_SIZE]; readBytesConsumer.accept(source, hmac); } catch (IndexOutOfBoundsException | BufferUnderflowException e) { throw new EncodingException("Bad ciphertext header"); } final CiphertextHeaderV2 header = new CiphertextHeaderV2(nonce, keyName); final byte[] encoded = header.encode(key); if (!arraysEqual(hmac, 0, encoded, encoded.length - HMAC_SIZE, HMAC_SIZE)) { throw new EncodingException("Ciphertext header HMAC verification failed"); } header.setKeyLookup(keyLookup); return header; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decodeInternal File: src/main/java/org/cryptacular/CiphertextHeaderV2.java Repository: vt-middleware/cryptacular The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-7226
MEDIUM
5
vt-middleware/cryptacular
decodeInternal
src/main/java/org/cryptacular/CiphertextHeaderV2.java
00395c232cdc62d4292ce27999c026fc1f076b1d
0
Analyze the following code function for security vulnerabilities
public String transform(String XMLPath, String XSLPath, int ttl) throws Exception { String x = XSLTTransform(XMLPath, XSLPath, ttl).getXmlTransformation(); return x; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: transform File: src/com/dotmarketing/viewtools/XsltTool.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-264" ]
CVE-2012-1826
MEDIUM
6
dotCMS/core
transform
src/com/dotmarketing/viewtools/XsltTool.java
b6b15c45fd550db7f1103e6aeab8780465855c29
0
Analyze the following code function for security vulnerabilities
boolean hasAnyForSystemInstall() { return (mUserKey != null) || hasUserCertificate() || hasCaCerts(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasAnyForSystemInstall File: src/com/android/certinstaller/CredentialHelper.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
hasAnyForSystemInstall
src/com/android/certinstaller/CredentialHelper.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
public State encode(HeaderMap headers, ByteBuffer target) { if(overflowData != null) { for(int i = overflowPos; i < overflowLength; ++i) { if(!target.hasRemaining()) { overflowPos = i; return State.OVERFLOW; } target.put(overflowData[i]); } overflowData = null; } long it = headersIterator; if (headersIterator == -1) { handleTableSizeChange(target); //new headers map it = headers.fastIterate(); currentHeaders = headers; } else { if (headers != currentHeaders) { throw new IllegalStateException(); } } while (it != -1) { HeaderValues values = headers.fiCurrent(it); boolean skip = false; if (firstPass) { if (values.getHeaderName().byteAt(0) != ':') { skip = true; } } else { if (values.getHeaderName().byteAt(0) == ':') { skip = true; } } if(SKIP.contains(values.getHeaderName())) { //ignore connection specific headers skip = true; } if (!skip) { for (int i = 0; i < values.size(); ++i) { HttpString headerName = values.getHeaderName(); int required = 11 + headerName.length(); //we use 11 to make sure we have enough room for the variable length itegers String val = values.get(i); for(int v = 0; v < val.length(); ++v) { char c = val.charAt(v); if(c == '\r' || c == '\n') { val = val.replace('\r', ' ').replace('\n', ' '); break; } } TableEntry tableEntry = findInTable(headerName, val); required += (1 + val.length()); boolean overflowing = false; ByteBuffer current = target; if (current.remaining() < required) { overflowing = true; current = ByteBuffer.wrap(overflowData = new byte[required]); overflowPos = 0; } boolean canIndex = hpackHeaderFunction.shouldUseIndexing(headerName, val) && (headerName.length() + val.length() + 32) < maxTableSize; //only index if it will fit if (tableEntry == null && canIndex) { //add the entry to the dynamic table current.put((byte) (1 << 6)); writeHuffmanEncodableName(current, headerName); writeHuffmanEncodableValue(current, headerName, val); addToDynamicTable(headerName, val); } else if (tableEntry == null) { //literal never indexed current.put((byte) (1 << 4)); writeHuffmanEncodableName(current, headerName); writeHuffmanEncodableValue(current, headerName, val); } else { //so we know something is already in the table if (val.equals(tableEntry.value)) { //the whole thing is in the table current.put((byte) (1 << 7)); encodeInteger(current, tableEntry.getPosition(), 7); } else { if (canIndex) { //add the entry to the dynamic table current.put((byte) (1 << 6)); encodeInteger(current, tableEntry.getPosition(), 6); writeHuffmanEncodableValue(current, headerName, val); addToDynamicTable(headerName, val); } else { current.put((byte) (1 << 4)); encodeInteger(current, tableEntry.getPosition(), 4); writeHuffmanEncodableValue(current, headerName, val); } } } if(overflowing) { it = headers.fiNext(it); this.headersIterator = it; this.overflowLength = current.position(); return State.OVERFLOW; } } } it = headers.fiNext(it); if (it == -1 && firstPass) { firstPass = false; it = headers.fastIterate(); } } headersIterator = -1; firstPass = true; return State.COMPLETE; }
Vulnerability Classification: - CWE: CWE-214 - CVE: CVE-2021-3859 - Severity: HIGH - CVSS Score: 7.5 Description: [UNDERTOW-1979] CVE-2021-3859 continuation frames are not read correctly Function: encode File: core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java Repository: undertow-io/undertow Fixed Code: public State encode(HeaderMap headers, ByteBuffer target) { if(overflowData != null) { for(int i = overflowPos; i < overflowLength; ++i) { if(!target.hasRemaining()) { overflowPos = i; return State.OVERFLOW; } target.put(overflowData[i]); } overflowData = null; } long it = headersIterator; if (headersIterator == -1) { handleTableSizeChange(target); //new headers map it = headers.fastIterate(); currentHeaders = headers; } else { if (headers != currentHeaders) { throw new IllegalStateException(); } it = headers.fiNext(it); } while (it != -1) { HeaderValues values = headers.fiCurrent(it); boolean skip = false; if (firstPass) { if (values.getHeaderName().byteAt(0) != ':') { skip = true; } } else { if (values.getHeaderName().byteAt(0) == ':') { skip = true; } } if(SKIP.contains(values.getHeaderName())) { //ignore connection specific headers skip = true; } if (!skip) { for (int i = 0; i < values.size(); ++i) { HttpString headerName = values.getHeaderName(); int required = 11 + headerName.length(); //we use 11 to make sure we have enough room for the variable length itegers String val = values.get(i); for(int v = 0; v < val.length(); ++v) { char c = val.charAt(v); if(c == '\r' || c == '\n') { val = val.replace('\r', ' ').replace('\n', ' '); break; } } TableEntry tableEntry = findInTable(headerName, val); required += (1 + val.length()); boolean overflowing = false; ByteBuffer current = target; if (current.remaining() < required) { overflowing = true; current = ByteBuffer.wrap(overflowData = new byte[required]); overflowPos = 0; } boolean canIndex = hpackHeaderFunction.shouldUseIndexing(headerName, val) && (headerName.length() + val.length() + 32) < maxTableSize; //only index if it will fit if (tableEntry == null && canIndex) { //add the entry to the dynamic table current.put((byte) (1 << 6)); writeHuffmanEncodableName(current, headerName); writeHuffmanEncodableValue(current, headerName, val); addToDynamicTable(headerName, val); } else if (tableEntry == null) { //literal never indexed current.put((byte) (1 << 4)); writeHuffmanEncodableName(current, headerName); writeHuffmanEncodableValue(current, headerName, val); } else { //so we know something is already in the table if (val.equals(tableEntry.value)) { //the whole thing is in the table current.put((byte) (1 << 7)); encodeInteger(current, tableEntry.getPosition(), 7); } else { if (canIndex) { //add the entry to the dynamic table current.put((byte) (1 << 6)); encodeInteger(current, tableEntry.getPosition(), 6); writeHuffmanEncodableValue(current, headerName, val); addToDynamicTable(headerName, val); } else { current.put((byte) (1 << 4)); encodeInteger(current, tableEntry.getPosition(), 4); writeHuffmanEncodableValue(current, headerName, val); } } } if(overflowing) { this.headersIterator = it; this.overflowLength = current.position(); return State.OVERFLOW; } } } it = headers.fiNext(it); if (it == -1 && firstPass) { firstPass = false; it = headers.fastIterate(); } } headersIterator = -1; firstPass = true; return State.COMPLETE; }
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
encode
core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
1
Analyze the following code function for security vulnerabilities
public ActivityImpl splitTask(String procDefId, String procInsId, String targetTaskDefinitionKey, Map<String, Object> variables, String... assignee) { return splitTask(procDefId, procInsId, targetTaskDefinitionKey, variables, true, assignee); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: splitTask File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java Repository: thinkgem/jeesite The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34601
CRITICAL
9.8
thinkgem/jeesite
splitTask
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
0
Analyze the following code function for security vulnerabilities
public ArraySet<String> getAllowInPowerSave() { return mAllowInPowerSave; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllowInPowerSave File: services/core/java/com/android/server/SystemConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
getAllowInPowerSave
services/core/java/com/android/server/SystemConfig.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
protected String quoteOneItem( String path, boolean isExecutable ) { if ( path == null ) { return null; } StringBuilder sb = new StringBuilder(); sb.append( "'" ); sb.append( path.replace( "'", "'\"'\"'" ) ); sb.append( "'" ); return sb.toString(); }
Vulnerability Classification: - CWE: CWE-116 - CVE: CVE-2022-29599 - Severity: HIGH - CVSS Score: 7.5 Description: [MSHARED-297] - Minor code cleanup Function: quoteOneItem File: src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java Repository: apache/maven-shared-utils Fixed Code: protected String quoteOneItem( String path, boolean isExecutable ) { if ( path == null ) { return null; } return "'" + path.replace( "'", "'\"'\"'" ) + "'"; }
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
quoteOneItem
src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
bb6b6a4bf44cc09f120068bd29fed3e9ab10eb6f
1
Analyze the following code function for security vulnerabilities
static int parseIntAttribute(TypedXmlPullParser parser, String attribute, int def) { return (int) parseLongAttribute(parser, attribute, def); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseIntAttribute File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
parseIntAttribute
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public CharSequence getMessage() { return mMessage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMessage File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
getMessage
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public ComponentName getDefaultNotificationAssistant() { try { return sINM.getDefaultNotificationAssistant(); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultNotificationAssistant File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
getDefaultNotificationAssistant
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection get(final String path1, final String path2, final String path3, final Route.ZeroArgHandler handler) { return new Route.Collection( new Route.Definition[]{get(path1, handler), get(path2, handler), get(path3, handler)}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
get
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public void setVolume(final Volume volume) throws IOException, RarException { this.volume = volume; setChannel(volume.getChannel(), volume.getLength()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVolume File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2022-23596
MEDIUM
5
junrar
setVolume
src/main/java/com/github/junrar/Archive.java
7b16b3d90b91445fd6af0adfed22c07413d4fab7
0
Analyze the following code function for security vulnerabilities
@Override public String getAliasForStatementSQL(String alias) { return "\"" + alias + "\""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAliasForStatementSQL File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
getAliasForStatementSQL
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
@Override public ConnectionState getConnectionState() { return mState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectionState File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
getConnectionState
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
protected void setContentLength(XWikiResponse response, long length) { // Set the content length in the response response.setContentLengthLong(length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setContentLength File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-23617
MEDIUM
4
xwiki/xwiki-platform
setContentLength
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
0
Analyze the following code function for security vulnerabilities
public static String formatMiliSeconds(long time) { long hours, minutes, seconds, mseconds; mseconds = time % 1000; time = time / 1000; hours = time / 3600; time = time - (hours * 3600); minutes = time / 60; time = time - (minutes * 60); seconds = time; return (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" + (seconds < 10 ? "0" + seconds : seconds) + "." + (mseconds < 10 ? "00" + mseconds : (mseconds < 100 ? "0" + mseconds : mseconds)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: formatMiliSeconds File: src/main/java/com/openkm/util/FormatUtil.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-40317
MEDIUM
5.4
openkm/document-management-system
formatMiliSeconds
src/main/java/com/openkm/util/FormatUtil.java
870d518f7de349c3fa4c7b9883789fdca4590c4e
0
Analyze the following code function for security vulnerabilities
private CipherInputStream<?> initializeCipherInputStream(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader) throws IOException { if (!localFileHeader.isEncrypted()) { return new NoCipherInputStream(zipEntryInputStream, localFileHeader, password, zip4jConfig.getBufferSize()); } if (localFileHeader.getEncryptionMethod() == EncryptionMethod.AES) { return new AesCipherInputStream(zipEntryInputStream, localFileHeader, password, zip4jConfig.getBufferSize(), zip4jConfig.isUseUtf8CharsetForPasswords()); } else if (localFileHeader.getEncryptionMethod() == EncryptionMethod.ZIP_STANDARD) { return new ZipStandardCipherInputStream(zipEntryInputStream, localFileHeader, password, zip4jConfig.getBufferSize(), zip4jConfig.isUseUtf8CharsetForPasswords()); } else { final String message = String.format("Entry [%s] Strong Encryption not supported", localFileHeader.getFileName()); throw new ZipException(message, ZipException.Type.UNSUPPORTED_ENCRYPTION); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeCipherInputStream File: src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java Repository: srikanth-lingala/zip4j The code follows secure coding practices.
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
initializeCipherInputStream
src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
0
Analyze the following code function for security vulnerabilities
public Cloud getCloud(String name) { return clouds.getByName(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCloud 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
getCloud
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public File newFolder(String... paths) throws IOException { if (paths.length == 0) { throw new IllegalArgumentException("must pass at least one path"); } /* * Before checking if the paths are absolute paths, check if create() was ever called, * and if it wasn't, throw IllegalStateException. */ File root = getRoot(); for (String path : paths) { if (new File(path).isAbsolute()) { throw new IOException("folder path \'" + path + "\' is not a relative path"); } } File relativePath = null; File file = root; boolean lastMkdirsCallSuccessful = true; for (String path : paths) { relativePath = new File(relativePath, path); file = new File(root, relativePath.getPath()); lastMkdirsCallSuccessful = file.mkdirs(); if (!lastMkdirsCallSuccessful && !file.isDirectory()) { if (file.exists()) { throw new IOException( "a file with the path \'" + relativePath.getPath() + "\' exists"); } else { throw new IOException( "could not create a folder with the path \'" + relativePath.getPath() + "\'"); } } } if (!lastMkdirsCallSuccessful) { throw new IOException( "a folder with the path \'" + relativePath.getPath() + "\' already exists"); } return file; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newFolder File: src/main/java/org/junit/rules/TemporaryFolder.java Repository: junit-team/junit4 The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-15250
LOW
1.9
junit-team/junit4
newFolder
src/main/java/org/junit/rules/TemporaryFolder.java
610155b8c22138329f0723eec22521627dbc52ae
0
Analyze the following code function for security vulnerabilities
protected boolean dumpProviderProto(FileDescriptor fd, PrintWriter pw, String name, String[] args) { return mProviderMap.dumpProviderProto(fd, pw, name, args); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpProviderProto 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
dumpProviderProto
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private XWikiAttachment retrieveDeletedAttachment(XWikiDocument doc, XWikiAttachment attachment, XWikiContext context) { XWikiAttachment result = null; InputStream is = null; try { is = attachment.getContentInputStream(context); if (is == null) { AttachmentRecycleBinStore attachmentRecycleBinStore = context.getWiki().getAttachmentRecycleBinStore(); List<DeletedAttachment> allDeletedAttachments = attachmentRecycleBinStore.getAllDeletedAttachments(doc, context, true); for (DeletedAttachment deletedAttachment : allDeletedAttachments) { XWikiAttachment restoredAttachment = deletedAttachment.restoreAttachment(); if (restoredAttachment.getDate().before(attachment.getDate())) { break; } result = restoredAttachment; } if (result != null) { if (!Objects.equals(attachment.getVersion(), result.getVersion())) { result = result.getAttachmentRevision(attachment.getVersion(), context); } } } } catch (XWikiException e) { LOGGER.error("Error while trying to load deleted attachment [{}] for doc [{}]", attachment, doc, e); } finally { if (is != null) { try { is.close(); } catch (IOException ex) { } } } if (result == null) { result = attachment; } else { result.setDoc(doc); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveDeletedAttachment 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
retrieveDeletedAttachment
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 NativeObject getPaginatedAPIsByStatus(APIConsumer apiConsumer, String tenantDomain, int start, int end, String[] status, boolean returnAPItags) { Set<API> apiSet; Map<String, Object> resultMap; NativeArray myn = new NativeArray(0); NativeObject result = new NativeObject(); try { if (tenantDomain != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true); } else { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true); } resultMap = apiConsumer.getAllPaginatedAPIsByStatus(tenantDomain, start, end, status, returnAPItags); } catch (APIManagementException e) { log.error("Error from Registry API while getting API Information", e); return result; } catch (Exception e) { log.error("Error while getting API Information", e); return result; } finally { PrivilegedCarbonContext.endTenantFlow(); } if (resultMap != null) { apiSet = (Set<API>) resultMap.get("apis"); if (apiSet != null) { Iterator it = apiSet.iterator(); int i = 0; while (it.hasNext()) { NativeObject row = new NativeObject(); Object apiObject = it.next(); API api = (API) apiObject; APIIdentifier apiIdentifier = api.getId(); row.put("name", row, apiIdentifier.getApiName()); row.put("provider", row, APIUtil.replaceEmailDomainBack(apiIdentifier.getProviderName())); row.put("version", row, apiIdentifier.getVersion()); row.put("context", row, api.getContext()); row.put("status", row, api.getStatus()); // api.getStatus().toString() if (api.getThumbnailUrl() == null) { row.put("thumbnailurl", row, "images/api-default.png"); } else { row.put("thumbnailurl", row, APIUtil.prependWebContextRoot(api.getThumbnailUrl())); } row.put("visibility", row, api.getVisibility()); row.put("visibleRoles", row, api.getVisibleRoles()); row.put("description", row, api.getDescription()); String apiOwner = APIUtil.replaceEmailDomainBack(api.getApiOwner()); if (apiOwner == null) { apiOwner = APIUtil.replaceEmailDomainBack(apiIdentifier.getProviderName()); } row.put("apiOwner", row, apiOwner); row.put("isAdvertiseOnly", row, api.isAdvertiseOnly()); row.put("apiBusinessOwner", row, api.getBusinessOwner()); row.put("rates", row, api.getRating()); NativeArray tierArr = new NativeArray(0); Set<Tier> tierSet = api.getAvailableTiers(); if (tierSet != null) { Iterator tierIt = tierSet.iterator(); int j = 0; while (tierIt.hasNext()) { Object tierObject = tierIt.next(); Tier tier = (Tier) tierObject; tierArr.put(j, tierArr, tier.getName()); j++; } } row.put("tiers", row, tierArr); row.put("monetizationCategory", row, api.getMonetizationCategory()); if (returnAPItags) { StringBuilder tagsSet = new StringBuilder(""); for (int k = 0; k < api.getTags().toArray().length; k++) { tagsSet.append(api.getTags().toArray()[k].toString()); if (k != api.getTags().toArray().length - 1) { tagsSet.append(","); } } row.put("tags", row, tagsSet.toString()); } NativeArray envArr = api.getEnvironmentList() != null ? new NativeArray(api.getEnvironmentList().toArray()) : new NativeArray(0); row.put("environmentList", row, envArr); myn.put(i, myn, row); i++; } result.put("apis", result, myn); result.put("totalLength", result, resultMap.get("totalLength")); result.put("isMore", result, resultMap.get("isMore")); } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPaginatedAPIsByStatus File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
getPaginatedAPIsByStatus
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
private CompletableFuture<Void> internalUpdateOffloadPolicies(OffloadPoliciesImpl offloadPolicies, TopicName topicName) { return pulsar().getBrokerService().getTopicIfExists(topicName.toString()) .thenAccept(optionalTopic -> { try { if (!optionalTopic.isPresent() || !topicName.isPersistent()) { return; } PersistentTopic persistentTopic = (PersistentTopic) optionalTopic.get(); ManagedLedgerConfig managedLedgerConfig = persistentTopic.getManagedLedger().getConfig(); if (offloadPolicies == null) { LedgerOffloader namespaceOffloader = pulsar().getLedgerOffloaderMap().get(topicName.getNamespaceObject()); LedgerOffloader topicOffloader = managedLedgerConfig.getLedgerOffloader(); if (topicOffloader != null && topicOffloader != namespaceOffloader) { topicOffloader.close(); } managedLedgerConfig.setLedgerOffloader(namespaceOffloader); } else { managedLedgerConfig.setLedgerOffloader( pulsar().createManagedLedgerOffloader(offloadPolicies)); } persistentTopic.getManagedLedger().setConfig(managedLedgerConfig); } catch (PulsarServerException e) { throw new RestException(e); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalUpdateOffloadPolicies 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
internalUpdateOffloadPolicies
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
private int readNext(byte[] dest, int offset, int len) throws IOException { int readBytes = 0; while (readBytes < len) { int ret = in.read(dest, readBytes + offset, len - readBytes); if (ret == -1) { finishedReading = true; return readBytes; } readBytes += ret; } return readBytes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readNext File: src/main/java/org/xerial/snappy/SnappyInputStream.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-34455
HIGH
7.5
xerial/snappy-java
readNext
src/main/java/org/xerial/snappy/SnappyInputStream.java
3bf67857fcf70d9eea56eed4af7c925671e8eaea
0
Analyze the following code function for security vulnerabilities
@Override public void printXMLComment(String content, boolean escape) { handleSpaceWhenStartElement(); super.printXMLComment(content, escape); this.elementEnded = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printXMLComment File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
printXMLComment
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
Task getTask() { return mActivityRecord != null ? mActivityRecord.getTask() : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTask 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
getTask
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override protected Set<ServerStatus.Capability> capabilities() { if (configuration.isLeader()) { //noinspection deprecation return EnumSet.of(ServerStatus.Capability.SERVER, ServerStatus.Capability.MASTER); } else { return EnumSet.of(ServerStatus.Capability.SERVER); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: capabilities File: graylog2-server/src/main/java/org/graylog2/commands/Server.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
capabilities
graylog2-server/src/main/java/org/graylog2/commands/Server.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
public Converter<?> createConverter(String converterId) { notNull("converterId", converterId); Converter<?> converter = createCDIConverter(converterId); if (converter != null) { return converter; } converter = newThing(converterId, converterIdMap); notNullNamedObject(converter, converterId, "jsf.cannot_instantiate_converter_error"); if (LOGGER.isLoggable(FINE)) { LOGGER.fine(MessageFormat.format("created converter of type ''{0}''", converterId)); } if (passDefaultTimeZone && converter instanceof DateTimeConverter) { ((DateTimeConverter) converter).setTimeZone(systemTimeZone); } associate.getAnnotationManager().applyConverterAnnotations(FacesContext.getCurrentInstance(), converter); return converter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createConverter File: impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-14371
MEDIUM
5
eclipse-ee4j/mojarra
createConverter
impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
1b434748d9239f42eae8aa7d37d7a0930c061e24
0
Analyze the following code function for security vulnerabilities
public void test_exception() throws Exception { RuntimeException ex = new RuntimeException("e1"); String text = JSON.toJSONString(ex); System.out.println(text); RuntimeException ex2 = (RuntimeException) JSON.parse(text); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2022-25845 - Severity: MEDIUM - CVSS Score: 6.8 Description: bug fix for autoType Function: test_exception File: src/test/java/com/alibaba/json/bvt/bug/Bug_for_Exception.java Repository: alibaba/fastjson Fixed Code: public void test_exception() throws Exception { RuntimeException ex = new RuntimeException("e1"); String text = JSON.toJSONString(ex); System.out.println(text); Object obj = JSON.parse(text); assertTrue(obj instanceof Map); RuntimeException ex2 = (RuntimeException) JSON.parseObject(text, Throwable.class); }
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
test_exception
src/test/java/com/alibaba/json/bvt/bug/Bug_for_Exception.java
35db4adad70c32089542f23c272def1ad920a60d
1
Analyze the following code function for security vulnerabilities
public boolean isAccessPermissionPdf() { synchronized (this) { if ((navigationHelper != null && !isEnabled(PDFDownloadJob.LOCAL_TYPE, navigationHelper.getCurrentPage())) || viewManager == null) { return false; } return viewManager.isAccessPermissionPdf(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAccessPermissionPdf File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
isAccessPermissionPdf
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
@Override public long getCompressedSize(String fileName) throws DirectoryException { return getSize(fileName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCompressedSize File: brut.j.dir/src/main/java/brut/directory/FileDirectory.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
getCompressedSize
brut.j.dir/src/main/java/brut/directory/FileDirectory.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
public ServerBuilder rejectedRouteHandler(RejectedRouteHandler handler) { virtualHostTemplate.rejectedRouteHandler(handler); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rejectedRouteHandler File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
rejectedRouteHandler
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public static void unregisterServlets(File webXML) { if ( !webXML.exists() ) { Log.error("Could not unregister plugin servlets, file " + webXML.getAbsolutePath() + " does not exist."); return; } // Find the name of the plugin directory given that the webXML file lives in plugins/[pluginName]/web/web.xml final String pluginName = webXML.getParentFile().getParentFile().getParentFile().getName(); try { final Document webXmlDoc = WebXmlUtils.asDocument( webXML ); // Un-register and destroy all servlets. final List<String> servletNames = WebXmlUtils.getServletNames( webXmlDoc ); for ( final String servletName : servletNames ) { Log.debug( "Unregistering servlet '{}' of plugin '{}'", servletName, pluginName ); final Set<Servlet> toDestroy = new HashSet<>(); final Set<String> urlPatterns = WebXmlUtils.getServletUrlPatterns( webXmlDoc, servletName ); for ( final String urlPattern : urlPatterns ) { final GenericServlet servlet = servlets.remove( ( pluginName + urlPattern ).toLowerCase() ); if (servlet != null) { toDestroy.add( servlet ); } } for ( final Servlet servlet : toDestroy ) { servlet.destroy(); } Log.debug( "Servlet '{}' of plugin '{}' unregistered and destroyed successfully.", servletName, pluginName ); } // Un-register and destroy all servlet filters. final List<String> filterNames = WebXmlUtils.getFilterNames( webXmlDoc ); for ( final String filterName : filterNames ) { Log.debug( "Unregistering filter '{}' of plugin '{}'", filterName, pluginName ); final Set<Filter> toDestroy = new HashSet<>(); final String className = WebXmlUtils.getFilterClassName( webXmlDoc, filterName ); final Set<String> urlPatterns = WebXmlUtils.getFilterUrlPatterns( webXmlDoc, filterName ); for ( final String urlPattern : urlPatterns ) { final Filter filter = PluginFilter.removePluginFilter( urlPattern, className ); if (filter != null) { toDestroy.add( filter ); } } for ( final Filter filter : toDestroy ) { filter.destroy(); } Log.debug( "Filter '{}' of plugin '{}' unregistered and destroyesd successfully.", filterName, pluginName ); } } catch (Throwable e) { Log.error( "An unexpected problem occurred while attempting to unregister servlets.", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterServlets File: xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java Repository: igniterealtime/Openfire The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18393
MEDIUM
5
igniterealtime/Openfire
unregisterServlets
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java
5af6e03c25b121d01e752927c401124a4da569f7
0
Analyze the following code function for security vulnerabilities
protected boolean disassociate(String userId, Location location) { synchronized (_uid2Location) { boolean result = false; Set<Location> locations = _uid2Location.get(userId); if (locations != null) { result = locations.remove(location); if (locations.isEmpty()) { _uid2Location.remove(userId); } } if (_logger.isDebugEnabled()) { _logger.debug("Associations: {}", _uid2Location.size()); } // Logging below can generate hugely long lines. if (_logger.isTraceEnabled()) { _logger.trace("Associations: {}", _uid2Location); } return result; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disassociate File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
disassociate
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
public ValueProvider<T, V> getValueProvider() { return valueProvider; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValueProvider 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
getValueProvider
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override public void destroyAllData() { droppedData.clear(); activeData.clear(); updatedData.clear(); getKeyMapper().removeAll(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroyAllData 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
destroyAllData
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
0
Analyze the following code function for security vulnerabilities
void removeJars(JARDesc[] jars) { for (JARDesc eachJar : jars) { try { tracker.removeResource(eachJar.getLocation()); } catch (Exception e) { LOG.error("Failed to remove resource from tracker, continuing..", e); } File cachedFile = CacheUtil.getCacheFile(eachJar.getLocation(), eachJar.getVersion()); String directoryUrl = CacheUtil.getCacheParentDirectory(cachedFile.getAbsolutePath()); File directory = new File(directoryUrl); LOG.info("Deleting cached file: {}", cachedFile.getAbsolutePath()); cachedFile.delete(); LOG.info("Deleting cached directory: {}", directory.getAbsolutePath()); directory.delete(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeJars File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
removeJars
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@Override public void setFocusedStack(int stackId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(stackId); mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFocusedStack File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setFocusedStack
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public int getActivityDisplayId(IBinder activityToken) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(activityToken); mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); reply.readException(); final int displayId = reply.readInt(); data.recycle(); reply.recycle(); return displayId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActivityDisplayId File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getActivityDisplayId
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
void setState(State state, String reason) { ProtoLog.v(WM_DEBUG_STATES, "State movement: %s from:%s to:%s reason:%s", this, getState(), state, reason); if (state == mState) { // No need to do anything if state doesn't change. ProtoLog.v(WM_DEBUG_STATES, "State unchanged from:%s", state); return; } mState = state; if (getTaskFragment() != null) { getTaskFragment().onActivityStateChanged(this, state, reason); } // The WindowManager interprets the app stopping signal as // an indication that the Surface will eventually be destroyed. // This however isn't necessarily true if we are going to sleep. if (state == STOPPING && !isSleeping()) { if (getParent() == null) { Slog.w(TAG_WM, "Attempted to notify stopping on non-existing app token: " + token); return; } } if (app != null) { mTaskSupervisor.onProcessActivityStateChanged(app, false /* forceBatch */); } switch (state) { case RESUMED: mAtmService.updateBatteryStats(this, true); mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_RESUMED); // Fall through. case STARTED: // Update process info while making an activity from invisible to visible, to make // sure the process state is updated to foreground. if (app != null) { app.updateProcessInfo(false /* updateServiceConnectionActivities */, true /* activityChange */, true /* updateOomAdj */, true /* addPendingTopUid */); } final ContentCaptureManagerInternal contentCaptureService = LocalServices.getService(ContentCaptureManagerInternal.class); if (contentCaptureService != null) { contentCaptureService.notifyActivityEvent(mUserId, mActivityComponent, ActivityEvent.TYPE_ACTIVITY_STARTED); } break; case PAUSED: mAtmService.updateBatteryStats(this, false); mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_PAUSED); break; case STOPPED: mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_STOPPED); break; case DESTROYED: if (app != null && (mVisible || mVisibleRequested)) { // The app may be died while visible (no PAUSED state). mAtmService.updateBatteryStats(this, false); } mAtmService.updateActivityUsageStats(this, Event.ACTIVITY_DESTROYED); // Fall through. case DESTROYING: if (app != null && !app.hasActivities()) { // Update any services we are bound to that might care about whether // their client may have activities. // No longer have activities, so update LRU list and oom adj. app.updateProcessInfo(true /* updateServiceConnectionActivities */, false /* activityChange */, true /* updateOomAdj */, false /* addPendingTopUid */); } break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setState File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
setState
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void sendMessage(String toJID, String message) { final Message newMessage = new Message(toJID, Message.Type.chat); newMessage.setBody(message); newMessage.addExtension(new DeliveryReceiptRequest()); if (isAuthenticated()) { if(mucJIDs.contains(toJID)) { sendMucMessage(toJID, message); } else { addChatMessageToDB(ChatConstants.OUTGOING, toJID, message, ChatConstants.DS_SENT_OR_READ, System.currentTimeMillis(), newMessage.getPacketID()); mXMPPConnection.sendPacket(newMessage); } } else { // send offline -> store to DB addChatMessageToDB(ChatConstants.OUTGOING, toJID, message, ChatConstants.DS_NEW, System.currentTimeMillis(), newMessage.getPacketID()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendMessage File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
sendMessage
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
@Override protected Identifier getRelatedIdentifier(Contentlet contentlet, String relationshipType) throws DotDataException { String tableName; try { //tableName = ((Inode) Identifier.class.newInstance()).getType(); tableName = "identifier"; } catch (Exception e) { throw new DotDataException("Unable to instantiate identifier",e); } HibernateUtil dh = new HibernateUtil(Identifier.class); String sql = "SELECT {" + tableName + ".*} from " + tableName + " " + tableName + ", tree tree, inode " + tableName + "_1_ where tree.parent = ? and "+ tableName+"_1_.type ='"+tableName+"' and tree.child = " + tableName + ".id and " + tableName + "_1_.inode = " + tableName + ".id and tree.relation_type = ?"; Logger.debug(this, "HibernateUtilSQL:getChildOfClassByRelationType\n " + sql + "\n"); dh.setSQLQuery(sql); Logger.debug(this, "contentlet inode: " + contentlet.getInode() + "\n"); dh.setParam(contentlet.getInode()); dh.setParam(relationshipType); return (Identifier)dh.load(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelatedIdentifier File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getRelatedIdentifier
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public static void cursorLongToContentValues(Cursor cursor, String field, ContentValues values) { cursorLongToContentValues(cursor, field, values, field); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cursorLongToContentValues File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
cursorLongToContentValues
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public @ColorInt int getSecondaryTextColor(StandardTemplateParams p) { return getColors(p).getSecondaryTextColor(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecondaryTextColor File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getSecondaryTextColor
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private static void splitBrainProtectionXmlGenerator(XmlGenerator gen, Config config) { for (SplitBrainProtectionConfig splitBrainProtectionConfig : config.getSplitBrainProtectionConfigs().values()) { gen.open("split-brain-protection", "name", splitBrainProtectionConfig.getName(), "enabled", splitBrainProtectionConfig.isEnabled()) .node("minimum-cluster-size", splitBrainProtectionConfig.getMinimumClusterSize()) .node("protect-on", splitBrainProtectionConfig.getProtectOn()); if (!splitBrainProtectionConfig.getListenerConfigs().isEmpty()) { gen.open("listeners"); for (SplitBrainProtectionListenerConfig listenerConfig : splitBrainProtectionConfig.getListenerConfigs()) { gen.node("listener", classNameOrImplClass(listenerConfig.getClassName(), listenerConfig.getImplementation())); } gen.close(); } handleSplitBrainProtectionFunction(gen, splitBrainProtectionConfig); gen.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: splitBrainProtectionXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-522" ]
CVE-2023-33264
MEDIUM
4.3
hazelcast
splitBrainProtectionXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
private void updateFromLabelMap(Iterable<Element> elts, HashMap<String, String> labelMap) { for (Element elt : elts) { String oldLib = elt.getAttribute("lib"); String name = elt.getAttribute("name"); if (oldLib != null && name != null) { String newLib = labelMap.get(oldLib + ":" + name); if (newLib != null) { elt.setAttribute("lib", newLib); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateFromLabelMap File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
updateFromLabelMap
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
private PasswordMetrics getPasswordMinimumMetricsUnchecked(@UserIdInt int userId, boolean deviceWideOnly) { if (!mHasFeature) { new PasswordMetrics(CREDENTIAL_TYPE_NONE); } Preconditions.checkArgumentNonnegative(userId, "Invalid userId"); if (deviceWideOnly) { Preconditions.checkArgument(!isManagedProfile(userId)); } ArrayList<PasswordMetrics> adminMetrics = new ArrayList<>(); final List<ActiveAdmin> admins; synchronized (getLockObject()) { if (deviceWideOnly) { admins = getActiveAdminsForUserAndItsManagedProfilesLocked(userId, /* shouldIncludeProfileAdmins */ (user) -> false); } else { admins = getActiveAdminsForLockscreenPoliciesLocked(userId); } for (ActiveAdmin admin : admins) { adminMetrics.add(admin.mPasswordPolicy.getMinMetrics()); } } return PasswordMetrics.merge(adminMetrics); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordMinimumMetricsUnchecked 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
getPasswordMinimumMetricsUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
boolean dumpUids(PrintWriter pw, String dumpPackage, SparseArray<UidRecord> uids, String header, boolean needSep) { boolean printed = false; int whichAppId = -1; if (dumpPackage != null) { try { ApplicationInfo info = mContext.getPackageManager().getApplicationInfo( dumpPackage, 0); whichAppId = UserHandle.getAppId(info.uid); } catch (NameNotFoundException e) { e.printStackTrace(); } } for (int i=0; i<uids.size(); i++) { UidRecord uidRec = uids.valueAt(i); if (dumpPackage != null && UserHandle.getAppId(uidRec.uid) != whichAppId) { continue; } if (!printed) { printed = true; if (needSep) { pw.println(); } pw.print(" "); pw.println(header); needSep = true; } pw.print(" UID "); UserHandle.formatUid(pw, uidRec.uid); pw.print(": "); pw.println(uidRec); } return printed; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpUids File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
dumpUids
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private void push(Context context) { if (++size >= limit) { throw new RuntimeException("Input is too deeply nested " + size); } context.next = head; head = context; }
Vulnerability Classification: - CWE: CWE-834 - CVE: CVE-2023-4043 - Severity: HIGH - CVSS Score: 7.5 Description: Eexception message moved to messages bundle in JsonParserImpl. Signed-off-by: Tomáš Kraus <tomas.kraus@oracle.com> Function: push File: impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java Repository: eclipse-ee4j/parsson Fixed Code: private void push(Context context) { if (++size >= limit) { throw new RuntimeException(JsonMessages.PARSER_INPUT_NESTED_TOO_DEEP(size)); } context.next = head; head = context; }
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
push
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
ab239fee273cb262910890f1a6fe666ae92cd623
1
Analyze the following code function for security vulnerabilities
public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).setScope(scope); return this; } } throw new RuntimeException("No OAuth2 authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOauthScope File: samples/openapi3/client/extensions/x-auth-id-alias/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
setOauthScope
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public boolean isUnlockWithFingerprintPossible(int userId) { return mFpm != null && mFpm.isHardwareDetected() && !isFingerprintDisabled(userId) && mFpm.getEnrolledFingerprints(userId).size() > 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUnlockWithFingerprintPossible File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
isUnlockWithFingerprintPossible
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public XWikiAttachment getAttachment(String filename) { XWikiAttachment output = this.attachmentList.getByFilename(filename); if (output != null) { return output; } for (XWikiAttachment attach : getAttachmentList()) { if (attach.getFilename().startsWith(filename + ".")) { return attach; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachment 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
getAttachment
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public boolean canReceiveKeys(boolean fromUserTouch) { final boolean canReceiveKeys = isVisibleRequestedOrAdding() && (mViewVisibility == View.VISIBLE) && !mRemoveOnExit && ((mAttrs.flags & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) == 0) && (mActivityRecord == null || mActivityRecord.windowsAreFocusable(fromUserTouch)) && canReceiveTouchInput(); if (!canReceiveKeys) { return false; } // Do not allow untrusted virtual display to receive keys unless user intentionally // touches the display. return fromUserTouch || getDisplayContent().isOnTop() || getDisplayContent().isTrusted(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canReceiveKeys 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
canReceiveKeys
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private LikeCondition createLike(Type type, String toMatch) { if (notLike) { return new NotLikeCondition(type, selector, toMatch); } else { return new LikeCondition(type, selector, toMatch); } }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2019-11343 - Severity: HIGH - CVSS Score: 7.5 Description: Fix issue with like Function: createLike File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java Repository: xjodoin/torpedoquery Fixed Code: private LikeCondition createLike(Type type, String toMatch) { if (notLike) { return new NotLikeCondition(selector, selector.generateParameter(type.wrap(toMatch))); } else { return new LikeCondition(selector, selector.generateParameter(type.wrap(toMatch))); } }
[ "CWE-Other" ]
CVE-2019-11343
HIGH
7.5
xjodoin/torpedoquery
createLike
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
3c20b874fba9cc2a78b9ace10208de1602b56c3f
1
Analyze the following code function for security vulnerabilities
public String getSlackLoginURL() { return "https://slack.com/oauth/v2/authorize?response_type=code&client_id=" + CONF.slackAppId() + "&user_scope=identity.basic%20identity.email%20identity.team%20identity.avatar&state=" + getParaAppId() + "&redirect_uri=" + getParaEndpoint() + "/slack_auth"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSlackLoginURL File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getSlackLoginURL
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public void restoreIntentResultListener() { waitingForResult = false; setIntentResultListener(defaultResultListener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restoreIntentResultListener File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
restoreIntentResultListener
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void setLocationEnabled(ComponentName who, boolean locationEnabled) { Preconditions.checkNotNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); UserHandle userHandle = caller.getUserHandle(); if (mIsAutomotive && !locationEnabled) { Slogf.i(LOG_TAG, "setLocationEnabled(%s, %b): ignoring for user %s on automotive build", who.flattenToShortString(), locationEnabled, userHandle); return; } mInjector.binderWithCleanCallingIdentity(() -> { boolean wasLocationEnabled = mInjector.getLocationManager().isLocationEnabledForUser( userHandle); Slogf.v(LOG_TAG, "calling locationMgr.setLocationEnabledForUser(%b, %s) when it was %b", locationEnabled, userHandle, wasLocationEnabled); mInjector.getLocationManager().setLocationEnabledForUser(locationEnabled, userHandle); // make a best effort to only show the notification if the admin is actually enabling // location. this is subject to race conditions with settings changes, but those are // unlikely to realistically interfere if (locationEnabled && !wasLocationEnabled) { showLocationSettingsEnabledNotification(userHandle); } }); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_SECURE_SETTING) .setAdmin(who) .setStrings(Settings.Secure.LOCATION_MODE, Integer.toString( locationEnabled ? Settings.Secure.LOCATION_MODE_ON : Settings.Secure.LOCATION_MODE_OFF)) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLocationEnabled 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
setLocationEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public int bindService(IApplicationThread caller, IBinder token, Intent service, String resolvedType, IServiceConnection connection, int flags, String callingPackage, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindService File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
bindService
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private void unloadAllContainers(Set<AsecInstallArgs> cidArgs) { // Just unmount all valid containers. for (AsecInstallArgs arg : cidArgs) { synchronized (mInstallLock) { arg.doPostDeleteLI(false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unloadAllContainers 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
unloadAllContainers
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public boolean getAttributeBooleanValue(int idx, boolean defaultValue) { final int t = nativeGetAttributeDataType(mParseState, idx); if (t == ERROR_NULL_DOCUMENT) { throw new NullPointerException("Null document"); } // Note: don't attempt to convert any other types, because // we want to count on aapt doing the conversion for us. if (t >= TypedValue.TYPE_FIRST_INT && t <= TypedValue.TYPE_LAST_INT) { final int v = nativeGetAttributeData(mParseState, idx); if (v == ERROR_NULL_DOCUMENT) { throw new NullPointerException("Null document"); } return v != 0; } return defaultValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttributeBooleanValue File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getAttributeBooleanValue
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
protected JSONArray newJSONArray() throws JSONException { return new JSONArray(this); }
Vulnerability Classification: - CWE: CWE-674, CWE-787 - CVE: CVE-2022-45693 - Severity: HIGH - CVSS Score: 7.5 Description: Fixing StackOverflow error Function: newJSONArray File: src/main/java/org/codehaus/jettison/json/JSONTokener.java Repository: jettison-json/jettison Fixed Code: protected JSONArray newJSONArray() throws JSONException { checkRecursionDepth(); return new JSONArray(this); }
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
newJSONArray
src/main/java/org/codehaus/jettison/json/JSONTokener.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
1
Analyze the following code function for security vulnerabilities
@Override public void pollState() { mPollingContext = new int[1]; mPollingContext[0] = 0; switch (mCi.getRadioState()) { case RADIO_UNAVAILABLE: mNewSS.setStateOutOfService(); mNewCellLoc.setStateInvalid(); setSignalStrengthDefaultValues(); mGotCountryCode = false; mNitzUpdatedTime = false; pollStateDone(); break; case RADIO_OFF: mNewSS.setStateOff(); mNewCellLoc.setStateInvalid(); setSignalStrengthDefaultValues(); mGotCountryCode = false; mNitzUpdatedTime = false; if (ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN != mSS.getRilDataRadioTechnology()) { pollStateDone(); } default: // Issue all poll-related commands at once // then count down the responses, which // are allowed to arrive out-of-order mPollingContext[0]++; mCi.getOperator( obtainMessage( EVENT_POLL_STATE_OPERATOR, mPollingContext)); mPollingContext[0]++; mCi.getDataRegistrationState( obtainMessage( EVENT_POLL_STATE_GPRS, mPollingContext)); mPollingContext[0]++; mCi.getVoiceRegistrationState( obtainMessage( EVENT_POLL_STATE_REGISTRATION, mPollingContext)); mPollingContext[0]++; mCi.getNetworkSelectionMode( obtainMessage( EVENT_POLL_STATE_NETWORK_SELECTION_MODE, mPollingContext)); break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pollState File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
pollState
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public void setKeyguardUserSwitcher(KeyguardUserSwitcher keyguardUserSwitcher) { mKeyguardUserSwitcher = keyguardUserSwitcher; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setKeyguardUserSwitcher 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
setKeyguardUserSwitcher
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private boolean handleSearchParam(String paramIdxString, HttpServletRequest theReq, IQuery theQuery, JsonWriter theClientCodeJsonWriter) throws IOException { String nextName = theReq.getParameter("param." + paramIdxString + ".name"); if (isBlank(nextName)) { return false; } String nextQualifier = StringUtils.defaultString(theReq.getParameter("param." + paramIdxString + ".qualifier")); String nextType = theReq.getParameter("param." + paramIdxString + ".type"); List<String> parts = new ArrayList<String>(); for (int i = 0; i < 5; i++) { parts.add(defaultString(theReq.getParameter("param." + paramIdxString + "." + i))); } List<String> values; boolean addToWhere = true; if ("token".equals(nextType)) { if (isBlank(parts.get(1))) { return true; } addToWhere = false; if (isBlank(parts.get(0))) { values = Collections.singletonList(parts.get(1)); theQuery.where(new TokenClientParam(nextName + nextQualifier).exactly().code(parts.get(1))); } else { values = Collections.singletonList(parts.get(0) + "|" + parts.get(1)); theQuery.where(new TokenClientParam(nextName + nextQualifier).exactly().systemAndCode(parts.get(0), parts.get(1))); } } else if ("date".equals(nextType)) { values = new ArrayList<String>(); if (isNotBlank(parts.get(1))) { values.add(StringUtils.join(parts.get(0), parts.get(1))); } if (isNotBlank(parts.get(3))) { values.add(StringUtils.join(parts.get(2), parts.get(3))); } if (values.isEmpty()) { return true; } } else if ("quantity".equals(nextType)) { values = new ArrayList<String>(); addToWhere = false; QuantityClientParam param = new QuantityClientParam(nextName); IMatches<IAndUnits> matcher; if ("~".equals(parts.get(0))) { matcher = param.approximately(); } else if ("=".equals(parts.get(0))) { matcher = param.exactly(); } else if (">=".equals(parts.get(0))) { matcher = param.greaterThanOrEquals(); } else if ("<=".equals(parts.get(0))) { matcher = param.lessThanOrEquals(); } else if (">".equals(parts.get(0))) { matcher = param.greaterThan(); } else if ("<".equals(parts.get(0))) { matcher = param.lessThan(); } else { throw new Error("Unknown qualifier: " + parts.get(0)); } IAndUnits number = matcher.number(parts.get(1)); if (isBlank(parts.get(3))) { theQuery.where(number.andNoUnits()); } else if (isBlank(parts.get(2))) { theQuery.where(number.andUnits(parts.get(3))); } else { theQuery.where(number.andUnits(parts.get(2), parts.get(3))); } values.add(parts.get(0) + parts.get(1) + "|" + parts.get(2) + "|" + parts.get(3)); if (values.isEmpty()) { return true; } } else { values = Collections.singletonList(StringUtils.join(parts, "")); if (isBlank(values.get(0))) { return true; } } for (String nextValue : values) { theClientCodeJsonWriter.beginObject(); theClientCodeJsonWriter.name("type"); theClientCodeJsonWriter.value(nextType); theClientCodeJsonWriter.name("name"); theClientCodeJsonWriter.value(nextName); theClientCodeJsonWriter.name("qualifier"); theClientCodeJsonWriter.value(nextQualifier); theClientCodeJsonWriter.name("value"); theClientCodeJsonWriter.value(nextValue); theClientCodeJsonWriter.endObject(); if (addToWhere) { theQuery.where(new StringClientParam(nextName + nextQualifier).matches().value(nextValue)); } } if (StringUtils.isNotBlank(theReq.getParameter("param." + paramIdxString + ".0.name"))) { handleSearchParam(paramIdxString + ".0", theReq, theQuery, theClientCodeJsonWriter); } return true; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-24301 - Severity: MEDIUM - CVSS Score: 4.3 Description: Resolve XSS vulnerability Function: handleSearchParam File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java Repository: hapifhir/hapi-fhir Fixed Code: private boolean handleSearchParam(String paramIdxString, HttpServletRequest theReq, IQuery theQuery, JsonWriter theClientCodeJsonWriter) throws IOException { String nextName = sanitizeUrlPart(theReq.getParameter("param." + paramIdxString + ".name")); if (isBlank(nextName)) { return false; } String nextQualifier = sanitizeUrlPart(defaultString(theReq.getParameter("param." + paramIdxString + ".qualifier"))); String nextType = sanitizeUrlPart(theReq.getParameter("param." + paramIdxString + ".type")); List<String> parts = new ArrayList<String>(); for (int i = 0; i < 5; i++) { parts.add(sanitizeUrlPart(defaultString(theReq.getParameter("param." + paramIdxString + "." + i)))); } List<String> values; boolean addToWhere = true; if ("token".equals(nextType)) { if (isBlank(parts.get(1))) { return true; } addToWhere = false; if (isBlank(parts.get(0))) { values = Collections.singletonList(parts.get(1)); theQuery.where(new TokenClientParam(nextName + nextQualifier).exactly().code(parts.get(1))); } else { values = Collections.singletonList(parts.get(0) + "|" + parts.get(1)); theQuery.where(new TokenClientParam(nextName + nextQualifier).exactly().systemAndCode(parts.get(0), parts.get(1))); } } else if ("date".equals(nextType)) { values = new ArrayList<String>(); if (isNotBlank(parts.get(1))) { values.add(StringUtils.join(parts.get(0), parts.get(1))); } if (isNotBlank(parts.get(3))) { values.add(StringUtils.join(parts.get(2), parts.get(3))); } if (values.isEmpty()) { return true; } } else if ("quantity".equals(nextType)) { values = new ArrayList<String>(); addToWhere = false; QuantityClientParam param = new QuantityClientParam(nextName); IMatches<IAndUnits> matcher; if ("~".equals(parts.get(0))) { matcher = param.approximately(); } else if ("=".equals(parts.get(0))) { matcher = param.exactly(); } else if (">=".equals(parts.get(0))) { matcher = param.greaterThanOrEquals(); } else if ("<=".equals(parts.get(0))) { matcher = param.lessThanOrEquals(); } else if (">".equals(parts.get(0))) { matcher = param.greaterThan(); } else if ("<".equals(parts.get(0))) { matcher = param.lessThan(); } else { throw new Error("Unknown qualifier: " + parts.get(0)); } IAndUnits number = matcher.number(parts.get(1)); if (isBlank(parts.get(3))) { theQuery.where(number.andNoUnits()); } else if (isBlank(parts.get(2))) { theQuery.where(number.andUnits(parts.get(3))); } else { theQuery.where(number.andUnits(parts.get(2), parts.get(3))); } values.add(parts.get(0) + parts.get(1) + "|" + parts.get(2) + "|" + parts.get(3)); if (values.isEmpty()) { return true; } } else { values = Collections.singletonList(StringUtils.join(parts, "")); if (isBlank(values.get(0))) { return true; } } for (String nextValue : values) { theClientCodeJsonWriter.beginObject(); theClientCodeJsonWriter.name("type"); theClientCodeJsonWriter.value(nextType); theClientCodeJsonWriter.name("name"); theClientCodeJsonWriter.value(nextName); theClientCodeJsonWriter.name("qualifier"); theClientCodeJsonWriter.value(nextQualifier); theClientCodeJsonWriter.name("value"); theClientCodeJsonWriter.value(nextValue); theClientCodeJsonWriter.endObject(); if (addToWhere) { theQuery.where(new StringClientParam(nextName + nextQualifier).matches().value(nextValue)); } } if (StringUtils.isNotBlank(theReq.getParameter("param." + paramIdxString + ".0.name"))) { handleSearchParam(paramIdxString + ".0", theReq, theQuery, theClientCodeJsonWriter); } return true; }
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
handleSearchParam
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
1
Analyze the following code function for security vulnerabilities
@Nullable protected String getAutosaveKey() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAutosaveKey File: server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-21242
HIGH
7.5
theonedev/onedev
getAutosaveKey
server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
f864053176c08f59ef2d97fea192ceca46a4d9be
0
Analyze the following code function for security vulnerabilities
@Override public boolean getBooleanAndRemove(K name, boolean defaultValue) { Boolean v = getBooleanAndRemove(name); return v != null ? v : defaultValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBooleanAndRemove File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
getBooleanAndRemove
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@CalledByNative private void clearNativePtr() { assert mNativeTabAndroid != 0; mNativeTabAndroid = 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearNativePtr File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
clearNativePtr
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public void dismiss(boolean authenticated, int targetId, boolean bypassSecondaryLockScreen, SecurityMode expectedSecurityMode) { mSecurityCallback.dismiss(authenticated, targetId, bypassSecondaryLockScreen, expectedSecurityMode); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dismiss File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21245
HIGH
7.8
android
dismiss
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
a33159e8cb297b9eee6fa5c63c0e343d05fad622
0
Analyze the following code function for security vulnerabilities
public ContentProviderHelper getContentProviderHelper() { return mCpHelper; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentProviderHelper File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
getContentProviderHelper
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private void setInactive(boolean inactive) { if (isInactiveSelf != inactive) { isInactiveSelf = inactive; visitNodeTree(child -> { if (!equals(child) && !child.isInactiveSelf) { /* * We are here if: the child node itself is not inactive but * it has some ascendant which is inactive. * * In this case we send only some subset of changes (not * from all the features). But we should send changes for * all remaining features. Normally it automatically happens * if the node becomes "visible". But if it was visible with * some invisible parent then only the parent becomes dirty * (when it's set visible) and this child will never * participate in collection of changes since it's not * marked as dirty. * * So here such node (which is active itself but its * ascendant is inactive) we mark as dirty again to be able * to collect its changes later on when its ascendant * becomes active. */ child.markAsDirty(); } }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setInactive File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
setInactive
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Override public void setTaskWindowingMode(int taskId, int windowingMode, boolean toTop) { if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) { setTaskWindowingModeSplitScreenPrimary(taskId, SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT, toTop, ANIMATE, null /* initialBounds */, true /* showRecents */); return; } enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "setTaskWindowingMode()"); synchronized (this) { final long ident = Binder.clearCallingIdentity(); try { final TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId); if (task == null) { Slog.w(TAG, "setTaskWindowingMode: No task for id=" + taskId); return; } if (DEBUG_STACK) Slog.d(TAG_STACK, "setTaskWindowingMode: moving task=" + taskId + " to windowingMode=" + windowingMode + " toTop=" + toTop); if (!task.isActivityTypeStandardOrUndefined()) { throw new IllegalArgumentException("setTaskWindowingMode: Attempt to move" + " non-standard task " + taskId + " to windowing mode=" + windowingMode); } final ActivityStack stack = task.getStack(); if (toTop) { stack.moveToFront("setTaskWindowingMode", task); } stack.setWindowingMode(windowingMode); } finally { Binder.restoreCallingIdentity(ident); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTaskWindowingMode 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
setTaskWindowingMode
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public int length() { return mText.length(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: length File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
length
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
private int peek(int idx) throws IOException { while (idx>=peek.length()) { int c=reader.read(); if (c<0) return c; peek.append((char)c); } return peek.charAt(idx); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: peek File: src/main/org/hjson/HjsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
peek
src/main/org/hjson/HjsonParser.java
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public Account getFromAccount() { return mReplyFromAccount != null && mReplyFromAccount.account != null ? mReplyFromAccount.account : mAccount; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFromAccount 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
getFromAccount
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public String getConfigValue(String key) { return runOrBomb(git_C().withArgs("config", "--get-all", key)).outputAsString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfigValue File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
getConfigValue
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0