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 checkPermission(Permission permission) throws IOException, ServletException { checkPermission(Jenkins.getInstance(),permission); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermission File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
checkPermission
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private static void checkCacheForAdding(final List<RequestScopedItem> cache) { if (cache == null) { throw new IllegalStateException("Unable to add request scoped cache item when request cache is not active"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkCacheForAdding File: impl/src/main/java/org/jboss/weld/context/cache/RequestScopedCache.java Repository: weld/core The code follows secure coding practices.
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
checkCacheForAdding
impl/src/main/java/org/jboss/weld/context/cache/RequestScopedCache.java
6808b11cd6d97c71a2eed754ed4f955acd789086
0
Analyze the following code function for security vulnerabilities
void updateDisplaySize() { mDisplay.getMetrics(mDisplayMetrics); mDisplay.getSize(mCurrentDisplaySize); if (DEBUG_GESTURES) { mGestureRec.tag("display", String.format("%dx%d", mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDisplaySize File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
updateDisplaySize
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public boolean finishActivity(IBinder token, int code, Intent data, boolean finishTask) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishActivity File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
finishActivity
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public void setSecret(@Nullable String secret) { this.secret = secret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSecret File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setSecret
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
private boolean calcChangeLog(AbstractBuild<?,?> build, File changelogFile, BuildListener listener, List<External> externals, EnvVars env) throws IOException, InterruptedException { if(build.getPreviousBuild()==null) { // nothing to compare against return createEmptyChangeLog(changelogFile, listener, "log"); } // some users reported that the file gets created with size 0. I suspect // maybe some XSLT engine doesn't close the stream properly. // so let's do it by ourselves to be really sure that the stream gets closed. OutputStream os = new BufferedOutputStream(new FileOutputStream(changelogFile)); boolean created; try { created = new SubversionChangeLogBuilder(build, env, listener, this).run(externals, new StreamResult(os)); } finally { os.close(); } if(!created) createEmptyChangeLog(changelogFile, listener, "log"); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calcChangeLog File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
calcChangeLog
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") @RequestMapping(value = { "/search" }) public String actionSearch(HttpServletRequest theServletRequest, HomeRequest theRequest, BindingResult theBindingResult, ModelMap theModel) throws IOException { addCommonParams(theServletRequest, theRequest, theModel); StringWriter clientCodeJsonStringWriter = new StringWriter(); JsonWriter clientCodeJsonWriter = new JsonWriter(clientCodeJsonStringWriter); clientCodeJsonWriter.beginObject(); clientCodeJsonWriter.name("action"); clientCodeJsonWriter.value("search"); clientCodeJsonWriter.name("base"); clientCodeJsonWriter.value((String) theModel.get("base")); CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); IUntypedQuery search = client.search(); IQuery query; if (isNotBlank(theServletRequest.getParameter("resource"))) { try { query = search.forResource(getResourceType(theRequest, theServletRequest).getImplementingClass()); } catch (ServletException e) { populateModelForResource(theServletRequest, theRequest, theModel); theModel.put("errorMsg", toDisplayError(e.toString(), e)); return "resource"; } clientCodeJsonWriter.name("resource"); clientCodeJsonWriter.value(theServletRequest.getParameter("resource")); } else { query = search.forAllResources(); clientCodeJsonWriter.name("resource"); clientCodeJsonWriter.nullValue(); } if (client.isPrettyPrint()) { clientCodeJsonWriter.name("pretty"); clientCodeJsonWriter.value("true"); } else { clientCodeJsonWriter.name("pretty"); clientCodeJsonWriter.nullValue(); } if (client.getEncoding() != null) { clientCodeJsonWriter.name("format"); clientCodeJsonWriter.value(client.getEncoding().getFormatContentType()); } else { clientCodeJsonWriter.name("format"); clientCodeJsonWriter.nullValue(); } String outcomeDescription = "Search for Resources"; clientCodeJsonWriter.name("params"); clientCodeJsonWriter.beginArray(); int paramIdx = -1; while (true) { paramIdx++; String paramIdxString = Integer.toString(paramIdx); boolean shouldContinue = handleSearchParam(paramIdxString, theServletRequest, query, clientCodeJsonWriter); if (!shouldContinue) { break; } } clientCodeJsonWriter.endArray(); clientCodeJsonWriter.name("includes"); clientCodeJsonWriter.beginArray(); String[] incValues = theServletRequest.getParameterValues(Constants.PARAM_INCLUDE); if (incValues != null) { for (String next : incValues) { if (isNotBlank(next)) { query.include(new Include(next)); clientCodeJsonWriter.value(next); } } } clientCodeJsonWriter.endArray(); clientCodeJsonWriter.name("revincludes"); clientCodeJsonWriter.beginArray(); String[] revIncValues = theServletRequest.getParameterValues(Constants.PARAM_REVINCLUDE); if (revIncValues != null) { for (String next : revIncValues) { if (isNotBlank(next)) { query.revInclude(new Include(next)); clientCodeJsonWriter.value(next); } } } clientCodeJsonWriter.endArray(); String limit = theServletRequest.getParameter("resource-search-limit"); if (isNotBlank(limit)) { if (!limit.matches("[0-9]+")) { populateModelForResource(theServletRequest, theRequest, theModel); theModel.put("errorMsg", toDisplayError("Search limit must be a numeric value.", null)); return "resource"; } int limitInt = Integer.parseInt(limit); query.count(limitInt); clientCodeJsonWriter.name("limit"); clientCodeJsonWriter.value(limit); } else { clientCodeJsonWriter.name("limit"); clientCodeJsonWriter.nullValue(); } String[] sort = theServletRequest.getParameterValues("sort_by"); if (sort != null) { for (String next : sort) { if (isBlank(next)) { continue; } String direction = theServletRequest.getParameter("sort_direction"); if ("asc".equals(direction)) { query.sort().ascending(new StringClientParam(next)); } else if ("desc".equals(direction)) { query.sort().descending(new StringClientParam(next)); } else { query.sort().defaultOrder(new StringClientParam(next)); } } } Class<? extends IBaseBundle> bundleType; bundleType = (Class<? extends IBaseBundle>) client.getFhirContext().getResourceDefinition("Bundle").getImplementingClass(); IQuery<?> queryTyped = query.returnBundle(bundleType); long start = System.currentTimeMillis(); ResultType returnsResource; try { ourLog.info(logPrefix(theModel) + "Executing a search"); queryTyped.execute(); returnsResource = ResultType.BUNDLE; } catch (Exception e) { returnsResource = handleClientException(client, e, theModel); } long delay = System.currentTimeMillis() - start; processAndAddLastClientInvocation(client, returnsResource, theModel, delay, outcomeDescription, interceptor, theRequest); clientCodeJsonWriter.endObject(); clientCodeJsonWriter.close(); String clientCodeJson = clientCodeJsonStringWriter.toString(); theModel.put("clientCodeJson", clientCodeJson); return "result"; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-24301 - Severity: MEDIUM - CVSS Score: 4.3 Description: Resolve XSS vulnerability Function: actionSearch File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java Repository: hapifhir/hapi-fhir Fixed Code: @SuppressWarnings("unchecked") @RequestMapping(value = { "/search" }) public String actionSearch(HttpServletRequest theServletRequest, HomeRequest theRequest, BindingResult theBindingResult, ModelMap theModel) throws IOException { addCommonParams(theServletRequest, theRequest, theModel); StringWriter clientCodeJsonStringWriter = new StringWriter(); JsonWriter clientCodeJsonWriter = new JsonWriter(clientCodeJsonStringWriter); clientCodeJsonWriter.beginObject(); clientCodeJsonWriter.name("action"); clientCodeJsonWriter.value("search"); clientCodeJsonWriter.name("base"); clientCodeJsonWriter.value((String) theModel.get("base")); CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); IUntypedQuery search = client.search(); IQuery query; if (isNotBlank(theServletRequest.getParameter("resource"))) { try { query = search.forResource(getResourceType(theRequest, theServletRequest).getImplementingClass()); } catch (ServletException e) { populateModelForResource(theServletRequest, theRequest, theModel); theModel.put("errorMsg", toDisplayError(e.toString(), e)); return "resource"; } clientCodeJsonWriter.name("resource"); clientCodeJsonWriter.value(sanitizeUrlPart(theServletRequest.getParameter("resource"))); } else { query = search.forAllResources(); clientCodeJsonWriter.name("resource"); clientCodeJsonWriter.nullValue(); } if (client.isPrettyPrint()) { clientCodeJsonWriter.name("pretty"); clientCodeJsonWriter.value("true"); } else { clientCodeJsonWriter.name("pretty"); clientCodeJsonWriter.nullValue(); } if (client.getEncoding() != null) { clientCodeJsonWriter.name("format"); clientCodeJsonWriter.value(client.getEncoding().getFormatContentType()); } else { clientCodeJsonWriter.name("format"); clientCodeJsonWriter.nullValue(); } String outcomeDescription = "Search for Resources"; clientCodeJsonWriter.name("params"); clientCodeJsonWriter.beginArray(); int paramIdx = -1; while (true) { paramIdx++; String paramIdxString = Integer.toString(paramIdx); boolean shouldContinue = handleSearchParam(paramIdxString, theServletRequest, query, clientCodeJsonWriter); if (!shouldContinue) { break; } } clientCodeJsonWriter.endArray(); clientCodeJsonWriter.name("includes"); clientCodeJsonWriter.beginArray(); String[] incValues = sanitizeUrlPart(theServletRequest.getParameterValues(Constants.PARAM_INCLUDE)); if (incValues != null) { for (String next : incValues) { if (isNotBlank(next)) { query.include(new Include(next)); clientCodeJsonWriter.value(next); } } } clientCodeJsonWriter.endArray(); clientCodeJsonWriter.name("revincludes"); clientCodeJsonWriter.beginArray(); String[] revIncValues = sanitizeUrlPart(theServletRequest.getParameterValues(Constants.PARAM_REVINCLUDE)); if (revIncValues != null) { for (String next : revIncValues) { if (isNotBlank(next)) { query.revInclude(new Include(next)); clientCodeJsonWriter.value(next); } } } clientCodeJsonWriter.endArray(); String limit = sanitizeUrlPart(theServletRequest.getParameter("resource-search-limit")); if (isNotBlank(limit)) { if (!limit.matches("[0-9]+")) { populateModelForResource(theServletRequest, theRequest, theModel); theModel.put("errorMsg", toDisplayError("Search limit must be a numeric value.", null)); return "resource"; } int limitInt = Integer.parseInt(limit); query.count(limitInt); clientCodeJsonWriter.name("limit"); clientCodeJsonWriter.value(limit); } else { clientCodeJsonWriter.name("limit"); clientCodeJsonWriter.nullValue(); } String[] sort = sanitizeUrlPart(theServletRequest.getParameterValues("sort_by")); if (sort != null) { for (String next : sort) { if (isBlank(next)) { continue; } String direction = sanitizeUrlPart(theServletRequest.getParameter("sort_direction")); if ("asc".equals(direction)) { query.sort().ascending(new StringClientParam(next)); } else if ("desc".equals(direction)) { query.sort().descending(new StringClientParam(next)); } else { query.sort().defaultOrder(new StringClientParam(next)); } } } Class<? extends IBaseBundle> bundleType; bundleType = (Class<? extends IBaseBundle>) client.getFhirContext().getResourceDefinition("Bundle").getImplementingClass(); IQuery<?> queryTyped = query.returnBundle(bundleType); long start = System.currentTimeMillis(); ResultType returnsResource; try { ourLog.info(logPrefix(theModel) + "Executing a search"); queryTyped.execute(); returnsResource = ResultType.BUNDLE; } catch (Exception e) { returnsResource = handleClientException(client, e, theModel); } long delay = System.currentTimeMillis() - start; processAndAddLastClientInvocation(client, returnsResource, theModel, delay, outcomeDescription, interceptor, theRequest); clientCodeJsonWriter.endObject(); clientCodeJsonWriter.close(); String clientCodeJson = clientCodeJsonStringWriter.toString(); theModel.put("clientCodeJson", clientCodeJson); return "result"; }
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
actionSearch
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
1
Analyze the following code function for security vulnerabilities
public void createAndAddWindows() { addStatusBarWindow(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAndAddWindows File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
createAndAddWindows
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public JSONObject put(String key, boolean value) throws JSONException { put(key, value ? Boolean.TRUE : Boolean.FALSE); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put 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
put
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder document() { return new XMLBuilder(getDocument(), null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: document 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
document
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public @ColorInt int getTertiaryAccentColor() { return mTertiaryAccentColor; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTertiaryAccentColor File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getTertiaryAccentColor
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public boolean isChannelShouldCheckRpcResponseType() { return channelShouldCheckRpcResponseType; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isChannelShouldCheckRpcResponseType File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
isChannelShouldCheckRpcResponseType
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
static void writeTagValue(TypedXmlSerializer out, String tag, long value) throws IOException { writeTagValue(out, tag, Long.toString(value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeTagValue File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
writeTagValue
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public static Field getFieldFromCache(String fieldName, Map<String, Field> fieldCacheMap) { Field field = fieldCacheMap.get(fieldName); if (field == null) { field = fieldCacheMap.get("_" + fieldName); } if (field == null) { field = fieldCacheMap.get("m_" + fieldName); } if (field == null) { char c0 = fieldName.charAt(0); if (c0 >= 'a' && c0 <= 'z') { char[] chars = fieldName.toCharArray(); chars[0] -= 32; // lower String fieldNameX = new String(chars); field = fieldCacheMap.get(fieldNameX); } if (fieldName.length() > 2) { char c1 = fieldName.charAt(1); if (c0 >= 'a' && c0 <= 'z' && c1 >= 'A' && c1 <= 'Z') { for (Map.Entry<String, Field> entry : fieldCacheMap.entrySet()) { if (fieldName.equalsIgnoreCase(entry.getKey())) { field = entry.getValue(); break; } } } } } return field; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFieldFromCache File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
getFieldFromCache
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
private boolean isRecoverSignatureUpdateNeeded(PackageParser.Package scannedPkg) { final VersionInfo ver = getSettingsVersionForPackage(scannedPkg); return ver.databaseVersion < DatabaseVersion.SIGNATURE_MALFORMED_RECOVER; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRecoverSignatureUpdateNeeded File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
isRecoverSignatureUpdateNeeded
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void disconnectService() { mContainerService = null; mBound = false; Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); mContext.unbindService(mDefContainerConn); Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disconnectService File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
disconnectService
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public void setClassLoader(ClassLoader classLoader) { if (classLoader == null) { throw new IllegalArgumentException( "Can not set class loader to null"); } this.classLoader = classLoader; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClassLoader 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
setClassLoader
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
private Config defaultConfig(final Config conf, final String cpath) { String ns = Optional.ofNullable(getClass().getPackage()) .map(Package::getName) .orElse("default." + getClass().getName()); String[] parts = ns.split("\\."); String appname = parts[parts.length - 1]; // locale final List<Locale> locales; if (!conf.hasPath("application.lang")) { locales = Optional.ofNullable(this.languages) .map(langs -> LocaleUtils.parse(Joiner.on(",").join(langs))) .orElse(ImmutableList.of(Locale.getDefault())); } else { locales = LocaleUtils.parse(conf.getString("application.lang")); } Locale locale = locales.iterator().next(); String lang = locale.toLanguageTag(); // time zone final String tz; if (!conf.hasPath("application.tz")) { tz = Optional.ofNullable(zoneId).orElse(ZoneId.systemDefault()).getId(); } else { tz = conf.getString("application.tz"); } // number format final String nf; if (!conf.hasPath("application.numberFormat")) { nf = Optional.ofNullable(numberFormat) .orElseGet(() -> ((DecimalFormat) DecimalFormat.getInstance(locale)).toPattern()); } else { nf = conf.getString("application.numberFormat"); } int processors = Runtime.getRuntime().availableProcessors(); String version = Optional.ofNullable(getClass().getPackage()) .map(Package::getImplementationVersion) .filter(Objects::nonNull) .orElse("0.0.0"); Config defs = ConfigFactory.parseResources(Jooby.class, "jooby.conf") .withValue("contextPath", fromAnyRef(cpath.equals("/") ? "" : cpath)) .withValue("application.name", fromAnyRef(appname)) .withValue("application.version", fromAnyRef(version)) .withValue("application.class", fromAnyRef(classname)) .withValue("application.ns", fromAnyRef(ns)) .withValue("application.lang", fromAnyRef(lang)) .withValue("application.tz", fromAnyRef(tz)) .withValue("application.numberFormat", fromAnyRef(nf)) .withValue("server.http2.enabled", fromAnyRef(http2)) .withValue("runtime.processors", fromAnyRef(processors)) .withValue("runtime.processors-plus1", fromAnyRef(processors + 1)) .withValue("runtime.processors-plus2", fromAnyRef(processors + 2)) .withValue("runtime.processors-x2", fromAnyRef(processors * 2)) .withValue("runtime.processors-x4", fromAnyRef(processors * 4)) .withValue("runtime.processors-x8", fromAnyRef(processors * 8)) .withValue("runtime.concurrencyLevel", fromAnyRef(Math.max(4, processors))) .withValue("server.threads.Min", fromAnyRef(Math.max(4, processors))) .withValue("server.threads.Max", fromAnyRef(Math.max(32, processors * 8))); if (charset != null) { defs = defs.withValue("application.charset", fromAnyRef(charset.name())); } if (port != null) { defs = defs.withValue("application.port", fromAnyRef(port)); } if (securePort != null) { defs = defs.withValue("application.securePort", fromAnyRef(securePort)); } if (dateFormat != null) { defs = defs.withValue("application.dateFormat", fromAnyRef(dateFormat)); } return defs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultConfig File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
defaultConfig
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public long toFractionLong(boolean includeTrailingZeros) { long result = 0L; int magnitude = -1; int lowerMagnitude = Math.max(scale, rOptPos); if (includeTrailingZeros) { lowerMagnitude = Math.min(lowerMagnitude, rReqPos); } // NOTE: Java has only signed longs, so we check result <= 1e17 instead of 1e18 for (; magnitude >= lowerMagnitude && result <= 1e17; magnitude--) { result = result * 10 + getDigitPos(magnitude - scale); } // Remove trailing zeros; this can happen during integer overflow cases. if (!includeTrailingZeros) { while (result > 0 && (result % 10) == 0) { result /= 10; } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toFractionLong File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
toFractionLong
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
void completeSwitchAndInitialize(UserState uss, int newUserId, boolean clearInitializing, boolean clearSwitching) { boolean unfrozen = false; synchronized (this) { if (clearInitializing) { uss.initializing = false; getUserManagerLocked().makeInitialized(uss.mHandle.getIdentifier()); } if (clearSwitching) { uss.switching = false; } if (!uss.switching && !uss.initializing) { mWindowManager.stopFreezingScreen(); unfrozen = true; } } if (unfrozen) { mHandler.removeMessages(REPORT_USER_SWITCH_COMPLETE_MSG); mHandler.sendMessage(mHandler.obtainMessage(REPORT_USER_SWITCH_COMPLETE_MSG, newUserId, 0)); } stopGuestUserIfBackground(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: completeSwitchAndInitialize 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
completeSwitchAndInitialize
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public SerializationConfig addDataSerializableFactoryClass(int factoryId, String dataSerializableFactoryClass) { getDataSerializableFactoryClasses().put(factoryId, dataSerializableFactoryClass); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addDataSerializableFactoryClass File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
addDataSerializableFactoryClass
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public boolean ensureSettingsForUserLocked(int userId) { // First make sure this user actually exists. if (mUserManager.getUserInfo(userId) == null) { Slog.wtf(LOG_TAG, "Requested user " + userId + " does not exist"); return false; } // Migrate the setting for this user if needed. migrateLegacySettingsForUserIfNeededLocked(userId); // Ensure config settings loaded if owner. if (userId == UserHandle.USER_SYSTEM) { final int configKey = makeKey(SETTINGS_TYPE_CONFIG, UserHandle.USER_SYSTEM); ensureSettingsStateLocked(configKey); } // Ensure global settings loaded if owner. if (userId == UserHandle.USER_SYSTEM) { final int globalKey = makeKey(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM); ensureSettingsStateLocked(globalKey); } // Ensure secure settings loaded. final int secureKey = makeKey(SETTINGS_TYPE_SECURE, userId); ensureSettingsStateLocked(secureKey); // Make sure the secure settings have an Android id set. SettingsState secureSettings = getSettingsLocked(SETTINGS_TYPE_SECURE, userId); ensureSecureSettingAndroidIdSetLocked(secureSettings); // Ensure system settings loaded. final int systemKey = makeKey(SETTINGS_TYPE_SYSTEM, userId); ensureSettingsStateLocked(systemKey); // Ensure secure settings loaded. final int ssaidKey = makeKey(SETTINGS_TYPE_SSAID, userId); ensureSettingsStateLocked(ssaidKey); // Upgrade the settings to the latest version. UpgradeController upgrader = new UpgradeController(userId); upgrader.upgradeIfNeededLocked(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ensureSettingsForUserLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
ensureSettingsForUserLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public boolean isSupplicantTransientState() { SupplicantState supplicantState = mWifiInfo.getSupplicantState(); if (supplicantState == SupplicantState.ASSOCIATING || supplicantState == SupplicantState.AUTHENTICATING || supplicantState == SupplicantState.FOUR_WAY_HANDSHAKE || supplicantState == SupplicantState.GROUP_HANDSHAKE) { if (mVerboseLoggingEnabled) { Log.d(getTag(), "Supplicant is under transient state: " + supplicantState); } return true; } else { if (mVerboseLoggingEnabled) { Log.d(getTag(), "Supplicant is under steady state: " + supplicantState); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSupplicantTransientState File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
isSupplicantTransientState
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void setUserErrorMessage(String userErrorMessage) { this.userErrorMessage = userErrorMessage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserErrorMessage File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setUserErrorMessage
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public void setRevokedOn(Date revokedOn) { this.revokedOn = revokedOn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRevokedOn File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setRevokedOn
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
void chooseClientCertificate(byte[] keyTypeBytes, byte[][] asn1DerEncodedPrincipals, long sslNativePointer, AliasChooser chooser) throws SSLException, CertificateEncodingException { Set<String> keyTypesSet = getSupportedClientKeyTypes(keyTypeBytes); String[] keyTypes = keyTypesSet.toArray(new String[keyTypesSet.size()]); X500Principal[] issuers; if (asn1DerEncodedPrincipals == null) { issuers = null; } else { issuers = new X500Principal[asn1DerEncodedPrincipals.length]; for (int i = 0; i < asn1DerEncodedPrincipals.length; i++) { issuers[i] = new X500Principal(asn1DerEncodedPrincipals[i]); } } X509KeyManager keyManager = getX509KeyManager(); String alias = (keyManager != null) ? chooser.chooseClientAlias(keyManager, issuers, keyTypes) : null; setCertificate(sslNativePointer, alias); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: chooseClientCertificate File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
chooseClientCertificate
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
private void sendStreamingResponse(HttpExchange pExchange, ParsedUri pParsedUri, JSONStreamAware pJson) throws IOException { Headers headers = pExchange.getResponseHeaders(); if (pJson != null) { headers.set("Content-Type", getMimeType(pParsedUri) + "; charset=utf-8"); String callback = pParsedUri.getParameter(ConfigKey.CALLBACK.getKeyValue()); pExchange.sendResponseHeaders(200, 0); Writer writer = new OutputStreamWriter(pExchange.getResponseBody(), "UTF-8"); IoUtil.streamResponseAndClose(writer, pJson, callback); } else { headers.set("Content-Type", "text/plain"); pExchange.sendResponseHeaders(200,-1); } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2018-1000129 - Severity: MEDIUM - CVSS Score: 4.3 Description: fix: Verify a given 'mimeType' and/or 'callback' request parameter So that only fixed values are possible, in order to avoid XSS attack vectors. Function: sendStreamingResponse File: agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java Repository: jolokia Fixed Code: private void sendStreamingResponse(HttpExchange pExchange, ParsedUri pParsedUri, JSONStreamAware pJson) throws IOException { Headers headers = pExchange.getResponseHeaders(); if (pJson != null) { headers.set("Content-Type", getMimeType(pParsedUri) + "; charset=utf-8"); pExchange.sendResponseHeaders(200, 0); Writer writer = new OutputStreamWriter(pExchange.getResponseBody(), "UTF-8"); String callback = pParsedUri.getParameter(ConfigKey.CALLBACK.getKeyValue()); IoUtil.streamResponseAndClose(writer, pJson, callback != null && MimeTypeUtil.isValidCallback(callback) ? callback : null); } else { headers.set("Content-Type", "text/plain"); pExchange.sendResponseHeaders(200,-1); } }
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
sendStreamingResponse
agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
1
Analyze the following code function for security vulnerabilities
public static C3P0Config extractXmlConfigFromInputStream(InputStream is) throws Exception { DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance(); DocumentBuilder db = fact.newDocumentBuilder(); Document doc = db.parse( is ); return extractConfigFromXmlDoc(doc); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-20433 - Severity: HIGH - CVSS Score: 7.5 Description: Repair XXE vulnerability at initialization Function: extractXmlConfigFromInputStream File: src/java/com/mchange/v2/c3p0/cfg/C3P0ConfigXmlUtils.java Repository: zhutougg/c3p0 Fixed Code: public static C3P0Config extractXmlConfigFromInputStream(InputStream is) throws Exception { DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance(); fact.setExpandEntityReferences(false); DocumentBuilder db = fact.newDocumentBuilder(); Document doc = db.parse( is ); return extractConfigFromXmlDoc(doc); }
[ "CWE-611" ]
CVE-2018-20433
HIGH
7.5
zhutougg/c3p0
extractXmlConfigFromInputStream
src/java/com/mchange/v2/c3p0/cfg/C3P0ConfigXmlUtils.java
2eb0ea97f745740b18dd45e4a909112d4685f87b
1
Analyze the following code function for security vulnerabilities
public static OpenFileResult testFilePermissions(File file) { if (file == null || !file.exists()) { return OpenFileResult.FAILURE; } try { file = file.getCanonicalFile(); } catch (final IOException e) { return OpenFileResult.FAILURE; } final DirectoryCheckResults dcr = FileUtils.testDirectoryPermissions(file); if (dcr != null && dcr.getFailures() == 0) { if (file.isDirectory()) return OpenFileResult.NOT_FILE; try { if (!file.exists() && !file.createNewFile()) { return OpenFileResult.CANT_CREATE; } } catch (IOException e) { return OpenFileResult.CANT_CREATE; } final boolean read = file.canRead(), write = file.canWrite(); if (read && write) return OpenFileResult.SUCCESS; else if (read) return OpenFileResult.CANT_WRITE; else return OpenFileResult.FAILURE; } return OpenFileResult.FAILURE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testFilePermissions File: core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
testFilePermissions
core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
@Override public Collection<LBMonitor> listMonitor(String monitorId) { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listMonitor File: src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java Repository: floodlight The code follows secure coding practices.
[ "CWE-362", "CWE-476" ]
CVE-2015-6569
MEDIUM
4.3
floodlight
listMonitor
src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java
7f5bedb625eec3ff4d29987c31cef2553a962b36
0
Analyze the following code function for security vulnerabilities
private void checkForNonWhitelistedStackFrames(Supplier<String> message, Predicate<StackFrame> takeFromTopWhileFilter) { var nonWhitelisted = getNonWhitelistedStackFrames(takeFromTopWhileFilter); throwSecurityExceptionIfNonWhitelistedFound(message, nonWhitelisted); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkForNonWhitelistedStackFrames File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
checkForNonWhitelistedStackFrames
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
public <T extends NodeFeature> T getFeature(Class<T> featureType) { int featureIndex = getFeatureIndex(featureType); /* * To limit memory use, the features array is kept as short as possible * and the size is increased when needed. * * Furthermore, instead of a one-item array, the single item is stored * as the field value. This further optimizes the case of text nodes and * template model nodes. */ NodeFeature feature; if (featureIndex == 0 && features instanceof NodeFeature) { feature = (NodeFeature) features; } else if (featureIndex == 0 && features == null) { feature = NodeFeatureRegistry.create(featureType, this); features = feature; } else { NodeFeature[] featuresArray; if (features instanceof NodeFeature[]) { featuresArray = (NodeFeature[]) features; } else { assert features == null || features instanceof NodeFeature; featuresArray = new NodeFeature[featureIndex + 1]; if (features instanceof NodeFeature) { featuresArray[0] = (NodeFeature) features; } features = featuresArray; } // Increase size if necessary if (featureIndex >= featuresArray.length) { featuresArray = Arrays.copyOf(featuresArray, featureIndex + 1); features = featuresArray; } feature = featuresArray[featureIndex]; if (feature == null) { feature = NodeFeatureRegistry.create(featureType, this); featuresArray[featureIndex] = feature; } } return featureType.cast(feature); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFeature File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getFeature
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Override public String getColumnNameSQL(String name) { return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getColumnNameSQL File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
getColumnNameSQL
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
private void deliverNewIntent(ActivityRecord activity, NeededUriGrants intentGrants) { if (mIntentDelivered) { return; } activity.logStartActivity(EventLogTags.WM_NEW_INTENT, activity.getTask()); activity.deliverNewIntentLocked(mCallingUid, mStartActivity.intent, intentGrants, mStartActivity.launchedFromPackage); mIntentDelivered = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deliverNewIntent File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
deliverNewIntent
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
@Override public void setGutsParent(NotificationGuts guts) { mGutsContainer = guts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setGutsParent File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
setGutsParent
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
@Override public IIntentSender getIntentSenderWithFeature(int type, String packageName, String featureId, IBinder token, String resultWho, int requestCode, Intent[] intents, String[] resolvedTypes, int flags, Bundle bOptions, int userId) { enforceNotIsolatedCaller("getIntentSender"); return getIntentSenderWithFeatureAsApp(type, packageName, featureId, token, resultWho, requestCode, intents, resolvedTypes, flags, bOptions, userId, Binder.getCallingUid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntentSenderWithFeature 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
getIntentSenderWithFeature
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
protected final long _parseLongPrimitive(JsonParser p, DeserializationContext ctxt) throws IOException { String text; switch (p.currentTokenId()) { case JsonTokenId.ID_STRING: text = p.getText(); break; case JsonTokenId.ID_NUMBER_FLOAT: final CoercionAction act = _checkFloatToIntCoercion(p, ctxt, Long.TYPE); if (act == CoercionAction.AsNull) { return 0L; } if (act == CoercionAction.AsEmpty) { return 0L; } return p.getValueAsLong(); case JsonTokenId.ID_NUMBER_INT: return p.getLongValue(); case JsonTokenId.ID_NULL: _verifyNullForPrimitive(ctxt); return 0L; // 29-Jun-2020, tatu: New! "Scalar from Object" (mostly for XML) case JsonTokenId.ID_START_OBJECT: text = ctxt.extractScalarFromObject(p, this, Long.TYPE); break; case JsonTokenId.ID_START_ARRAY: if (ctxt.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) { p.nextToken(); final long parsed = _parseLongPrimitive(p, ctxt); _verifyEndArrayForSingle(p, ctxt); return parsed; } // fall through default: return ((Number) ctxt.handleUnexpectedToken(Long.TYPE, p)).longValue(); } final CoercionAction act = _checkFromStringCoercion(ctxt, text, LogicalType.Integer, Long.TYPE); if (act == CoercionAction.AsNull) { // 03-May-2021, tatu: Might not be allowed (should we do "empty" check?) _verifyNullForPrimitive(ctxt); return 0L; } if (act == CoercionAction.AsEmpty) { return 0L; } text = text.trim(); if (_hasTextualNull(text)) { _verifyNullForPrimitiveCoercion(ctxt, text); return 0L; } return _parseLongPrimitive(ctxt, text); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2022-42003 - Severity: HIGH - CVSS Score: 7.5 Description: Fix #3590 Function: _parseLongPrimitive File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind Fixed Code: protected final long _parseLongPrimitive(JsonParser p, DeserializationContext ctxt) throws IOException { String text; switch (p.currentTokenId()) { case JsonTokenId.ID_STRING: text = p.getText(); break; case JsonTokenId.ID_NUMBER_FLOAT: final CoercionAction act = _checkFloatToIntCoercion(p, ctxt, Long.TYPE); if (act == CoercionAction.AsNull) { return 0L; } if (act == CoercionAction.AsEmpty) { return 0L; } return p.getValueAsLong(); case JsonTokenId.ID_NUMBER_INT: return p.getLongValue(); case JsonTokenId.ID_NULL: _verifyNullForPrimitive(ctxt); return 0L; // 29-Jun-2020, tatu: New! "Scalar from Object" (mostly for XML) case JsonTokenId.ID_START_OBJECT: text = ctxt.extractScalarFromObject(p, this, Long.TYPE); break; case JsonTokenId.ID_START_ARRAY: if (ctxt.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) { if (p.nextToken() == JsonToken.START_ARRAY) { return (long) handleNestedArrayForSingle(p, ctxt); } final long parsed = _parseLongPrimitive(p, ctxt); _verifyEndArrayForSingle(p, ctxt); return parsed; } // fall through default: return ((Number) ctxt.handleUnexpectedToken(Long.TYPE, p)).longValue(); } final CoercionAction act = _checkFromStringCoercion(ctxt, text, LogicalType.Integer, Long.TYPE); if (act == CoercionAction.AsNull) { // 03-May-2021, tatu: Might not be allowed (should we do "empty" check?) _verifyNullForPrimitive(ctxt); return 0L; } if (act == CoercionAction.AsEmpty) { return 0L; } text = text.trim(); if (_hasTextualNull(text)) { _verifyNullForPrimitiveCoercion(ctxt, text); return 0L; } return _parseLongPrimitive(ctxt, text); }
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_parseLongPrimitive
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
1
Analyze the following code function for security vulnerabilities
@Override public boolean shutdown(int timeout) { if (checkCallingPermission(android.Manifest.permission.SHUTDOWN) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.SHUTDOWN); } final boolean timedout = mAtmInternal.shuttingDown(mBooted, timeout); mAppOpsService.shutdown(); if (mUsageStatsService != null) { mUsageStatsService.prepareShutdown(); } mBatteryStatsService.shutdown(); mProcessStats.shutdown(); return timedout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shutdown 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
shutdown
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public long getSize() { return size; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSize File: jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java Repository: GoogleContainerTools/jib The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-25914
CRITICAL
9.8
GoogleContainerTools/jib
getSize
jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java
67fa40bc2c484da0546333914ea07a89fe44eaaf
0
Analyze the following code function for security vulnerabilities
@Override public boolean clearContainerBlockContents(BlockVector3 pt) { checkNotNull(pt); BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); if (adapter != null) { try { return adapter.clearContainerBlockContents(getWorld(), pt); } catch (Exception ignored) { } } if (!getBlock(pt).getBlockType().getMaterial().hasContainer()) { return false; } Block block = getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); BlockState state = PaperLib.getBlockState(block, false).getState(); if (!(state instanceof InventoryHolder)) { return false; } TaskManager.taskManager().sync(() -> { InventoryHolder chest = (InventoryHolder) state; Inventory inven = chest.getInventory(); if (chest instanceof Chest) { inven = ((Chest) chest).getBlockInventory(); } inven.clear(); return null; }); return true; }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-35925 - Severity: MEDIUM - CVSS Score: 5.5 Description: feat: prevent edits outside +/- 30,000,000 blocks Function: clearContainerBlockContents File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java Repository: IntellectualSites/FastAsyncWorldEdit Fixed Code: @Override public boolean clearContainerBlockContents(BlockVector3 pt) { checkNotNull(pt); //FAWE start - safe edit region testCoords(pt); //FAWE end BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); if (adapter != null) { try { return adapter.clearContainerBlockContents(getWorld(), pt); } catch (Exception ignored) { } } if (!getBlock(pt).getBlockType().getMaterial().hasContainer()) { return false; } Block block = getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); BlockState state = PaperLib.getBlockState(block, false).getState(); if (!(state instanceof InventoryHolder)) { return false; } TaskManager.taskManager().sync(() -> { InventoryHolder chest = (InventoryHolder) state; Inventory inven = chest.getInventory(); if (chest instanceof Chest) { inven = ((Chest) chest).getBlockInventory(); } inven.clear(); return null; }); return true; }
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
clearContainerBlockContents
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
1
Analyze the following code function for security vulnerabilities
public String injectGetLocaleTagsForUser(@UserIdInt int userId) { // TODO This should get the per-user locale. b/30123329 b/30119489 return LocaleList.getDefault().toLanguageTags(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectGetLocaleTagsForUser File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
injectGetLocaleTagsForUser
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { return doc.createAttributeNS(namespaceURI, qualifiedName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAttributeNS File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
createAttributeNS
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Override public boolean isNotificationPolicyAccessGranted(String pkg) { return checkPolicyAccess(pkg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNotificationPolicyAccessGranted File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
isNotificationPolicyAccessGranted
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@Override public boolean isWikiNameAvailable(String wikiName, XWikiContext inputxcontext) throws XWikiException { try { return !this.store.isWikiDatabaseExist(wikiName); } catch (Exception e) { Object[] args = {wikiName}; throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_HIBERNATE_CHECK_EXISTS_DATABASE, "Exception while listing databases to search for {0}", e, args); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isWikiNameAvailable File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
isWikiNameAvailable
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
public String getFieldValue(String key, String prefix) { String value = mFields.get(key); // Uninitialized or known to be empty after reading from supplicant if (TextUtils.isEmpty(value) || EMPTY_VALUE.equals(value)) return ""; value = removeDoubleQuotes(value); if (value.startsWith(prefix)) { return value.substring(prefix.length()); } else { return value; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFieldValue File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
getFieldValue
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).useAuthorizationCodeFlow(code); return this; } } throw new RuntimeException("No OAuth2 authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOauthAuthorizationCodeFlow File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setOauthAuthorizationCodeFlow
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder insertInstruction(String target, String data) { super.insertInstructionImpl(target, data); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insertInstruction 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
insertInstruction
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public boolean canConvert(Class type) { return type==Secret.class; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canConvert File: core/src/main/java/hudson/util/Secret.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-326" ]
CVE-2017-2598
MEDIUM
4
jenkinsci/jenkins
canConvert
core/src/main/java/hudson/util/Secret.java
e6aa166246d1734f4798a9e31f78842f4c85c28b
0
Analyze the following code function for security vulnerabilities
public List<DictModel> queryAllDepartBackDictModel();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryAllDepartBackDictModel 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
queryAllDepartBackDictModel
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
String chooseClientAlias(X509KeyManager keyManager, X500Principal[] issuers, String[] keyTypes);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: chooseClientAlias File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
chooseClientAlias
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
public Jooby conf(final String path) { this.confname = path; use(ConfigFactory.parseResources(path)); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: conf File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
conf
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public void deleteActivityContainer(IActivityContainer container) throws RemoteException { enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "deleteActivityContainer()"); synchronized (this) { mStackSupervisor.deleteActivityContainer(container); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteActivityContainer 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
deleteActivityContainer
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public static void cursorIntToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getInt(index)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cursorIntToContentValuesIfPresent File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
cursorIntToContentValuesIfPresent
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
private static void printInCLI(String element, int charactersAllowed) { int lengthOfElement = element.length(); if (lengthOfElement > charactersAllowed || lengthOfElement == charactersAllowed) { int margin = 3; String trimmedElement = element.substring(0, charactersAllowed - margin) + "..."; outStream.print(trimmedElement + " |"); } else { printCharacter(element, charactersAllowed, " ", false); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printInCLI File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Search.java Repository: ballerina-platform/ballerina-lang The code follows secure coding practices.
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
printInCLI
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Search.java
4609ffee1744ecd16aac09303b1783bf0a525816
0
Analyze the following code function for security vulnerabilities
@Override public void setParameter(BeforeEvent event, @OptionalParameter String parameter) { Location location = event.getLocation(); QueryParameters queryParameters = location.getQueryParameters(); // query parameter: pageSize List<String> pageSize = queryParameters.getParameters().get("pageSize"); if (pageSize != null) { grid.setPageSize(Integer.parseInt(pageSize.get(0))); } // query parameter: nodesPerLevel List<String> nodesPerLevel = queryParameters.getParameters() .get("nodesPerLevel"); // query parameter: depth List<String> depth = queryParameters.getParameters().get("depth"); int dpNodesPerLevel = nodesPerLevel == null ? 3 : Integer.parseInt(nodesPerLevel.get(0)); int dpDepth = depth == null ? 4 : Integer.parseInt(depth.get(0)); setDataProvider(dpNodesPerLevel, dpDepth); // query parameter: expandedRootIndexes List<String> expandedRootIndexes = queryParameters.getParameters() .get("expandedRootIndexes"); if (expandedRootIndexes != null) { List<HierarchicalTestBean> expandedRootItems = Arrays .stream(expandedRootIndexes.get(0).split(",")) .map(Integer::parseInt) .map(expandedRootIndex -> new HierarchicalTestBean(null, 0, expandedRootIndex)) .collect(java.util.stream.Collectors.toList()); grid.expandRecursively(expandedRootItems, Integer.MAX_VALUE); } // query parameter: sortDirection List<String> sortDirection = queryParameters.getParameters() .get("sortDirection"); if (sortDirection != null) { SortDirection direction = SortDirection .valueOf(sortDirection.get(0).toUpperCase()); GridSortOrderBuilder<HierarchicalTestBean> sorting = new GridSortOrderBuilder<HierarchicalTestBean>(); Column<HierarchicalTestBean> column = grid.getColumns().get(0); if (direction == SortDirection.ASCENDING) { grid.sort(sorting.thenAsc(column).build()); } else { grid.sort(sorting.thenDesc(column).build()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setParameter File: vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridPreloadPage.java Repository: vaadin/flow-components The code follows secure coding practices.
[ "CWE-200" ]
CVE-2022-29567
MEDIUM
5
vaadin/flow-components
setParameter
vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridPreloadPage.java
e70a2dff396d32999c6b5e771869b2fed0185e11
0
Analyze the following code function for security vulnerabilities
private static void parseTagRules(Element root, Map<String, Attribute> commonAttributes1, Map<String, AntiSamyPattern> commonRegularExpressions1, Map<String, Tag> tagRules1) throws PolicyException { if (root == null) return; for (Element tagNode : getByTagName(root, "tag")) { String name = getAttributeValue(tagNode, "name"); String action = getAttributeValue(tagNode, "action"); NodeList attributeList = tagNode.getElementsByTagName("attribute"); Map<String, Attribute> tagAttributes = getTagAttributes(commonAttributes1, commonRegularExpressions1, attributeList, name); Tag tag = new Tag(name, tagAttributes, action); tagRules1.put(name.toLowerCase(), tag); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseTagRules File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
parseTagRules
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
WifiManager getWifiManager() { return mContext.getSystemService(WifiManager.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWifiManager File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
getWifiManager
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static XMLException adaptSAXException(Exception toCatch) { if (toCatch instanceof XMLException) { return (XMLException) toCatch; } else if (toCatch instanceof org.xml.sax.SAXException) { String message = toCatch.getMessage(); Exception embedded = ((org.xml.sax.SAXException) toCatch).getException(); if (embedded != null && embedded.getMessage() != null && embedded.getMessage().equals(message)) { // Just SAX wrapper - skip it return adaptSAXException(embedded); } else { return new XMLException( message, embedded != null ? adaptSAXException(embedded) : null); } } else { return new XMLException(toCatch.getMessage(), toCatch); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: adaptSAXException File: bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java Repository: dbeaver The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3836
MEDIUM
4.3
dbeaver
adaptSAXException
bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
4debf8f25184b7283681ed3fb5e9e887d9d4fe22
0
Analyze the following code function for security vulnerabilities
public void setName(String name) { this.name = name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setName File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setName
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public void broadcastScanFailedEvent(String iface) { sendMessage(iface, SCAN_FAILED_EVENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastScanFailedEvent File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
broadcastScanFailedEvent
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public static Set<String> resolveValidRedirects(KeycloakSession session, String rootUrl, Set<String> validRedirects) { // If the valid redirect URI is relative (no scheme, host, port) then use the request's scheme, host, and port Set<String> resolveValidRedirects = new HashSet<>(); for (String validRedirect : validRedirects) { if (validRedirect.startsWith("/")) { validRedirect = relativeToAbsoluteURI(session, rootUrl, validRedirect); logger.debugv("replacing relative valid redirect with: {0}", validRedirect); resolveValidRedirects.add(validRedirect); } else { resolveValidRedirects.add(validRedirect); } } return resolveValidRedirects; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2022-4361 - Severity: MEDIUM - CVSS Score: 6.1 Description: Check the redirect URI is http(s) when used for a form Post (#22) Closes https://github.com/keycloak/security/issues/22 Co-authored-by: Stian Thorgersen <stianst@gmail.com> Function: resolveValidRedirects File: services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java Repository: keycloak Fixed Code: public static Set<String> resolveValidRedirects(KeycloakSession session, String rootUrl, Set<String> validRedirects) { // If the valid redirect URI is relative (no scheme, host, port) then use the request's scheme, host, and port // the set is ordered by length to get the longest match first Set<String> resolveValidRedirects = new TreeSet<>((String s1, String s2) -> s1.length() == s2.length()? s1.compareTo(s2) : s1.length() < s2.length()? 1 : -1); for (String validRedirect : validRedirects) { if (validRedirect.startsWith("/")) { validRedirect = relativeToAbsoluteURI(session, rootUrl, validRedirect); logger.debugv("replacing relative valid redirect with: {0}", validRedirect); resolveValidRedirects.add(validRedirect); } else { resolveValidRedirects.add(validRedirect); } } return resolveValidRedirects; }
[ "CWE-79" ]
CVE-2022-4361
MEDIUM
6.1
keycloak
resolveValidRedirects
services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java
a1cfe6e24e5b34792699a00b8b4a8016a5929e3a
1
Analyze the following code function for security vulnerabilities
public String buildSqlQueryForRawAssociation( Set<String> uids ) { Stream<String> queryParts = Stream.of( SHARING_OUTER_QUERY_BEGIN, innerQueryProvider( uids, null, null ), SHARING_OUTER_QUERY_END ); return queryParts.collect( joining( " " ) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildSqlQueryForRawAssociation File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
buildSqlQueryForRawAssociation
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
public String[] getRecognizedFeatures() { return RECOGNIZED_FEATURES; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRecognizedFeatures File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
getRecognizedFeatures
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
void setSSLParameters(long sslCtxNativePointer, long sslNativePointer, AliasChooser chooser, PSKCallbacks pskCallbacks, String sniHostname) throws SSLException, IOException { if (npnProtocols != null) { NativeCrypto.SSL_CTX_enable_npn(sslCtxNativePointer); } if (client_mode && alpnProtocols != null) { NativeCrypto.SSL_set_alpn_protos(sslNativePointer, alpnProtocols); } NativeCrypto.setEnabledProtocols(sslNativePointer, enabledProtocols); NativeCrypto.setEnabledCipherSuites(sslNativePointer, enabledCipherSuites); // setup server certificates and private keys. // clients will receive a call back to request certificates. if (!client_mode) { Set<String> keyTypes = new HashSet<String>(); for (long sslCipherNativePointer : NativeCrypto.SSL_get_ciphers(sslNativePointer)) { String keyType = getServerX509KeyType(sslCipherNativePointer); if (keyType != null) { keyTypes.add(keyType); } } X509KeyManager keyManager = getX509KeyManager(); if (keyManager != null) { for (String keyType : keyTypes) { try { setCertificate(sslNativePointer, chooser.chooseServerAlias(x509KeyManager, keyType)); } catch (CertificateEncodingException e) { throw new IOException(e); } } } } // Enable Pre-Shared Key (PSK) key exchange if requested PSKKeyManager pskKeyManager = getPSKKeyManager(); if (pskKeyManager != null) { boolean pskEnabled = false; for (String enabledCipherSuite : enabledCipherSuites) { if ((enabledCipherSuite != null) && (enabledCipherSuite.contains("PSK"))) { pskEnabled = true; break; } } if (pskEnabled) { if (client_mode) { NativeCrypto.set_SSL_psk_client_callback_enabled(sslNativePointer, true); } else { NativeCrypto.set_SSL_psk_server_callback_enabled(sslNativePointer, true); String identityHint = pskCallbacks.chooseServerPSKIdentityHint(pskKeyManager); NativeCrypto.SSL_use_psk_identity_hint(sslNativePointer, identityHint); } } } if (useSessionTickets) { NativeCrypto.SSL_clear_options(sslNativePointer, NativeConstants.SSL_OP_NO_TICKET); } if (getUseSni() && AddressUtils.isValidSniHostname(sniHostname)) { NativeCrypto.SSL_set_tlsext_host_name(sslNativePointer, sniHostname); } // BEAST attack mitigation (1/n-1 record splitting for CBC cipher suites // with TLSv1 and SSLv3). NativeCrypto.SSL_set_mode(sslNativePointer, NativeConstants.SSL_MODE_CBC_RECORD_SPLITTING); boolean enableSessionCreation = getEnableSessionCreation(); if (!enableSessionCreation) { NativeCrypto.SSL_set_session_creation_enabled(sslNativePointer, enableSessionCreation); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSSLParameters File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
setSSLParameters
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
public static String toXmlString(final List<IBaseDataObject> list) { return JDOMUtil.toString(toXml(list)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toXmlString File: src/main/java/emissary/util/PayloadUtil.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
toXmlString
src/main/java/emissary/util/PayloadUtil.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
public int runMovePackage() { final String packageName = nextArg(); String volumeUuid = nextArg(); if ("internal".equals(volumeUuid)) { volumeUuid = null; } try { final int moveId = mPm.movePackage(packageName, volumeUuid); int status = mPm.getMoveStatus(moveId); while (!PackageManager.isMoveStatusFinished(status)) { SystemClock.sleep(DateUtils.SECOND_IN_MILLIS); status = mPm.getMoveStatus(moveId); } if (status == PackageManager.MOVE_SUCCEEDED) { System.out.println("Success"); return 0; } else { System.err.println("Failure [" + status + "]"); return 1; } } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runMovePackage File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runMovePackage
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
@Override public abstract BeanSerializerBase withFilterId(Object filterId);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withFilterId File: src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
withFilterId
src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private void sendLinkConfigurationChangedBroadcast() { Intent intent = new Intent(WifiManager.ACTION_LINK_CONFIGURATION_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); String summary = "broadcast=ACTION_LINK_CONFIGURATION_CHANGED"; if (mVerboseLoggingEnabled) Log.d(getTag(), "Queuing " + summary); mBroadcastQueue.queueOrSendBroadcast( mClientModeManager, () -> { if (mVerboseLoggingEnabled) Log.d(getTag(), "Sending " + summary); mContext.sendBroadcastAsUser(intent, UserHandle.ALL); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendLinkConfigurationChangedBroadcast File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
sendLinkConfigurationChangedBroadcast
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public ServerBuilder idleTimeout(Duration idleTimeout) { requireNonNull(idleTimeout, "idleTimeout"); idleTimeoutMillis = validateIdleTimeoutMillis(idleTimeout.toMillis()); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: idleTimeout 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
idleTimeout
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
@Override public void addCookie(Cookie c) { if(isUseNativeCookieStore()) { this.addCookie(c, true, true); } else { super.addCookie(c); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addCookie 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
addCookie
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public List<PanelSharePo> queryShareOut() { String username = AuthUtils.getUser().getUsername(); return extPanelShareMapper.queryOut(username); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryShareOut File: backend/src/main/java/io/dataease/service/panel/ShareService.java Repository: dataease The code follows secure coding practices.
[ "CWE-639" ]
CVE-2023-32310
HIGH
8.1
dataease
queryShareOut
backend/src/main/java/io/dataease/service/panel/ShareService.java
72f428e87b5395c03d2f94ef6185fc247ddbc8dc
0
Analyze the following code function for security vulnerabilities
public Object get(int index) throws JSONException { Object o = opt(index); if (o == null) { throw new JSONException("JSONArray[" + index + "] not found."); } return o; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
get
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public Set<String> getUniqueLinkedPages(XWikiContext context) { Set<DocumentReference> references = toDocumentReferenceSet( getUniqueLinkedEntityReferences(context, EntityType.DOCUMENT), getDocumentReference()); Set<String> documentNames = new LinkedHashSet<>(references.size()); XWikiDocument contextDoc = context.getDoc(); String contextWiki = context.getWikiId(); EntityReferenceSerializer<String> serializer; try { // Specify the right context information for using the compact wiki serializer properly // Make sure the right document is used as context document context.setDoc(this); // Make sure the right wiki is used as context document context.setWikiId(getDocumentReference().getWikiReference().getName()); // for retro-compatibility reason we don't use the same serializer for 1.0 syntax. if (is10Syntax()) { serializer = getCompactEntityReferenceSerializer(); } else { serializer = getCompactWikiEntityReferenceSerializer(); } for (DocumentReference reference : references) { documentNames.add(serializer.serialize(reference)); } } finally { context.setDoc(contextDoc); context.setWikiId(contextWiki); } return documentNames; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUniqueLinkedPages 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
getUniqueLinkedPages
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 isCollectionLikeType() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCollectionLikeType File: src/main/java/com/fasterxml/jackson/databind/JavaType.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
isCollectionLikeType
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setAttachmentVersioningStore(AttachmentVersioningStore attachmentArchiveStore) { setDefaultAttachmentArchiveStore(attachmentArchiveStore); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAttachmentVersioningStore 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
setAttachmentVersioningStore
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 ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setUsername(username); return this; } } throw new RuntimeException("No HTTP basic authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUsername File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setUsername
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public ClientConfig getClientConfig() { return clientConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClientConfig File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getClientConfig
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void checkSavingDocument(DocumentReference userReference, XWikiDocument document, String comment, boolean isMinorEdit, XWikiContext context) throws XWikiException { String currentWiki = context.getWikiId(); try { // Switch to document wiki context.setWikiId(document.getDocumentReference().getWikiReference().getName()); // Make sure the document is ready to be saved XWikiDocument originalDocument = prepareDocumentForSave(document, comment, isMinorEdit, context); ObservationManager om = getObservationManager(); // Notify listeners about the document about to be created or updated // Note that for the moment the event being send is a bridge event, as we are still passing around // an XWikiDocument as source and an XWikiContext as data. if (om != null) { CancelableEvent documentEvent; if (originalDocument.isNew()) { documentEvent = new UserCreatingDocumentEvent(userReference, document.getDocumentReference()); } else { documentEvent = new UserUpdatingDocumentEvent(userReference, document.getDocumentReference()); } om.notify(documentEvent, document, context); // If the action has been canceled by the user then don't perform any save and throw an exception if (documentEvent.isCanceled()) { throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, String.format("User [%s] has been denied the right to save the document [%s]. Reason: [%s]", userReference, document.getDocumentReference(), documentEvent.getReason())); } } } finally { context.setWikiId(currentWiki); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkSavingDocument 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
checkSavingDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
protected abstract void onStringImport(final AjaxRequestTarget target, final String filename, final String content);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStringImport File: src/main/java/org/projectforge/web/wicket/components/DropFileContainer.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
onStringImport
src/main/java/org/projectforge/web/wicket/components/DropFileContainer.java
422de35e3c3141e418a73bfb39b430d5fd74077e
0
Analyze the following code function for security vulnerabilities
private void handleDisplayChangedLocked(int displayId) { final DisplayContent displayContent = getDisplayContentLocked(displayId); if (displayContent != null) { displayContent.updateDisplayInfo(); } requestTraversalLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleDisplayChangedLocked 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
handleDisplayChangedLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public String getTagForIntentSender(IIntentSender sender, String prefix) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTagForIntentSender File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getTagForIntentSender
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private static int compareNumbers(Number a, Number b) { Number valueA = a != null ? a : Double.POSITIVE_INFINITY; Number valueB = b != null ? b : Double.POSITIVE_INFINITY; // Most Number implementations are Comparable if (valueA instanceof Comparable && valueA.getClass().isInstance(valueB)) { return ((Comparable<Number>) valueA).compareTo(valueB); } if (valueA.equals(valueB)) { return 0; } // Fall back to comparing based on potentially truncated values int compare = Long.compare(valueA.longValue(), valueB.longValue()); if (compare == 0) { // This might still produce 0 even though the values are not // equals, but there's nothing more we can do about that compare = Double.compare(valueA.doubleValue(), valueB.doubleValue()); } return compare; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compareNumbers File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
compareNumbers
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public XWikiStoreInterface getStore() { return this.store; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStore 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
getStore
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 void start() { start(new String[0]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
start
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public boolean dumpForProcesses(FileDescriptor fd, PrintWriter pw, boolean dumpAll, String dumpPackage, int dumpAppId, boolean needSep, boolean testPssMode, int wakefulness) { synchronized (mGlobalLock) { if (mHomeProcess != null && (dumpPackage == null || mHomeProcess.mPkgList.contains(dumpPackage))) { if (needSep) { pw.println(); needSep = false; } pw.println(" mHomeProcess: " + mHomeProcess); } if (mPreviousProcess != null && (dumpPackage == null || mPreviousProcess.mPkgList.contains(dumpPackage))) { if (needSep) { pw.println(); needSep = false; } pw.println(" mPreviousProcess: " + mPreviousProcess); } if (dumpAll && (mPreviousProcess == null || dumpPackage == null || mPreviousProcess.mPkgList.contains(dumpPackage))) { StringBuilder sb = new StringBuilder(128); sb.append(" mPreviousProcessVisibleTime: "); TimeUtils.formatDuration(mPreviousProcessVisibleTime, sb); pw.println(sb); } if (mHeavyWeightProcess != null && (dumpPackage == null || mHeavyWeightProcess.mPkgList.contains(dumpPackage))) { if (needSep) { pw.println(); needSep = false; } pw.println(" mHeavyWeightProcess: " + mHeavyWeightProcess); } if (dumpPackage == null) { pw.println(" mGlobalConfiguration: " + getGlobalConfiguration()); mRootWindowContainer.dumpDisplayConfigs(pw, " "); } if (dumpAll) { final Task topFocusedRootTask = getTopDisplayFocusedRootTask(); if (dumpPackage == null && topFocusedRootTask != null) { pw.println(" mConfigWillChange: " + topFocusedRootTask.mConfigWillChange); } if (mCompatModePackages.getPackages().size() > 0) { boolean printed = false; for (Map.Entry<String, Integer> entry : mCompatModePackages.getPackages().entrySet()) { String pkg = entry.getKey(); int mode = entry.getValue(); if (dumpPackage != null && !dumpPackage.equals(pkg)) { continue; } if (!printed) { pw.println(" mScreenCompatPackages:"); printed = true; } pw.println(" " + pkg + ": " + mode); } } } if (dumpPackage == null) { pw.println(" mWakefulness=" + PowerManagerInternal.wakefulnessToString(wakefulness)); pw.println(" mSleepTokens=" + mRootWindowContainer.mSleepTokens); if (mRunningVoice != null) { pw.println(" mRunningVoice=" + mRunningVoice); pw.println(" mVoiceWakeLock" + mVoiceWakeLock); } pw.println(" mSleeping=" + mSleeping); pw.println(" mShuttingDown=" + mShuttingDown + " mTestPssMode=" + testPssMode); pw.println(" mVrController=" + mVrController); } if (mCurAppTimeTracker != null) { mCurAppTimeTracker.dumpWithHeader(pw, " ", true); } if (mAllowAppSwitchUids.size() > 0) { boolean printed = false; for (int i = 0; i < mAllowAppSwitchUids.size(); i++) { ArrayMap<String, Integer> types = mAllowAppSwitchUids.valueAt(i); for (int j = 0; j < types.size(); j++) { if (dumpPackage == null || UserHandle.getAppId(types.valueAt(j).intValue()) == dumpAppId) { if (needSep) { pw.println(); needSep = false; } if (!printed) { pw.println(" mAllowAppSwitchUids:"); printed = true; } pw.print(" User "); pw.print(mAllowAppSwitchUids.keyAt(i)); pw.print(": Type "); pw.print(types.keyAt(j)); pw.print(" = "); UserHandle.formatUid(pw, types.valueAt(j).intValue()); pw.println(); } } } } if (dumpPackage == null) { if (mController != null) { pw.println(" mController=" + mController + " mControllerIsAMonkey=" + mControllerIsAMonkey); } pw.println(" mGoingToSleepWakeLock=" + mTaskSupervisor.mGoingToSleepWakeLock); pw.println(" mLaunchingActivityWakeLock=" + mTaskSupervisor.mLaunchingActivityWakeLock); } return needSep; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpForProcesses 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
dumpForProcesses
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private void handleServlet(String pathInfo, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Strip the starting "/" from the path to find the JSP URL. GenericServlet servlet = getServlet(pathInfo); if (servlet != null) { servlet.service(request, response); } else { response.setStatus(HttpServletResponse.SC_NOT_FOUND); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleServlet File: xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java Repository: igniterealtime/Openfire The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18393
MEDIUM
5
igniterealtime/Openfire
handleServlet
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java
5af6e03c25b121d01e752927c401124a4da569f7
0
Analyze the following code function for security vulnerabilities
private void setupMappers() { packageAliasingMapper = (PackageAliasingMapper)this.mapper.lookupMapperOfType(PackageAliasingMapper.class); classAliasingMapper = (ClassAliasingMapper)this.mapper.lookupMapperOfType(ClassAliasingMapper.class); elementIgnoringMapper = (ElementIgnoringMapper)this.mapper.lookupMapperOfType(ElementIgnoringMapper.class); fieldAliasingMapper = (FieldAliasingMapper)this.mapper.lookupMapperOfType(FieldAliasingMapper.class); attributeMapper = (AttributeMapper)this.mapper.lookupMapperOfType(AttributeMapper.class); attributeAliasingMapper = (AttributeAliasingMapper)this.mapper.lookupMapperOfType( AttributeAliasingMapper.class); systemAttributeAliasingMapper = (SystemAttributeAliasingMapper)this.mapper.lookupMapperOfType( SystemAttributeAliasingMapper.class); implicitCollectionMapper = (ImplicitCollectionMapper)this.mapper.lookupMapperOfType( ImplicitCollectionMapper.class); defaultImplementationsMapper = (DefaultImplementationsMapper)this.mapper.lookupMapperOfType( DefaultImplementationsMapper.class); immutableTypesMapper = (ImmutableTypesMapper)this.mapper.lookupMapperOfType(ImmutableTypesMapper.class); localConversionMapper = (LocalConversionMapper)this.mapper.lookupMapperOfType(LocalConversionMapper.class); securityMapper = (SecurityMapper)this.mapper.lookupMapperOfType(SecurityMapper.class); annotationConfiguration = (AnnotationConfiguration)this.mapper.lookupMapperOfType( AnnotationConfiguration.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setupMappers 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
setupMappers
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public ServerBuilder blockingTaskExecutor(BlockingTaskExecutor blockingTaskExecutor, boolean shutdownOnStop) { requireNonNull(blockingTaskExecutor, "blockingTaskExecutor"); virtualHostTemplate.blockingTaskExecutor(blockingTaskExecutor, shutdownOnStop); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: blockingTaskExecutor 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
blockingTaskExecutor
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
void clearBackupTrace() { if (DEBUG_BACKUP_TRACE) { synchronized (mBackupTrace) { mBackupTrace.clear(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearBackupTrace File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
clearBackupTrace
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Override public void init(ServletConfig servletConfig) throws ServletException { config = (ConfigManager) servletConfig.getServletContext().getAttribute("ConfigManager"); if (config != null) { String s = config.get("sessionTimeout", null); if (s != null) { try { timeout = Integer.parseInt(s); // timeout of 0 means default timeout if (timeout == 0) { timeout = null; } } catch (Exception e) { // ignore and use default timeout value } } } LOG.info("hawtio login is using " + (timeout != null ? timeout + " sec." : "default") + " HttpSession timeout"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: hawtio-system/src/main/java/io/hawt/web/LoginServlet.java Repository: hawtio The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0120
MEDIUM
6.8
hawtio
init
hawtio-system/src/main/java/io/hawt/web/LoginServlet.java
b4e23e002639c274a2f687ada980118512f06113
0
Analyze the following code function for security vulnerabilities
public void setInsertDocumentBlockedHosts(String insertDocumentBlockedHosts) { this.insertDocumentBlockedHosts = new ArrayList<>(Arrays.asList(insertDocumentBlockedHosts.split(","))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setInsertDocumentBlockedHosts File: bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43798
MEDIUM
5.4
bigbluebutton
setInsertDocumentBlockedHosts
bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
02ba4c6ff8e78a0f4384ad1b7c7367c5a90376e8
0
Analyze the following code function for security vulnerabilities
public void installNativeTheme() { hasNativeTheme(); if (nativeThemeAvailable) { try { InputStream is; if (android.os.Build.VERSION.SDK_INT < 14 && !isTablet() || Display.getInstance().getProperty("and.hololight", "false").equals("true")) { is = getResourceAsStream(getClass(), "/androidTheme.res"); } else { is = getResourceAsStream(getClass(), "/android_holo_light.res"); } Resources r = Resources.open(is); Hashtable h = r.getTheme(r.getThemeResourceNames()[0]); h.put("@commandBehavior", "Native"); UIManager.getInstance().setThemeProps(h); is.close(); Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_NATIVE); } catch (IOException ex) { ex.printStackTrace(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installNativeTheme 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
installNativeTheme
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void setPackageExtensionId(String packageExtensionId) { this.packageExtensionId = packageExtensionId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPackageExtensionId File: xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-27480
HIGH
7.7
xwiki/xwiki-platform
setPackageExtensionId
xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
e3527b98fdd8dc8179c24dc55e662b2c55199434
0
Analyze the following code function for security vulnerabilities
private URI addContentToRepo(MediaPackage mp, String elementId, String filename, InputStream file) throws IOException { ProgressInputStream progressInputStream = new ProgressInputStream(file); progressInputStream.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { long totalNumBytesRead = (Long) evt.getNewValue(); long oldTotalNumBytesRead = (Long) evt.getOldValue(); ingestStatistics.add(totalNumBytesRead - oldTotalNumBytesRead); } }); return workingFileRepository.put(mp.getIdentifier().toString(), elementId, filename, progressInputStream); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addContentToRepo File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
addContentToRepo
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
@Procedure(mode = Mode.WRITE, value = "apoc.xml.import") public Stream<NodeResult> importToGraph(@Name("url") String url, @Name(value="config", defaultValue = "{}") Map<String, Object> config) throws IOException, XMLStreamException { final XMLStreamReader xml = getXMLStreamReaderFromUrl(url); XmlImportConfig importConfig = new XmlImportConfig(config); //TODO: make labels, reltypes and magic properties configurable // stores parents and their most recent child Deque<ParentAndChildPair> parents = new ArrayDeque<>(); org.neo4j.graphdb.Node root = db.createNode(Label.label("XmlDocument")); setPropertyIfNotNull(root, "_xmlVersion", xml.getVersion()); setPropertyIfNotNull(root, "_xmlEncoding", xml.getEncoding()); root.setProperty("url", url); parents.push(new ParentAndChildPair(root)); org.neo4j.graphdb.Node last = root; org.neo4j.graphdb.Node lastWord = root; while (xml.hasNext()) { xml.next(); switch (xml.getEventType()) { case XMLStreamConstants.START_DOCUMENT: // xmlsteamreader starts off by definition at START_DOCUMENT prior to call next() - so ignore this one break; case XMLStreamConstants.PROCESSING_INSTRUCTION: org.neo4j.graphdb.Node pi = db.createNode(Label.label("XmlProcessingInstruction")); pi.setProperty("_piData", xml.getPIData()); pi.setProperty("_piTarget", xml.getPITarget()); last = connectWithParent(pi, parents.peek(), last); break; case XMLStreamConstants.START_ELEMENT: final QName qName = xml.getName(); final org.neo4j.graphdb.Node tag = db.createNode(Label.label("XmlTag")); tag.setProperty("_name", qName.getLocalPart()); for (int i=0; i<xml.getAttributeCount(); i++) { tag.setProperty(xml.getAttributeLocalName(i), xml.getAttributeValue(i)); } last = connectWithParent(tag, parents.peek(), last); parents.push(new ParentAndChildPair(tag)); break; case XMLStreamConstants.CHARACTERS: String text = xml.getText().trim(); String[] words = text.split("\\s"); for (int i = 0; i < words.length; i++) { final String currentWord = words[i]; if (!currentWord.isEmpty()) { org.neo4j.graphdb.Node word = db.createNode(Label.label("XmlWord")); word.setProperty("text", currentWord); last = connectWithParent(word, parents.peek(), last); if (importConfig.isCreateNextWordRelationship()) { lastWord.createRelationshipTo(word, RelationshipType.withName("NEXT_WORD")); lastWord = word; } } } break; case XMLStreamConstants.END_ELEMENT: ParentAndChildPair parent = parents.pop(); if (parent.getPreviousChild()!=null) { parent.getPreviousChild().createRelationshipTo(parent.getParent(), RelationshipType.withName("LAST_CHILD_OF")); } break; case XMLStreamConstants.END_DOCUMENT: parents.pop(); break; case XMLStreamConstants.COMMENT: case XMLStreamConstants.SPACE: // intentionally do nothing break; default: log.warn("xml file contains a {} type structure - ignoring this.", xml.getEventType()); } } if (!parents.isEmpty()) { throw new IllegalStateException("non empty parents"); } return Stream.of(new NodeResult(root)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: importToGraph File: src/main/java/apoc/load/Xml.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000820
HIGH
7.5
neo4j-contrib/neo4j-apoc-procedures
importToGraph
src/main/java/apoc/load/Xml.java
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
0
Analyze the following code function for security vulnerabilities
@Override public LabelAtom getSelfLabel() { return getLabelAtom("master"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSelfLabel 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
getSelfLabel
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public ConstraintValidatorContext getContext() { return context; }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2020-11002 - Severity: HIGH - CVSS Score: 9.0 Description: Disable message interpolation in ConstraintViolations by default (#3208) Disable message interpolation in ConstraintViolations by default but allow enabling it explicitly with `SelfValidating#escapeExpressions()`. Additionally, `ConstraintViolations` now provides a set of methods which take a map of message parameters for interpolation. The message parameters will be escaped by default. Refs #3153 Refs #3157 Function: getContext File: dropwizard-validation/src/main/java/io/dropwizard/validation/selfvalidating/ViolationCollector.java Repository: dropwizard Fixed Code: public ConstraintValidatorContext getContext() { return constraintValidatorContext; }
[ "CWE-74" ]
CVE-2020-11002
HIGH
9
dropwizard
getContext
dropwizard-validation/src/main/java/io/dropwizard/validation/selfvalidating/ViolationCollector.java
d5a512f7abf965275f2a6b913ac4fe778e424242
1
Analyze the following code function for security vulnerabilities
protected void openFileChooser(ValueCallback<Uri> uploadMsg) { mUploadMessage = uploadMsg; Intent i = new Intent(Intent.ACTION_GET_CONTENT); i.addCategory(Intent.CATEGORY_OPENABLE); i.setType("image/*"); AndroidNativeUtil.getActivity().startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openFileChooser 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
openFileChooser
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void signalPersistentProcesses(int sig) throws RemoteException { if (sig != Process.SIGNAL_USR1) { throw new SecurityException("Only SIGNAL_USR1 is allowed"); } synchronized (this) { if (checkCallingPermission(android.Manifest.permission.SIGNAL_PERSISTENT_PROCESSES) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.SIGNAL_PERSISTENT_PROCESSES); } for (int i = mLruProcesses.size() - 1 ; i >= 0 ; i--) { ProcessRecord r = mLruProcesses.get(i); if (r.thread != null && r.persistent) { Process.sendSignal(r.pid, sig); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: signalPersistentProcesses 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
signalPersistentProcesses
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public int getPort() { return port; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPort 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
getPort
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0