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
@Deprecated // not used, possibly remove as early as 2.9 protected AnnotatedMethod _findJsonValueFor(DeserializationConfig config, JavaType enumType) { if (enumType == null) { return null; } BeanDescription beanDesc = config.introspect(enumType); return beanDesc.findJsonValueMethod(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _findJsonValueFor File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
_findJsonValueFor
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public FooterRow getFooterRow(int rowIndex) { return footer.getRow(rowIndex); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFooterRow 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
getFooterRow
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
private State requireValueState(int pos, State state, boolean canBeKey) throws UnbracketedComma { switch (state) { case START_MAP: case BEFORE_KEY: if (canBeKey) { return State.AFTER_KEY; } else { insert(pos, "\"\":"); return State.AFTER_VALUE; } case AFTER_KEY: insert(pos, ':'); return State.AFTER_VALUE; case BEFORE_VALUE: return State.AFTER_VALUE; case AFTER_VALUE: if (canBeKey) { insert(pos, ','); return State.AFTER_KEY; } else { insert(pos, ",\"\":"); return State.AFTER_VALUE; } case START_ARRAY: case BEFORE_ELEMENT: return State.AFTER_ELEMENT; case AFTER_ELEMENT: if (bracketDepth == 0) { throw UNBRACKETED_COMMA; } insert(pos, ','); return State.AFTER_ELEMENT; } throw new AssertionError(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requireValueState File: src/main/java/com/google/json/JsonSanitizer.java Repository: OWASP/json-sanitizer The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-13973
MEDIUM
4.3
OWASP/json-sanitizer
requireValueState
src/main/java/com/google/json/JsonSanitizer.java
53ceaac3e0a10e86d512ce96a0056578f2d1978f
0
Analyze the following code function for security vulnerabilities
void finishIfSubActivity(ActivityRecord parent, String otherResultWho, int otherRequestCode) { if (resultTo != parent || requestCode != otherRequestCode || !Objects.equals(resultWho, otherResultWho)) return; finishIfPossible("request-sub", false /* oomAdj */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishIfSubActivity File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
finishIfSubActivity
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
void setAppTimeTracker(AppTimeTracker att) { appTimeTracker = att; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAppTimeTracker File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
setAppTimeTracker
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void showBootMessage(final CharSequence msg, final boolean always) { boolean first = false; synchronized(mWindowMap) { if (DEBUG_BOOT) { RuntimeException here = new RuntimeException("here"); here.fillInStackTrace(); Slog.i(TAG, "showBootMessage: msg=" + msg + " always=" + always + " mAllowBootMessages=" + mAllowBootMessages + " mShowingBootMessages=" + mShowingBootMessages + " mSystemBooted=" + mSystemBooted, here); } if (!mAllowBootMessages) { return; } if (!mShowingBootMessages) { if (!always) { return; } first = true; } if (mSystemBooted) { return; } mShowingBootMessages = true; mPolicy.showBootMessage(msg, always); } if (first) { performEnableScreen(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showBootMessage 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
showBootMessage
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void addObject(EntityReference reference, String className, Object... properties) { gotoPage(reference, "objectadd", toQueryParameters(className, null, properties)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addObject File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
addObject
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public String getDefaultTemplate() { if (this.defaultTemplate == null) { return ""; } else { return this.defaultTemplate; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultTemplate 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
getDefaultTemplate
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 rotationHasCompatibleMetricsLw(int orientation, int rotation) { switch (orientation) { case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT: case ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT: case ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT: return isAnyPortrait(rotation); case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE: case ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE: case ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE: return isLandscapeOrSeascape(rotation); default: return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rotationHasCompatibleMetricsLw File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
rotationHasCompatibleMetricsLw
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Editable @OmitName @NotEmpty public String getDockerImage() { return dockerImage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDockerImage File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
getDockerImage
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
0
Analyze the following code function for security vulnerabilities
@Override public void screenTurnedOff() { if (DEBUG_WAKEUP) Slog.i(TAG, "Screen turned off..."); synchronized (mLock) { mScreenOnEarly = false; mScreenOnFully = false; mWindowManagerDrawComplete = false; mScreenOnListener = null; updateOrientationListenerLp(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: screenTurnedOff File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
screenTurnedOff
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
private void networkConfigXmlGenerator(XmlGenerator gen, Config config) { NetworkConfig netCfg = config.getNetworkConfig(); gen.open("network") .node("public-address", netCfg.getPublicAddress()) .node("port", netCfg.getPort(), "port-count", netCfg.getPortCount(), "auto-increment", netCfg.isPortAutoIncrement()) .node("reuse-address", netCfg.isReuseAddress()); Collection<String> outboundPortDefinitions = netCfg.getOutboundPortDefinitions(); if (CollectionUtil.isNotEmpty(outboundPortDefinitions)) { gen.open("outbound-ports"); for (String def : outboundPortDefinitions) { gen.node("ports", def); } gen.close(); } JoinConfig join = netCfg.getJoin(); gen.open("join"); multicastConfigXmlGenerator(gen, join); tcpConfigXmlGenerator(gen, join); awsConfigXmlGenerator(gen, join.getAwsConfig()); discoveryStrategyConfigXmlGenerator(gen, join.getDiscoveryConfig()); gen.close(); interfacesConfigXmlGenerator(gen, netCfg); sslConfigXmlGenerator(gen, netCfg); socketInterceptorConfigXmlGenerator(gen, netCfg); symmetricEncInterceptorConfigXmlGenerator(gen, netCfg); memberAddressProviderConfigXmlGenerator(gen, netCfg); failureDetectorConfigXmlGenerator(gen, netCfg); gen.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: networkConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
networkConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
Intent createAppErrorIntentLocked(ProcessRecord r, long timeMillis, ApplicationErrorReport.CrashInfo crashInfo) { ApplicationErrorReport report = createAppErrorReportLocked(r, timeMillis, crashInfo); if (report == null) { return null; } Intent result = new Intent(Intent.ACTION_APP_ERROR); result.setComponent(r.errorReportReceiver); result.putExtra(Intent.EXTRA_BUG_REPORT, report); result.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAppErrorIntentLocked 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
createAppErrorIntentLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public static <T> T bytes2obj(Marshaller marshaller, byte[] bytes, short status, List<String> whitelist) { if (bytes == null || bytes.length == 0) return null; try { Object ret = marshaller.objectFromByteBuffer(bytes); if (HotRodConstants.hasCompatibility(status)) { // Compatibility mode enabled // No extra configuration is required for client when using compatibility mode, // and no different marshaller should be required to deal with standard serialization. // So, if the unmarshalled object is still a byte[], it could be a standard // serialized object, so check for stream magic if (ret instanceof byte[] && isJavaSerialized((byte[]) ret)) { T ois = tryJavaDeserialize(bytes, (byte[]) ret, whitelist); if (ois != null) return ois; } } return (T) ret; } catch (Exception e) { throw log.unableToUnmarshallBytes(Util.toHexString(bytes), e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bytes2obj File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/marshall/MarshallerUtil.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
bytes2obj
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/marshall/MarshallerUtil.java
efc44b7b0a5dd4f44773808840dd9785cabcf21c
0
Analyze the following code function for security vulnerabilities
@Override public IBinder asBinder() { return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asBinder File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
asBinder
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public static boolean isActive() { return CACHE.get() != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isActive 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
isActive
impl/src/main/java/org/jboss/weld/context/cache/RequestScopedCache.java
6808b11cd6d97c71a2eed754ed4f955acd789086
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting void saveState(Bundle outState) { if (mCategories.size() > 0) { outState.putParcelableArrayList(SAVE_KEY_CATEGORIES, mCategories); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveState File: src/com/android/settings/SettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
saveState
src/com/android/settings/SettingsActivity.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
@Override protected Mono<Void> doNotify(InstanceEvent event, Instance instance) { return Mono.fromRunnable(() -> restTemplate.exchange(buildUrl(event, instance), HttpMethod.POST, createRequest(event, instance), Void.class)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doNotify File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
doNotify
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
private int checkDeviceOwnerProvisioningPreCondition(@UserIdInt int callingUserId) { synchronized (getLockObject()) { final int deviceOwnerUserId = mInjector.userManagerIsHeadlessSystemUserMode() ? UserHandle.USER_SYSTEM : callingUserId; Slogf.i(LOG_TAG, "Calling user %d, device owner will be set on user %d", callingUserId, deviceOwnerUserId); // hasIncompatibleAccountsOrNonAdb doesn't matter since the caller is not adb. return checkDeviceOwnerProvisioningPreConditionLocked(/* owner unknown */ null, deviceOwnerUserId, callingUserId, /* isAdb= */ false, /* hasIncompatibleAccountsOrNonAdb=*/ true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkDeviceOwnerProvisioningPreCondition 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
checkDeviceOwnerProvisioningPreCondition
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static CertDataInfos fromDOM(Element infosElement) { CertDataInfos infos = new CertDataInfos(); NodeList totalList = infosElement.getElementsByTagName("total"); if (totalList.getLength() > 0) { String value = totalList.item(0).getTextContent(); infos.setTotal(Integer.parseInt(value)); } NodeList infoList = infosElement.getElementsByTagName("CertDataInfo"); int infoCount = infoList.getLength(); for (int i=0; i<infoCount; i++) { Element infoElement = (Element) infoList.item(i); CertDataInfo info = CertDataInfo.fromDOM(infoElement); infos.addEntry(info); } return infos; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfos.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfos.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public static void init(Arguments args) throws IOException { instance = new ConfigManager(args); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
init
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
public static JSONObject toJSONObject(Reader reader, boolean keepStrings) throws JSONException { if(keepStrings) { return toJSONObject(reader, XMLParserConfiguration.KEEP_STRINGS); } return toJSONObject(reader, XMLParserConfiguration.ORIGINAL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toJSONObject File: src/main/java/org/json/XML.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2022-45688
HIGH
7.5
stleary/JSON-java
toJSONObject
src/main/java/org/json/XML.java
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
0
Analyze the following code function for security vulnerabilities
@Override boolean check(QueueConfig c1, QueueConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getName(), c2.getName()) && nullSafeEqual(c1.getItemListenerConfigs(), c2.getItemListenerConfigs()) && nullSafeEqual(c1.getBackupCount(), c2.getBackupCount()) && nullSafeEqual(c1.getAsyncBackupCount(), c2.getAsyncBackupCount()) && nullSafeEqual(c1.getMaxSize(), c2.getMaxSize()) && nullSafeEqual(c1.getEmptyQueueTtl(), c2.getEmptyQueueTtl()) && isCompatible(c1.getQueueStoreConfig(), c2.getQueueStoreConfig()) && ConfigCompatibilityChecker.isCompatible(c1.getMergePolicyConfig(), c2.getMergePolicyConfig()) && nullSafeEqual(c1.isStatisticsEnabled(), c2.isStatisticsEnabled()) && nullSafeEqual(c1.getQuorumName(), c2.getQuorumName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public TtyExecErrorable<String, OutputStream, PipedInputStream, ExecWatch> readingOutput(PipedInputStream outPipe) { return new PodOperationsImpl(getContext().withOutPipe(outPipe)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readingOutput File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
readingOutput
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition trace(final String path, final Route.OneArgHandler handler) { return appendDefinition(TRACE, path, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trace 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
trace
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public XOPMultipartProxyGetFileResponse getFile(String request) throws Exception { return getResponse(request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFile File: testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/providers/multipart/resource/XOPMultipartProxyResource.java Repository: resteasy The code follows secure coding practices.
[ "CWE-378" ]
CVE-2023-0482
MEDIUM
5.5
resteasy
getFile
testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/providers/multipart/resource/XOPMultipartProxyResource.java
807d7456f2137cde8ef7c316707211bf4e542d56
0
Analyze the following code function for security vulnerabilities
public String formatDate(Date date) { return dateFormat.format(date); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: formatDate 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
formatDate
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
private String truncateValue(int maxWidth, String value) { if (value.length() > maxWidth) { return value.subSequence(0, maxWidth - 3) + "..."; } return value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: truncateValue File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java Repository: jline/jline3 The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-50572
MEDIUM
5.5
jline/jline3
truncateValue
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
0
Analyze the following code function for security vulnerabilities
@Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("Dump of ClientModeImpl id=" + mId); if (mObituary == null) { // StateMachine hasn't quit yet, dump `this` via StateMachineObituary's dump() // method for consistency with `else` branch. new StateMachineObituary(this).dump(fd, pw, args); } else { // StateMachine has quit and cleared all LogRecs. // Get them from the obituary instead. mObituary.dump(fd, pw, args); } mSupplicantStateTracker.dump(fd, pw, args); // Polls link layer stats and RSSI. This allows the stats to show up in // WifiScoreReport's dump() output when taking a bug report even if the screen is off. updateLinkLayerStatsRssiAndScoreReport(); pw.println("mLinkProperties " + mLinkProperties); pw.println("mWifiInfo " + mWifiInfo); pw.println("mDhcpResultsParcelable " + dhcpResultsParcelableToString(mDhcpResultsParcelable)); pw.println("mLastSignalLevel " + mLastSignalLevel); pw.println("mLastTxKbps " + mLastTxKbps); pw.println("mLastRxKbps " + mLastRxKbps); pw.println("mLastBssid " + mLastBssid); pw.println("mLastNetworkId " + mLastNetworkId); pw.println("mLastSubId " + mLastSubId); pw.println("mLastSimBasedConnectionCarrierName " + mLastSimBasedConnectionCarrierName); pw.println("mSuspendOptimizationsEnabled " + mContext.getResources().getBoolean( R.bool.config_wifiSuspendOptimizationsEnabled)); pw.println("mSuspendOptNeedsDisabled " + mSuspendOptNeedsDisabled); pw.println("mPowerSaveDisableRequests " + mPowerSaveDisableRequests); dumpIpClient(fd, pw, args); pw.println("WifiScoreReport:"); mWifiScoreReport.dump(fd, pw, args); pw.println("QosPolicyRequestHandler:"); mQosPolicyRequestHandler.dump(fd, pw, args); pw.println(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump 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
dump
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private ActivityRecord ensureValidPictureInPictureActivityParamsLocked(String caller, IBinder token, PictureInPictureParams params) { if (!mSupportsPictureInPicture) { throw new IllegalStateException(caller + ": Device doesn't support picture-in-picture mode."); } final ActivityRecord r = ActivityRecord.forTokenLocked(token); if (r == null) { throw new IllegalStateException(caller + ": Can't find activity for token=" + token); } if (!r.supportsPictureInPicture()) { throw new IllegalStateException(caller + ": Current activity does not support picture-in-picture."); } if (params.hasSetAspectRatio() && !mWindowManager.isValidPictureInPictureAspectRatio(r.getStack().mDisplayId, params.getAspectRatio())) { final float minAspectRatio = mContext.getResources().getFloat( com.android.internal.R.dimen.config_pictureInPictureMinAspectRatio); final float maxAspectRatio = mContext.getResources().getFloat( com.android.internal.R.dimen.config_pictureInPictureMaxAspectRatio); throw new IllegalArgumentException(String.format(caller + ": Aspect ratio is too extreme (must be between %f and %f).", minAspectRatio, maxAspectRatio)); } // Truncate the number of actions if necessary params.truncateActions(getMaxNumPictureInPictureActions(token)); return r; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ensureValidPictureInPictureActivityParamsLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
ensureValidPictureInPictureActivityParamsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static boolean isFilenameConverted(final Context context) { if (filenameConverted == null) { filenameConverted = getConvertedMarkedFile(context).exists(); } return filenameConverted; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFilenameConverted File: library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
isFilenameConverted
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
public static boolean isTopLevelChild(Entry entry) { return entry.row.getParent() instanceof NotificationStackScrollLayout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTopLevelChild 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
isTopLevelChild
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected void doHandleMessage(Buffer buffer) throws Exception { int cmd = buffer.getUByte(); if (log.isDebugEnabled()) { log.debug("doHandleMessage({}) process #{} {}", this, seqi - 1, SshConstants.getCommandMessageName(cmd)); } switch (cmd) { case SshConstants.SSH_MSG_DISCONNECT: handleDisconnect(buffer); break; case SshConstants.SSH_MSG_IGNORE: handleIgnore(buffer); break; case SshConstants.SSH_MSG_UNIMPLEMENTED: handleUnimplemented(buffer); break; case SshConstants.SSH_MSG_DEBUG: handleDebug(buffer); break; case SshConstants.SSH_MSG_SERVICE_REQUEST: handleServiceRequest(buffer); break; case SshConstants.SSH_MSG_SERVICE_ACCEPT: handleServiceAccept(buffer); break; case SshConstants.SSH_MSG_KEXINIT: handleKexInit(buffer); break; case SshConstants.SSH_MSG_NEWKEYS: handleNewKeys(cmd, buffer); break; case KexExtensions.SSH_MSG_EXT_INFO: handleKexExtension(cmd, buffer); break; case KexExtensions.SSH_MSG_NEWCOMPRESS: handleNewCompression(cmd, buffer); break; default: if ((cmd >= SshConstants.SSH_MSG_KEX_FIRST) && (cmd <= SshConstants.SSH_MSG_KEX_LAST)) { if (firstKexPacketFollows != null) { try { if (!handleFirstKexPacketFollows(cmd, buffer, firstKexPacketFollows)) { break; } } finally { firstKexPacketFollows = null; // avoid re-checking } } handleKexMessage(cmd, buffer); } else if (currentService.process(cmd, buffer)) { resetIdleTimeout(); } else { /* * According to https://tools.ietf.org/html/rfc4253#section-11.4 * * An implementation MUST respond to all unrecognized messages with an SSH_MSG_UNIMPLEMENTED message * in the order in which the messages were received. */ if (log.isDebugEnabled()) { log.debug("process({}) Unsupported command: {}", this, SshConstants.getCommandMessageName(cmd)); } notImplemented(cmd, buffer); } break; } checkRekey(); }
Vulnerability Classification: - CWE: CWE-354 - CVE: CVE-2023-48795 - Severity: MEDIUM - CVSS Score: 5.9 Description: GH-445: OpenSSH "strict KEX" protocol extension Implements the OpenSSH "strict KEX" protocol extension.[1] If both parties in a an SSH connection announce support for strict KEX in the initial KEX_INIT message, strict KEX is active; otherwise it isn't. With strict KEX active, there must be only KEX-related messages during the initial key exchange (no IGNORE or DEBUG messages are allowed), and the KEX_INIT message must be the first one to have been received after the initial version exchange. If these conditions are violated, the connection is terminated. Strict KEX also resets message sequence numbers to zero after each NEW_KEYS message sent or received. [1] https://github.com/openssh/openssh-portable/blob/master/PROTOCOL Function: doHandleMessage File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd Fixed Code: protected void doHandleMessage(Buffer buffer) throws Exception { int cmd = buffer.getUByte(); if (log.isDebugEnabled()) { log.debug("doHandleMessage({}) process #{} {}", this, seqi - 1, SshConstants.getCommandMessageName(cmd)); } switch (cmd) { case SshConstants.SSH_MSG_DISCONNECT: handleDisconnect(buffer); break; case SshConstants.SSH_MSG_IGNORE: failStrictKex(cmd); handleIgnore(buffer); break; case SshConstants.SSH_MSG_UNIMPLEMENTED: failStrictKex(cmd); handleUnimplemented(buffer); break; case SshConstants.SSH_MSG_DEBUG: // Fail after handling -- by default a message will be logged, which might be helpful. handleDebug(buffer); failStrictKex(cmd); break; case SshConstants.SSH_MSG_SERVICE_REQUEST: failStrictKex(cmd); handleServiceRequest(buffer); break; case SshConstants.SSH_MSG_SERVICE_ACCEPT: failStrictKex(cmd); handleServiceAccept(buffer); break; case SshConstants.SSH_MSG_KEXINIT: handleKexInit(buffer); break; case SshConstants.SSH_MSG_NEWKEYS: handleNewKeys(cmd, buffer); break; case KexExtensions.SSH_MSG_EXT_INFO: failStrictKex(cmd); handleKexExtension(cmd, buffer); break; case KexExtensions.SSH_MSG_NEWCOMPRESS: failStrictKex(cmd); handleNewCompression(cmd, buffer); break; default: if ((cmd >= SshConstants.SSH_MSG_KEX_FIRST) && (cmd <= SshConstants.SSH_MSG_KEX_LAST)) { if (firstKexPacketFollows != null) { try { if (!handleFirstKexPacketFollows(cmd, buffer, firstKexPacketFollows)) { break; } } finally { firstKexPacketFollows = null; // avoid re-checking } } handleKexMessage(cmd, buffer); } else { failStrictKex(cmd); if (currentService.process(cmd, buffer)) { resetIdleTimeout(); } else { /* * According to https://tools.ietf.org/html/rfc4253#section-11.4 * * An implementation MUST respond to all unrecognized messages with an SSH_MSG_UNIMPLEMENTED * message in the order in which the messages were received. */ if (log.isDebugEnabled()) { log.debug("process({}) Unsupported command: {}", this, SshConstants.getCommandMessageName(cmd)); } notImplemented(cmd, buffer); } } break; } checkRekey(); }
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
doHandleMessage
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
1
Analyze the following code function for security vulnerabilities
@Override public int getUserProvisioningState() { if (!mHasFeature) { return DevicePolicyManager.STATE_USER_UNMANAGED; } final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(canManageUsers(caller) || hasCallingOrSelfPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS)); return getUserProvisioningState(caller.getUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserProvisioningState 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
getUserProvisioningState
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setKeyStore(final KeyStore keyStore) { this.keyStore = keyStore; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setKeyStore File: src/main/java/org/cryptacular/bean/AbstractCipherBean.java Repository: vt-middleware/cryptacular The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-7226
MEDIUM
5
vt-middleware/cryptacular
setKeyStore
src/main/java/org/cryptacular/bean/AbstractCipherBean.java
8c6c7528f1e24c6b71f3e36db0cb8a697256ce25
0
Analyze the following code function for security vulnerabilities
private static String computeProvisioningErrorString(int code, @UserIdInt int userId) { switch (code) { case STATUS_OK: return "OK"; case STATUS_HAS_DEVICE_OWNER: return "Trying to set the device owner, but device owner is already set."; case STATUS_USER_HAS_PROFILE_OWNER: return "Trying to set the device owner, but the user already has a profile owner."; case STATUS_USER_NOT_RUNNING: return "User " + userId + " not running."; case STATUS_NOT_SYSTEM_USER: return "User " + userId + " is not system user."; case STATUS_USER_SETUP_COMPLETED: return "Cannot set the device owner if the device is already set-up."; case STATUS_NONSYSTEM_USER_EXISTS: return "Not allowed to set the device owner because there are already several" + " users on the device."; case STATUS_ACCOUNTS_NOT_EMPTY: return "Not allowed to set the device owner because there are already some accounts" + " on the device."; case STATUS_HAS_PAIRED: return "Not allowed to set the device owner because this device has already " + "paired."; default: return "Unexpected @ProvisioningPreCondition: " + code; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: computeProvisioningErrorString 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
computeProvisioningErrorString
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public @Nullable SourceInfo getSourceInfo() { return mSourceInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSourceInfo File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getSourceInfo
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Boolean> internalGetDeduplication(boolean applied) { return getTopicPoliciesAsyncWithRetry(topicName) .thenApply(op -> op.map(TopicPolicies::getDeduplicationEnabled) .orElseGet(() -> { if (applied) { Boolean enabled = getNamespacePolicies(namespaceName).deduplicationEnabled; return enabled == null ? config().isBrokerDeduplicationEnabled() : enabled; } return null; })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalGetDeduplication File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalGetDeduplication
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public static Property property(String name, Object value) { Property property = new Property(); property.setName(name); property.setValue(toPropertyString(value)); return property; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: property File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
property
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private static int checkPackageNamePermissionUncached( String permName, String pkgName, @UserIdInt int userId) { try { return ActivityThread.getPackageManager().checkPermission( permName, pkgName, userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPackageNamePermissionUncached File: core/java/android/permission/PermissionManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
checkPackageNamePermissionUncached
core/java/android/permission/PermissionManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public void setDateHeader(String name, long value) { this.response.setDateHeader(name, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDateHeader File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-601" ]
CVE-2022-23618
MEDIUM
5.8
xwiki/xwiki-platform
setDateHeader
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
5251c02080466bf9fb55288f04a37671108f8096
0
Analyze the following code function for security vulnerabilities
protected boolean isSidsAllZeros() { if (mHomeSystemId != null) { for (int i=0; i < mHomeSystemId.length; i++) { if (mHomeSystemId[i] != 0) { return false; } } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSidsAllZeros File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
isSidsAllZeros
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public void setRealm(String realm) { try { this.realm = Utils.urlEncode(realm); } catch(UnsupportedEncodingException e) { throw new OpenIdException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRealm File: JOpenId/src/org/expressme/openid/OpenIdManager.java Repository: michaelliao/jopenid The code follows secure coding practices.
[ "CWE-208" ]
CVE-2010-10006
LOW
1.4
michaelliao/jopenid
setRealm
JOpenId/src/org/expressme/openid/OpenIdManager.java
c9baaa976b684637f0d5a50268e91846a7a719ab
0
Analyze the following code function for security vulnerabilities
public BaseObject getXObject(DocumentReference classReference, String key, String value) { return getXObject(classReference, key, value, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXObject 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
getXObject
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public void register() { mRm.addOnRoleHoldersChangedListenerAsUser(mExecutor, this, UserHandle.SYSTEM); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: register 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
register
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected synchronized void reset() { if (!this.initialized) { return; } if (!this.chunks.isEmpty()) { for (IChunk chunk : this.chunks.values()) { chunk.recycle(); } getChunkLock.lock(); this.chunks.clear(); getChunkLock.unlock(); } this.enabledQueue = true; this.lastChunk = null; this.lastPair = Long.MAX_VALUE; this.currentThread = null; this.initialized = false; this.setProcessor(EmptyBatchProcessor.getInstance()); this.setPostProcessor(EmptyBatchProcessor.getInstance()); this.world = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reset File: worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
reset
worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
@Override public void stopOneTimePermissionSession(String packageName, @UserIdInt int userId) { mContext.enforceCallingPermission(Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS, "Must hold " + Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS + " to remove permissions as one time."); Objects.requireNonNull(packageName); final long token = Binder.clearCallingIdentity(); try { getOneTimePermissionUserManager(userId).stopPackageOneTimeSession(packageName); } finally { Binder.restoreCallingIdentity(token); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopOneTimePermissionSession File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
stopOneTimePermissionSession
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection post(final String path1, final String path2, final String path3, final Route.ZeroArgHandler handler) { return new Route.Collection( new Route.Definition[]{post(path1, handler), post(path2, handler), post(path3, handler)}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: post 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
post
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private static Element getTopLevelElement(InputStream is) throws PolicyException { return getTopLevelElement(new InputSource(is)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTopLevelElement 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
getTopLevelElement
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
Builder setCaller(@NonNull WindowProcessController caller) { mCallerApp = caller; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCaller File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
setCaller
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Nullable private Integer gatherAndStartNewUploads( Intent intent, User user, List<String> requestedUploads, boolean onWifiOnly, boolean whileChargingOnly ) { String[] localPaths = null; String[] remotePaths = null; String[] mimeTypes = null; OCFile[] files = null; if (intent.hasExtra(KEY_FILE)) { Parcelable[] files_temp = intent.getParcelableArrayExtra(KEY_FILE); files = new OCFile[files_temp.length]; System.arraycopy(files_temp, 0, files, 0, files_temp.length); } else { localPaths = intent.getStringArrayExtra(KEY_LOCAL_FILE); remotePaths = intent.getStringArrayExtra(KEY_REMOTE_FILE); mimeTypes = intent.getStringArrayExtra(KEY_MIME_TYPE); } if (intent.hasExtra(KEY_FILE) && files == null) { Log_OC.e(TAG, "Incorrect array for OCFiles provided in upload intent"); return Service.START_NOT_STICKY; } else if (!intent.hasExtra(KEY_FILE)) { if (localPaths == null) { Log_OC.e(TAG, "Incorrect array for local paths provided in upload intent"); return Service.START_NOT_STICKY; } if (remotePaths == null) { Log_OC.e(TAG, "Incorrect array for remote paths provided in upload intent"); return Service.START_NOT_STICKY; } if (localPaths.length != remotePaths.length) { Log_OC.e(TAG, "Different number of remote paths and local paths!"); return Service.START_NOT_STICKY; } files = new OCFile[localPaths.length]; for (int i = 0; i < localPaths.length; i++) { files[i] = UploadFileOperation.obtainNewOCFileToUpload( remotePaths[i], localPaths[i], mimeTypes != null ? mimeTypes[i] : null ); if (files[i] == null) { Log_OC.e(TAG, "obtainNewOCFileToUpload() returned null for remotePaths[i]:" + remotePaths[i] + " and localPaths[i]:" + localPaths[i]); return Service.START_NOT_STICKY; } } } // at this point variable "OCFile[] files" is loaded correctly. NameCollisionPolicy nameCollisionPolicy = (NameCollisionPolicy) intent.getSerializableExtra(KEY_NAME_COLLISION_POLICY); if (nameCollisionPolicy == null) { nameCollisionPolicy = NameCollisionPolicy.DEFAULT; } int localAction = intent.getIntExtra(KEY_LOCAL_BEHAVIOUR, LOCAL_BEHAVIOUR_FORGET); boolean isCreateRemoteFolder = intent.getBooleanExtra(KEY_CREATE_REMOTE_FOLDER, false); int createdBy = intent.getIntExtra(KEY_CREATED_BY, UploadFileOperation.CREATED_BY_USER); boolean disableRetries = intent.getBooleanExtra(KEY_DISABLE_RETRIES, true); try { for (OCFile file : files) { startNewUpload( user, requestedUploads, onWifiOnly, whileChargingOnly, nameCollisionPolicy, localAction, isCreateRemoteFolder, createdBy, file, disableRetries ); } } catch (IllegalArgumentException e) { Log_OC.e(TAG, "Not enough information provided in intent: " + e.getMessage()); return START_NOT_STICKY; } catch (IllegalStateException e) { Log_OC.e(TAG, "Bad information provided in intent: " + e.getMessage()); return START_NOT_STICKY; } catch (Exception e) { Log_OC.e(TAG, "Unexpected exception while processing upload intent", e); return START_NOT_STICKY; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gatherAndStartNewUploads File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39210
MEDIUM
5.5
nextcloud/android
gatherAndStartNewUploads
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
public void duplicateXObjects(XWikiDocument templatedoc) { cloneXObjects(templatedoc, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: duplicateXObjects 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
duplicateXObjects
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
void addQueryParam(String name, @Nullable String value, boolean encoded) { if (relativeUrl != null) { // Do a one-time combination of the built relative URL and the base URL. urlBuilder = baseUrl.newBuilder(relativeUrl); if (urlBuilder == null) { throw new IllegalArgumentException( "Malformed URL. Base: " + baseUrl + ", Relative: " + relativeUrl); } relativeUrl = null; } if (encoded) { //noinspection ConstantConditions Checked to be non-null by above 'if' block. urlBuilder.addEncodedQueryParameter(name, value); } else { //noinspection ConstantConditions Checked to be non-null by above 'if' block. urlBuilder.addQueryParameter(name, value); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addQueryParam File: retrofit/src/main/java/retrofit2/RequestBuilder.java Repository: square/retrofit The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-1000850
MEDIUM
6.4
square/retrofit
addQueryParam
retrofit/src/main/java/retrofit2/RequestBuilder.java
b9a7f6ad72073ddd40254c0058710e87a073047d
0
Analyze the following code function for security vulnerabilities
@Test public void testDeserializationAsInt03Milliseconds() throws Exception { Instant date = Instant.now(); date = date.minus(date.getNano(), ChronoUnit.NANOS); Instant value = MAPPER.readerFor(Instant.class) .without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS) .readValue(Long.toString(date.toEpochMilli())); assertEquals("The value is not correct.", date, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testDeserializationAsInt03Milliseconds File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testDeserializationAsInt03Milliseconds
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
public synchronized void updateBinaryStream( String columnName, java.io.@Nullable InputStream x, int length) throws SQLException { updateBinaryStream(findColumn(columnName), x, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBinaryStream File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateBinaryStream
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
private String getUidsFilter( Set<String> uids ) { return T_ALIAS + ".uid in (" + uids.stream() .map( this::withQuotes ) .collect( joining( "," ) ) + ")"; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2022-24848 - Severity: MEDIUM - CVSS Score: 6.5 Description: Merge pull request from GHSA-52vp-f7hj-cj92 * fix: Add validation for programs org unit associations [DHIS2-13056] * fix compilation failure in test class * Fix one more compilation failure in another test class Co-authored-by: Lars Helge Øverland <lars@dhis2.org> Co-authored-by: Ameen <ameen@dhis2.org> Function: getUidsFilter File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java Repository: dhis2/dhis2-core Fixed Code: private String getUidsFilter( Set<String> uids ) { return T_ALIAS + ".uid in (" + uids.stream() .map( SqlUtils::singleQuote ) .collect( joining( "," ) ) + ")"; }
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getUidsFilter
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
1
Analyze the following code function for security vulnerabilities
private void deleteCreatedSP(ServiceProvider savedSP, String tenantDomain, String username, boolean isUpdate) throws IdentityApplicationManagementException { if (savedSP != null && !isUpdate) { try { log.warn(String.format("Remove newly imported %s@%s application as error occurred ", savedSP.getApplicationName(), tenantDomain)); deleteApplication(savedSP.getApplicationName(), tenantDomain, username); } catch (IdentityApplicationManagementException e) { String errorMsg = String.format("Error occurred when removing newly imported service provider %s@%s", savedSP.getApplicationName(), tenantDomain); log.error(errorMsg, e); throw new IdentityApplicationManagementException(errorMsg, e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteCreatedSP File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
deleteCreatedSP
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
protected String getSessionAttributeName() { return VaadinSession.class.getName() + "." + getServiceName(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSessionAttributeName File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
getSessionAttributeName
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
public void showRouteTarget(Location viewLocation, Component target, List<RouterLayout> layouts) { assert target != null; assert viewLocation != null; HasElement oldRoot = null; if (!routerTargetChain.isEmpty()) { oldRoot = routerTargetChain.get(routerTargetChain.size() - 1); } this.viewLocation = viewLocation; // Assemble previous parent-child relationships to enable detecting // changes Map<RouterLayout, HasElement> oldChildren = new IdentityHashMap<>(); for (int i = 0; i < routerTargetChain.size() - 1; i++) { HasElement child = routerTargetChain.get(i); RouterLayout parent = (RouterLayout) routerTargetChain.get(i + 1); oldChildren.put(parent, child); } routerTargetChain = new ArrayList<>(); routerTargetChain.add(target); if (layouts != null) { routerTargetChain.addAll(layouts); } // If the old and the new router target chains are not intersect, // meaning that the new chain doesn't contain the root router // layout node of the old chain, this aims to recursively remove // content of the all nested router layouts of the given old content // to be detached. This is needed to let Dependency Injection // frameworks to re-create managed components with no // duplicates/leftovers. if (oldRoot != null && !routerTargetChain.contains(oldRoot)) { oldChildren.forEach(RouterLayout::removeRouterLayoutContent); } // Ensure the entire chain is connected HasElement previous = null; for (HasElement current : routerTargetChain) { if (previous != null || oldChildren.containsKey(current)) { /* * Either we're beyond the initial leaf entry, or then it's now * the leaf but was previously a non-leaf. * * In either case, we should update the contents of the current * entry based on its current position in the chain. */ assert current instanceof RouterLayout : "All parts of the chain except the first must implement " + RouterLayout.class.getSimpleName(); HasElement oldContent = oldChildren.get(current); HasElement newContent = previous; if (oldContent != newContent) { RouterLayout layout = (RouterLayout) current; removeChildrenContentFromRouterLayout(layout, oldChildren); layout.showRouterLayoutContent(newContent); } } previous = current; } // Final "previous" from the chain is the root component HasElement root = previous; if (root == null) { throw new IllegalArgumentException( "Root can't be null here since we know there's at least one item in the chain"); } internalsHandler.updateRoot(ui, oldRoot, root); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showRouteTarget File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
showRouteTarget
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) public int getPasswordMinimumLowerCase(@Nullable ComponentName admin, int userHandle) { if (mService != null) { try { return mService.getPasswordMinimumLowerCase(admin, userHandle, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordMinimumLowerCase File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getPasswordMinimumLowerCase
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public Bitmap getTaskDescriptionIcon(String filePath, int userId) { userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, "getTaskDescriptionIcon"); final File passedIconFile = new File(filePath); final File legitIconFile = new File(TaskPersister.getUserImagesDir(userId), passedIconFile.getName()); if (!legitIconFile.getPath().equals(filePath) || !filePath.contains(ActivityRecord.ACTIVITY_ICON_SUFFIX)) { throw new IllegalArgumentException("Bad file path: " + filePath + " passed for userId " + userId); } return mRecentTasks.getTaskDescriptionIcon(filePath); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTaskDescriptionIcon 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
getTaskDescriptionIcon
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Nullable Abort check(@Nullable String nodeName, Collection<JsonNode> containerStatusNodes);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
check
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
0
Analyze the following code function for security vulnerabilities
public Cliente buscarClienteId(Cliente cliente) throws SQLException, ClassNotFoundException, ParseException { Connection con = null; PreparedStatement stmt = null; ResultSet rs = null; try { con = ConnectionFactory.getConnection(); stmt = con.prepareStatement(stmtBuscarClienteId); stmt.setInt(1, cliente.getIdCliente()); rs = stmt.executeQuery(); rs.next(); Cliente clienteRetorno = new Cliente(); clienteRetorno.setIdCliente(cliente.getIdCliente()); clienteRetorno.setNome(rs.getString("nome")); clienteRetorno.setSexo(rs.getString("sexo")); clienteRetorno.setCpf(rs.getString("cpf")); Date nascimento = rs.getDate("nascimento"); clienteRetorno.setNascimento(nascimento); clienteRetorno.setTelefone(rs.getString("telefone")); clienteRetorno.setEmail(rs.getString("email")); clienteRetorno.setSenha(rs.getString("senha")); clienteRetorno.setCep(rs.getString("cep")); clienteRetorno.setEndereco(rs.getString("endereco")); clienteRetorno.setEndNumero(rs.getString("endnumero")); clienteRetorno.setEndComplemento(rs.getString("endcomplemento")); clienteRetorno.setBairro(rs.getString("bairro")); clienteRetorno.setCidade(rs.getString("cidade")); clienteRetorno.setEstado(rs.getString("estado")); clienteRetorno.setPerfil(rs.getInt("perfil")); return clienteRetorno; } catch (SQLException e) { throw new RuntimeException(e); } finally { try { rs.close(); } catch (Exception ex) { System.out.println("Erro ao fechar result set.Erro: " + ex.getMessage()); } try { stmt.close(); } catch (SQLException ex) { System.out.println("Erro ao fechar statement. Ex = " + ex.getMessage()); } try { con.close(); } catch (SQLException ex) { System.out.println("Erro ao fechar a conexao. Ex = " + ex.getMessage()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buscarClienteId File: src/java/br/com/magazine/dao/ClienteDAO.java Repository: evandro-machado/Trabalho-Web2 The code follows secure coding practices.
[ "CWE-89" ]
CVE-2015-10061
MEDIUM
5.2
evandro-machado/Trabalho-Web2
buscarClienteId
src/java/br/com/magazine/dao/ClienteDAO.java
f59ac954625d0a4f6d34f069a2e26686a7a20aeb
0
Analyze the following code function for security vulnerabilities
public void setParamResource(String value) { m_paramResource = value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setParamResource File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
setParamResource
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public void stopWaitingForKeyguardExit() { mWaitingForKeyguardExit = false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopWaitingForKeyguardExit 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
stopWaitingForKeyguardExit
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handle(httpPostHandler, req, resp); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doPost File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
doPost
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
0
Analyze the following code function for security vulnerabilities
private void ensureCallerIdentityMatchesIfNotSystem(String packageName, int pid, int uid, CallerIdentity caller) { // If the caller is not a system app then it should only be able to check its own device // identifier access. int callingUid = caller.getUid(); int callingPid = mInjector.binderGetCallingPid(); if (UserHandle.getAppId(callingUid) >= Process.FIRST_APPLICATION_UID && (callingUid != uid || callingPid != pid)) { String message = String.format( "Calling uid %d, pid %d cannot check device identifier access for package %s " + "(uid=%d, pid=%d)", callingUid, callingPid, packageName, uid, pid); Slogf.w(LOG_TAG, message); throw new SecurityException(message); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ensureCallerIdentityMatchesIfNotSystem 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
ensureCallerIdentityMatchesIfNotSystem
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Deprecated public String parseContent(String content) { return this.xwiki.parseContent(content, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseContent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
parseContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
private DefaultJpaInstanceConfiguration derbyConfig() { DefaultJpaInstanceConfiguration config = new DefaultJpaInstanceConfiguration(); File dbFolder = new File(tempFolder.getRoot(), "derbyDb"); config.transactionType(DefaultJpaInstanceConfiguration.TransactionType.RESOURCE_LOCAL) .db(JpaDb.DERBY_EMBEDDED) .autoCreate(true) .url(dbFolder.getAbsolutePath()) .user("test") .password("test") .ddlGeneration(DefaultJpaInstanceConfiguration.Ddl.DROP_AND_CREATE) . bind(OptionJpaDao_LongInt.class, DefaultOptionJpaDao_LongInt.class) .bind(JpaDao_LongInt.class, DefaultJpaDao_LongInt.class) .bind(JpaPatternDao.class, DefaultJpaPatternDao_LongInt.class); return config; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2016-15018 - Severity: MEDIUM - CVSS Score: 5.2 Description: Fix #18 SQLInjection vulnerability cleared Pattern and Option DAOs re-written to a common key-value base class. Using composite primary key in place of surrogate key. Function: derbyConfig File: src/test/java/uk/q3c/krail/jpa/persist/TestJpaModule.java Repository: KrailOrg/krail-jpa Fixed Code: private DefaultJpaInstanceConfiguration derbyConfig() { DefaultJpaInstanceConfiguration config = new DefaultJpaInstanceConfiguration(); File dbFolder = new File(tempFolder.getRoot(), "derbyDb"); config.transactionType(DefaultJpaInstanceConfiguration.TransactionType.RESOURCE_LOCAL) .db(JpaDb.DERBY_EMBEDDED) .autoCreate(true) .url(dbFolder.getAbsolutePath()) .user("test") .password("test") .ddlGeneration(DefaultJpaInstanceConfiguration.Ddl.DROP_AND_CREATE) . bind(JpaOptionDao.class, DefaultJpaOptionDao.class) .bind(JpaDao_LongInt.class, DefaultJpaDao_LongInt.class) .bind(JpaPatternDao.class, DefaultJpaPatternDao.class); return config; }
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
derbyConfig
src/test/java/uk/q3c/krail/jpa/persist/TestJpaModule.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
1
Analyze the following code function for security vulnerabilities
public static <T> Collection<T> emptyList() { return Collections.emptyList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: emptyList 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
emptyList
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
void wtf(String message, Throwable e) { if (e == null) { e = new RuntimeException("Stacktrace"); } synchronized (mLock) { mWtfCount++; mLastWtfStacktrace = new Exception("Last failure was logged here:"); } Slog.wtf(TAG, message, e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wtf File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40092
MEDIUM
5.5
android
wtf
services/core/java/com/android/server/pm/ShortcutService.java
a5e55363e69b3c84d3f4011c7b428edb1a25752c
0
Analyze the following code function for security vulnerabilities
public String getHost() { return host; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHost 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
getHost
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Override public boolean convertToTranslucent(IBinder token, ActivityOptions options) { final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { return false; } int index = r.task.mActivities.lastIndexOf(r); if (index > 0) { ActivityRecord under = r.task.mActivities.get(index - 1); under.returningOptions = options; } final boolean translucentChanged = r.changeWindowTranslucency(false); if (translucentChanged) { r.task.stack.convertActivityToTranslucent(r); } mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); mWindowManager.setAppFullscreen(token, false); return translucentChanged; } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertToTranslucent 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
convertToTranslucent
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
private void startUser(@UserIdInt int userId, String callerPackage) throws IllegalStateException { final long startTime = SystemClock.elapsedRealtime(); final UserUnlockedBlockingReceiver unlockedReceiver = new UserUnlockedBlockingReceiver( userId); mContext.registerReceiverAsUser( unlockedReceiver, new UserHandle(userId), new IntentFilter(Intent.ACTION_USER_UNLOCKED), /* broadcastPermission = */ null, /* scheduler= */ null); try { if (!mInjector.getIActivityManager().startUserInBackground(userId)) { throw new ServiceSpecificException(ERROR_STARTING_PROFILE_FAILED, String.format("Unable to start user %d in background", userId)); } if (!unlockedReceiver.waitForUserUnlocked()) { throw new ServiceSpecificException(ERROR_STARTING_PROFILE_FAILED, String.format("Timeout whilst waiting for unlock of user %d.", userId)); } logEventDuration( DevicePolicyEnums.PLATFORM_PROVISIONING_START_PROFILE_MS, startTime, callerPackage); } catch (RemoteException e) { // Shouldn't happen. } finally { mContext.unregisterReceiver(unlockedReceiver); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startUser 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
startUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean isConsumable(String item) { if (getBillingSupport() != null) { return getBillingSupport().isConsumable(item); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isConsumable File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
isConsumable
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") private final boolean startProcessLocked(ProcessRecord app, String hostingType, String hostingNameStr, String abiOverride) { return startProcessLocked(app, hostingType, hostingNameStr, false /* disableHiddenApiChecks */, abiOverride); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startProcessLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
startProcessLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(caller != null ? caller.asBinder() : null); data.writeString(callingPackage); intent.writeToParcel(data, 0); data.writeString(resolvedType); data.writeStrongBinder(resultTo); data.writeString(resultWho); data.writeInt(requestCode); data.writeInt(startFlags); if (profilerInfo != null) { data.writeInt(1); profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { data.writeInt(0); } if (options != null) { data.writeInt(1); options.writeToParcel(data, 0); } else { data.writeInt(0); } data.writeInt(userId); mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); reply.readException(); int result = reply.readInt(); reply.recycle(); data.recycle(); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityAsUser File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startActivityAsUser
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void beginDefinitionDescription() { getXHTMLWikiPrinter().printXMLStartElement("dd"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: beginDefinitionDescription File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
beginDefinitionDescription
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
protected Object getParameter(String parameterName, String resource, XWikiContext context) { return getParametersForResource(resource, context).get(parameterName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParameter File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
getParameter
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
public Client getHttpClient() { return httpClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHttpClient File: samples/client/petstore/java/resteasy/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
getHttpClient
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void startNewUpload( User user, List<String> requestedUploads, boolean onWifiOnly, boolean whileChargingOnly, NameCollisionPolicy nameCollisionPolicy, int localAction, boolean isCreateRemoteFolder, int createdBy, OCFile file, boolean disableRetries ) { OCUpload ocUpload = new OCUpload(file, user.toPlatformAccount()); ocUpload.setFileSize(file.getFileLength()); ocUpload.setNameCollisionPolicy(nameCollisionPolicy); ocUpload.setCreateRemoteFolder(isCreateRemoteFolder); ocUpload.setCreatedBy(createdBy); ocUpload.setLocalAction(localAction); ocUpload.setUseWifiOnly(onWifiOnly); ocUpload.setWhileChargingOnly(whileChargingOnly); ocUpload.setUploadStatus(UploadStatus.UPLOAD_IN_PROGRESS); UploadFileOperation newUpload = new UploadFileOperation( mUploadsStorageManager, connectivityService, powerManagementService, user, file, ocUpload, nameCollisionPolicy, localAction, this, onWifiOnly, whileChargingOnly, disableRetries ); newUpload.setCreatedBy(createdBy); if (isCreateRemoteFolder) { newUpload.setRemoteFolderToBeCreated(); } newUpload.addDataTransferProgressListener(this); newUpload.addDataTransferProgressListener((FileUploaderBinder) mBinder); newUpload.addRenameUploadListener(this); Pair<String, String> putResult = mPendingUploads.putIfAbsent( user.getAccountName(), file.getRemotePath(), newUpload ); if (putResult != null) { requestedUploads.add(putResult.first); // Save upload in database long id = mUploadsStorageManager.storeUpload(ocUpload); newUpload.setOCUploadId(id); } }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2021-32695 - Severity: MEDIUM - CVSS Score: 4.3 Description: prevent upload from sensitive path Signed-off-by: tobiasKaminsky <tobias@kaminsky.me> Function: startNewUpload File: src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android Fixed Code: @SuppressLint("SdCardPath") private void startNewUpload( User user, List<String> requestedUploads, boolean onWifiOnly, boolean whileChargingOnly, NameCollisionPolicy nameCollisionPolicy, int localAction, boolean isCreateRemoteFolder, int createdBy, OCFile file, boolean disableRetries ) { if (file.getStoragePath().startsWith("/data/data/")) { Log_OC.d(TAG, "Upload from sensitive path is not allowed"); return; } OCUpload ocUpload = new OCUpload(file, user.toPlatformAccount()); ocUpload.setFileSize(file.getFileLength()); ocUpload.setNameCollisionPolicy(nameCollisionPolicy); ocUpload.setCreateRemoteFolder(isCreateRemoteFolder); ocUpload.setCreatedBy(createdBy); ocUpload.setLocalAction(localAction); ocUpload.setUseWifiOnly(onWifiOnly); ocUpload.setWhileChargingOnly(whileChargingOnly); ocUpload.setUploadStatus(UploadStatus.UPLOAD_IN_PROGRESS); UploadFileOperation newUpload = new UploadFileOperation( mUploadsStorageManager, connectivityService, powerManagementService, user, file, ocUpload, nameCollisionPolicy, localAction, this, onWifiOnly, whileChargingOnly, disableRetries ); newUpload.setCreatedBy(createdBy); if (isCreateRemoteFolder) { newUpload.setRemoteFolderToBeCreated(); } newUpload.addDataTransferProgressListener(this); newUpload.addDataTransferProgressListener((FileUploaderBinder) mBinder); newUpload.addRenameUploadListener(this); Pair<String, String> putResult = mPendingUploads.putIfAbsent( user.getAccountName(), file.getRemotePath(), newUpload ); if (putResult != null) { requestedUploads.add(putResult.first); // Save upload in database long id = mUploadsStorageManager.storeUpload(ocUpload); newUpload.setOCUploadId(id); } }
[ "CWE-200" ]
CVE-2021-32695
MEDIUM
4.3
nextcloud/android
startNewUpload
src/main/java/com/owncloud/android/files/services/FileUploader.java
97d6f2954c879f3bfebcd241993147bced5fd50b
1
Analyze the following code function for security vulnerabilities
public void setOwnerInfoEnabled(boolean enabled, int userId) { setBoolean(LOCK_SCREEN_OWNER_INFO_ENABLED, enabled, userId); updateCryptoUserInfo(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOwnerInfoEnabled File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
setOwnerInfoEnabled
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
private void setVolumeTo(String packageName, String opPackageName, int pid, int uid, int value, int flags) { if (mVolumeType == PlaybackInfo.PLAYBACK_TYPE_LOCAL) { int stream = getVolumeStream(mAudioAttrs); final int volumeValue = value; mHandler.post(new Runnable() { @Override public void run() { try { mAudioManager.setStreamVolumeForUid(stream, volumeValue, flags, opPackageName, uid, pid, mContext.getApplicationInfo().targetSdkVersion); } catch (IllegalArgumentException | SecurityException e) { Log.e(TAG, "Cannot set volume: stream=" + stream + ", value=" + volumeValue + ", flags=" + flags, e); } } }); } else { if (mVolumeControlType != VolumeProvider.VOLUME_CONTROL_ABSOLUTE) { if (DEBUG) { Log.d(TAG, "Session does not support setting volume"); } } else { value = Math.max(0, Math.min(value, mMaxVolume)); mSessionCb.setVolumeTo(packageName, pid, uid, value); int volumeBefore = (mOptimisticVolume < 0 ? mCurrentVolume : mOptimisticVolume); mOptimisticVolume = Math.max(0, Math.min(value, mMaxVolume)); mHandler.removeCallbacks(mClearOptimisticVolumeRunnable); mHandler.postDelayed(mClearOptimisticVolumeRunnable, OPTIMISTIC_VOLUME_TIMEOUT); if (volumeBefore != mOptimisticVolume) { pushVolumeUpdate(); } if (DEBUG) { Log.d(TAG, "Set optimistic volume to " + mOptimisticVolume + " max is " + mMaxVolume); } } // Always notify, even if the volume hasn't changed. mService.notifyRemoteVolumeChanged(flags, this); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVolumeTo File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
setVolumeTo
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
@Override protected boolean allowFilterResult( PackageParser.ProviderIntentInfo filter, List<ResolveInfo> dest) { ProviderInfo filterPi = filter.provider.info; for (int i = dest.size() - 1; i >= 0; i--) { ProviderInfo destPi = dest.get(i).providerInfo; if (destPi.name == filterPi.name && destPi.packageName == filterPi.packageName) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: allowFilterResult 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
allowFilterResult
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private static String getNextCodePath(String oldCodePath, String prefix, String suffix) { String idxStr = ""; int idx = 1; // Fall back to default value of idx=1 if prefix is not // part of oldCodePath if (oldCodePath != null) { String subStr = oldCodePath; // Drop the suffix right away if (suffix != null && subStr.endsWith(suffix)) { subStr = subStr.substring(0, subStr.length() - suffix.length()); } // If oldCodePath already contains prefix find out the // ending index to either increment or decrement. int sidx = subStr.lastIndexOf(prefix); if (sidx != -1) { subStr = subStr.substring(sidx + prefix.length()); if (subStr != null) { if (subStr.startsWith(INSTALL_PACKAGE_SUFFIX)) { subStr = subStr.substring(INSTALL_PACKAGE_SUFFIX.length()); } try { idx = Integer.parseInt(subStr); if (idx <= 1) { idx++; } else { idx--; } } catch(NumberFormatException e) { } } } } idxStr = INSTALL_PACKAGE_SUFFIX + Integer.toString(idx); return prefix + idxStr; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNextCodePath 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
getNextCodePath
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private static LoadingCache<AsciiString, String> buildCache(String spec) { return Caffeine.from(spec).build(AsciiString::toString); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildCache File: core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
buildCache
core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
@Override public void writeTo(BufferedSink sink) throws IOException { delegate.writeTo(sink); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeTo File: retrofit/src/main/java/retrofit2/RequestBuilder.java Repository: square/retrofit The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-1000850
MEDIUM
6.4
square/retrofit
writeTo
retrofit/src/main/java/retrofit2/RequestBuilder.java
b9a7f6ad72073ddd40254c0058710e87a073047d
0
Analyze the following code function for security vulnerabilities
@GuardedBy("getLockObject()") private List<ActiveAdmin> getActiveAdminsForAffectedUserLocked(int userHandle) { if (isManagedProfile(userHandle)) { return getUserDataUnchecked(userHandle).mAdminList; } return getActiveAdminsForUserAndItsManagedProfilesLocked(userHandle, /* shouldIncludeProfileAdmins */ (user) -> false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveAdminsForAffectedUserLocked 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
getActiveAdminsForAffectedUserLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setMacRandomizationEnabled(boolean enabled) { mIsMacRandomizationEnabled = enabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMacRandomizationEnabled File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
setMacRandomizationEnabled
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private boolean setUrlText(OmniboxResultItem result) { OmniboxSuggestion suggestion = result.getSuggestion(); Spannable str = SpannableString.valueOf(suggestion.getDisplayText()); boolean hasMatch = applyHighlightToMatchRegions( str, suggestion.getDisplayTextClassifications()); showDescriptionLine(str, URL_COLOR); return hasMatch; }
Vulnerability Classification: - CWE: CWE-254 - CVE: CVE-2016-5163 - Severity: MEDIUM - CVSS Score: 4.3 Description: Android omnibox: Force paragraph direction to LTR. This means that URLs will always be displayed in a left-to-right context. Right-to-left runs are still rendered as RTL, but will not cause the whole URL to flip around. This fixes several spoofing concerns and makes Android's omnibox consistent with the Views omnibox. BUG=609680 Review-Url: https://codereview.chromium.org/1988553002 Cr-Commit-Position: refs/heads/master@{#400359} Function: setUrlText File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java Repository: chromium Fixed Code: private boolean setUrlText(OmniboxResultItem result) { OmniboxSuggestion suggestion = result.getSuggestion(); Spannable str = SpannableString.valueOf(suggestion.getDisplayText()); boolean hasMatch = applyHighlightToMatchRegions( str, suggestion.getDisplayTextClassifications()); showDescriptionLine(str, true); return hasMatch; }
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
setUrlText
chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
3bd33fee094e863e5496ac24714c558bd58d28ef
1
Analyze the following code function for security vulnerabilities
protected boolean useXStream11XmlFriendlyMapper() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: useXStream11XmlFriendlyMapper 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
useXStream11XmlFriendlyMapper
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public static String getPduTable(boolean accessRestricted) { return accessRestricted ? VIEW_PDU_RESTRICTED : TABLE_PDU; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPduTable File: src/com/android/providers/telephony/MmsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-22" ]
CVE-2023-21268
MEDIUM
5.5
android
getPduTable
src/com/android/providers/telephony/MmsProvider.java
ca4c9a19635119d95900793e7a41b820cd1d94d9
0
Analyze the following code function for security vulnerabilities
public static String rfc822Date(Calendar cal) { return Util.RFC822_DATETIME_FORMATTER.format(cal.getTime()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rfc822Date 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
rfc822Date
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public void delete(AsyncResult<SQLConnection> connection, String table, String id, Handler<AsyncResult<UpdateResult>> replyHandler) { try { if (connection.failed()) { replyHandler.handle(Future.failedFuture(connection.cause())); return; } connection.result().updateWithParams( "DELETE FROM " + schemaName + DOT + table + WHERE + ID_FIELD + "=?", new JsonArray().add(id), replyHandler); } catch (Exception e) { replyHandler.handle(Future.failedFuture(e)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
delete
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public boolean containsHeader(String arg0) { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsHeader File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
containsHeader
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
private DefaultServerConfig buildServerConfig(List<ServerPort> serverPorts) { final AnnotatedServiceExtensions extensions = virtualHostTemplate.annotatedServiceExtensions(); assert extensions != null; final DependencyInjector dependencyInjector = dependencyInjectorOrReflective(); final UnhandledExceptionsReporter unhandledExceptionsReporter; if (unhandledExceptionsReportIntervalMillis > 0) { unhandledExceptionsReporter = UnhandledExceptionsReporter.of( meterRegistry, unhandledExceptionsReportIntervalMillis); serverListeners.add(unhandledExceptionsReporter); } else { unhandledExceptionsReporter = null; } final VirtualHost defaultVirtualHost = defaultVirtualHostBuilder.build(virtualHostTemplate, dependencyInjector, unhandledExceptionsReporter); final List<VirtualHost> virtualHosts = virtualHostBuilders.stream() .map(vhb -> vhb.build(virtualHostTemplate, dependencyInjector, unhandledExceptionsReporter)) .collect(toImmutableList()); // Pre-populate the domain name mapping for later matching. final Mapping<String, SslContext> sslContexts; final SslContext defaultSslContext = findDefaultSslContext(defaultVirtualHost, virtualHosts); final Collection<ServerPort> ports; for (ServerPort port : this.ports) { checkState(port.protocols().stream().anyMatch(p -> p != PROXY), "protocols: %s (expected: at least one %s or %s)", port.protocols(), HTTP, HTTPS); } // The port numbers of port-based virtual hosts must exist in 'ServerPort's. final List<VirtualHost> portBasedVirtualHosts = virtualHosts.stream() .filter(v -> v.port() > 0) .collect(toImmutableList()); final List<Integer> portNumbers = this.ports.stream() .map(port -> port.localAddress().getPort()) .filter(port -> port > 0) .collect(toImmutableList()); for (VirtualHost virtualHost : portBasedVirtualHosts) { final int virtualHostPort = virtualHost.port(); final boolean portMatched = portNumbers.stream().anyMatch(port -> port == virtualHostPort); checkState(portMatched, "virtual host port: %s (expected: one of %s)", virtualHostPort, portNumbers); } if (defaultSslContext == null) { sslContexts = null; if (!serverPorts.isEmpty()) { ports = resolveDistinctPorts(serverPorts); for (final ServerPort p : ports) { if (p.hasTls()) { throw new IllegalArgumentException("TLS not configured; cannot serve HTTPS"); } } } else { ports = ImmutableList.of(new ServerPort(0, HTTP)); } } else { if (!Flags.useOpenSsl() && !SystemInfo.jettyAlpnOptionalOrAvailable()) { throw new IllegalStateException( "TLS configured but this is Java 8 and neither OpenSSL nor Jetty ALPN could be " + "detected. To use TLS with Armeria, you must either use Java 9+, enable OpenSSL, " + "usually by adding a build dependency on the " + "io.netty:netty-tcnative-boringssl-static artifact or enable Jetty ALPN as described " + "at https://www.eclipse.org/jetty/documentation/9.4.x/alpn-chapter.html"); } if (!serverPorts.isEmpty()) { ports = resolveDistinctPorts(serverPorts); } else { ports = ImmutableList.of(new ServerPort(0, HTTPS)); } final DomainMappingBuilder<SslContext> mappingBuilder = new DomainMappingBuilder<>(defaultSslContext); for (VirtualHost h : virtualHosts) { final SslContext sslCtx = h.sslContext(); if (sslCtx != null) { final String originalHostnamePattern = h.originalHostnamePattern(); // The SslContext for the default virtual host was added when creating DomainMappingBuilder. if (!"*".equals(originalHostnamePattern)) { mappingBuilder.add(originalHostnamePattern, sslCtx); } } } sslContexts = mappingBuilder.build(); } if (pingIntervalMillis > 0) { pingIntervalMillis = Math.max(pingIntervalMillis, MIN_PING_INTERVAL_MILLIS); if (idleTimeoutMillis > 0 && pingIntervalMillis >= idleTimeoutMillis) { pingIntervalMillis = 0; } } if (maxConnectionAgeMillis > 0) { maxConnectionAgeMillis = Math.max(maxConnectionAgeMillis, MIN_MAX_CONNECTION_AGE_MILLIS); if (idleTimeoutMillis == 0 || idleTimeoutMillis > maxConnectionAgeMillis) { idleTimeoutMillis = maxConnectionAgeMillis; } } final Map<ChannelOption<?>, Object> newChildChannelOptions = ChannelUtil.applyDefaultChannelOptions( childChannelOptions, idleTimeoutMillis, pingIntervalMillis); final BlockingTaskExecutor blockingTaskExecutor = defaultVirtualHost.blockingTaskExecutor(); return new DefaultServerConfig( ports, setSslContextIfAbsent(defaultVirtualHost, defaultSslContext), virtualHosts, workerGroup, shutdownWorkerGroupOnStop, startStopExecutor, maxNumConnections, idleTimeoutMillis, keepAliveOnPing, pingIntervalMillis, maxConnectionAgeMillis, maxNumRequestsPerConnection, connectionDrainDurationMicros, http2InitialConnectionWindowSize, http2InitialStreamWindowSize, http2MaxStreamsPerConnection, http2MaxFrameSize, http2MaxHeaderListSize, http1MaxInitialLineLength, http1MaxHeaderSize, http1MaxChunkSize, gracefulShutdownQuietPeriod, gracefulShutdownTimeout, blockingTaskExecutor, meterRegistry, proxyProtocolMaxTlvSize, channelOptions, newChildChannelOptions, childChannelPipelineCustomizer, clientAddressSources, clientAddressTrustedProxyFilter, clientAddressFilter, clientAddressMapper, enableServerHeader, enableDateHeader, errorHandler, sslContexts, http1HeaderNaming, dependencyInjector, absoluteUriTransformer, unhandledExceptionsReportIntervalMillis, ImmutableList.copyOf(shutdownSupports)); }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-44487 - Severity: HIGH - CVSS Score: 7.5 Description: Limit max reset frames to mitigate HTTP/2 RST floods Motivation: To mitigate against the "HTTP/2 Rapid Reset" attack, it is recommended that HTTP/2 servers should close connections that exceed the concurrent stream limit. Reference: - https://blog.cloudflare.com/technical-breakdown-http2-rapid-reset-ddos-attack/ - https://www.cve.org/CVERecord?id=CVE-2023-44487 - https://github.com/netty/netty/commit/58f75f665aa81a8cbcf6ffa74820042a285c5e61#diff-82f568a075ff63e9727ce8622f3a2b1553099182edf1fd0b4f857226252b05adR47 Modifications: - Add `ServerBuilder.http2MaxRestFramesPerWindow()` option `-Dcom.linecorp.armeria.defaultHttp2MaxResetFramesPerMinute<integer>` property to limit the maximum allowed RST frames. - If not set, 400 RST frames per minute are alllowed by default. - Bump Netty version to 4.1.100 from 4.1.96 Result: You can now protect your server against DDOS caused by RST floods. ```java Server .builder() .http2MaxResetFramesPerWindow(100, 10) .build(); ``` Function: buildServerConfig File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria Fixed Code: private DefaultServerConfig buildServerConfig(List<ServerPort> serverPorts) { final AnnotatedServiceExtensions extensions = virtualHostTemplate.annotatedServiceExtensions(); assert extensions != null; final DependencyInjector dependencyInjector = dependencyInjectorOrReflective(); final UnhandledExceptionsReporter unhandledExceptionsReporter; if (unhandledExceptionsReportIntervalMillis > 0) { unhandledExceptionsReporter = UnhandledExceptionsReporter.of( meterRegistry, unhandledExceptionsReportIntervalMillis); serverListeners.add(unhandledExceptionsReporter); } else { unhandledExceptionsReporter = null; } final VirtualHost defaultVirtualHost = defaultVirtualHostBuilder.build(virtualHostTemplate, dependencyInjector, unhandledExceptionsReporter); final List<VirtualHost> virtualHosts = virtualHostBuilders.stream() .map(vhb -> vhb.build(virtualHostTemplate, dependencyInjector, unhandledExceptionsReporter)) .collect(toImmutableList()); // Pre-populate the domain name mapping for later matching. final Mapping<String, SslContext> sslContexts; final SslContext defaultSslContext = findDefaultSslContext(defaultVirtualHost, virtualHosts); final Collection<ServerPort> ports; for (ServerPort port : this.ports) { checkState(port.protocols().stream().anyMatch(p -> p != PROXY), "protocols: %s (expected: at least one %s or %s)", port.protocols(), HTTP, HTTPS); } // The port numbers of port-based virtual hosts must exist in 'ServerPort's. final List<VirtualHost> portBasedVirtualHosts = virtualHosts.stream() .filter(v -> v.port() > 0) .collect(toImmutableList()); final List<Integer> portNumbers = this.ports.stream() .map(port -> port.localAddress().getPort()) .filter(port -> port > 0) .collect(toImmutableList()); for (VirtualHost virtualHost : portBasedVirtualHosts) { final int virtualHostPort = virtualHost.port(); final boolean portMatched = portNumbers.stream().anyMatch(port -> port == virtualHostPort); checkState(portMatched, "virtual host port: %s (expected: one of %s)", virtualHostPort, portNumbers); } if (defaultSslContext == null) { sslContexts = null; if (!serverPorts.isEmpty()) { ports = resolveDistinctPorts(serverPorts); for (final ServerPort p : ports) { if (p.hasTls()) { throw new IllegalArgumentException("TLS not configured; cannot serve HTTPS"); } } } else { ports = ImmutableList.of(new ServerPort(0, HTTP)); } } else { if (!Flags.useOpenSsl() && !SystemInfo.jettyAlpnOptionalOrAvailable()) { throw new IllegalStateException( "TLS configured but this is Java 8 and neither OpenSSL nor Jetty ALPN could be " + "detected. To use TLS with Armeria, you must either use Java 9+, enable OpenSSL, " + "usually by adding a build dependency on the " + "io.netty:netty-tcnative-boringssl-static artifact or enable Jetty ALPN as described " + "at https://www.eclipse.org/jetty/documentation/9.4.x/alpn-chapter.html"); } if (!serverPorts.isEmpty()) { ports = resolveDistinctPorts(serverPorts); } else { ports = ImmutableList.of(new ServerPort(0, HTTPS)); } final DomainMappingBuilder<SslContext> mappingBuilder = new DomainMappingBuilder<>(defaultSslContext); for (VirtualHost h : virtualHosts) { final SslContext sslCtx = h.sslContext(); if (sslCtx != null) { final String originalHostnamePattern = h.originalHostnamePattern(); // The SslContext for the default virtual host was added when creating DomainMappingBuilder. if (!"*".equals(originalHostnamePattern)) { mappingBuilder.add(originalHostnamePattern, sslCtx); } } } sslContexts = mappingBuilder.build(); } if (pingIntervalMillis > 0) { pingIntervalMillis = Math.max(pingIntervalMillis, MIN_PING_INTERVAL_MILLIS); if (idleTimeoutMillis > 0 && pingIntervalMillis >= idleTimeoutMillis) { pingIntervalMillis = 0; } } if (maxConnectionAgeMillis > 0) { maxConnectionAgeMillis = Math.max(maxConnectionAgeMillis, MIN_MAX_CONNECTION_AGE_MILLIS); if (idleTimeoutMillis == 0 || idleTimeoutMillis > maxConnectionAgeMillis) { idleTimeoutMillis = maxConnectionAgeMillis; } } final Map<ChannelOption<?>, Object> newChildChannelOptions = ChannelUtil.applyDefaultChannelOptions( childChannelOptions, idleTimeoutMillis, pingIntervalMillis); final BlockingTaskExecutor blockingTaskExecutor = defaultVirtualHost.blockingTaskExecutor(); return new DefaultServerConfig( ports, setSslContextIfAbsent(defaultVirtualHost, defaultSslContext), virtualHosts, workerGroup, shutdownWorkerGroupOnStop, startStopExecutor, maxNumConnections, idleTimeoutMillis, keepAliveOnPing, pingIntervalMillis, maxConnectionAgeMillis, maxNumRequestsPerConnection, connectionDrainDurationMicros, http2InitialConnectionWindowSize, http2InitialStreamWindowSize, http2MaxStreamsPerConnection, http2MaxFrameSize, http2MaxHeaderListSize, http2MaxResetFramesPerWindow, http2MaxResetFramesWindowSeconds, http1MaxInitialLineLength, http1MaxHeaderSize, http1MaxChunkSize, gracefulShutdownQuietPeriod, gracefulShutdownTimeout, blockingTaskExecutor, meterRegistry, proxyProtocolMaxTlvSize, channelOptions, newChildChannelOptions, childChannelPipelineCustomizer, clientAddressSources, clientAddressTrustedProxyFilter, clientAddressFilter, clientAddressMapper, enableServerHeader, enableDateHeader, errorHandler, sslContexts, http1HeaderNaming, dependencyInjector, absoluteUriTransformer, unhandledExceptionsReportIntervalMillis, ImmutableList.copyOf(shutdownSupports)); }
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
buildServerConfig
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
1
Analyze the following code function for security vulnerabilities
@ApiOperation(value = "Fetch the list of active public Composite Solution for the specified User Id") @RequestMapping(value = "/getCompositeSolutions", method = RequestMethod.GET, produces = "text/plain") @ResponseBody public String getCompositeSolutions(@RequestParam(value = "userId", required = true) String userId, @RequestParam(value = "visibilityLevel", required = true) String visibilityLevel) { logger.debug(EELFLoggerDelegator.debugLogger, " getCompositeSolutions() : Begin"); String result = ""; String resultTemplate = "{\"items\" : %s}"; String error = "{errorCode : \"%s\", errorDescription : \"%s\"}"; try { visibilityLevel = visibilityLevel.toUpperCase(); result = compositeServiceImpl.getCompositeSolutions(userId, visibilityLevel); result = String.format(resultTemplate, result); } catch (AcumosException e) { logger.error(EELFLoggerDelegator.errorLogger, " Exception in getCompositeSolutions() ", e); result = String.format(error, e.getErrorCode(), e.getErrorDesc()); } catch (Exception e) { logger.error(EELFLoggerDelegator.errorLogger, " Exception in getCompositeSolutions()", e); result = String.format(error, "401", "Failed to fetch the list of active Public Composite Solutions"); } logger.debug(EELFLoggerDelegator.debugLogger, " getCompositeSolutions() : End"); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCompositeSolutions File: ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java Repository: acumos/design-studio The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-25097
MEDIUM
4
acumos/design-studio
getCompositeSolutions
ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java
0df8a5e8722188744973168648e4c74c69ce67fd
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(MANAGE_FINGERPRINT) public void setActiveUser(int userId) { if (mService != null) try { mService.setActiveUser(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActiveUser File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
setActiveUser
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private void initializeLookup() { /* * There are two cases: * * - the servlet context is initialized before all of the Servlets or * * - after at least one of the servlets with the same context. * * SevletContext::getClassLoader doesn't return the container the web * app classloader for the servlet context instance here (in the * "contextInitialized" method). It returns the web app classloader for * the servlet context which is passed to the Servlet::init method: in * fact two servlet context instances are different even though they * share the same attributes and values. So to be able to identify the * servlet context (which is coming from Servlet) and the * "servletContext" instance here the Lookupx instance is used which is * set as an attribute and if the context "is the same" the attributes * should be the same. */ // at this point at least one of the Servlet::init method should be // called and the classloader should be available // ensure the lookup is set into the context Lookup[] created = new Lookup[1]; Lookup lookup = servletContext.getAttribute(Lookup.class, () -> { Lookup result = new OsgiLookupImpl(webAppBundle, servletContext); created[0] = result; return result; }); if (lookup == null) { throw new IllegalStateException( VaadinContextInitializer.class.getSimpleName() + " has been executed but there is no " + ApplicationClassLoaderAccess.class.getSimpleName() + " instance available"); } if (created[0] != lookup) { // The context has been already initialized if there is already // lookup instance: just return return; } if (isFrameworkStarted()) { registerResoures(servletContext); } else { FrameworkListener listener = new FrameworkListener() { @Override public void frameworkEvent(FrameworkEvent event) { if (isFrameworkStarted()) { registerResoures(servletContext); context.removeFrameworkListener(this); } } }; context.addFrameworkListener(listener); } OSGiVaadinInitialization .checkLicense(ApplicationConfiguration.get(servletContext)); getRegisteredVaadinServlets().stream() .filter(this::isUninitializedServlet).forEach( servlet -> handleUninitializedServlet(lookup, servlet)); initializerClasses.addContext(servletContext.getContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeLookup File: flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java Repository: vaadin/osgi The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-31407
MEDIUM
5
vaadin/osgi
initializeLookup
flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
3e17674c2e3f88b6e682872c42b7d0ad7d9c4ad8
0
Analyze the following code function for security vulnerabilities
public PolicyEnforcerConfig getEnforcerConfig() { return this.enforcerConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnforcerConfig File: services/src/main/java/org/keycloak/services/managers/ClientManager.java Repository: keycloak The code follows secure coding practices.
[ "CWE-798" ]
CVE-2019-14837
MEDIUM
6.4
keycloak
getEnforcerConfig
services/src/main/java/org/keycloak/services/managers/ClientManager.java
9a7c1a91a59ab85e7f8889a505be04a71580777f
0