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
public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, Bundle args) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); intent.writeToParcel(data, 0); data.writeInt(requestType); data.writeString(hint); data.writeInt(userHandle); data.writeBundle(args); mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); reply.readException(); boolean res = reply.readInt() != 0; data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: launchAssistIntent File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
launchAssistIntent
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void flush() { synchronized (builder) { try { body = new String(builder.toString().getBytes(StandardCharsets.UTF_8)); boolean includeEndTag = isIncludePageEndTag(body); if (includeEndTag && response.getContentType().contains("text/html")) { body = getCompressAndParseHtml(body); } out.write(body); // Reset the local StringBuilder and issue real flush. builder.setLength(0); super.flush(); } catch (IOException ex) { LOGGER.error("", ex); } } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2019-16643 - Severity: LOW - CVSS Score: 3.5 Description: Upgrade jar version & fix #54 Signed-off-by: xiaochun <xchun90@163.com> Function: flush File: web/src/main/java/com/zrlog/web/handler/ResponseRenderPrintWriter.java Repository: 94fzb/zrlog Fixed Code: @Override public void flush() { synchronized (builder) { try { body = new String(builder.toString().getBytes(StandardCharsets.UTF_8)); boolean includeEndTag = isIncludePageEndTag(body); if (includeEndTag && response.getContentType().contains("text/html")) { body = getCompressAndParseHtml(body); } if(out != null) { out.write(body); } // Reset the local StringBuilder and issue real flush. builder.setLength(0); super.flush(); } catch (IOException ex) { LOGGER.error("", ex); } } }
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
flush
web/src/main/java/com/zrlog/web/handler/ResponseRenderPrintWriter.java
4a91c83af669e31a22297c14f089d8911d353fa1
1
Analyze the following code function for security vulnerabilities
public void dispose() { mContext.getContentResolver().unregisterContentObserver(mSettingsObserver); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispose File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
dispose
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
public static byte[] rawCompress(Object data, int byteSize) throws IOException { byte[] buf = new byte[Snappy.maxCompressedLength(byteSize)]; int compressedByteSize = impl.rawCompress(data, 0, byteSize, buf, 0); byte[] result = new byte[compressedByteSize]; System.arraycopy(buf, 0, result, 0, compressedByteSize); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rawCompress File: src/main/java/org/xerial/snappy/Snappy.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34454
HIGH
7.5
xerial/snappy-java
rawCompress
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
protected CoercionAction _checkFromStringCoercion(DeserializationContext ctxt, String value, LogicalType logicalType, Class<?> rawTargetType) throws IOException { // 18-Dec-2020, tatu: Formats without strong typing (XML, CSV, Properties at // least) should allow from-String "coercion" since Strings are their // native type. // One open question is whether Empty/Blank String are special; they might // be so only apply short-cut to other cases, for now final CoercionAction act; if (value.isEmpty()) { act = ctxt.findCoercionAction(logicalType, rawTargetType, CoercionInputShape.EmptyString); return _checkCoercionFail(ctxt, act, rawTargetType, value, "empty String (\"\")"); } else if (_isBlank(value)) { act = ctxt.findCoercionFromBlankString(logicalType, rawTargetType, CoercionAction.Fail); return _checkCoercionFail(ctxt, act, rawTargetType, value, "blank String (all whitespace)"); } else { // 18-Dec-2020, tatu: As per above, allow for XML, CSV, Properties if (ctxt.isEnabled(StreamReadCapability.UNTYPED_SCALARS)) { return CoercionAction.TryConvert; } act = ctxt.findCoercionAction(logicalType, rawTargetType, CoercionInputShape.String); if (act == CoercionAction.Fail) { // since it MIGHT (but might not), create desc here, do not use helper ctxt.reportInputMismatch(this, "Cannot coerce String value (\"%s\") to %s (but might if coercion using `CoercionConfig` was enabled)", value, _coercedTypeDesc()); } } return act; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _checkFromStringCoercion File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_checkFromStringCoercion
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
private String[] _getUsersWithRole(final String roleid) throws IOException { final List<String> usersWithRole = new ArrayList<String>(); for (final User user : m_users.values()) { if (_userHasRole(user, roleid)) { usersWithRole.add(user.getUserId()); } } return usersWithRole.toArray(new String[usersWithRole.size()]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _getUsersWithRole File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
_getUsersWithRole
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
@Override public OptionalDouble getValue() { ModelNode result = readAttributeValue(address, attributeName); if (result.isDefined()) { try { return OptionalDouble.of(result.asDouble()); } catch (Exception e) { LOGGER.unableToConvertAttribute(attributeName, address, e); } } return OptionalDouble.empty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValue File: metrics/src/main/java/org/wildfly/extension/metrics/WildFlyMetric.java Repository: wildfly The code follows secure coding practices.
[ "CWE-200" ]
CVE-2021-3503
MEDIUM
4
wildfly
getValue
metrics/src/main/java/org/wildfly/extension/metrics/WildFlyMetric.java
a48db605577d941b5ae3e899a1187303e138ca74
0
Analyze the following code function for security vulnerabilities
void updateUserConfigurationLocked() { final Configuration configuration = new Configuration(getGlobalConfiguration()); final int currentUserId = mUserController.getCurrentUserId(); Settings.System.adjustConfigurationForUser(mContext.getContentResolver(), configuration, currentUserId, Settings.System.canWrite(mContext)); updateConfigurationLocked(configuration, null /* starting */, false /* initLocale */, false /* persistent */, currentUserId, false /* deferResume */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateUserConfigurationLocked 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
updateUserConfigurationLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override protected void dump(FileDescriptor fd, PrintWriter printWriter, String[] args) { if (!DumpUtils.checkDumpPermission(mContext, LOG_TAG, printWriter)) return; try (IndentingPrintWriter pw = new IndentingPrintWriter(printWriter, " ")) { pw.println("Current Device Policy Manager state:"); pw.increaseIndent(); dumpImmutableState(pw); synchronized (getLockObject()) { mOwners.dump(pw); pw.println(); mDeviceAdminServiceController.dump(pw); pw.println(); dumpPerUserData(pw); pw.println(); mConstants.dump(pw); pw.println(); mStatLogger.dump(pw); pw.println(); pw.println("Encryption Status: " + getEncryptionStatusName(getEncryptionStatus())); pw.println("Logout user: " + getLogoutUserIdUnchecked()); pw.println(); if (mPendingUserCreatedCallbackTokens.isEmpty()) { pw.println("no pending user created callback tokens"); } else { int size = mPendingUserCreatedCallbackTokens.size(); pw.printf("%d pending user created callback token%s\n", size, (size == 1 ? "" : "s")); } pw.println(); mPolicyCache.dump(pw); pw.println(); mStateCache.dump(pw); pw.println(); } mHandler.post(() -> handleDump(pw)); dumpResources(pw); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump 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
dump
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public String serializeReference(EntityReference reference) { return referenceSerializer.serialize(reference); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serializeReference File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
serializeReference
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private String getRequiredVerifierLPr() { final Intent verification = new Intent(Intent.ACTION_PACKAGE_NEEDS_VERIFICATION); final List<ResolveInfo> receivers = queryIntentReceivers(verification, PACKAGE_MIME_TYPE, PackageManager.GET_DISABLED_COMPONENTS, 0 /* TODO: Which userId? */); String requiredVerifier = null; final int N = receivers.size(); for (int i = 0; i < N; i++) { final ResolveInfo info = receivers.get(i); if (info.activityInfo == null) { continue; } final String packageName = info.activityInfo.packageName; if (checkPermission(android.Manifest.permission.PACKAGE_VERIFICATION_AGENT, packageName, UserHandle.USER_OWNER) != PackageManager.PERMISSION_GRANTED) { continue; } if (requiredVerifier != null) { throw new RuntimeException("There can be only one required verifier"); } requiredVerifier = packageName; } return requiredVerifier; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequiredVerifierLPr 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
getRequiredVerifierLPr
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void removeAccount(Account account, @UserIdInt int sourceUserId) { final AccountManager accountManager = mContext.createContextAsUser( UserHandle.of(sourceUserId), /* flags= */ 0) .getSystemService(AccountManager.class); try { final Bundle result = accountManager.removeAccount(account, null, null /* callback */, null /* handler */).getResult(60, TimeUnit.SECONDS); if (result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT, /* default */ false)) { Slogf.i(LOG_TAG, "Account removed from the primary user."); } else { // TODO(174768447): Revisit start activity logic. final Intent removeIntent = result.getParcelable(AccountManager.KEY_INTENT, android.content.Intent.class); removeIntent.addFlags(FLAG_ACTIVITY_NEW_TASK); if (removeIntent != null) { Slogf.i(LOG_TAG, "Starting activity to remove account"); new Handler(Looper.getMainLooper()).post(() -> { mContext.startActivity(removeIntent); }); } else { Slogf.e(LOG_TAG, "Could not remove account from the primary user."); } } } catch (OperationCanceledException | AuthenticatorException | IOException e) { Slogf.e(LOG_TAG, "Exception removing account from the primary user.", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeAccount File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
removeAccount
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void testTools() throws Exception { if (config.memory || config.cipher != null) { return; } deleteDb(getTestName()); Connection conn = getConnection(getTestName()); conn.createStatement().execute( "create table test(id int) as select 1"); conn.close(); Server server = new Server(); server.setOut(new PrintStream(new ByteArrayOutputStream())); server.runTool("-web", "-webPort", "8182", "-properties", "null", "-tcp", "-tcpPort", "9101", "-webAdminPassword", "123"); try { String url = "http://localhost:8182"; WebClient client; String result; client = new WebClient(); result = client.get(url); client.readSessionId(result); result = client.get(url, "adminLogin.do?password=123"); result = client.get(url, "tools.jsp"); FileUtils.delete(getBaseDir() + "/backup.zip"); result = client.get(url, "tools.do?tool=Backup&args=-dir," + getBaseDir() + ",-db," + getTestName() + ",-file," + getBaseDir() + "/backup.zip"); deleteDb(getTestName()); assertTrue(FileUtils.exists(getBaseDir() + "/backup.zip")); result = client.get(url, "tools.do?tool=DeleteDbFiles&args=-dir," + getBaseDir() + ",-db," + getTestName()); String fn = getBaseDir() + "/" + getTestName() + Constants.SUFFIX_MV_FILE; assertFalse(FileUtils.exists(fn)); result = client.get(url, "tools.do?tool=Restore&args=-dir," + getBaseDir() + ",-db," + getTestName() +",-file," + getBaseDir() + "/backup.zip"); assertTrue(FileUtils.exists(fn)); FileUtils.delete(getBaseDir() + "/web.h2.sql"); FileUtils.delete(getBaseDir() + "/backup.zip"); result = client.get(url, "tools.do?tool=Recover&args=-dir," + getBaseDir() + ",-db," + getTestName()); assertTrue(FileUtils.exists(getBaseDir() + "/" + getTestName() + ".h2.sql")); FileUtils.delete(getBaseDir() + "/web.h2.sql"); result = client.get(url, "tools.do?tool=RunScript&args=-script," + getBaseDir() + "/" + getTestName() + ".h2.sql,-url," + getURL(getTestName(), true) + ",-user," + getUser() + ",-password," + getPassword()); FileUtils.delete(getBaseDir() + "/" + getTestName() + ".h2.sql"); assertTrue(FileUtils.exists(fn)); deleteDb(getTestName()); } finally { server.shutdown(); } }
Vulnerability Classification: - CWE: CWE-312 - CVE: CVE-2022-45868 - Severity: HIGH - CVSS Score: 7.8 Description: Disallow plain webAdminPassword values to force usage of hashes Function: testTools File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database Fixed Code: private void testTools() throws Exception { if (config.memory || config.cipher != null) { return; } deleteDb(getTestName()); Connection conn = getConnection(getTestName()); conn.createStatement().execute( "create table test(id int) as select 1"); conn.close(); String hash = WebServer.encodeAdminPassword("1234567890AB"); try { Server.main("-web", "-webPort", "8182", "-properties", "null", "-tcp", "-tcpPort", "9101", "-webAdminPassword", hash); fail("Expected exception"); } catch (JdbcSQLFeatureNotSupportedException e) { // Expected } Server server = new Server(); server.setOut(new PrintStream(new ByteArrayOutputStream())); try { server.runTool("-web", "-webPort", "8182", "-properties", "null", "-tcp", "-tcpPort", "9101", "-webAdminPassword", "123"); fail("Expected exception"); } catch (JdbcSQLNonTransientException e) { // Expected } server.runTool("-web", "-webPort", "8182", "-properties", "null", "-tcp", "-tcpPort", "9101", "-webAdminPassword", hash); try { String url = "http://localhost:8182"; WebClient client; String result; client = new WebClient(); result = client.get(url); client.readSessionId(result); result = client.get(url, "adminLogin.do?password=1234567890AB"); result = client.get(url, "tools.jsp"); FileUtils.delete(getBaseDir() + "/backup.zip"); result = client.get(url, "tools.do?tool=Backup&args=-dir," + getBaseDir() + ",-db," + getTestName() + ",-file," + getBaseDir() + "/backup.zip"); deleteDb(getTestName()); assertTrue(FileUtils.exists(getBaseDir() + "/backup.zip")); result = client.get(url, "tools.do?tool=DeleteDbFiles&args=-dir," + getBaseDir() + ",-db," + getTestName()); String fn = getBaseDir() + "/" + getTestName() + Constants.SUFFIX_MV_FILE; assertFalse(FileUtils.exists(fn)); result = client.get(url, "tools.do?tool=Restore&args=-dir," + getBaseDir() + ",-db," + getTestName() +",-file," + getBaseDir() + "/backup.zip"); assertTrue(FileUtils.exists(fn)); FileUtils.delete(getBaseDir() + "/web.h2.sql"); FileUtils.delete(getBaseDir() + "/backup.zip"); result = client.get(url, "tools.do?tool=Recover&args=-dir," + getBaseDir() + ",-db," + getTestName()); assertTrue(FileUtils.exists(getBaseDir() + "/" + getTestName() + ".h2.sql")); FileUtils.delete(getBaseDir() + "/web.h2.sql"); result = client.get(url, "tools.do?tool=RunScript&args=-script," + getBaseDir() + "/" + getTestName() + ".h2.sql,-url," + getURL(getTestName(), true) + ",-user," + getUser() + ",-password," + getPassword()); FileUtils.delete(getBaseDir() + "/" + getTestName() + ".h2.sql"); assertTrue(FileUtils.exists(fn)); deleteDb(getTestName()); } finally { server.shutdown(); } }
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
testTools
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
1
Analyze the following code function for security vulnerabilities
private JWT decode(String encodedJWT, Header header, String[] parts, Verifier verifier) { int index = encodedJWT.lastIndexOf("."); // The message comprises the first two segments of the entire JWT, the signature is the last segment. byte[] message = encodedJWT.substring(0, index).getBytes(StandardCharsets.UTF_8); // If a signature is provided and verifier must be provided. if (parts.length == 3 && verifier == null) { throw new MissingVerifierException("No Verifier has been provided for verify a signature signed using [" + header.algorithm.getName() + "]"); } if (parts.length == 3) { // Verify the signature before de-serializing the payload. byte[] signature = base64Decode(parts[2].getBytes(StandardCharsets.UTF_8)); verifier.verify(header.algorithm, message, signature); } JWT jwt = Mapper.deserialize(base64Decode(parts[1].getBytes(StandardCharsets.UTF_8)), JWT.class); // Verify expiration claim if (jwt.isExpired()) { throw new JWTExpiredException(); } // Verify the notBefore claim if (jwt.isUnavailableForProcessing()) { throw new JWTUnavailableForProcessingException(); } return jwt; }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2018-1000125 - Severity: HIGH - CVSS Score: 7.5 Description: Fixes Issue #2, bug exists that allows a JWT to be decoded even when no signature is provided. Function: decode File: src/main/java/org/primeframework/jwt/JWTDecoder.java Repository: FusionAuth/fusionauth-jwt Fixed Code: private JWT decode(String encodedJWT, Header header, String[] parts, Verifier verifier) { int index = encodedJWT.lastIndexOf("."); // The message comprises the first two segments of the entire JWT, the signature is the last segment. byte[] message = encodedJWT.substring(0, index).getBytes(StandardCharsets.UTF_8); // If a signature is provided and verifier must be provided. if (parts.length == 3 && verifier == null) { throw new MissingVerifierException("No Verifier has been provided for verify a signature signed using [" + header.algorithm.getName() + "]"); } // A verifier was provided but no signature exists, this is treated as an invalid signature. if (parts.length == 2 && verifier != null) { throw new InvalidJWTSignatureException(); } if (parts.length == 3) { // Verify the signature before de-serializing the payload. byte[] signature = base64Decode(parts[2].getBytes(StandardCharsets.UTF_8)); verifier.verify(header.algorithm, message, signature); } JWT jwt = Mapper.deserialize(base64Decode(parts[1].getBytes(StandardCharsets.UTF_8)), JWT.class); // Verify expiration claim if (jwt.isExpired()) { throw new JWTExpiredException(); } // Verify the notBefore claim if (jwt.isUnavailableForProcessing()) { throw new JWTUnavailableForProcessingException(); } return jwt; }
[ "CWE-20" ]
CVE-2018-1000125
HIGH
7.5
FusionAuth/fusionauth-jwt
decode
src/main/java/org/primeframework/jwt/JWTDecoder.java
0d94dcef0133d699f21d217e922564adbb83a227
1
Analyze the following code function for security vulnerabilities
private static final boolean writeProcessOomListToProto(ProtoOutputStream proto, long fieldId, ActivityManagerService service, List<ProcessRecord> origList, boolean inclDetails, String dumpPackage) { ArrayList<Pair<ProcessRecord, Integer>> list = sortProcessOomList(origList, dumpPackage); if (list.isEmpty()) return false; final long curUptime = SystemClock.uptimeMillis(); for (int i = list.size() - 1; i >= 0; i--) { ProcessRecord r = list.get(i).first; long token = proto.start(fieldId); String oomAdj = ProcessList.makeOomAdjString(r.setAdj); proto.write(ProcessOomProto.PERSISTENT, r.persistent); proto.write(ProcessOomProto.NUM, (origList.size()-1)-list.get(i).second); proto.write(ProcessOomProto.OOM_ADJ, oomAdj); int schedGroup = ProcessOomProto.SCHED_GROUP_UNKNOWN; switch (r.setSchedGroup) { case ProcessList.SCHED_GROUP_BACKGROUND: schedGroup = ProcessOomProto.SCHED_GROUP_BACKGROUND; break; case ProcessList.SCHED_GROUP_DEFAULT: schedGroup = ProcessOomProto.SCHED_GROUP_DEFAULT; break; case ProcessList.SCHED_GROUP_TOP_APP: schedGroup = ProcessOomProto.SCHED_GROUP_TOP_APP; break; case ProcessList.SCHED_GROUP_TOP_APP_BOUND: schedGroup = ProcessOomProto.SCHED_GROUP_TOP_APP_BOUND; break; } if (schedGroup != ProcessOomProto.SCHED_GROUP_UNKNOWN) { proto.write(ProcessOomProto.SCHED_GROUP, schedGroup); } if (r.foregroundActivities) { proto.write(ProcessOomProto.ACTIVITIES, true); } else if (r.foregroundServices) { proto.write(ProcessOomProto.SERVICES, true); } proto.write(ProcessOomProto.STATE, ProcessList.makeProcStateProtoEnum(r.curProcState)); proto.write(ProcessOomProto.TRIM_MEMORY_LEVEL, r.trimMemoryLevel); r.writeToProto(proto, ProcessOomProto.PROC); proto.write(ProcessOomProto.ADJ_TYPE, r.adjType); if (r.adjSource != null || r.adjTarget != null) { if (r.adjTarget instanceof ComponentName) { ComponentName cn = (ComponentName) r.adjTarget; cn.writeToProto(proto, ProcessOomProto.ADJ_TARGET_COMPONENT_NAME); } else if (r.adjTarget != null) { proto.write(ProcessOomProto.ADJ_TARGET_OBJECT, r.adjTarget.toString()); } if (r.adjSource instanceof ProcessRecord) { ProcessRecord p = (ProcessRecord) r.adjSource; p.writeToProto(proto, ProcessOomProto.ADJ_SOURCE_PROC); } else if (r.adjSource != null) { proto.write(ProcessOomProto.ADJ_SOURCE_OBJECT, r.adjSource.toString()); } } if (inclDetails) { long detailToken = proto.start(ProcessOomProto.DETAIL); proto.write(ProcessOomProto.Detail.MAX_ADJ, r.maxAdj); proto.write(ProcessOomProto.Detail.CUR_RAW_ADJ, r.curRawAdj); proto.write(ProcessOomProto.Detail.SET_RAW_ADJ, r.setRawAdj); proto.write(ProcessOomProto.Detail.CUR_ADJ, r.curAdj); proto.write(ProcessOomProto.Detail.SET_ADJ, r.setAdj); proto.write(ProcessOomProto.Detail.CURRENT_STATE, ProcessList.makeProcStateProtoEnum(r.curProcState)); proto.write(ProcessOomProto.Detail.SET_STATE, ProcessList.makeProcStateProtoEnum(r.setProcState)); proto.write(ProcessOomProto.Detail.LAST_PSS, DebugUtils.sizeValueToString( r.lastPss*1024, new StringBuilder())); proto.write(ProcessOomProto.Detail.LAST_SWAP_PSS, DebugUtils.sizeValueToString( r.lastSwapPss*1024, new StringBuilder())); proto.write(ProcessOomProto.Detail.LAST_CACHED_PSS, DebugUtils.sizeValueToString( r.lastCachedPss*1024, new StringBuilder())); proto.write(ProcessOomProto.Detail.CACHED, r.cached); proto.write(ProcessOomProto.Detail.EMPTY, r.empty); proto.write(ProcessOomProto.Detail.HAS_ABOVE_CLIENT, r.hasAboveClient); if (r.setProcState >= ActivityManager.PROCESS_STATE_SERVICE) { if (r.lastCpuTime != 0) { long uptimeSince = curUptime - service.mLastPowerCheckUptime; long timeUsed = r.curCpuTime - r.lastCpuTime; long cpuTimeToken = proto.start(ProcessOomProto.Detail.SERVICE_RUN_TIME); proto.write(ProcessOomProto.Detail.CpuRunTime.OVER_MS, uptimeSince); proto.write(ProcessOomProto.Detail.CpuRunTime.USED_MS, timeUsed); proto.write(ProcessOomProto.Detail.CpuRunTime.ULTILIZATION, (100.0*timeUsed)/uptimeSince); proto.end(cpuTimeToken); } } proto.end(detailToken); } proto.end(token); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeProcessOomListToProto 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
writeProcessOomListToProto
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void setLogPrefix(String logPrefix) { this.logPrefix = logPrefix; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLogPrefix File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
setLogPrefix
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getPermittedInputMethods(ComponentName who, boolean calledOnParentInstance) { if (!mHasFeature) { return null; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); if (calledOnParentInstance) { Preconditions.checkCallAuthorization(isProfileOwnerOfOrganizationOwnedDevice(caller)); } else { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); } synchronized (getLockObject()) { final ActiveAdmin admin = getParentOfAdminIfRequired( getProfileOwnerOrDeviceOwnerLocked(caller), calledOnParentInstance); return admin.permittedInputMethods; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermittedInputMethods 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
getPermittedInputMethods
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public Map<String, Authentication> getAuthentications() { return authentications; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthentications File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getAuthentications
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
protected void hideToast() { if (mToast != null) { mToast.cancel(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hideToast File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
hideToast
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
static void registerSmackProviders() { ProviderManager pm = ProviderManager.getInstance(); // add IQ handling pm.addIQProvider("query","http://jabber.org/protocol/disco#info", new DiscoverInfoProvider()); pm.addIQProvider("query","http://jabber.org/protocol/disco#items", new DiscoverItemsProvider()); // add delayed delivery notifications pm.addExtensionProvider("delay","urn:xmpp:delay", new DelayInfoProvider()); pm.addExtensionProvider("x","jabber:x:delay", new DelayInfoProvider()); // add XEP-0092 Software Version pm.addIQProvider("query", Version.NAMESPACE, new Version.Provider()); // data forms pm.addExtensionProvider("x","jabber:x:data", new DataFormProvider()); // add carbons and forwarding pm.addExtensionProvider("forwarded", Forwarded.NAMESPACE, new Forwarded.Provider()); pm.addExtensionProvider("sent", Carbon.NAMESPACE, new Carbon.Provider()); pm.addExtensionProvider("received", Carbon.NAMESPACE, new Carbon.Provider()); // add delivery receipts pm.addExtensionProvider(DeliveryReceipt.ELEMENT, DeliveryReceipt.NAMESPACE, new DeliveryReceipt.Provider()); pm.addExtensionProvider(DeliveryReceiptRequest.ELEMENT, DeliveryReceipt.NAMESPACE, new DeliveryReceiptRequest.Provider()); // add XMPP Ping (XEP-0199) pm.addIQProvider("ping","urn:xmpp:ping", new PingProvider()); ServiceDiscoveryManager.setDefaultIdentity(YAXIM_IDENTITY); // XEP-0115 Entity Capabilities pm.addExtensionProvider("c", "http://jabber.org/protocol/caps", new CapsExtensionProvider()); // XEP-0308 Last Message Correction pm.addExtensionProvider("replace", Replace.NAMESPACE, new Replace.Provider()); // XEP-XXXX Pre-Authenticated Roster Subscription pm.addExtensionProvider("preauth", PreAuth.NAMESPACE, new PreAuth.Provider()); // MUC User pm.addExtensionProvider("x","http://jabber.org/protocol/muc#user", new MUCUserProvider()); // MUC direct invitation pm.addExtensionProvider("x","jabber:x:conference", new GroupChatInvitation.Provider()); // MUC Admin pm.addIQProvider("query","http://jabber.org/protocol/muc#admin", new MUCAdminProvider()); // MUC Owner pm.addIQProvider("query","http://jabber.org/protocol/muc#owner", new MUCOwnerProvider()); XmppStreamHandler.addExtensionProviders(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerSmackProviders 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
registerSmackProviders
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
private void migrateLegacySettingsLocked(SettingsState settingsState, SQLiteDatabase database, String table) { SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder(); queryBuilder.setTables(table); Cursor cursor = queryBuilder.query(database, LEGACY_SQL_COLUMNS, null, null, null, null, null); if (cursor == null) { return; } try { if (!cursor.moveToFirst()) { return; } final int nameColumnIdx = cursor.getColumnIndex(Settings.NameValueTable.NAME); final int valueColumnIdx = cursor.getColumnIndex(Settings.NameValueTable.VALUE); settingsState.setVersionLocked(database.getVersion()); while (!cursor.isAfterLast()) { String name = cursor.getString(nameColumnIdx); String value = cursor.getString(valueColumnIdx); settingsState.insertSettingLocked(name, value, null, true, SettingsState.SYSTEM_PACKAGE_NAME); cursor.moveToNext(); } } finally { cursor.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrateLegacySettingsLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
migrateLegacySettingsLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public void editorMoved(EditorMoveEvent e);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: editorMoved 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
editorMoved
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public Connection newConnection(ExecutorService executor, List<Address> addrs) throws IOException, TimeoutException { return newConnection(executor, addrs, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newConnection File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
newConnection
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
public static LicenseInfo retrieveNamed(final String key) { if (key.length() > 99 && key.matches("^[0-9a-z]+$")) { try { final String sig = SignatureUtils.toHexString(PLSSignature.signature()); return PLSSignature.retrieveNamed(sig, key, true); } catch (Exception e) { // Logme.error(e); Log.info("Error retrieving license info" + e); } } return LicenseInfo.NONE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveNamed File: src/net/sourceforge/plantuml/version/LicenseInfo.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
retrieveNamed
src/net/sourceforge/plantuml/version/LicenseInfo.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public void addRole(String role) { roles.add(role); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addRole File: base/common/src/main/java/com/netscape/certsrv/account/Account.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
addRole
base/common/src/main/java/com/netscape/certsrv/account/Account.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private int getUidForVerifier(VerifierInfo verifierInfo) { synchronized (mPackages) { final PackageParser.Package pkg = mPackages.get(verifierInfo.packageName); if (pkg == null) { return -1; } else if (pkg.mSignatures.length != 1) { Slog.i(TAG, "Verifier package " + verifierInfo.packageName + " has more than one signature; ignoring"); return -1; } /* * If the public key of the package's signature does not match * our expected public key, then this is a different package and * we should skip. */ final byte[] expectedPublicKey; try { final Signature verifierSig = pkg.mSignatures[0]; final PublicKey publicKey = verifierSig.getPublicKey(); expectedPublicKey = publicKey.getEncoded(); } catch (CertificateException e) { return -1; } final byte[] actualPublicKey = verifierInfo.publicKey.getEncoded(); if (!Arrays.equals(actualPublicKey, expectedPublicKey)) { Slog.i(TAG, "Verifier package " + verifierInfo.packageName + " does not have the expected public key; ignoring"); return -1; } return pkg.applicationInfo.uid; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUidForVerifier 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
getUidForVerifier
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public ServiceRegistry getServiceRegistry() { return serviceRegistry; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServiceRegistry File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java Repository: opencast The code follows secure coding practices.
[ "CWE-74" ]
CVE-2020-5230
MEDIUM
5
opencast
getServiceRegistry
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
bbb473f34ab95497d6c432c81285efb0c739f317
0
Analyze the following code function for security vulnerabilities
static void splashScreenAttachedLocked(IBinder token) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); if (r == null) { Slog.w(TAG, "splashScreenTransferredLocked cannot find activity"); return; } r.onSplashScreenAttachComplete(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: splashScreenAttachedLocked 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
splashScreenAttachedLocked
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
void resolveActivity(ActivityTaskSupervisor supervisor) { if (realCallingPid == Request.DEFAULT_REAL_CALLING_PID) { realCallingPid = Binder.getCallingPid(); } if (realCallingUid == Request.DEFAULT_REAL_CALLING_UID) { realCallingUid = Binder.getCallingUid(); } if (callingUid >= 0) { callingPid = -1; } else if (caller == null) { callingPid = realCallingPid; callingUid = realCallingUid; } else { callingPid = callingUid = -1; } // To determine the set of needed Uri permission grants, we need the // "resolved" calling UID, where we try our best to identify the // actual caller that is starting this activity int resolvedCallingUid = callingUid; if (caller != null) { synchronized (supervisor.mService.mGlobalLock) { final WindowProcessController callerApp = supervisor.mService .getProcessController(caller); if (callerApp != null) { resolvedCallingUid = callerApp.mInfo.uid; } } } // Save a copy in case ephemeral needs it ephemeralIntent = new Intent(intent); // Don't modify the client's object! intent = new Intent(intent); if (intent.getComponent() != null && !(Intent.ACTION_VIEW.equals(intent.getAction()) && intent.getData() == null) && !Intent.ACTION_INSTALL_INSTANT_APP_PACKAGE.equals(intent.getAction()) && !Intent.ACTION_RESOLVE_INSTANT_APP_PACKAGE.equals(intent.getAction()) && supervisor.mService.getPackageManagerInternalLocked() .isInstantAppInstallerComponent(intent.getComponent())) { // Intercept intents targeted directly to the ephemeral installer the ephemeral // installer should never be started with a raw Intent; instead adjust the intent // so it looks like a "normal" instant app launch. intent.setComponent(null /* component */); } resolveInfo = supervisor.resolveIntent(intent, resolvedType, userId, 0 /* matchFlags */, computeResolveFilterUid(callingUid, realCallingUid, filterCallingUid)); if (resolveInfo == null) { final UserInfo userInfo = supervisor.getUserInfo(userId); if (userInfo != null && userInfo.isManagedProfile()) { // Special case for managed profiles, if attempting to launch non-cryto aware // app in a locked managed profile from an unlocked parent allow it to resolve // as user will be sent via confirm credentials to unlock the profile. final UserManager userManager = UserManager.get(supervisor.mService.mContext); boolean profileLockedAndParentUnlockingOrUnlocked = false; final long token = Binder.clearCallingIdentity(); try { final UserInfo parent = userManager.getProfileParent(userId); profileLockedAndParentUnlockingOrUnlocked = (parent != null) && userManager.isUserUnlockingOrUnlocked(parent.id) && !userManager.isUserUnlockingOrUnlocked(userId); } finally { Binder.restoreCallingIdentity(token); } if (profileLockedAndParentUnlockingOrUnlocked) { resolveInfo = supervisor.resolveIntent(intent, resolvedType, userId, PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE, computeResolveFilterUid(callingUid, realCallingUid, filterCallingUid)); } } } // Collect information about the target of the Intent. activityInfo = supervisor.resolveActivity(intent, resolveInfo, startFlags, profilerInfo); // Carefully collect grants without holding lock if (activityInfo != null) { intentGrants = supervisor.mService.mUgmInternal.checkGrantUriPermissionFromIntent( intent, resolvedCallingUid, activityInfo.applicationInfo.packageName, UserHandle.getUserId(activityInfo.applicationInfo.uid)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveActivity File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
resolveActivity
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
private void skipReceiverLocked(BroadcastRecord r) { logBroadcastReceiverDiscardLocked(r); finishReceiverLocked(r, r.resultCode, r.resultData, r.resultExtras, r.resultAbort, false); scheduleBroadcastsLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: skipReceiverLocked File: services/core/java/com/android/server/am/BroadcastQueue.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
skipReceiverLocked
services/core/java/com/android/server/am/BroadcastQueue.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public static String encodeXMLChar(char ch) { switch (ch) { case '&': return "&amp;"; case '\"': return "&quot;"; case '\'': return "&#39;"; case '<': return "&lt;"; case '>': return "&gt;"; default: return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: encodeXMLChar File: bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java Repository: dbeaver The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3836
MEDIUM
4.3
dbeaver
encodeXMLChar
bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
4debf8f25184b7283681ed3fb5e9e887d9d4fe22
0
Analyze the following code function for security vulnerabilities
public void saveUser(final String name, final User details) throws Exception { update(); m_writeLock.lock(); try { _writeUser(name, details); } finally { m_writeLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveUser File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
saveUser
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
private boolean hasAccountsOnAnyUser() { long callingIdentity = Binder.clearCallingIdentity(); try { for (UserInfo user : mUserManagerInternal.getUsers(/* excludeDying= */ true)) { AccountManager am = mContext.createContextAsUser( UserHandle.of(user.id), /* flags= */ 0) .getSystemService(AccountManager.class); Account[] accounts = am.getAccounts(); if (accounts.length != 0) { return true; } } return false; } finally { Binder.restoreCallingIdentity(callingIdentity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasAccountsOnAnyUser File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
hasAccountsOnAnyUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public int delByBareMetalId(String id) { TaskExample e = new TaskExample(); e.createCriteria().andBareMetalIdEqualTo(id); if (taskMapper.selectByExample(e).stream().filter(t -> t.getStatus().equalsIgnoreCase(ServiceConstants.TaskStatusEnum.running.name())).findFirst().isPresent()) try { MqUtil.request(MqConstants.EXCHANGE_NAME, MqConstants.MQ_ROUTINGKEY_DELETION + id, ""); } catch (Exception e1) { LogUtil.error(String.format("delete queue failed!%s", id)); } return taskMapper.deleteByExample(e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delByBareMetalId File: rackshift-server/src/main/java/io/rackshift/service/TaskService.java Repository: fit2cloud/rackshift The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-42405
CRITICAL
9.8
fit2cloud/rackshift
delByBareMetalId
rackshift-server/src/main/java/io/rackshift/service/TaskService.java
305aea3b20d36591d519f7d04e0a25be05a51e93
0
Analyze the following code function for security vulnerabilities
public void exchangeComplete(final HttpServerExchange exchange) { if (!exchange.isUpgrade() && exchange.isPersistent()) { startRequest(); ConduitStreamSourceChannel channel = ((AjpServerConnection) exchange.getConnection()).getChannel().getSourceChannel(); channel.getReadSetter().set(this); channel.wakeupReads(); } else if(!exchange.isPersistent()) { safeClose(exchange.getConnection()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exchangeComplete File: core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-252" ]
CVE-2022-1319
HIGH
7.5
undertow-io/undertow
exchangeComplete
core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java
1443a1a2bbb8e32e56788109d8285db250d55c8b
0
Analyze the following code function for security vulnerabilities
public String getAttachmentRevisionURL(String filename, String revision, String querystring, XWikiContext context) { // Attachment file name cannot be empty if (StringUtils.isEmpty(filename)) { return null; } return context.getWiki().getAttachmentRevisionURL(new AttachmentReference(filename, getDocumentReference()), revision, querystring, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachmentRevisionURL 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
getAttachmentRevisionURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
@Override public AMQCommand transformReply(AMQCommand command) { return command; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: transformReply File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
transformReply
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTaskDescription File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setTaskDescription
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private static XmlSaxParserContext newInstance(final Ruby runtime, final RubyClass klazz) { return (XmlSaxParserContext) NokogiriService.XML_SAXPARSER_CONTEXT_ALLOCATOR.allocate(runtime, klazz); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newInstance File: ext/java/nokogiri/XmlSaxParserContext.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
newInstance
ext/java/nokogiri/XmlSaxParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
0
Analyze the following code function for security vulnerabilities
public boolean isAllowMdmExpansion() { return myModelConfig.isAllowMdmExpansion(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAllowMdmExpansion File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
isAllowMdmExpansion
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
private static List<Route> alternative(final Set<Route.Definition> routeDefs, final String verb, final String uri) { List<Route> routes = new LinkedList<>(); Set<String> verbs = Sets.newHashSet(Route.METHODS); verbs.remove(verb); for (String alt : verbs) { findRoutes(routeDefs, alt, uri, MediaType.all, MediaType.ALL) .stream() // skip glob pattern .filter(r -> !r.pattern().contains("*")) .forEach(routes::add); } return routes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: alternative File: jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
alternative
jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
public CopyBuildTask outFolder(Getter<File> out) { outputType = FOLDER; outputFile = out; // It's better to just do diffs on the source // if (inputType == FOLDER) { // orChangeNoticer((new ChecksumChangeNoticer()).sourceDestFile(inputFile, out)); // } orGetterChangeNoticer(out); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: outFolder File: APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java Repository: Calsign/APDE The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36628
CRITICAL
9.8
Calsign/APDE
outFolder
APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java
c6d64cbe465348c1bfd211122d89e3117afadecf
0
Analyze the following code function for security vulnerabilities
private NotificationCompat.Builder createNotificationBuilder() { NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getContext()); notificationBuilder.setSmallIcon(R.drawable.notification_icon).setAutoCancel(true); notificationBuilder.setColor(ThemeColorUtils.primaryColor(getContext(), true)); return notificationBuilder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createNotificationBuilder File: src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
createNotificationBuilder
src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java
27559efb79d45782e000b762860658d49e9c35e9
0
Analyze the following code function for security vulnerabilities
public abstract int getEllipsisCount(int line);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEllipsisCount File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getEllipsisCount
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
private void setSurfaceIfReadyLocked() { if (DEBUG_STACK) Slog.v(TAG_STACK, "setSurfaceIfReadyLocked: mDrawn=" + mDrawn + " mContainerState=" + mContainerState + " mSurface=" + mSurface); if (mDrawn && mSurface != null && mContainerState == CONTAINER_STATE_NO_SURFACE) { ((VirtualActivityDisplay) mActivityDisplay).setSurface(mSurface); mContainerState = CONTAINER_STATE_HAS_SURFACE; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSurfaceIfReadyLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
setSurfaceIfReadyLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
private static boolean isCompatible(PermissionPolicyConfig c1, PermissionPolicyConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getProperties(), c2.getProperties()) && nullSafeEqual(c1.getClassName(), c2.getClassName()) && nullSafeEqual(c1.getImplementation(), c2.getImplementation()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCompatible File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
isCompatible
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public int selectAnimationLw(WindowState win, int transit) { if (PRINT_ANIM) Log.i(TAG, "selectAnimation in " + win + ": transit=" + transit); if (win == mStatusBar) { boolean isKeyguard = (win.getAttrs().privateFlags & PRIVATE_FLAG_KEYGUARD) != 0; if (transit == TRANSIT_EXIT || transit == TRANSIT_HIDE) { return isKeyguard ? -1 : R.anim.dock_top_exit; } else if (transit == TRANSIT_ENTER || transit == TRANSIT_SHOW) { return isKeyguard ? -1 : R.anim.dock_top_enter; } } else if (win == mNavigationBar) { // This can be on either the bottom or the right. if (mNavigationBarOnBottom) { if (transit == TRANSIT_EXIT || transit == TRANSIT_HIDE) { return R.anim.dock_bottom_exit; } else if (transit == TRANSIT_ENTER || transit == TRANSIT_SHOW) { return R.anim.dock_bottom_enter; } } else { if (transit == TRANSIT_EXIT || transit == TRANSIT_HIDE) { return R.anim.dock_right_exit; } else if (transit == TRANSIT_ENTER || transit == TRANSIT_SHOW) { return R.anim.dock_right_enter; } } } if (transit == TRANSIT_PREVIEW_DONE) { if (win.hasAppShownWindows()) { if (PRINT_ANIM) Log.i(TAG, "**** STARTING EXIT"); return com.android.internal.R.anim.app_starting_exit; } } else if (win.getAttrs().type == TYPE_DREAM && mDreamingLockscreen && transit == TRANSIT_ENTER) { // Special case: we are animating in a dream, while the keyguard // is shown. We don't want an animation on the dream, because // we need it shown immediately with the keyguard animating away // to reveal it. return -1; } return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectAnimationLw File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
selectAnimationLw
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public void characters(final char[] ch, final int start, final int length) throws SAXException { content.append(ch, start, length); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-1000651 - Severity: HIGH - CVSS Score: 7.5 Description: gh-813 Turn on secure processing feature for XML parsers etc Function: characters File: stroom-pipeline/src/test/java/stroom/util/UniqueXMLEvents.java Repository: gchq/stroom Fixed Code: @Override public void characters(final char[] ch, final int start, final int length) { content.append(ch, start, length); }
[ "CWE-611" ]
CVE-2018-1000651
HIGH
7.5
gchq/stroom
characters
stroom-pipeline/src/test/java/stroom/util/UniqueXMLEvents.java
ba30ffd415bd7d32ee40ba4b04035267ce80b499
1
Analyze the following code function for security vulnerabilities
public void setId(long id) { this.id = id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setId 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
setId
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 String deleteBackupConfig(Request req, Response res) throws IOException { // to throw a NFE, if none is available fetchEntityFromConfig(); goConfigService.updateConfig(new DeleteBackupConfigCommand(), currentUsername()); return renderMessage(res, 200, EntityType.BackupConfig.deleteSuccessful()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteBackupConfig File: api/api-backup-config-v1/src/main/java/com/thoughtworks/go/apiv1/backupconfig/BackupConfigControllerV1.java Repository: gocd The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25924
HIGH
9.3
gocd
deleteBackupConfig
api/api-backup-config-v1/src/main/java/com/thoughtworks/go/apiv1/backupconfig/BackupConfigControllerV1.java
7d0baab0d361c377af84994f95ba76c280048548
0
Analyze the following code function for security vulnerabilities
public ObjectOutputStream createObjectOutputStream(final HierarchicalStreamWriter writer, final String rootNodeName) throws IOException { return createObjectOutputStream(writer, rootNodeName, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createObjectOutputStream File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
createObjectOutputStream
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
private void doHandle(final Request req, final Response rsp, final Asset asset) throws Throwable { // handle etag if (this.etag) { String etag = asset.etag(); boolean ifnm = req.header("If-None-Match").toOptional() .map(etag::equals) .orElse(false); if (ifnm) { rsp.header("ETag", etag).status(Status.NOT_MODIFIED).end(); return; } rsp.header("ETag", etag); } // Handle if modified since if (this.lastModified) { long lastModified = asset.lastModified(); if (lastModified > 0) { boolean ifm = req.header("If-Modified-Since").toOptional(Long.class) .map(ifModified -> lastModified / 1000 <= ifModified / 1000) .orElse(false); if (ifm) { rsp.status(Status.NOT_MODIFIED).end(); return; } rsp.header("Last-Modified", new Date(lastModified)); } } // cache max-age if (maxAge > 0) { rsp.header("Cache-Control", "max-age=" + maxAge); } send(req, rsp, asset); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2020-7647 - Severity: MEDIUM - CVSS Score: 5.0 Description: asset: path traversal fix #1639 Function: doHandle File: jooby/src/main/java/org/jooby/handlers/AssetHandler.java Repository: jooby-project/jooby Fixed Code: private void doHandle(final Request req, final Response rsp, final Asset asset) throws Throwable { // handle etag if (this.etag) { String etag = asset.etag(); boolean ifnm = req.header("If-None-Match").toOptional() .map(etag::equals) .orElse(false); if (ifnm) { rsp.header("ETag", etag).status(Status.NOT_MODIFIED).end(); return; } rsp.header("ETag", etag); } // Handle if modified since if (this.lastModified) { long lastModified = asset.lastModified(); if (lastModified > 0) { boolean ifm = req.header("If-Modified-Since").toOptional(Long.class) .map(ifModified -> lastModified / 1000 <= ifModified / 1000) .orElse(false); if (ifm) { rsp.status(Status.NOT_MODIFIED).end(); return; } rsp.header("Last-Modified", new Date(lastModified)); } } // cache max-age if (maxAge > 0) { rsp.header("Cache-Control", "max-age=" + maxAge); } send(req, rsp, asset); }
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
doHandle
jooby/src/main/java/org/jooby/handlers/AssetHandler.java
34f526028e6cd0652125baa33936ffb6a8a4a009
1
Analyze the following code function for security vulnerabilities
public static void testValidity(Object o) throws JSONException { if (o instanceof Number && !numberIsFinite((Number) o)) { throw new JSONException("JSON does not allow non-finite numbers."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testValidity File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
testValidity
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
static Config fileConfig(final String fname) { // TODO: sanitization of arguments File dir = new File(System.getProperty("user.dir")); // TODO: sanitization of arguments File froot = new File(dir, fname); if (froot.exists()) { return ConfigFactory.parseFile(froot); } else { // TODO: sanitization of arguments File fconfig = new File(new File(dir, "conf"), fname); if (fconfig.exists()) { return ConfigFactory.parseFile(fconfig); } } return ConfigFactory.empty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fileConfig 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
fileConfig
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private boolean isSecondaryInternet() { return mClientModeManager.getRole() == ROLE_CLIENT_SECONDARY_LONG_LIVED && mClientModeManager.isSecondaryInternet(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSecondaryInternet File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
isSecondaryInternet
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public TtyExecErrorable<String, OutputStream, PipedInputStream, ExecWatch> writingOutput(OutputStream out) { return new PodOperationsImpl(getContext().withOut(out)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writingOutput File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
writingOutput
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
public String parameterToString(Object param) { if (param == null) { return ""; } else if (param instanceof Date) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } b.append(String.valueOf(o)); } return b.toString(); } else { return String.valueOf(param); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToString 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
parameterToString
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 void setBundleandDeferCallback(BundleAndDeferCallback bundleAndDeferCallback) { this.bundleAndDeferCallback = bundleAndDeferCallback; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBundleandDeferCallback File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
setBundleandDeferCallback
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
private static boolean isValidFatFilenameChar(char c) { if ((0x00 <= c && c <= 0x1f)) { return false; } switch (c) { case '"': case '*': case '/': case ':': case '<': case '>': case '?': case '\\': case '|': case 0x7F: return false; default: return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidFatFilenameChar File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
isValidFatFilenameChar
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
public static boolean isDataFlavorAvailable(@Nonnull final Clipboard clipboard, @Nonnull final DataFlavor flavor) { boolean result = false; try { result = clipboard.isDataFlavorAvailable(flavor); } catch (final IllegalStateException ex) { LOGGER.warn("Can't get access to clipboard : "+ ex.getMessage()); } return result; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-1000542 - Severity: MEDIUM - CVSS Score: 6.8 Description: #45 activated FEATURE_SECURE_PROCESSING for XML parsing Function: isDataFlavorAvailable File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java Repository: raydac/netbeans-mmd-plugin Fixed Code: public static boolean isDataFlavorAvailable(@Nonnull final Clipboard clipboard, @Nonnull final DataFlavor flavor) { boolean result = false; try { result = clipboard.isDataFlavorAvailable(flavor); } catch (final IllegalStateException ex) { LOGGER.warn("Can't get access to clipboard : " + ex.getMessage()); } return result; }
[ "CWE-611" ]
CVE-2018-1000542
MEDIUM
6.8
raydac/netbeans-mmd-plugin
isDataFlavorAvailable
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
9fba652bf06e649186b8f9e612d60e9cc15097e9
1
Analyze the following code function for security vulnerabilities
protected String getHomeLink(Map<String, Object> data) { String home_page_link = data.get("context_path").toString() + "/home"; if (!getPropertyString("homeUrl").isEmpty()) { home_page_link = getPropertyString("homeUrl"); } return "<li class=\"\"><a class=\"btn\" href=\"" + home_page_link + "\" title=\"" + ResourceBundleUtil.getMessage("theme.universal.home") + "\"><i class=\"fa fa-home\"></i></a></li>\n"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHomeLink File: wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
getHomeLink
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
public List<PanelShareOutDTO> queryTargets(String panelId) { String username = AuthUtils.getUser().getUsername(); List<PanelShareOutDTO> targets = extPanelShareMapper.queryTargets(panelId, username); if (CollectionUtils.isEmpty(targets)) return new ArrayList<>(); return targets.stream().filter(item -> StringUtils.isNotEmpty(item.getTargetName())) .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(item -> item.getPanelId() + item.getType() + item.getTargetId()))), ArrayList::new)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryTargets File: backend/src/main/java/io/dataease/service/panel/ShareService.java Repository: dataease The code follows secure coding practices.
[ "CWE-639" ]
CVE-2023-32310
HIGH
8.1
dataease
queryTargets
backend/src/main/java/io/dataease/service/panel/ShareService.java
72f428e87b5395c03d2f94ef6185fc247ddbc8dc
0
Analyze the following code function for security vulnerabilities
private static Logger getLogger() { return LoggerFactory.getLogger(StaticFileServer.class.getName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLogger File: flow-server/src/main/java/com/vaadin/flow/server/StaticFileServer.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
getLogger
flow-server/src/main/java/com/vaadin/flow/server/StaticFileServer.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
@Override public void showWaitingForDebugger(IApplicationThread who, boolean waiting) { synchronized (this) { ProcessRecord app = who != null ? getRecordForAppLocked(who) : null; if (app == null) return; Message msg = Message.obtain(); msg.what = WAIT_FOR_DEBUGGER_MSG; msg.obj = app; msg.arg1 = waiting ? 1 : 0; mUiHandler.sendMessage(msg); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showWaitingForDebugger 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
showWaitingForDebugger
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public static void fireConfigurationChanged() { final ChangeEvent event = new ChangeEvent(GeoTools.class); final Object[] listeners = LISTENERS.getListenerList(); for (int i = 0; i < listeners.length; i += 2) { if (listeners[i] == ChangeListener.class) { ((ChangeListener) listeners[i + 1]).stateChanged(event); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fireConfigurationChanged File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java Repository: geotools The code follows secure coding practices.
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
fireConfigurationChanged
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
@Override public String getFailedOutput() { return failedOutput; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFailedOutput File: vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-172" ]
CVE-2021-33604
LOW
1.2
vaadin/flow
getFailedOutput
vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
2a801c42b406a00c44f4a85b4b4e4a4c5bf89adc
0
Analyze the following code function for security vulnerabilities
public boolean requestedShowSurfaceBehindKeyguard() { return mSurfaceBehindRemoteAnimationRequested; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestedShowSurfaceBehindKeyguard 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
requestedShowSurfaceBehindKeyguard
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@Override public X509Certificate[] getAcceptedIssuers() { return (acceptedIssuers != null) ? acceptedIssuers.clone() : acceptedIssuers(rootKeyStore); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAcceptedIssuers File: src/platform/java/org/conscrypt/TrustManagerImpl.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-345" ]
CVE-2016-0818
MEDIUM
4.3
android
getAcceptedIssuers
src/platform/java/org/conscrypt/TrustManagerImpl.java
c4ab1b959280413fb11bf4fd7f6b4c2ba38bd779
0
Analyze the following code function for security vulnerabilities
void blockNativeFocus(boolean block) { if (layoutWrapper != null) { layoutWrapper.setDescendantFocusability(block ? ViewGroup.FOCUS_BLOCK_DESCENDANTS : ViewGroup.FOCUS_AFTER_DESCENDANTS); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: blockNativeFocus File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
blockNativeFocus
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
protected String parametersAsQueryString(String resource, XWikiContext context) { Map<String, Object> parameters = getParametersForResource(resource, context); StringBuilder query = new StringBuilder(); for (Entry<String, Object> parameter : parameters.entrySet()) { // Skip the parameter that forces the file extensions to be sent through the /skin/ action if (FORCE_SKIN_ACTION.equals(parameter.getKey())) { continue; } query.append(PARAMETER_SEPARATOR); query.append(sanitize(parameter.getKey())); query.append("="); query.append(sanitize(Objects.toString(parameter.getValue(), ""))); } // If the main page is requested unminified, also send unminified extensions if ("false".equals(context.getRequest().getParameter("minify"))) { query.append("&minify=false"); } return query.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parametersAsQueryString File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
parametersAsQueryString
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
@Override public boolean isUnattendedManagedKiosk() { if (!mHasFeature) { return false; } Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity()) || hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS)); return mInjector.binderWithCleanCallingIdentity(() -> isUnattendedManagedKioskUnchecked()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUnattendedManagedKiosk File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
isUnattendedManagedKiosk
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected void afterSuccessfulLogin(final boolean resumed) throws NotConnectedException, InterruptedException { // Indicate that we're now authenticated. this.authenticated = true; // If debugging is enabled, change the the debug window title to include the // name we are now logged-in as. // If DEBUG was set to true AFTER the connection was created the debugger // will be null if (config.isDebuggerEnabled() && debugger != null) { debugger.userHasLogged(user); } callConnectionAuthenticatedListener(resumed); // Set presence to online. It is important that this is done after // callConnectionAuthenticatedListener(), as this call will also // eventually load the roster. And we should load the roster before we // send the initial presence. if (config.isSendPresence() && !resumed) { sendStanza(new Presence(Presence.Type.available)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: afterSuccessfulLogin File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
afterSuccessfulLogin
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
@Override public List<Entry<String, String>> entries() { if (isEmpty()) { return Collections.emptyList(); } List<Entry<String, String>> entriesConverted = new ArrayList<Entry<String, String>>( headers.size()); for (Entry<String, String> entry : this) { entriesConverted.add(entry); } return entriesConverted; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: entries File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-43797
MEDIUM
4.3
netty
entries
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
07aa6b5938a8b6ed7a6586e066400e2643897323
0
Analyze the following code function for security vulnerabilities
@Override public Directory read(final ImageInputStream input) throws IOException { Validate.notNull(input, "input"); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); try { // TODO: Consider parsing using SAX? // TODO: Determine encoding and parse using a Reader... // TODO: Refactor scanner to return inputstream? // TODO: Be smarter about ASCII-NULL termination/padding (the SAXParser aka Xerces DOMParser doesn't like it)... DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new DefaultHandler()); Document document = builder.parse(new InputSource(IIOUtil.createStreamAdapter(input))); // XMLSerializer serializer = new XMLSerializer(System.err, System.getProperty("file.encoding")); // serializer.serialize(document); String toolkit = getToolkit(document); Node rdfRoot = document.getElementsByTagNameNS(XMP.NS_RDF, "RDF").item(0); NodeList descriptions = document.getElementsByTagNameNS(XMP.NS_RDF, "Description"); return parseDirectories(rdfRoot, descriptions, toolkit); } catch (SAXException e) { throw new IIOException(e.getMessage(), e); } catch (ParserConfigurationException e) { throw new RuntimeException(e); // TODO: Or IOException? } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2021-23792 - Severity: HIGH - CVSS Score: 7.5 Description: Avoid fetching external resources in XMPReader. Function: read File: imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/xmp/XMPReader.java Repository: haraldk/TwelveMonkeys Fixed Code: @Override public Directory read(final ImageInputStream input) throws IOException { Validate.notNull(input, "input"); try { DocumentBuilderFactory factory = createDocumentBuilderFactory(); // TODO: Consider parsing using SAX? // TODO: Determine encoding and parse using a Reader... // TODO: Refactor scanner to return inputstream? // TODO: Be smarter about ASCII-NULL termination/padding (the SAXParser aka Xerces DOMParser doesn't like it)... DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new DefaultHandler()); Document document = builder.parse(new InputSource(IIOUtil.createStreamAdapter(input))); String toolkit = getToolkit(document); Node rdfRoot = document.getElementsByTagNameNS(XMP.NS_RDF, "RDF").item(0); NodeList descriptions = document.getElementsByTagNameNS(XMP.NS_RDF, "Description"); return parseDirectories(rdfRoot, descriptions, toolkit); } catch (SAXException e) { throw new IIOException(e.getMessage(), e); } catch (ParserConfigurationException e) { throw new RuntimeException(e); } }
[ "CWE-611" ]
CVE-2021-23792
HIGH
7.5
haraldk/TwelveMonkeys
read
imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/xmp/XMPReader.java
da4efe98bf09e1cce91b7633cb251958a200fc80
1
Analyze the following code function for security vulnerabilities
@Deprecated public BaseObject updateObjectFromRequest(String className, XWikiContext context) throws XWikiException { return updateObjectFromRequest(className, "", context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateObjectFromRequest 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
updateObjectFromRequest
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 static void filterContent(String[] values, String customXssString) { String[] xssArr = XSS_STR.split("\\|"); for (String value : values) { if (value == null || "".equals(value)) { return; } // 统一转为小写 value = value.toLowerCase(); //SQL注入检测存在绕过风险 https://gitee.com/jeecg/jeecg-boot/issues/I4NZGE value = value.replaceAll("/\\*.*\\*/",""); for (int i = 0; i < xssArr.length; i++) { if (value.indexOf(xssArr[i]) > -1) { log.error("请注意,存在SQL注入关键词---> {}", xssArr[i]); log.error("请注意,值可能存在SQL注入风险!---> {}", value); throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value); } } //update-begin-author:taoyan date:2022-7-13 for: 除了XSS_STR这些提前设置好的,还需要额外的校验比如 单引号 if (customXssString != null) { String[] xssArr2 = customXssString.split("\\|"); for (int i = 0; i < xssArr2.length; i++) { if (value.indexOf(xssArr2[i]) > -1) { log.error("请注意,存在SQL注入关键词---> {}", xssArr2[i]); log.error("请注意,值可能存在SQL注入风险!---> {}", value); throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value); } } } //update-end-author:taoyan date:2022-7-13 for: 除了XSS_STR这些提前设置好的,还需要额外的校验比如 单引号 if(Pattern.matches(SHOW_TABLES, value) || Pattern.matches(REGULAR_EXPRE_USER, value)){ throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value); } } return; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2022-45206 - Severity: CRITICAL - CVSS Score: 9.8 Description: sql注入检查更加严格,修复/sys/duplicate/check存在sql注入漏洞 #4129 Function: filterContent File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java Repository: jeecgboot/jeecg-boot Fixed Code: public static void filterContent(String[] values, String customXssString) { String[] xssArr = XSS_STR.split("\\|"); for (String value : values) { if (value == null || "".equals(value)) { return; } // 校验sql注释 不允许有sql注释 checkSqlAnnotation(value); // 统一转为小写 value = value.toLowerCase(); //SQL注入检测存在绕过风险 https://gitee.com/jeecg/jeecg-boot/issues/I4NZGE //value = value.replaceAll("/\\*.*\\*/",""); for (int i = 0; i < xssArr.length; i++) { if (value.indexOf(xssArr[i]) > -1) { log.error("请注意,存在SQL注入关键词---> {}", xssArr[i]); log.error("请注意,值可能存在SQL注入风险!---> {}", value); throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value); } } //update-begin-author:taoyan date:2022-7-13 for: 除了XSS_STR这些提前设置好的,还需要额外的校验比如 单引号 if (customXssString != null) { String[] xssArr2 = customXssString.split("\\|"); for (int i = 0; i < xssArr2.length; i++) { if (value.indexOf(xssArr2[i]) > -1) { log.error("请注意,存在SQL注入关键词---> {}", xssArr2[i]); log.error("请注意,值可能存在SQL注入风险!---> {}", value); throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value); } } } //update-end-author:taoyan date:2022-7-13 for: 除了XSS_STR这些提前设置好的,还需要额外的校验比如 单引号 if(Pattern.matches(SHOW_TABLES, value) || Pattern.matches(REGULAR_EXPRE_USER, value)){ throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value); } } return; }
[ "CWE-89" ]
CVE-2022-45206
CRITICAL
9.8
jeecgboot/jeecg-boot
filterContent
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java
f18ced524c9ec13e876bfb74785a1b112cc8b6bb
1
Analyze the following code function for security vulnerabilities
private boolean validPropertyValueType(Object value) { return (value instanceof String || value instanceof Boolean || value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long || value instanceof Float || value instanceof Double); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validPropertyValueType File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
validPropertyValueType
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public List<ServerConfiguration> getServers() { return servers; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServers File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getServers
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void maybeMakeSpaceHidden(SpaceReference spaceReference, String modifiedDocument, Session session) { XWikiSpace space = loadXWikiSpace(spaceReference, session); // The space is supposed to exist if (space == null) { this.logger.warn( "Space [{}] does not exist. Usually means the spaces table is not in sync with the documents table.", spaceReference); return; } // If the space is already hidden return if (space.isHidden()) { return; } if (calculateHiddenStatus(spaceReference, modifiedDocument, session)) { // Make the space hidden space.setHidden(true); session.update(space); // Update space parent if (spaceReference.getParent() instanceof SpaceReference) { maybeMakeSpaceHidden((SpaceReference) spaceReference.getParent(), modifiedDocument, session); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeMakeSpaceHidden File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
maybeMakeSpaceHidden
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
private boolean isCurrentThreadWhitelisted() { var trustScope = configuration != null ? configuration.threadTrustScope() : TrustScope.MINIMAL; if (trustScope == TrustScope.ALL_THREADS) return true; var currentThread = Thread.currentThread(); var name = externGet(currentThread::getName); /* * NOTE: the order is very important here! */ if (THREAD_NAME_BLACKLIST.stream().anyMatch(name::startsWith)) return trustScope != TrustScope.MINIMAL; if (!testThreadGroup.parentOf(currentThread.getThreadGroup())) return true; return whitelistedThreads.stream().anyMatch(t -> t.equals(currentThread)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCurrentThreadWhitelisted File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
isCurrentThreadWhitelisted
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
public Stream<UserSessionModel> loadUserSessionsStream(Integer firstResult, Integer maxResults, boolean offline, String lastUserSessionId) { String offlineStr = offlineToString(offline); TypedQuery<PersistentUserSessionEntity> query = paginateQuery(em.createNamedQuery("findUserSessionsOrderedById", PersistentUserSessionEntity.class) .setParameter("offline", offlineStr) .setParameter("lastSessionId", lastUserSessionId), firstResult, maxResults); return loadUserSessionsWithClientSessions(query, offlineStr); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2023-6563 - Severity: HIGH - CVSS Score: 7.7 Description: Fix performance issues with many offline sessions Fixes: #13340 Function: loadUserSessionsStream File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java Repository: keycloak Fixed Code: public Stream<UserSessionModel> loadUserSessionsStream(Integer firstResult, Integer maxResults, boolean offline, String lastUserSessionId) { String offlineStr = offlineToString(offline); TypedQuery<PersistentUserSessionEntity> query = paginateQuery(em.createNamedQuery("findUserSessionsOrderedById", PersistentUserSessionEntity.class) .setParameter("offline", offlineStr) .setParameter("lastSessionId", lastUserSessionId), firstResult, maxResults); return loadUserSessionsWithClientSessions(query, offlineStr, false); }
[ "CWE-770" ]
CVE-2023-6563
HIGH
7.7
keycloak
loadUserSessionsStream
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
11eb952e1df7cbb95b1e2c101dfd4839a2375695
1
Analyze the following code function for security vulnerabilities
public ViewsTabBar getViewsTabBar() { return viewsTabBar; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getViewsTabBar 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
getViewsTabBar
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public void registerProcessObserver(IProcessObserver observer) { enforceCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER, "registerProcessObserver()"); mProcessList.registerProcessObserver(observer); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerProcessObserver 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
registerProcessObserver
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override void resetDragResizingChangeReported() { mDragResizingChangeReported = false; super.resetDragResizingChangeReported(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetDragResizingChangeReported 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
resetDragResizingChangeReported
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public void gotoPage(String space, String page, String action) { gotoPage(space, page, action, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gotoPage File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
gotoPage
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private boolean isFileOk() { // ::comment when __CORE__ if (SecurityUtils.getSecurityProfile() == SecurityProfile.SANDBOX) // In SANDBOX, we cannot read any files return false; // In any case SFile should not access the security folders // (the files must be handled internally) try { if (isDenied()) return false; } catch (IOException e) { return false; } // Files in "plantuml.include.path" and "plantuml.allowlist.path" are ok. if (isInAllowList(SecurityUtils.getPath(SecurityUtils.PATHS_INCLUDES))) return true; if (isInAllowList(SecurityUtils.getPath(SecurityUtils.ALLOWLIST_LOCAL_PATHS))) return true; if (SecurityUtils.getSecurityProfile() == SecurityProfile.INTERNET) return false; if (SecurityUtils.getSecurityProfile() == SecurityProfile.ALLOWLIST) return false; if (SecurityUtils.getSecurityProfile() != SecurityProfile.UNSECURE) { // For UNSECURE, we did not do those checks final String path = getCleanPathSecure(); if (path.startsWith("/etc/") || path.startsWith("/dev/") || path.startsWith("/boot/") || path.startsWith("/proc/") || path.startsWith("/sys/")) return false; if (path.startsWith("//")) return false; } // ::done return true; }
Vulnerability Classification: - CWE: CWE-284 - CVE: CVE-2023-3431 - Severity: MEDIUM - CVSS Score: 5.3 Description: feat: remove legacy ALLOW_INCLUDE use PLANTUML_SECURITY_PROFILE instead https://github.com/plantuml/plantuml-server/issues/232 Function: isFileOk File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml Fixed Code: public boolean isFileOk() { // ::comment when __CORE__ if (SecurityUtils.getSecurityProfile() == SecurityProfile.SANDBOX) // In SANDBOX, we cannot read any files return false; // In any case SFile should not access the security folders // (the files must be handled internally) try { if (isDenied()) return false; } catch (IOException e) { return false; } // Files in "plantuml.include.path" and "plantuml.allowlist.path" are ok. if (isInAllowList(SecurityUtils.getPath(SecurityUtils.PATHS_INCLUDES))) return true; if (isInAllowList(SecurityUtils.getPath(SecurityUtils.ALLOWLIST_LOCAL_PATHS))) return true; if (SecurityUtils.getSecurityProfile() == SecurityProfile.INTERNET) return false; if (SecurityUtils.getSecurityProfile() == SecurityProfile.ALLOWLIST) return false; if (SecurityUtils.getSecurityProfile() != SecurityProfile.UNSECURE) { // For UNSECURE, we did not do those checks final String path = getCleanPathSecure(); if (path.startsWith("/etc/") || path.startsWith("/dev/") || path.startsWith("/boot/") || path.startsWith("/proc/") || path.startsWith("/sys/")) return false; if (path.startsWith("//")) return false; } // ::done return true; }
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
isFileOk
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
1
Analyze the following code function for security vulnerabilities
@Override public void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId) { enforceSystemOrPhoneCaller("grantPermissionsToEnabledCarrierApps"); synchronized (mPackages) { final long identity = Binder.clearCallingIdentity(); try { mDefaultPermissionPolicy.grantDefaultPermissionsToEnabledCarrierAppsLPr( packageNames, userId); } finally { Binder.restoreCallingIdentity(identity); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grantDefaultPermissionsToEnabledCarrierApps 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
grantDefaultPermissionsToEnabledCarrierApps
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public boolean setChecked(boolean isChecked) { mWifiManager.setScanAlwaysAvailable(isChecked); // Returning true means the underlying setting is updated. return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setChecked File: src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21247
HIGH
7.8
android
setChecked
src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java
edd4023805bc7fa54ae31de222cde02b9012bbc4
0
Analyze the following code function for security vulnerabilities
void scheduleIdleTimeoutLocked(ActivityRecord next) { if (DEBUG_IDLE) Slog.d(TAG_IDLE, "scheduleIdleTimeoutLocked: Callers=" + Debug.getCallers(4)); Message msg = mHandler.obtainMessage(IDLE_TIMEOUT_MSG, next); mHandler.sendMessageDelayed(msg, IDLE_TIMEOUT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleIdleTimeoutLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
scheduleIdleTimeoutLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public Long getLastModified() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastModified File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
getLastModified
src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
@Test public void selectSingleParam(TestContext context) { postgresClient = createNumbers(context, 51, 52, 53); postgresClient.selectSingle("SELECT i FROM numbers WHERE i IN (?, ?, ?) ORDER BY i", new JsonArray().add(51).add(53).add(55), context.asyncAssertSuccess(select -> { context.assertEquals(51, select.getInteger(0)); })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectSingleParam File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
selectSingleParam
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Column(name = "content", nullable = false, length = 65535) public String getContent() { return this.content; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContent File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogOperate.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
getContent
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogOperate.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
@ApiOperation(value = "Delete the CompositeSolution") @RequestMapping(value = "/deleteCompositeSolution", method = RequestMethod.POST) @ResponseBody public String deleteCompositeSolution(@RequestParam(value = "userid", required = true) String userId, @RequestParam(value = "solutionid", required = true) String solutionId, @RequestParam(value = "version", required = true) String version) { String resultTemplate = "{\"success\":\"%s\",\"errorMessage\":\"%s\"}"; String result = ""; logger.debug(EELFLoggerDelegator.debugLogger, " deleteCompositeSolution() : Begin"); try { boolean deleted = compositeServiceImpl.deleteCompositeSolution(userId, solutionId, version); if (!deleted) { result = String.format(resultTemplate, "false", "Requested Solution Not Found"); } else { result = String.format(resultTemplate, "true", ""); } } catch (Exception e) { logger.debug(EELFLoggerDelegator.debugLogger, "Exception in deleteCompositeSolution() ", e); result = String.format(resultTemplate, "false", "Exception : Requested Solution Not Found"); } logger.debug(EELFLoggerDelegator.debugLogger, " deleteCompositeSolution() : End"); return result; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2018-25097 - Severity: MEDIUM - CVSS Score: 4.0 Description: Senitization for CSS Vulnerability Issue-Id : ACUMOS-1650 Description : Senitization for CSS Vulnerability - Design Studio Change-Id: If8fd4b9b06f884219d93881f7922421870de8e3d Signed-off-by: Ramanaiah Pirla <RP00490596@techmahindra.com> Function: deleteCompositeSolution File: ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java Repository: acumos/design-studio Fixed Code: @ApiOperation(value = "Delete the CompositeSolution") @RequestMapping(value = "/deleteCompositeSolution", method = RequestMethod.POST) @ResponseBody public String deleteCompositeSolution(@RequestParam(value = "userid", required = true) String userId, @RequestParam(value = "solutionid", required = true) String solutionId, @RequestParam(value = "version", required = true) String version) { String resultTemplate = "{\"success\":\"%s\",\"errorMessage\":\"%s\"}"; String result = ""; logger.debug(EELFLoggerDelegator.debugLogger, " deleteCompositeSolution() : Begin"); try { boolean deleted = compositeServiceImpl.deleteCompositeSolution(userId, SanitizeUtils.sanitize(solutionId), version); if (!deleted) { result = String.format(resultTemplate, "false", "Requested Solution Not Found"); } else { result = String.format(resultTemplate, "true", ""); } } catch (Exception e) { logger.debug(EELFLoggerDelegator.debugLogger, "Exception in deleteCompositeSolution() ", e); result = String.format(resultTemplate, "false", "Exception : Requested Solution Not Found"); } logger.debug(EELFLoggerDelegator.debugLogger, " deleteCompositeSolution() : End"); return result; }
[ "CWE-79" ]
CVE-2018-25097
MEDIUM
4
acumos/design-studio
deleteCompositeSolution
ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java
0df8a5e8722188744973168648e4c74c69ce67fd
1
Analyze the following code function for security vulnerabilities
public void addServletMapping(String servletName, String urlPattern) { if (log.isDebugEnabled()) { log.debug("Process servletName=" + servletName + ", urlPattern=" + urlPattern); } if (servletName == null) { return; } if (servletName.equals(this.servletName)) { this.servletMapping = urlPattern; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addServletMapping File: src/share/org/apache/struts/action/ActionServlet.java Repository: kawasima/struts1-forever The code follows secure coding practices.
[ "CWE-Other", "CWE-20" ]
CVE-2016-1181
MEDIUM
6.8
kawasima/struts1-forever
addServletMapping
src/share/org/apache/struts/action/ActionServlet.java
eda3a79907ed8fcb0387a0496d0cb14332f250e8
0
Analyze the following code function for security vulnerabilities
public static boolean isBreakpointAvailable(final int id, final FileDownloadModel model, final String path, final Boolean outputStreamSupportSeek) { boolean result = false; do { if (path == null) { if (FileDownloadLog.NEED_LOG) { FileDownloadLog.d(FileDownloadUtils.class, "can't continue %d path = null", id); } break; } File file = new File(path); final boolean isExists = file.exists(); final boolean isDirectory = file.isDirectory(); if (!isExists || isDirectory) { if (FileDownloadLog.NEED_LOG) { FileDownloadLog.d(FileDownloadUtils.class, "can't continue %d file not suit, exists[%B], directory[%B]", id, isExists, isDirectory); } break; } final long fileLength = file.length(); final long currentOffset = model.getSoFar(); if (model.getConnectionCount() <= 1 && currentOffset == 0) { // the sofar is stored on connection table if (FileDownloadLog.NEED_LOG) { FileDownloadLog.d(FileDownloadUtils.class, "can't continue %d the downloaded-record is zero.", id); } break; } final long totalLength = model.getTotal(); if (fileLength < currentOffset || (totalLength != TOTAL_VALUE_IN_CHUNKED_RESOURCE // not chunk transfer && (fileLength > totalLength || currentOffset >= totalLength)) ) { // dirty data. if (FileDownloadLog.NEED_LOG) { FileDownloadLog.d(FileDownloadUtils.class, "can't continue %d dirty data" + " fileLength[%d] sofar[%d] total[%d]", id, fileLength, currentOffset, totalLength); } break; } if (outputStreamSupportSeek != null && !outputStreamSupportSeek && totalLength == fileLength) { if (FileDownloadLog.NEED_LOG) { FileDownloadLog.d(FileDownloadUtils.class, "can't continue %d, because of the " + "output stream doesn't support seek, but the task has " + "already pre-allocated, so we only can download it from the" + " very beginning.", id); } break; } result = true; } while (false); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBreakpointAvailable File: library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
isBreakpointAvailable
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
public ServerBuilder disableServerHeader() { enableServerHeader = false; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disableServerHeader 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
disableServerHeader
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
private VelocityEvaluator getVelocityEvaluator() { if (this.velocityEvaluator == null) { this.velocityEvaluator = Utils.getComponent(VelocityEvaluator.class); } return this.velocityEvaluator; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVelocityEvaluator File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getVelocityEvaluator
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public ClientConfig getClientConfig() { return clientConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClientConfig File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getClientConfig
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private boolean isVisibleToCaller(PhoneAccount account) { if (account == null) { return false; } // If this PhoneAccount has CAPABILITY_MULTI_USER, it should be visible to all users and // all profiles. Only Telephony and SIP accounts should have this capability. if (account.hasCapabilities(PhoneAccount.CAPABILITY_MULTI_USER)) { return true; } UserHandle phoneAccountUserHandle = account.getAccountHandle().getUserHandle(); if (phoneAccountUserHandle == null) { return false; } if (phoneAccountUserHandle.equals(Binder.getCallingUserHandle())) { return true; } List<UserHandle> profileUserHandles; if (UserHandle.getCallingUserId() == UserHandle.USER_OWNER) { profileUserHandles = mUserManager.getUserProfiles(); } else { // Otherwise, it has to be owned by the current caller's profile. profileUserHandles = new ArrayList<>(1); profileUserHandles.add(Binder.getCallingUserHandle()); } return profileUserHandles.contains(phoneAccountUserHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isVisibleToCaller File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
isVisibleToCaller
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
XmlGenerator open(String name, Object... attributes) { appendOpenNode(xml, name, attributes); openNodes.addLast(name); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: open File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
open
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0