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 static void fromDOM(Element infoElement, CMSRequestInfo info) { NodeList requestIDList = infoElement.getElementsByTagName("requestID"); if (requestIDList.getLength() > 0) { String value = requestIDList.item(0).getTextContent(); info.setRequestID(new RequestId(value)); } NodeList requestTypeList = infoElement.getElementsByTagName("requestType"); if (requestTypeList.getLength() > 0) { String value = requestTypeList.item(0).getTextContent(); info.setRequestType(value); } NodeList requestStatusList = infoElement.getElementsByTagName("requestStatus"); if (requestStatusList.getLength() > 0) { String value = requestStatusList.item(0).getTextContent(); info.setRequestStatus(RequestStatus.valueOf(value)); } NodeList requestURLList = infoElement.getElementsByTagName("requestURL"); if (requestURLList.getLength() > 0) { String value = requestURLList.item(0).getTextContent(); info.setRequestURL(value); } NodeList realmList = infoElement.getElementsByTagName("realm"); if (realmList.getLength() > 0) { String value = realmList.item(0).getTextContent(); info.setRealm(value); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public AutoCloseTagResponse doTagComplete(DOMDocument xmlDocument, Position position) { return doTagComplete(xmlDocument, position, NULL_CHECKER); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doTagComplete File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
doTagComplete
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
private static List<Node> migrateFieldSupplies(List<Element> fieldSupplyElements) { List<Node> fieldSupplyNodes = new ArrayList<>(); for (Element fieldSupplyElement: fieldSupplyElements) { List<NodeTuple> tuples = new ArrayList<>(); tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "name"), new ScalarNode(Tag.STR, fieldSupplyElement.elementText("name").trim()))); tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "secret"), new ScalarNode(Tag.STR, fieldSupplyElement.elementText("secret").trim()))); Element valueProviderElement = fieldSupplyElement.element("valueProvider"); String classTag = getClassTag(valueProviderElement.attributeValue("class")); List<NodeTuple> valueProviderTuples = new ArrayList<>(); Element scriptNameElement = valueProviderElement.element("scriptName"); if (scriptNameElement != null) { valueProviderTuples.add(new NodeTuple( new ScalarNode(Tag.STR, "scriptName"), new ScalarNode(Tag.STR, scriptNameElement.getText().trim()))); } Element valueElement = valueProviderElement.element("value"); if (valueElement != null) { List<Node> valueItemNodes = new ArrayList<>(); for (Element valueItemElement: valueElement.elements()) valueItemNodes.add(new ScalarNode(Tag.STR, valueItemElement.getText().trim())); valueProviderTuples.add(new NodeTuple( new ScalarNode(Tag.STR, "value"), new SequenceNode(Tag.SEQ, valueItemNodes, FlowStyle.BLOCK))); } tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "valueProvider"), new MappingNode(new Tag(classTag), valueProviderTuples, FlowStyle.BLOCK))); fieldSupplyNodes.add(new MappingNode(Tag.MAP, tuples, FlowStyle.BLOCK)); } return fieldSupplyNodes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrateFieldSupplies File: server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-538" ]
CVE-2021-21250
MEDIUM
4
theonedev/onedev
migrateFieldSupplies
server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java
9196fd795e87dab069b4260a3590a0ea886e770f
0
Analyze the following code function for security vulnerabilities
public ConnectionManager getConnectionManager() { return connectionManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectionManager File: providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/GrizzlyAsyncHttpProvider.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
getConnectionManager
providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/GrizzlyAsyncHttpProvider.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public boolean getIsTargetServiceActive(ComponentName cname, int userId) { synchronized (mAuthorities) { if (cname != null) { AuthorityInfo authority = getAuthorityLocked( new EndPoint(cname, userId), "get service active"); if (authority == null) { return false; } return (authority.syncable == 1); } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIsTargetServiceActive File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
getIsTargetServiceActive
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@Nullable private static SslContext findDefaultSslContext(VirtualHost defaultVirtualHost, List<VirtualHost> virtualHosts) { final SslContext defaultSslContext = defaultVirtualHost.sslContext(); if (defaultSslContext != null) { return defaultSslContext; } for (int i = virtualHosts.size() - 1; i >= 0; i--) { final SslContext sslContext = virtualHosts.get(i).sslContext(); if (sslContext != null) { return sslContext; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findDefaultSslContext 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
findDefaultSslContext
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
private static void readInto(final InputStream input, final byte[] output) throws StreamException { try { input.read(output); } catch (IOException e) { throw new StreamException(e); } }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2020-7226 - Severity: MEDIUM - CVSS Score: 5.0 Description: Remove runtime exception from method sig. Function: readInto File: src/main/java/org/cryptacular/CiphertextHeaderV2.java Repository: vt-middleware/cryptacular Fixed Code: private static void readInto(final InputStream input, final byte[] output) { try { input.read(output); } catch (IOException e) { throw new StreamException(e); } }
[ "CWE-770" ]
CVE-2020-7226
MEDIUM
5
vt-middleware/cryptacular
readInto
src/main/java/org/cryptacular/CiphertextHeaderV2.java
00395c232cdc62d4292ce27999c026fc1f076b1d
1
Analyze the following code function for security vulnerabilities
boolean isFreezingScreen() { return mFreezingScreen; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFreezingScreen 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
isFreezingScreen
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
protected String getStudyUsersSql(String studyId) { return "select distinct ua.user_id, ua.first_name, ua.last_name, ua.institutional_affiliation" + " from user_account ua, study_user_role sur" + " where sur.study_id = " + studyId + " and sur.user_name = ua.user_name order by ua.user_id"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStudyUsersSql File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getStudyUsersSql
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public Object nextValue() throws JSONException { char c = nextClean(); String s; switch (c) { case '"': case '\'': return nextString(c); case '{': back(); return newJSONObject(); case '[': back(); return newJSONArray(); } /* * Handle unquoted text. This could be the values true, false, or * null, or it can be a number. An implementation (such as this one) * is allowed to also accept non-standard forms. * * Accumulate characters until we reach the end of the text or a * formatting character. */ StringBuilder sb = new StringBuilder(); char b = c; while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) { sb.append(c); c = next(); } back(); /* * If it is true, false, or null, return the proper value. */ s = sb.toString().trim(); if (s.equals("")) { throw syntaxError("Missing value."); } if (s.equalsIgnoreCase("true")) { return Boolean.TRUE; } if (s.equalsIgnoreCase("false")) { return Boolean.FALSE; } if (s.equalsIgnoreCase("null")) { return JSONObject.EXPLICIT_NULL; } /* * If it might be a number, try converting it. We support the 0- and 0x- * conventions. If a number cannot be produced, then the value will just * be a string. Note that the 0-, 0x-, plus, and implied string * conventions are non-standard. A JSON parser is free to accept * non-JSON forms as long as it accepts all correct JSON forms. */ if ((b >= '0' && b <= '9') || b == '.' || b == '-' || b == '+') { if (b == '0') { if (s.length() > 2 && (s.charAt(1) == 'x' || s.charAt(1) == 'X')) { try { return Integer.valueOf(Integer.parseInt(s.substring(2), 16)); } catch (Exception e) { /* Ignore the error */ } } else { try { return Integer.valueOf(Integer.parseInt(s, 8)); } catch (Exception e) { /* Ignore the error */ } } } try { return Integer.valueOf(s); } catch (Exception e) { try { return Long.valueOf(s); } catch (Exception f) { try { if (useBigDecimal) { return new BigDecimal(s); } else { return new Double(s); } } catch (Exception g) { return s; } } } } return s; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nextValue File: src/main/java/org/codehaus/jettison/json/JSONTokener.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
nextValue
src/main/java/org/codehaus/jettison/json/JSONTokener.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
private void rangeCheckForAdd(int index) { if (index < 0 || index > this.size || index == Integer.MAX_VALUE) { throw new IndexOutOfBoundsException(outOfBoundsMsg(index)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rangeCheckForAdd File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/doc/BaseObjects.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
rangeCheckForAdd
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/doc/BaseObjects.java
fdfce062642b0ac062da5cda033d25482f4600fa
0
Analyze the following code function for security vulnerabilities
@Deprecated protected B initialHuffmanDecodeCapacity(int initialHuffmanDecodeCapacity) { return self(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialHuffmanDecodeCapacity File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
netty
initialHuffmanDecodeCapacity
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
0
Analyze the following code function for security vulnerabilities
protected void setupImmutableTypes() { if (immutableTypesMapper == null) { return; } // primitives are always immutable addImmutableType(boolean.class, false); addImmutableType(Boolean.class, false); addImmutableType(byte.class, false); addImmutableType(Byte.class, false); addImmutableType(char.class, false); addImmutableType(Character.class, false); addImmutableType(double.class, false); addImmutableType(Double.class, false); addImmutableType(float.class, false); addImmutableType(Float.class, false); addImmutableType(int.class, false); addImmutableType(Integer.class, false); addImmutableType(long.class, false); addImmutableType(Long.class, false); addImmutableType(short.class, false); addImmutableType(Short.class, false); // additional types addImmutableType(Mapper.Null.class, false); addImmutableType(BigDecimal.class, false); addImmutableType(BigInteger.class, false); addImmutableType(String.class, false); addImmutableType(URL.class, false); addImmutableType(File.class, false); addImmutableType(Class.class, false); if (JVM.isVersion(7)) { Class type = JVM.loadClassForName("java.nio.file.Paths"); if (type != null) { Method methodGet; try { methodGet = type.getDeclaredMethod("get", new Class[]{String.class, String[].class}); if (methodGet != null) { Object path = methodGet.invoke(null, new Object[]{".", new String[0]}); if (path != null) { addImmutableType(path.getClass(), false); } } } catch (NoSuchMethodException e) { } catch (SecurityException e) { } catch (IllegalAccessException e) { } catch (InvocationTargetException e) { } } } if (JVM.isAWTAvailable()) { addImmutableTypeDynamically("java.awt.font.TextAttribute", false); } if (JVM.isVersion(4)) { // late bound types - allows XStream to be compiled on earlier JDKs addImmutableTypeDynamically("java.nio.charset.Charset", true); addImmutableTypeDynamically("java.util.Currency", true); } if (JVM.isVersion(5)) { addImmutableTypeDynamically("java.util.UUID", true); } addImmutableType(URI.class, true); addImmutableType(Collections.EMPTY_LIST.getClass(), true); addImmutableType(Collections.EMPTY_SET.getClass(), true); addImmutableType(Collections.EMPTY_MAP.getClass(), true); if (JVM.isVersion(8)) { addImmutableTypeDynamically("java.time.Duration", false); addImmutableTypeDynamically("java.time.Instant", false); addImmutableTypeDynamically("java.time.LocalDate", false); addImmutableTypeDynamically("java.time.LocalDateTime", false); addImmutableTypeDynamically("java.time.LocalTime", false); addImmutableTypeDynamically("java.time.MonthDay", false); addImmutableTypeDynamically("java.time.OffsetDateTime", false); addImmutableTypeDynamically("java.time.OffsetTime", false); addImmutableTypeDynamically("java.time.Period", false); addImmutableTypeDynamically("java.time.Year", false); addImmutableTypeDynamically("java.time.YearMonth", false); addImmutableTypeDynamically("java.time.ZonedDateTime", false); addImmutableTypeDynamically("java.time.ZoneId", false); addImmutableTypeDynamically("java.time.ZoneOffset", false); addImmutableTypeDynamically("java.time.ZoneRegion", false); addImmutableTypeDynamically("java.time.chrono.HijrahChronology", false); addImmutableTypeDynamically("java.time.chrono.HijrahDate", false); addImmutableTypeDynamically("java.time.chrono.IsoChronology", false); addImmutableTypeDynamically("java.time.chrono.JapaneseChronology", false); addImmutableTypeDynamically("java.time.chrono.JapaneseDate", false); addImmutableTypeDynamically("java.time.chrono.JapaneseEra", false); addImmutableTypeDynamically("java.time.chrono.MinguoChronology", false); addImmutableTypeDynamically("java.time.chrono.MinguoDate", false); addImmutableTypeDynamically("java.time.chrono.ThaiBuddhistChronology", false); addImmutableTypeDynamically("java.time.chrono.ThaiBuddhistDate", false); addImmutableTypeDynamically("java.time.temporal.IsoFields$Field", false); addImmutableTypeDynamically("java.time.temporal.IsoFields$Unit", false); addImmutableTypeDynamically("java.time.temporal.JulianFields$Field", false); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setupImmutableTypes 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
setupImmutableTypes
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
@Override public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, IActivityContainerCallback callback) throws RemoteException { enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "createActivityContainer()"); synchronized (this) { if (parentActivityToken == null) { throw new IllegalArgumentException("parent token must not be null"); } ActivityRecord r = ActivityRecord.forTokenLocked(parentActivityToken); if (r == null) { return null; } if (callback == null) { throw new IllegalArgumentException("callback must not be null"); } return mStackSupervisor.createVirtualActivityContainer(r, callback); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createVirtualActivityContainer File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
createVirtualActivityContainer
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public void close() throws IOException { if(reader!=null){ reader.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: close File: src/main/java/org/json/JSONTokener.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
close
src/main/java/org/json/JSONTokener.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public final void publishContentProviders(IApplicationThread caller, List<ContentProviderHolder> providers) { if (providers == null) { return; } enforceNotIsolatedCaller("publishContentProviders"); synchronized (this) { final ProcessRecord r = getRecordForAppLocked(caller); if (DEBUG_MU) Slog.v(TAG_MU, "ProcessRecord uid = " + r.uid); if (r == null) { throw new SecurityException( "Unable to find app for caller " + caller + " (pid=" + Binder.getCallingPid() + ") when publishing content providers"); } final long origId = Binder.clearCallingIdentity(); final int N = providers.size(); for (int i = 0; i < N; i++) { ContentProviderHolder src = providers.get(i); if (src == null || src.info == null || src.provider == null) { continue; } ContentProviderRecord dst = r.pubProviders.get(src.info.name); if (DEBUG_MU) Slog.v(TAG_MU, "ContentProviderRecord uid = " + dst.uid); if (dst != null) { ComponentName comp = new ComponentName(dst.info.packageName, dst.info.name); mProviderMap.putProviderByClass(comp, dst); String names[] = dst.info.authority.split(";"); for (int j = 0; j < names.length; j++) { mProviderMap.putProviderByName(names[j], dst); } int launchingCount = mLaunchingProviders.size(); int j; boolean wasInLaunchingProviders = false; for (j = 0; j < launchingCount; j++) { if (mLaunchingProviders.get(j) == dst) { mLaunchingProviders.remove(j); wasInLaunchingProviders = true; j--; launchingCount--; } } if (wasInLaunchingProviders) { mHandler.removeMessages(CONTENT_PROVIDER_PUBLISH_TIMEOUT_MSG, r); } synchronized (dst) { dst.provider = src.provider; dst.proc = r; dst.notifyAll(); } updateOomAdjLocked(r); maybeUpdateProviderUsageStatsLocked(r, src.info.packageName, src.info.authority); } } Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: publishContentProviders 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
publishContentProviders
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public static Predicate<File> isDirectory() { return FilePredicate.IS_DIRECTORY; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDirectory File: guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
isDirectory
guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
@Override public void setAudioRoute(String callId, int audioRoute, String bluetoothAddress, Session.Info sessionInfo) { Log.startSession(sessionInfo, "CSW.sAR", mPackageAbbreviation); long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { logIncoming("setAudioRoute %s %s", callId, CallAudioState.audioRouteToString(audioRoute)); mCallsManager.setAudioRoute(audioRoute, bluetoothAddress); } } catch (Throwable t) { Log.e(ConnectionServiceWrapper.this, t, ""); throw t; } finally { Binder.restoreCallingIdentity(token); Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAudioRoute File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
setAudioRoute
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private void enforcePermissions(String[] permissions, int adminPolicy, String callerPackageName, int targetUserId) throws SecurityException { if (hasAdminPolicy(adminPolicy, callerPackageName) && mInjector.userHandleGetCallingUserId() == targetUserId) { return; } enforcePermissions(permissions, callerPackageName, targetUserId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforcePermissions 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
enforcePermissions
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void setRequestedBy(Provider requestedBy) { this.requestedBy = requestedBy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRequestedBy File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4727
MEDIUM
6.1
openmrs/openmrs-module-appointmentscheduling
setRequestedBy
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
LockTaskController getLockTaskController() { return mLockTaskController; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLockTaskController File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getLockTaskController
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private static native int nativeMigrateFromBoost();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeMigrateFromBoost 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
nativeMigrateFromBoost
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
private Collection<VaadinServlet> getRegisteredVaadinServlets() { Set<VaadinServlet> result = new HashSet<>(); try { Stream.of(context.getAllServiceReferences(Servlet.class.getName(), null)) .forEach(reference -> collectVaadinServlets(result, reference)); } catch (InvalidSyntaxException e) { LoggerFactory.getLogger(AppConfigFactoryTracker.class) .error("Unexpected invalid filter expression", e); assert false : "Implementation error: Unexpected invalid filter exception is " + "thrown even though the service filter is null. Check the exception and update the impl"; } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRegisteredVaadinServlets File: flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java Repository: vaadin/osgi The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-31407
MEDIUM
5
vaadin/osgi
getRegisteredVaadinServlets
flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
3e17674c2e3f88b6e682872c42b7d0ad7d9c4ad8
0
Analyze the following code function for security vulnerabilities
@Override public void onPackageAdded(@NonNull AndroidPackage pkg, boolean isInstantApp, @Nullable AndroidPackage oldPkg) { mPermissionManagerServiceImpl.onPackageAdded(pkg, isInstantApp, oldPkg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPackageAdded File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
onPackageAdded
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public boolean requestVisibleBehind(IBinder token, boolean visible) { final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r != null) { return mStackSupervisor.requestVisibleBehindLocked(r, visible); } } return false; } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestVisibleBehind File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
requestVisibleBehind
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public Menu getMenu() { return menu; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMenu File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getMenu
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public SecurityStatusResult getStatus() { if (ssl_fd == null) { return null; } return SSL.SecurityStatus(ssl_fd); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatus File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java Repository: dogtagpki/jss The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
getStatus
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
@Override public URL getURL(ResourceInfo resource, FacesContext ctx) { ResourceResolver nonDefaultResourceResolver = (ResourceResolver) ctx.getAttributes().get(DefaultResourceResolver.NON_DEFAULT_RESOURCE_RESOLVER_PARAM_NAME); String path = resource.getPath(); if (null != nonDefaultResourceResolver) { return nonDefaultResourceResolver.resolveUrl(path); } try { return ctx.getExternalContext().getResource(path); } catch (MalformedURLException e) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: impl/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-6950
MEDIUM
4.3
eclipse-ee4j/mojarra
getURL
impl/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
cefbb9447e7be560e59da2da6bd7cb93776f7741
0
Analyze the following code function for security vulnerabilities
@Test public void setLabelParams() throws Exception { assertPlotParam("ylabel", "This is good"); assertPlotParam("ylabel", " and so Is this - _ yay"); assertInvalidPlotParam("ylabel", "[33:system(%20"); assertInvalidPlotParam("title", "[33:system(%20"); assertInvalidPlotParam("y2label", "[33:system(%20"); }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2023-36812 - Severity: CRITICAL - CVSS Score: 9.8 Description: Improved fix for #2261. Regular expressions wouldn't catch the newlines or possibly other control characters. Now we'll use the TAG validation code to make sure the inputs are only plain ASCII printables first. Fixes CVE-2018-12972, CVE-2020-35476 Function: setLabelParams File: test/tsd/TestGraphHandler.java Repository: OpenTSDB/opentsdb Fixed Code: @Test public void setLabelParams() throws Exception { assertPlotParam("ylabel", "This is good"); assertPlotParam("ylabel", " and so Is this - _ yay"); assertInvalidPlotParam("ylabel", "system(%20no%0anewlines"); assertInvalidPlotParam("title", "system(%20no%0anewlines"); assertInvalidPlotParam("y2label", "system(%20no%0anewlines"); }
[ "CWE-74" ]
CVE-2023-36812
CRITICAL
9.8
OpenTSDB/opentsdb
setLabelParams
test/tsd/TestGraphHandler.java
07c4641471c6f5c2ab5aab615969e97211eb50d9
1
Analyze the following code function for security vulnerabilities
public boolean syncThirdPartyAllIssues(IssueSyncRequest syncRequest) { syncRequest.setProjectId(syncRequest.getProjectId()); XpackIssueService xpackIssueService = CommonBeanFactory.getBean(XpackIssueService.class); if (StringUtils.isNotBlank(syncRequest.getProjectId())) { // 获取当前项目执行同步缺陷Key String syncValue = getSyncKey(syncRequest.getProjectId()); // 存在即正在同步中 if (StringUtils.isNotEmpty(syncValue)) { return false; } // 不存在则设置Key, 设置过期时间, 执行完成后delete掉 setSyncKey(syncRequest.getProjectId()); try { Project project = baseProjectService.getProjectById(syncRequest.getProjectId()); if (!isThirdPartTemplate(project)) { syncRequest.setDefaultCustomFields(getDefaultCustomFields(syncRequest.getProjectId())); } xpackIssueService.syncThirdPartyIssues(project, syncRequest); syncAllPluginIssueAttachment(project, syncRequest); } catch (Exception e) { LogUtil.error(e); MSException.throwException(e); } finally { deleteSyncKey(syncRequest.getProjectId()); } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: syncThirdPartyAllIssues File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
syncThirdPartyAllIssues
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public XWikiDocumentArchive loadDocumentArchive() { XWikiDocumentArchive arch = getDocumentArchive(); if (arch != null) { return arch; } // A document not comming from the database cannot have an archive stored in the database if (this.isNew()) { arch = new XWikiDocumentArchive(getId()); setDocumentArchive(arch); return arch; } XWikiContext xcontext = getXWikiContext(); try { arch = getVersioningStore(xcontext).getXWikiDocumentArchive(this, xcontext); // Put a copy of the archive in the soft reference for later use if needed. setDocumentArchive(arch); return arch; } catch (Exception e) { // VersioningStore.getXWikiDocumentArchive may throw an XWikiException, and xcontext or VersioningStore // may be null (tests) // To maintain the behavior of this method we can't throw an exception. // Formerly, null was returned if there was no SoftReference. LOGGER.warn("Could not get document archive", e); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadDocumentArchive File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
loadDocumentArchive
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 getCorsAllowedHeaders() { return prop.getProperty(TS_CORS_ALLOWED_HEADERS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCorsAllowedHeaders File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getCorsAllowedHeaders
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
native boolean cancelBondNative(byte[] address);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelBondNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
cancelBondNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public CreateOrUpdateArticleResponse create(AdminTokenVO adminTokenVO, CreateArticleRequest createArticleRequest) { return save(adminTokenVO, createArticleRequest); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create File: service/src/main/java/com/zrlog/service/ArticleService.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
create
service/src/main/java/com/zrlog/service/ArticleService.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder cmnt(String comment) { return comment(comment); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cmnt File: src/main/java/com/jamesmurty/utils/XMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
cmnt
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public static String loadPassword(KieServerConfig config) { String passwordKey; KeyStoreHelper keyStoreHelper = new KeyStoreHelper(); try { passwordKey = keyStoreHelper.getPasswordKey(); } catch (RuntimeException re) { logger.warn("Unable to load key store. Using password from configuration"); passwordKey = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_PASSWORD, "kieserver1!"); } return passwordKey; }
Vulnerability Classification: - CWE: CWE-260 - CVE: CVE-2016-7043 - Severity: MEDIUM - CVSS Score: 5.0 Description: [RHBMS-4312] Loading pasword from a keystore Function: loadPassword File: kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/KeyStoreHelperUtil.java Repository: kiegroup/droolsjbpm-integration Fixed Code: public static String loadPassword() { String passwordKey; KeyStoreHelper keyStoreHelper = new KeyStoreHelper(); try { passwordKey = keyStoreHelper.getPasswordKey(); } catch (RuntimeException re) { logger.warn("Unable to load key store. Using password from configuration"); passwordKey = System.getProperty(KieServerConstants.CFG_KIE_PASSWORD, "kieserver1!"); } return passwordKey; }
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
loadPassword
kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/KeyStoreHelperUtil.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
1
Analyze the following code function for security vulnerabilities
public void setServiceForeground(ComponentName className, IBinder token, int id, Notification notification, boolean keepNotification) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServiceForeground File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setServiceForeground
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Test public void executeTransSyntaxError(TestContext context) { Async async = context.async(); postgresClient = postgresClient(); postgresClient.startTx(trans -> { postgresClient.execute(trans, "'", exec -> { postgresClient.rollbackTx(trans, context.asyncAssertSuccess()); context.assertTrue(exec.failed()); async.complete(); }); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeTransSyntaxError 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
executeTransSyntaxError
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; PolicyConstraint other = (PolicyConstraint) obj; if (classId == null) { if (other.classId != null) return false; } else if (!classId.equals(other.classId)) return false; if (constraints == null) { if (other.constraints != null) return false; } else if (!constraints.equals(other.constraints)) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (text == null) { if (other.text != null) return false; } else if (!text.equals(other.text)) return false; return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraint.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
equals
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraint.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public int getLocalReferenceMaxLength() { return this.doc.getLocalReferenceMaxLength(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocalReferenceMaxLength File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getLocalReferenceMaxLength
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public String getUniquePageName(String space, String name) throws XWikiException { return this.xwiki.getUniquePageName(space, name, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUniquePageName File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getUniquePageName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public void updateSessionParameters(long timeoutMillis, long revokeAfterKilledDelayMillis, int importanceToResetTimer, int importanceToKeepSessionAlive) { synchronized (mInnerLock) { mTimeout = Math.min(mTimeout, timeoutMillis); mRevokeAfterKilledDelay = Math.min(mRevokeAfterKilledDelay, revokeAfterKilledDelayMillis == -1 ? DeviceConfig.getLong( DeviceConfig.NAMESPACE_PERMISSIONS, PROPERTY_KILLED_DELAY_CONFIG_KEY, DEFAULT_KILLED_DELAY_MILLIS) : revokeAfterKilledDelayMillis); mImportanceToResetTimer = Math.min(importanceToResetTimer, mImportanceToResetTimer); mImportanceToKeepSessionAlive = Math.min(importanceToKeepSessionAlive, mImportanceToKeepSessionAlive); Log.v(LOG_TAG, "Updated params for " + mPackageName + ". timeout=" + mTimeout + " killedDelay=" + mRevokeAfterKilledDelay + " importanceToResetTimer=" + mImportanceToResetTimer + " importanceToKeepSessionAlive=" + mImportanceToKeepSessionAlive); onImportanceChanged(mUid, mActivityManager.getPackageImportance(mPackageName)); } }
Vulnerability Classification: - CWE: CWE-281 - CVE: CVE-2023-21249 - Severity: MEDIUM - CVSS Score: 5.5 Description: Watch uid proc state instead of importance for 1-time permissions The system process may bind to an app with the flag BIND_FOREGROUND_SERVICE, this will put the client in the foreground service importance level without the normal requirement that foreground services must show a notification. Looking at proc states instead allows us to differentiate between these two levels of foreground service and revoke the client when not in use. This change makes the parameters `importanceToResetTimer` and `importanceToKeepSessionAlive` in PermissionManager#startOneTimePermissionSession obsolete. Test: atest CtsPermissionTestCases + manual testing with mic/cam/loc Bug: 217981062 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0be78fbbf7d92bf29858aa0c48b171045ab5057f) Merged-In: I7a725647c001062d1a76a82b680a02e3e2edcb03 Change-Id: I7a725647c001062d1a76a82b680a02e3e2edcb03 Function: updateSessionParameters File: services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java Repository: android Fixed Code: public void updateSessionParameters(long timeoutMillis, long revokeAfterKilledDelayMillis) { synchronized (mInnerLock) { mTimeout = Math.min(mTimeout, timeoutMillis); mRevokeAfterKilledDelay = Math.min(mRevokeAfterKilledDelay, revokeAfterKilledDelayMillis == -1 ? DeviceConfig.getLong( DeviceConfig.NAMESPACE_PERMISSIONS, PROPERTY_KILLED_DELAY_CONFIG_KEY, DEFAULT_KILLED_DELAY_MILLIS) : revokeAfterKilledDelayMillis); Log.v(LOG_TAG, "Updated params for " + mPackageName + ". timeout=" + mTimeout + " killedDelay=" + mRevokeAfterKilledDelay); updateUidState(); } }
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
updateSessionParameters
services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
1
Analyze the following code function for security vulnerabilities
@Nullable private Class<?> classFromName(String className) { try { return chainingClassLoader.loadClass(className); } catch (ClassNotFoundException e) { return null; } }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2024-24824 - Severity: HIGH - CVSS Score: 8.8 Description: Restrict classes allowed for cluster config and event types (#18165) (#18179) * Restrict classes allowed for cluster config and event types (#18165) Add a new safe_classes configuration option to restrict the classes allowed to be used as cluster config and event types. The configuration option allows to specify a comma-separated set of prefixes matched against the fully qualified class name. For now, the default value for the configuration is org.graylog.,org.graylog2., which will allow all classes that Graylog maintains. This should work out of the box for almost all setups. Changing the default value might only be necessary if external plugins require cluster config or event types outside the "org.graylog." or "org.graylog2." namespaces. If that is the case, the configuration setting can be adjusted to cover this use case, e.b. by setting it to safe_classes = org.graylog.,org.graylog2.,custom.plugin.namespace. if said classes are located within the custom.plugin.namespace package. Refs: https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-p6gg-5hf4-4rgj (cherry picked from commit 813203263b06dda18e2aed68ae92b34277f904b4) * Use javax.inject.Inject instead of jakarta.inject.Inject * Use javax.ws.rs instead of jakarta.ws.rs --------- Co-authored-by: Othello Maurer <othello@graylog.com> Function: classFromName File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/ClusterConfigResource.java Repository: Graylog2/graylog2-server Fixed Code: @Nullable private Class<?> classFromName(String className) { try { return chainingClassLoader.loadClassSafely(className); } catch (ClassNotFoundException e) { return null; } catch (UnsafeClassLoadingAttemptException e) { throw new BadRequestException(e.getLocalizedMessage()); } }
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
classFromName
graylog2-server/src/main/java/org/graylog2/rest/resources/system/ClusterConfigResource.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
1
Analyze the following code function for security vulnerabilities
@Override public void getTransform(Object graphics, Transform transform) { com.codename1.ui.Transform t = ((AndroidGraphics) graphics).getTransform(); if (t == null) { transform.setIdentity(); } else { transform.setTransform(t); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransform 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
getTransform
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void setValidNotBeforeInUse(boolean validNotBeforeInUse) { this.validNotBeforeInUse = validNotBeforeInUse; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValidNotBeforeInUse File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setValidNotBeforeInUse
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
void setInstallAsUid(int uid) { mUid = uid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setInstallAsUid File: src/com/android/certinstaller/CredentialHelper.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
setInstallAsUid
src/com/android/certinstaller/CredentialHelper.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
protected static long getLongValue(final String parameterName, final String value) { try { return Long.parseLong(value); } catch (final Exception e) { throw new InvalidConfigurationException( format("Invalid long integer value for parameter %s: %s", parameterName, value)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLongValue File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
getLongValue
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public int getBackgroundColor() { if (mNativePage != null) return mNativePage.getBackgroundColor(); if (mContentViewCore != null) return mContentViewCore.getBackgroundColor(); return Color.WHITE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBackgroundColor File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getBackgroundColor
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
static void resetPriorityAfterProcLockedSection() { if (ENABLE_PROC_LOCK) { sProcThreadPriorityBooster.reset(); } else { sThreadPriorityBooster.reset(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetPriorityAfterProcLockedSection 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
resetPriorityAfterProcLockedSection
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private void start() { removeAllProcessGroups(); mProcessCpuThread.start(); mBatteryStatsService.publish(); mAppOpsService.publish(mContext); Slog.d("AppOps", "AppOpsService published"); LocalServices.addService(ActivityManagerInternal.class, new LocalService()); // Wait for the synchronized block started in mProcessCpuThread, // so that any other acccess to mProcessCpuTracker from main thread // will be blocked during mProcessCpuTracker initialization. try { mProcessCpuInitLatch.await(); } catch (InterruptedException e) { Slog.wtf(TAG, "Interrupted wait during start", e); Thread.currentThread().interrupt(); throw new IllegalStateException("Interrupted wait during start"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start 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
start
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static void restoreContext(Map<String, Object> backup, XWikiContext context) { // Restore the Execution Context. This will also restore the previous Velocity and Script Context. Execution execution = Utils.getComponent(Execution.class); execution.popContext(); // Restore the current document on the XWiki Context. context.setDoc((XWikiDocument) backup.get("doc")); context.put("cdoc", backup.get("cdoc")); context.put("tdoc", backup.get("tdoc")); // Restore the secure document context.put(CKEY_SDOC, backup.get(CKEY_SDOC)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restoreContext 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
restoreContext
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 void updateAsciiStream(@Positive int columnIndex, @Nullable InputStream inputStream, long length) throws SQLException { throw org.postgresql.Driver.notImplemented(this.getClass(), "updateAsciiStream(int, InputStream, long)"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAsciiStream File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateAsciiStream
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void prepareAppTransition(int transit, boolean alwaysKeepCurrent) { if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, "prepareAppTransition()")) { throw new SecurityException("Requires MANAGE_APP_TOKENS permission"); } synchronized(mWindowMap) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Prepare app transition:" + " transit=" + AppTransition.appTransitionToString(transit) + " " + mAppTransition + " alwaysKeepCurrent=" + alwaysKeepCurrent + " Callers=" + Debug.getCallers(3)); if (!mAppTransition.isTransitionSet() || mAppTransition.isTransitionNone()) { mAppTransition.setAppTransition(transit); } else if (!alwaysKeepCurrent) { if (transit == AppTransition.TRANSIT_TASK_OPEN && mAppTransition.isTransitionEqual( AppTransition.TRANSIT_TASK_CLOSE)) { // Opening a new task always supersedes a close for the anim. mAppTransition.setAppTransition(transit); } else if (transit == AppTransition.TRANSIT_ACTIVITY_OPEN && mAppTransition.isTransitionEqual( AppTransition.TRANSIT_ACTIVITY_CLOSE)) { // Opening a new activity always supersedes a close for the anim. mAppTransition.setAppTransition(transit); } } if (okToDisplay() && mAppTransition.prepare()) { mSkipAppTransitionAnimation = false; } if (mAppTransition.isTransitionSet()) { mH.removeMessages(H.APP_TRANSITION_TIMEOUT); mH.sendEmptyMessageDelayed(H.APP_TRANSITION_TIMEOUT, 5000); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepareAppTransition File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
prepareAppTransition
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { if (devServerStartFuture.isDone()) { try { devServerStartFuture.getNow(null); } catch (CompletionException exception) { isDevServerFailedToStart.set(true); throw getCause(exception); } return false; } else { InputStream inputStream = DevModeHandler.class .getResourceAsStream("dev-mode-not-ready.html"); IOUtils.copy(inputStream, response.getOutputStream()); response.setContentType("text/html;charset=utf-8"); return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleRequest File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
handleRequest
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
protected void validateIncomingMac(byte[] data, int offset, int len) throws Exception { if (inMac == null) { return; } // Update mac with packet id inMac.updateUInt(seqi); // Update mac with packet data inMac.update(data, offset, len); // Compute mac result inMac.doFinal(inMacResult, 0); // Check the computed result with the received mac (just after the packet data) if (!Mac.equals(inMacResult, 0, data, offset + len, inMacSize)) { throw new SshException(SshConstants.SSH2_DISCONNECT_MAC_ERROR, "MAC Error"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateIncomingMac File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
validateIncomingMac
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
private Optional<? extends FileCustomizableResponseType> matchFile(String path) { Optional<URL> optionalUrl = staticResourceResolver.resolve(path); if (optionalUrl.isPresent()) { try { URL url = optionalUrl.get(); if (url.getProtocol().equals("file")) { File file = Paths.get(url.toURI()).toFile(); if (file.exists() && !file.isDirectory() && file.canRead()) { return Optional.of(new NettySystemFileCustomizableResponseType(file)); } } return Optional.of(new NettyStreamedFileCustomizableResponseType(url)); } catch (URISyntaxException e) { //no-op } } return Optional.empty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: matchFile File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
matchFile
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public List<DictModel> queryAllUserBackDictModel();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryAllUserBackDictModel File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45207
CRITICAL
9.8
jeecgboot/jeecg-boot
queryAllUserBackDictModel
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
8632a835c23f558dfee3584d7658cc6a13ccec6f
0
Analyze the following code function for security vulnerabilities
private static final Logger getLogger() { return LoggerFactory.getLogger(VaadinService.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/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
getLogger
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
private int getBigMessagingLayoutResource() { return R.layout.notification_template_material_big_messaging; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBigMessagingLayoutResource File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getBigMessagingLayoutResource
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public Image gaussianBlurImage(Image image, float radius) { try { Bitmap outputBitmap = Bitmap.createBitmap((Bitmap)image.getImage()); RenderScript rs = RenderScript.create(getContext()); try { ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); Allocation tmpIn = Allocation.createFromBitmap(rs, (Bitmap)image.getImage()); Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap); theIntrinsic.setRadius(radius); theIntrinsic.setInput(tmpIn); theIntrinsic.forEach(tmpOut); tmpOut.copyTo(outputBitmap); tmpIn.destroy(); tmpOut.destroy(); theIntrinsic.destroy(); } finally { rs.destroy(); } return new NativeImage(outputBitmap); } catch(Throwable t) { brokenGaussian = true; return image; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gaussianBlurImage 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
gaussianBlurImage
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void setLiveReload(BrowserLiveReload liveReload) { this.liveReload = liveReload; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLiveReload File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
setLiveReload
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
private URL findPathConsideringContracts(ClassLoader loader, LibraryInfo library, String resourceName, String localePrefix, ContractInfo [] outContract, String [] outBasePath, FacesContext ctx) { UIViewRoot root = ctx.getViewRoot(); List<String> contracts = null; URL result = null; if (library != null) { if(library.getContract() == null) { contracts = Collections.emptyList(); } else { contracts = new ArrayList<String>(1); contracts.add(library.getContract()); } } else if (root == null) { String contractName = ctx.getExternalContext().getRequestParameterMap() .get("con"); if (null != contractName && 0 < contractName.length()) { contracts = new ArrayList<>(); contracts.add(contractName); } else { return null; } } else { contracts = ctx.getResourceLibraryContracts(); } String basePath = null; for (String curContract : contracts) { if (library != null) { // PENDING(fcaputo) no need to iterate over the contracts, if we have a library basePath = library.getPath(localePrefix) + '/' + resourceName; } else { if (localePrefix == null) { basePath = getBaseContractsPath() + '/' + curContract + '/' + resourceName; } else { basePath = getBaseContractsPath() + '/' + curContract + '/' + localePrefix + '/' + resourceName; } } if (null != (result = loader.getResource(basePath))) { outContract[0] = new ContractInfo(curContract); outBasePath[0] = basePath; break; } else { basePath = null; } } return result; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2020-6950 - Severity: MEDIUM - CVSS Score: 4.3 Description: Multiple Path Traversal security issues Function: findPathConsideringContracts File: impl/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java Repository: eclipse-ee4j/mojarra Fixed Code: private URL findPathConsideringContracts(ClassLoader loader, LibraryInfo library, String resourceName, String localePrefix, ContractInfo [] outContract, String [] outBasePath, FacesContext ctx) { UIViewRoot root = ctx.getViewRoot(); List<String> contracts = null; URL result = null; if (library != null) { if(library.getContract() == null) { contracts = Collections.emptyList(); } else { contracts = new ArrayList<String>(1); contracts.add(library.getContract()); } } else if (root == null) { String contractName = ctx.getExternalContext().getRequestParameterMap() .get("con"); if (null != contractName && 0 < contractName.length() && !ResourceManager.nameContainsForbiddenSequence(contractName)) { contracts = new ArrayList<>(); contracts.add(contractName); } else { return null; } } else { contracts = ctx.getResourceLibraryContracts(); } String basePath = null; for (String curContract : contracts) { if (library != null) { // PENDING(fcaputo) no need to iterate over the contracts, if we have a library basePath = library.getPath(localePrefix) + '/' + resourceName; } else { if (localePrefix == null) { basePath = getBaseContractsPath() + '/' + curContract + '/' + resourceName; } else { basePath = getBaseContractsPath() + '/' + curContract + '/' + localePrefix + '/' + resourceName; } } if (null != (result = loader.getResource(basePath))) { outContract[0] = new ContractInfo(curContract); outBasePath[0] = basePath; break; } else { basePath = null; } } return result; }
[ "CWE-22" ]
CVE-2020-6950
MEDIUM
4.3
eclipse-ee4j/mojarra
findPathConsideringContracts
impl/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java
cefbb9447e7be560e59da2da6bd7cb93776f7741
1
Analyze the following code function for security vulnerabilities
@Deprecated public List<String> getSpaces(XWikiContext context) throws XWikiException { try { return getStore().getQueryManager().getNamedQuery("getSpaces") .addFilter(Utils.<QueryFilter>getComponent(QueryFilter.class, "hidden")).execute(); } catch (QueryException ex) { throw new XWikiException(0, 0, ex.getMessage(), ex); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpaces 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
getSpaces
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 PasswordMetrics getPasswordMinimumMetrics(@UserIdInt int userHandle) { return getPasswordMinimumMetrics(userHandle, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordMinimumMetrics File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getPasswordMinimumMetrics
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private String getComponentInstanceIntroDestination(ComponentSessionController sc) { String returnURL = URLUtil.getApplicationURL() + URLUtil.getComponentInstanceURL(sc.getComponentId()) + "Main"; ContributionIdentifier id = ContributionIdentifier .from(sc.getComponentId(), "Intro", CoreContributionType.COMPONENT_INSTANCE); if (sc.getComponentId().startsWith("classifieds")) { id = ContributionIdentifier.from(sc.getComponentId(), "Node_0", CoreContributionType.NODE); } else { ComponentInstLight component = OrganizationController.get().getComponentInstLight(sc.getComponentId()); if (component.isWorkflow()) { id = ContributionIdentifier .from(sc.getComponentId(), sc.getComponentId(), CoreContributionType.COMPONENT_INSTANCE); } } WysiwygRouting routing = new WysiwygRouting(); WysiwygRouting.WysiwygRoutingContext context = WysiwygRouting.WysiwygRoutingContext.fromComponentSessionController(sc) .withContributionId(id) .withLanguage(sc.getLanguage()) .withComeBackUrl(returnURL) .withBrowseInfo(sc.getMultilang().getString("GML.operations.editComponentIntro")); try { return routing.getDestinationToWysiwygEditor(context); } catch (Exception e) { SilverLogger.getLogger(this).error(e); return "#"; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComponentInstanceIntroDestination File: core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
getComponentInstanceIntroDestination
core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
@Override public void invalidateAuthToken(String accountType, String authToken) { int callerUid = Binder.getCallingUid(); Objects.requireNonNull(accountType, "accountType cannot be null"); Objects.requireNonNull(authToken, "authToken cannot be null"); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "invalidateAuthToken: accountType " + accountType + ", caller's uid " + callerUid + ", pid " + Binder.getCallingPid()); } int userId = UserHandle.getCallingUserId(); final long identityToken = clearCallingIdentity(); try { UserAccounts accounts = getUserAccounts(userId); List<Pair<Account, String>> deletedTokens; synchronized (accounts.dbLock) { accounts.accountsDb.beginTransaction(); try { deletedTokens = invalidateAuthTokenLocked(accounts, accountType, authToken); accounts.accountsDb.setTransactionSuccessful(); } finally { accounts.accountsDb.endTransaction(); } synchronized (accounts.cacheLock) { for (Pair<Account, String> tokenInfo : deletedTokens) { Account act = tokenInfo.first; String tokenType = tokenInfo.second; writeAuthTokenIntoCacheLocked(accounts, act, tokenType, null); } // wipe out cached token in memory. accounts.accountTokenCaches.remove(accountType, authToken); } } } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invalidateAuthToken File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
invalidateAuthToken
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean getStorageEncryption(@Nullable ComponentName admin) { throwIfParentInstance("getStorageEncryption"); if (mService != null) { try { return mService.getStorageEncryption(admin, myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStorageEncryption File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getStorageEncryption
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { try { synchronized (this) { mBinderTransactionTrackingEnabled = false; // TODO: hijacking SET_ACTIVITY_WATCHER, but should be changed to its own // permission (same as profileControl). if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.SET_ACTIVITY_WATCHER); } if (fd == null) { throw new IllegalArgumentException("null fd"); } PrintWriter pw = new FastPrintWriter(new FileOutputStream(fd.getFileDescriptor())); pw.println("Binder transaction traces for all processes.\n"); for (ProcessRecord process : mLruProcesses) { if (!processSanityChecksLocked(process)) { continue; } pw.println("Traces for process: " + process.processName); pw.flush(); try { TransferPipe tp = new TransferPipe(); try { process.thread.stopBinderTrackingAndDump( tp.getWriteFd().getFileDescriptor()); tp.go(fd.getFileDescriptor()); } finally { tp.kill(); } } catch (IOException e) { pw.println("Failure while dumping IPC traces from " + process + ". Exception: " + e); pw.flush(); } catch (RemoteException e) { pw.println("Got a RemoteException while dumping IPC traces from " + process + ". Exception: " + e); pw.flush(); } } fd = null; return true; } } finally { if (fd != null) { try { fd.close(); } catch (IOException e) { } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopBinderTrackingAndDump File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
stopBinderTrackingAndDump
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@TestApi @RequiresPermission(android.Manifest.permission.CLEAR_FREEZE_PERIOD) public void clearSystemUpdatePolicyFreezePeriodRecord() { throwIfParentInstance("clearSystemUpdatePolicyFreezePeriodRecord"); if (mService == null) { return; } try { mService.clearSystemUpdatePolicyFreezePeriodRecord(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearSystemUpdatePolicyFreezePeriodRecord File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
clearSystemUpdatePolicyFreezePeriodRecord
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public String getKeywords() { return keywords; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeywords File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
getKeywords
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
public Builder setThreadPoolMonitor(IThreadPoolMonitor threadPoolMonitor) { this.threadPoolMonitor = threadPoolMonitor; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setThreadPoolMonitor File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
setThreadPoolMonitor
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
protected List<MutableTrigger> getLoadedTriggers() { return Collections.unmodifiableList(loadedTriggers); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLoadedTriggers File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java Repository: quartz-scheduler/quartz The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-13990
HIGH
7.5
quartz-scheduler/quartz
getLoadedTriggers
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
0
Analyze the following code function for security vulnerabilities
public static void prepareUserDirectory(Context context, String volumeUuid, int userId) { final StorageManager storage = context.getSystemService(StorageManager.class); final File userDir = Environment.getDataUserDirectory(volumeUuid, userId); storage.createNewUserDir(userId, userDir); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepareUserDirectory File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
prepareUserDirectory
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { return "QueryTable{" + "name='" + name + '\'' + ", alias='" + alias + '\'' + ", fields=" + fields + ", all=" + all + '}'; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34602
HIGH
7.5
jeecgboot/jeecg-boot
toString
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java
dd7bf104e7ed59142909567ecd004335c3442ec5
0
Analyze the following code function for security vulnerabilities
@SuppressLint("InflateParams") private void quickEdit(final String previousValue, final OnValueEdited callback, final @StringRes int hint, boolean password, boolean permitEmpty) { AlertDialog.Builder builder = new AlertDialog.Builder(this); DialogQuickeditBinding binding = DataBindingUtil.inflate(getLayoutInflater(),R.layout.dialog_quickedit, null, false); if (password) { binding.inputEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); } builder.setPositiveButton(R.string.accept, null); if (hint != 0) { binding.inputLayout.setHint(getString(hint)); } binding.inputEditText.requestFocus(); if (previousValue != null) { binding.inputEditText.getText().append(previousValue); } builder.setView(binding.getRoot()); builder.setNegativeButton(R.string.cancel, null); final AlertDialog dialog = builder.create(); dialog.setOnShowListener(d -> SoftKeyboardUtils.showKeyboard(binding.inputEditText)); dialog.show(); View.OnClickListener clickListener = v -> { String value = binding.inputEditText.getText().toString(); if (!value.equals(previousValue) && (!value.trim().isEmpty() || permitEmpty)) { String error = callback.onValueEdited(value); if (error != null) { binding.inputLayout.setError(error); return; } } SoftKeyboardUtils.hideSoftKeyboard(binding.inputEditText); dialog.dismiss(); }; dialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener(clickListener); dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setOnClickListener((v -> { SoftKeyboardUtils.hideSoftKeyboard(binding.inputEditText); dialog.dismiss(); })); dialog.setOnDismissListener(dialog1 -> { SoftKeyboardUtils.hideSoftKeyboard(binding.inputEditText); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: quickEdit File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
quickEdit
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void setPersistentVrThread(int tid) { if (checkCallingPermission(permission.RESTRICTED_VR_ACCESS) != PERMISSION_GRANTED) { final String msg = "Permission Denial: setPersistentVrThread() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + permission.RESTRICTED_VR_ACCESS; Slog.w(TAG, msg); throw new SecurityException(msg); } enforceSystemHasVrFeature(); synchronized (this) { synchronized (mPidsSelfLocked) { final int pid = Binder.getCallingPid(); final ProcessRecord proc = mPidsSelfLocked.get(pid); mVrController.setPersistentVrThreadLocked(tid, pid, proc); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPersistentVrThread 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
setPersistentVrThread
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected boolean loadFromFile(File file) { logger.info("Loading workspace: {}", file.getAbsolutePath()); _projectsMetadata.clear(); boolean found = false; if (file.exists() || file.canRead()) { try { ParsingUtilities.mapper.readerForUpdating(this).readValue(file); LocaleUtils.setLocale((String) this.getPreferenceStore().get("userLang")); found = true; } catch (IOException e) { logger.warn(e.toString()); } } return found; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadFromFile File: main/src/com/google/refine/io/FileProjectManager.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-37476
HIGH
7.8
OpenRefine
loadFromFile
main/src/com/google/refine/io/FileProjectManager.java
e9c1e65d58b47aec8cd676bd5c07d97b002f205e
0
Analyze the following code function for security vulnerabilities
protected String getOnreset() { return this.onreset; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOnreset File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
getOnreset
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
public boolean isUpgradedFromBefore(VersionNumber v) { try { return new VersionNumber(version).isOlderThan(v); } catch (IllegalArgumentException e) { // fail to parse this version number return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUpgradedFromBefore 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
isUpgradedFromBefore
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
R apply(T password) throws PSQLException, IOException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: apply File: pgjdbc/src/main/java/org/postgresql/core/v3/AuthenticationPluginManager.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-665" ]
CVE-2022-21724
HIGH
7.5
pgjdbc
apply
pgjdbc/src/main/java/org/postgresql/core/v3/AuthenticationPluginManager.java
f4d0ed69c0b3aae8531d83d6af4c57f22312c813
0
Analyze the following code function for security vulnerabilities
@Override public void onTypingStopped() { final XmppConnectionService service = activity == null ? null : activity.xmppConnectionService; if (service == null) { return; } Account.State status = conversation.getAccount().getStatus(); if (status == Account.State.ONLINE && conversation.setOutgoingChatState(ChatState.PAUSED)) { service.sendChatState(conversation); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTypingStopped File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onTypingStopped
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void placeCall(Uri handle, Bundle extras, String callingPackage) { enforceCallingPackage(callingPackage); if (!canCallPhone(callingPackage, "placeCall")) { throw new SecurityException("Package " + callingPackage + " is not allowed to place phone calls"); } // Note: we can still get here for the default/system dialer, even if the Phone // permission is turned off. This is because the default/system dialer is always // allowed to attempt to place a call (regardless of permission state), in case // it turns out to be an emergency call. If the permission is denied and the // call is being made to a non-emergency number, the call will be denied later on // by {@link UserCallIntentProcessor}. final boolean hasCallAppOp = mAppOpsManager.noteOp(AppOpsManager.OP_CALL_PHONE, Binder.getCallingUid(), callingPackage) == AppOpsManager.MODE_ALLOWED; final boolean hasCallPermission = mContext.checkCallingPermission(CALL_PHONE) == PackageManager.PERMISSION_GRANTED; synchronized (mLock) { final UserHandle userHandle = Binder.getCallingUserHandle(); long token = Binder.clearCallingIdentity(); try { final Intent intent = new Intent(Intent.ACTION_CALL, handle); intent.putExtras(extras); new UserCallIntentProcessor(mContext, userHandle).processIntent(intent, callingPackage, hasCallAppOp && hasCallPermission); } finally { Binder.restoreCallingIdentity(token); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: placeCall 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
placeCall
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setDBStringListValue(String className, String fieldName, List value) { setDBStringListValue( getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()), fieldName, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDBStringListValue 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
setDBStringListValue
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
@Override public boolean bindAppWidgetId(String callingPackage, int appWidgetId, int providerProfileId, ComponentName providerComponent, Bundle options) { final int userId = UserHandle.getCallingUserId(); if (DEBUG) { Slog.i(TAG, "bindAppWidgetId() " + userId); } // Make sure the package runs under the caller uid. mSecurityPolicy.enforceCallFromPackage(callingPackage); // Check that if a cross-profile binding is attempted, it is allowed. if (!mSecurityPolicy.isEnabledGroupProfile(providerProfileId)) { return false; } // If the provider is not under the calling user, make sure this // provider is white listed for access from the parent. if (!mSecurityPolicy.isProviderInCallerOrInProfileAndWhitelListed( providerComponent.getPackageName(), providerProfileId)) { return false; } synchronized (mLock) { ensureGroupStateLoadedLocked(userId); // A special permission or white listing is required to bind widgets. if (!mSecurityPolicy.hasCallerBindPermissionOrBindWhiteListedLocked( callingPackage)) { return false; } // NOTE: The lookup is enforcing security across users by making // sure the caller can only access widgets it hosts or provides. Widget widget = lookupWidgetLocked(appWidgetId, Binder.getCallingUid(), callingPackage); if (widget == null) { Slog.e(TAG, "Bad widget id " + appWidgetId); return false; } if (widget.provider != null) { Slog.e(TAG, "Widget id " + appWidgetId + " already bound to: " + widget.provider.id); return false; } final int providerUid = getUidForPackage(providerComponent.getPackageName(), providerProfileId); if (providerUid < 0) { Slog.e(TAG, "Package " + providerComponent.getPackageName() + " not installed " + " for profile " + providerProfileId); return false; } // NOTE: The lookup is enforcing security across users by making // sure the provider is in the already vetted user profile. ProviderId providerId = new ProviderId(providerUid, providerComponent); Provider provider = lookupProviderLocked(providerId); if (provider == null) { Slog.e(TAG, "No widget provider " + providerComponent + " for profile " + providerProfileId); return false; } if (provider.zombie) { Slog.e(TAG, "Can't bind to a 3rd party provider in" + " safe mode " + provider); return false; } widget.provider = provider; widget.options = (options != null) ? cloneIfLocalBinder(options) : new Bundle(); // We need to provide a default value for the widget category if it is not specified if (!widget.options.containsKey(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY)) { widget.options.putInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY, AppWidgetProviderInfo.WIDGET_CATEGORY_HOME_SCREEN); } provider.widgets.add(widget); final int widgetCount = provider.widgets.size(); if (widgetCount == 1) { // Tell the provider that it's ready. sendEnableIntentLocked(provider); } // Send an update now -- We need this update now, and just for this appWidgetId. // It's less critical when the next one happens, so when we schedule the next one, // we add updatePeriodMillis to its start time. That time will have some slop, // but that's okay. sendUpdateIntentLocked(provider, new int[] {appWidgetId}); // Schedule the future updates. registerForBroadcastsLocked(provider, getWidgetIds(provider.widgets)); saveGroupStateAsync(userId); if (DEBUG) { Slog.i(TAG, "Bound widget " + appWidgetId + " to provider " + provider.id); } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindAppWidgetId File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
bindAppWidgetId
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(MANAGE_FINGERPRINT) public void rename(int fpId, int userId, String newName) { // Renames the given fpId if (mService != null) { try { mService.rename(fpId, userId, newName); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } else { Log.w(TAG, "rename(): Service not connected!"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rename File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
rename
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private boolean interceptFallback(WindowState win, KeyEvent fallbackEvent, int policyFlags) { int actions = interceptKeyBeforeQueueing(fallbackEvent, policyFlags); if ((actions & ACTION_PASS_TO_USER) != 0) { long delayMillis = interceptKeyBeforeDispatching( win, fallbackEvent, policyFlags); if (delayMillis == 0) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: interceptFallback 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
interceptFallback
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public final String getContext() { return context; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContext 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
getContext
src/net/sourceforge/plantuml/version/LicenseInfo.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
@XmlElement public String getSource() { return source; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSource File: core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
getSource
core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
PdfEncryption getDecrypt() { return decrypt; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDecrypt File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getDecrypt
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public Builder setCompressionEnabled(boolean compressionEnabled) { this.compressionEnabled = compressionEnabled; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCompressionEnabled File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setCompressionEnabled
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@Override public String getName() { return "V6 Universal Theme"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName 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
getName
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
protected void rolesSearch(LdapContext searchContext, String dn) throws LoginException { /* * The distinguished name passed into this method is expected to be unquoted. */ Object[] filterArgs = null; if (isUserDnAbsolute(dn)) { filterArgs = new Object[] {getIdentity().getName(), localUserDN(dn)}; } else { filterArgs = new Object[] {getIdentity().getName(), dn}; } NamingEnumeration results = null; try { if (trace) { log.trace("rolesCtxDN=" + rolesCtxDN + " roleFilter=" + roleFilter + " filterArgs[0]=" + filterArgs[0] + " filterArgs[1]=" + filterArgs[1]); } if (roleFilter != null && roleFilter.length() > 0) { boolean referralsExist = true; while (referralsExist) { try { results = searchContext.search(rolesCtxDN, roleFilter, filterArgs, roleSearchControls); while (results.hasMore()) { SearchResult sr = (SearchResult) results.next(); String resultDN = null; if (sr.isRelative()) { resultDN = canonicalize(sr.getName()); } else { resultDN = sr.getNameInNamespace(); } /* * By this point if the distinguished name needs to be quoted for attribute * searches it will have been already. */ obtainRole(searchContext, resultDN, sr); } referralsExist = false; } catch (ReferralException e) { searchContext = (LdapContext) e.getReferralContext(); } } } else { /* * As there was no search based on the distinguished name it would not have been * auto-quoted - do that here to be safe. */ obtainRole(searchContext, quoted(dn), null); } } catch (NamingException e) { LoginException le = new LoginException("Error finding roles"); le.initCause(e); throw le; } finally { if (results != null) { try { results.close(); } catch (NamingException e) { log.warn("Problem closing results", e); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rolesSearch File: jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java Repository: wildfly-security/jboss-negotiation The code follows secure coding practices.
[ "CWE-200" ]
CVE-2015-1849
MEDIUM
4.3
wildfly-security/jboss-negotiation
rolesSearch
jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java
0dc9d191b6eb1d13b8f0189c5b02ba6576f4722e
0
Analyze the following code function for security vulnerabilities
@Nonnull public final JsonParser setAllowSpecialCharsInStrings (final boolean bAllowSpecialCharsInStrings) { m_bAllowSpecialCharsInStrings = bAllowSpecialCharsInStrings; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowSpecialCharsInStrings File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
setAllowSpecialCharsInStrings
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double)o).isInfinite() || ((Double)o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers"); } } else if (o instanceof Float) { if (((Float)o).isInfinite() || ((Float)o).isNaN()) { 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/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
testValidity
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
void updateIssue(IssuesUpdateRequest request);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateIssue File: framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
updateIssue
framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Void> internalSetRetention(RetentionPolicies retention) { if (retention == null) { return CompletableFuture.completedFuture(null); } return getTopicPoliciesAsyncWithRetry(topicName) .thenCompose(op -> { TopicPolicies topicPolicies = op.orElseGet(TopicPolicies::new); for (BacklogQuota.BacklogQuotaType backlogQuotaType : BacklogQuota.BacklogQuotaType.values()) { BacklogQuota backlogQuota = topicPolicies.getBackLogQuotaMap().get(backlogQuotaType.name()); if (backlogQuota == null) { Policies policies = getNamespacePolicies(topicName.getNamespaceObject()); backlogQuota = policies.backlog_quota_map.get(backlogQuotaType); } if (!checkBacklogQuota(backlogQuota, retention)) { log.warn( "[{}] Failed to update retention quota configuration for topic {}: " + "conflicts with retention quota", clientAppId(), topicName); return FutureUtil.failedFuture(new RestException(Status.PRECONDITION_FAILED, "Retention Quota must exceed configured backlog quota for topic. " + "Please increase retention quota and retry")); } } topicPolicies.setRetentionPolicies(retention); return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, topicPolicies); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalSetRetention File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalSetRetention
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public void sendActivityResult(int callingUid, IBinder activityToken, String resultWho, int requestCode, int resultCode, Intent data) { final ActivityRecord r; synchronized (mGlobalLock) { r = ActivityRecord.isInRootTaskLocked(activityToken); if (r == null || r.getRootTask() == null) { return; } } // Carefully collect grants without holding lock final NeededUriGrants dataGrants = collectGrants(data, r); synchronized (mGlobalLock) { r.sendResult(callingUid, resultWho, requestCode, resultCode, data, dataGrants); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendActivityResult File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
sendActivityResult
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public static void encrypt( final BlockCipher cipher, final SecretKey key, final Nonce nonce, final InputStream input, final OutputStream output) throws CryptoException, StreamException { final byte[] iv = nonce.generate(); final byte[] header = new CiphertextHeader(iv).encode(); final PaddedBufferedBlockCipher padded = new PaddedBufferedBlockCipher(cipher, new PKCS7Padding()); padded.init(true, new ParametersWithIV(new KeyParameter(key.getEncoded()), iv)); writeHeader(header, output); process(new BufferedBlockCipherAdapter(padded), input, output); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2020-7226 - Severity: MEDIUM - CVSS Score: 5.0 Description: Define new ciphertext header format. New format does not allocate any memory until HMAC check passes, which guards against untrusted input. All encryption components have been updated to use the new header, while preserving backward compatibility to decrypt messages encrypted with the old format. The decoding process for the old header has been hardened to impose reasonable limits on header fields: nonce sizes up to 255 bytes, key names up to 500 bytes. Fixes #52. Function: encrypt File: src/main/java/org/cryptacular/util/CipherUtil.java Repository: vt-middleware/cryptacular Fixed Code: public static void encrypt( final BlockCipher cipher, final SecretKey key, final Nonce nonce, final InputStream input, final OutputStream output) throws CryptoException, StreamException { final byte[] iv = nonce.generate(); final byte[] header = new CiphertextHeaderV2(iv, "1").encode(key); final PaddedBufferedBlockCipher padded = new PaddedBufferedBlockCipher(cipher, new PKCS7Padding()); padded.init(true, new ParametersWithIV(new KeyParameter(key.getEncoded()), iv)); writeHeader(header, output); process(new BufferedBlockCipherAdapter(padded), input, output); }
[ "CWE-770" ]
CVE-2020-7226
MEDIUM
5
vt-middleware/cryptacular
encrypt
src/main/java/org/cryptacular/util/CipherUtil.java
8c6c7528f1e24c6b71f3e36db0cb8a697256ce25
1
Analyze the following code function for security vulnerabilities
@Override protected void handleDestroy() { super.handleDestroy(); mController.unregisterWalletChangeObservers(DEFAULT_PAYMENT_APP_CHANGE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleDestroy File: packages/SystemUI/src/com/android/systemui/qs/tiles/QuickAccessWalletTile.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21289
MEDIUM
5.5
android
handleDestroy
packages/SystemUI/src/com/android/systemui/qs/tiles/QuickAccessWalletTile.java
7a5e51c918b7097be3c7e669e1825a4d159c4185
0
Analyze the following code function for security vulnerabilities
IPage<SysUser> getUserByRoleId(Page page, @Param("roleId") String roleId, @Param("username") String username);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserByRoleId File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
getUserByRoleId
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0