instruction string | input string | output string | cwe_ids list | cve_id string | severity string | cvss_score float64 | repo_name string | func_name string | file_path string | commit_hash string | is_vulnerable int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities | public String getCurrentTabHandle()
{
return getDriver().getWindowHandle();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentTabHandle
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 | getCurrentTabHandle | 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 Date parseDate(String str) {
try {
return dateFormat.parse(str);
} catch (java.text.ParseException e) {
throw new RuntimeException(e);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseDate
File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2021-21430 | LOW | 2.1 | OpenAPITools/openapi-generator | parseDate | samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | @SuppressWarnings("javadoc")
public int computeVerticalScrollOffset() {
return mRenderCoordinates.getScrollYPixInt();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: computeVerticalScrollOffset
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2014-3159 | MEDIUM | 6.4 | chromium | computeVerticalScrollOffset | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | @Deprecated
public Boolean getSignOutgoingMessages() {
logger.warn("Option signOutgoingMessages is used for signing of error messages. Normal SAML messages are "
+ "signed by SAML2SignatureGenerationHandler.");
return true;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSignOutgoingMessages
File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
Repository: picketlink/picketlink-bindings
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2015-3158 | MEDIUM | 4 | picketlink/picketlink-bindings | getSignOutgoingMessages | picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java | 341a37aefd69e67b6b5f6d775499730d6ccaff0d | 0 |
Analyze the following code function for security vulnerabilities | public ServerBuilder startStopExecutor(Executor startStopExecutor) {
this.startStopExecutor = requireNonNull(startStopExecutor, "startStopExecutor");
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startStopExecutor
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-44487 | HIGH | 7.5 | line/armeria | startStopExecutor | core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java | df7f85824a62e997b910b5d6194a3335841065fd | 0 |
Analyze the following code function for security vulnerabilities | AppOpsManager getAppOpsManager() {
if (mAppOpsManager == null) {
mAppOpsManager = mContext.getSystemService(AppOpsManager.class);
}
return mAppOpsManager;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAppOpsManager
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21292 | MEDIUM | 5.5 | android | getAppOpsManager | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | @Override
public DSpaceObject getParentObject(Context context, Collection collection) throws SQLException {
List<Community> communities = collection.getCommunities();
if (CollectionUtils.isNotEmpty(communities)) {
return communities.get(0);
} else {
return null;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParentObject
File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
Repository: DSpace
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-41189 | HIGH | 9 | DSpace | getParentObject | dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java | 277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
//Enforce SerialKiller's whitelist
boolean safeClass = false;
for (String whiteRegExp : whitelist) {
Pattern whitePattern = Pattern.compile(whiteRegExp);
Matcher whiteMatcher = whitePattern.matcher(desc.getName());
if (whiteMatcher.find()) {
safeClass = true;
if (log.isTraceEnabled())
log.tracef("Whitelist match: '%s'", desc.getName());
}
}
if (!safeClass)
throw log.classNotInWhitelist(desc.getName());
return super.resolveClass(desc);
} | Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2017-15089
- Severity: MEDIUM
- CVSS Score: 6.5
Description: ISPN-8624 White list unmarshalling for GenericJBossMarshaller
Function: resolveClass
File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/marshall/MarshallerUtil.java
Repository: infinispan
Fixed Code:
@Override
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
//Enforce SerialKiller's whitelist
boolean safeClass = MarshallUtil.isSafeClass(desc.getName(), whitelist);
if (!safeClass)
throw log.classNotInWhitelist(desc.getName());
return super.resolveClass(desc);
} | [
"CWE-502"
] | CVE-2017-15089 | MEDIUM | 6.5 | infinispan | resolveClass | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/marshall/MarshallerUtil.java | efc44b7b0a5dd4f44773808840dd9785cabcf21c | 1 |
Analyze the following code function for security vulnerabilities | private void clearUserSelection() {
if (mFocusedNodeEditable) {
if (mInputConnection != null) {
int selectionEnd = Selection.getSelectionEnd(mEditable);
mInputConnection.setSelection(selectionEnd, selectionEnd);
}
} else if (mImeAdapter != null) {
mImeAdapter.unselect();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearUserSelection
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-1021"
] | CVE-2015-1241 | MEDIUM | 4.3 | chromium | clearUserSelection | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 9d343ad2ea6ec395c377a4efa266057155bfa9c1 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void internalError(final Exception cause) {
logError("Internal Server Error on " + request().getUri(), cause);
if (this.api_version > 0) {
// always default to the latest version of the error formatter since we
// need to return something
switch (this.api_version) {
case 1:
default:
sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR,
serializer.formatErrorV1(cause));
}
return;
}
ThrowableProxy tp = new ThrowableProxy(cause);
tp.calculatePackagingData();
final String pretty_exc = ThrowableProxyUtil.asString(tp);
tp = null;
if (hasQueryStringParam("json")) {
// 32 = 10 + some extra space as exceptions always have \t's to escape.
final StringBuilder buf = new StringBuilder(32 + pretty_exc.length());
buf.append("{\"err\":\"");
HttpQuery.escapeJson(pretty_exc, buf);
buf.append("\"}");
sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, buf);
} else {
sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR,
makePage("Internal Server Error", "Houston, we have a problem",
"<blockquote>"
+ "<h1>Internal Server Error</h1>"
+ "Oops, sorry but your request failed due to a"
+ " server error.<br/><br/>"
+ "Please try again in 30 seconds.<pre>"
+ pretty_exc
+ "</pre></blockquote>"));
}
} | Vulnerability Classification:
- CWE: CWE-74
- CVE: CVE-2023-36812
- Severity: CRITICAL
- CVSS Score: 9.8
Description: Fix for #2269 and #2267 XSS vulnerability.
Escaping the user supplied input when outputing the HTML for the old BadRequest
HTML handlers should help. Thanks to the reporters.
Fixes CVE-2018-13003.
Function: internalError
File: src/tsd/HttpQuery.java
Repository: OpenTSDB/opentsdb
Fixed Code:
@Override
public void internalError(final Exception cause) {
logError("Internal Server Error on " + request().getUri(), cause);
if (this.api_version > 0) {
// always default to the latest version of the error formatter since we
// need to return something
switch (this.api_version) {
case 1:
default:
sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR,
serializer.formatErrorV1(cause));
}
return;
}
ThrowableProxy tp = new ThrowableProxy(cause);
tp.calculatePackagingData();
final String pretty_exc = ThrowableProxyUtil.asString(tp);
tp = null;
if (hasQueryStringParam("json")) {
// 32 = 10 + some extra space as exceptions always have \t's to escape.
final StringBuilder buf = new StringBuilder(32 + pretty_exc.length());
buf.append("{\"err\":\"");
HttpQuery.escapeJson(pretty_exc, buf);
buf.append("\"}");
sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, buf);
} else {
String response = "";
if (pretty_exc != null) {
response = HtmlEscapers.htmlEscaper().escape(pretty_exc);
}
sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR,
makePage("Internal Server Error", "Houston, we have a problem",
"<blockquote>"
+ "<h1>Internal Server Error</h1>"
+ "Oops, sorry but your request failed due to a"
+ " server error.<br/><br/>"
+ "Please try again in 30 seconds.<pre>"
+ response
+ "</pre></blockquote>"));
}
} | [
"CWE-74"
] | CVE-2023-36812 | CRITICAL | 9.8 | OpenTSDB/opentsdb | internalError | src/tsd/HttpQuery.java | fa88d3e4b5369f9fb73da384fab0b23e246309ba | 1 |
Analyze the following code function for security vulnerabilities | private SSLEngineResult newResult(
int bytesConsumed, int bytesProduced, HandshakeStatus status) throws SSLException {
return new SSLEngineResult(
getEngineStatus(), mayFinishHandshake(status != FINISHED ? getHandshakeStatus() : status)
, bytesConsumed, bytesProduced);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newResult
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices. | [
"CWE-835"
] | CVE-2016-4970 | HIGH | 7.8 | netty | newResult | handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java | bc8291c80912a39fbd2303e18476d15751af0bf1 | 0 |
Analyze the following code function for security vulnerabilities | @SuppressWarnings("deprecation")
private static boolean isCompatible(EvictionConfig c1, EvictionConfig c2) {
return c1 == c2 || !(c1 == null || c2 == null)
&& nullSafeEqual(c1.getSize(), c2.getSize())
&& nullSafeEqual(c1.getMaximumSizePolicy(), c2.getMaximumSizePolicy())
&& nullSafeEqual(c1.getEvictionPolicy(), c2.getEvictionPolicy())
&& nullSafeEqual(c1.getEvictionPolicyType(), c2.getEvictionPolicyType())
&& nullSafeEqual(c1.getEvictionStrategyType(), c2.getEvictionStrategyType())
&& nullSafeEqual(c1.getComparatorClassName(), c2.getComparatorClassName());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCompatible
File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
Repository: hazelcast
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2016-10750 | MEDIUM | 6.8 | hazelcast | isCompatible | hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java | c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9 | 0 |
Analyze the following code function for security vulnerabilities | private void doDiscard() {
// Only need to ask for confirmation if the draft is in a dirty state.
if (isDraftDirty()) {
final DialogFragment frag = new DiscardConfirmDialogFragment();
frag.show(getFragmentManager(), "discard confirm");
} else {
doDiscardWithoutConfirmation();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doDiscard
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2016-2425 | MEDIUM | 4.3 | android | doDiscard | src/com/android/mail/compose/ComposeActivity.java | 0d9dfd649bae9c181e3afc5d571903f1eb5dc46f | 0 |
Analyze the following code function for security vulnerabilities | @Nullable
@Deprecated
public PendingIntent getBubbleIntent() {
return mPendingIntent;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBubbleIntent
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | getBubbleIntent | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void deletePackageAsUser(String packageName, IPackageDeleteObserver observer, int userId,
int flags) {
deletePackage(packageName, new LegacyPackageDeleteObserver(observer).getBinder(), userId,
flags);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deletePackageAsUser
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 | deletePackageAsUser | services/core/java/com/android/server/pm/PackageManagerService.java | a75537b496e9df71c74c1d045ba5569631a16298 | 0 |
Analyze the following code function for security vulnerabilities | @Test
public void selectParam(TestContext context) {
createNumbers(context, 7, 8, 9)
.select("SELECT i FROM numbers WHERE i IN (?, ?, ?) ORDER BY i",
new JsonArray().add(7).add(9).add(11), context.asyncAssertSuccess(select -> {
context.assertEquals("7, 9", intsAsString(select));
}));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectParam
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2019-15534 | HIGH | 7.5 | folio-org/raml-module-builder | selectParam | domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java | b7ef741133e57add40aa4cb19430a0065f378a94 | 0 |
Analyze the following code function for security vulnerabilities | public static void launch(Context context) {
final Intent intent = new Intent(context, StartConversationActivity.class);
context.startActivity(intent);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: launch
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2018-18467 | MEDIUM | 5 | iNPUTmice/Conversations | launch | src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java | 7177c523a1b31988666b9337249a4f1d0c36f479 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void setSessionPolicies(int policies) {
synchronized (mLock) {
mPolicies = policies;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSessionPolicies
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 | setSessionPolicies | services/core/java/com/android/server/media/MediaSessionRecord.java | 06e772e05514af4aa427641784c5eec39a892ed3 | 0 |
Analyze the following code function for security vulnerabilities | private void fetchClusterInfos(ProxiedResourceHelper proxiedResourceHelper, Map<String, SupportBundleNodeManifest> nodeManifests, Path tmpDir) throws IOException {
try (FileOutputStream clusterJson = new FileOutputStream(tmpDir.resolve("cluster.json").toFile())) {
final Map<String, CallResult<SystemOverviewResponse>> systemOverview =
proxiedResourceHelper.requestOnAllNodes(RemoteSystemResource.class, RemoteSystemResource::system, CALL_TIMEOUT);
final Map<String, CallResult<SystemJVMResponse>> jvm = proxiedResourceHelper.requestOnAllNodes(
RemoteSystemResource.class, RemoteSystemResource::jvm, CALL_TIMEOUT);
final Map<String, CallResult<SystemProcessBufferDumpResponse>> processBuffer = proxiedResourceHelper.requestOnAllNodes(
RemoteSystemResource.class, RemoteSystemResource::processBufferDump, CALL_TIMEOUT);
final Map<String, CallResult<PluginList>> installedPlugins = proxiedResourceHelper.requestOnAllNodes(
RemoteSystemPluginResource.class, RemoteSystemPluginResource::list, CALL_TIMEOUT);
final Map<String, Object> result = new HashMap<>(
Map.of(
"manifest", nodeManifests,
"cluster_system_overview", stripCallResult(systemOverview),
"jvm", stripCallResult(jvm),
"process_buffer_dump", stripCallResult(processBuffer),
"installed_plugins", stripCallResult(installedPlugins)
)
);
result.putAll(getClusterInfo());
objectMapper.writerWithDefaultPrettyPrinter().writeValue(clusterJson, result);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fetchClusterInfos
File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2023-41044 | LOW | 3.8 | Graylog2/graylog2-server | fetchClusterInfos | graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java | 02b8792e6f4b829f0c1d87fcbf2d58b73458b938 | 0 |
Analyze the following code function for security vulnerabilities | @Before
public void setup() throws WebdavException, IOException {
when(request.getContentType()).thenReturn("application/xml");
requestPars = new PostRequestPars(request, webdavNsIntf, UUID.randomUUID().toString());
when(methodBase.getNsIntf()).thenReturn(webdavNsIntf);
when(request.getContentLength()).thenReturn(1);
when(request.getReader()).thenReturn(getResource("/malicious-request.xml"));
} | Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2018-20000
- Severity: MEDIUM
- CVSS Score: 5.0
Description: format: follow the repo code style, and welcome mvnvm props to manage maven versions
Function: setup
File: src/test/java/org/bedework/webdav/servlet/common/TestSecureXmlTypes.java
Repository: Bedework/bw-webdav
Fixed Code:
@Before
public void setup() throws WebdavException, IOException {
when(request.getContentType()).thenReturn("application/xml");
requestPars = new PostRequestPars(request, webdavNsIntf, UUID.randomUUID().toString());
when(methodBase.getNsIntf()).thenReturn(webdavNsIntf);
when(request.getContentLength()).thenReturn(1);
when(request.getReader()).thenReturn(getResource("/malicious-request.xml"));
} | [
"CWE-611"
] | CVE-2018-20000 | MEDIUM | 5 | Bedework/bw-webdav | setup | src/test/java/org/bedework/webdav/servlet/common/TestSecureXmlTypes.java | 0ce2007b3515a23b5f287ef521300bcb1f748edc | 1 |
Analyze the following code function for security vulnerabilities | @Override
public void silenceRinger(String callingPackage) {
try {
Log.startSession("TSI.sR");
synchronized (mLock) {
enforcePermissionOrPrivilegedDialer(MODIFY_PHONE_STATE, callingPackage);
long token = Binder.clearCallingIdentity();
try {
Log.i(this, "Silence Ringer requested by %s", callingPackage);
mCallsManager.getCallAudioManager().silenceRingers();
mCallsManager.getInCallController().silenceRinger();
} finally {
Binder.restoreCallingIdentity(token);
}
}
} finally {
Log.endSession();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: silenceRinger
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21394 | MEDIUM | 5.5 | android | silenceRinger | src/com/android/server/telecom/TelecomServiceImpl.java | 68dca62035c49e14ad26a54f614199cb29a3393f | 0 |
Analyze the following code function for security vulnerabilities | protected void startPicketLink() throws LifecycleException {
SystemPropertiesUtil.ensure();
//Introduce a timer to reload configuration if desired
if (timerInterval > 0) {
if (timer == null) {
timer = new Timer();
}
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
try {
logger.info("Reloading configuration for " + getContext().getName());
processConfiguration();
} catch (LifecycleException e) {
logger.error(e);
}
}
}, timerInterval, timerInterval);
}
processConfiguration();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startPicketLink
File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
Repository: picketlink/picketlink-bindings
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2015-3158 | MEDIUM | 4 | picketlink/picketlink-bindings | startPicketLink | picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java | 341a37aefd69e67b6b5f6d775499730d6ccaff0d | 0 |
Analyze the following code function for security vulnerabilities | public final void setProxyGrantingTicketStorage(final ProxyGrantingTicketStorage proxyGrantingTicketStorage) {
this.proxyGrantingTicketStorage = proxyGrantingTicketStorage;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProxyGrantingTicketStorage
File: cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java
Repository: apereo/java-cas-client
The code follows secure coding practices. | [
"CWE-74"
] | CVE-2014-4172 | HIGH | 7.5 | apereo/java-cas-client | setProxyGrantingTicketStorage | cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java | ae37092100c8eaec610dab6d83e5e05a8ee58814 | 0 |
Analyze the following code function for security vulnerabilities | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
String reportPackage) throws RemoteException; | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDumpHeapDebugLimit
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | setDumpHeapDebugLimit | core/java/android/app/IActivityManager.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Analyze the following code function for security vulnerabilities | private void checkForStrippedApkSignatures(
ManifestParser.Section sfMainSection,
Map<Integer, String> supportedApkSigSchemeNames,
Set<Integer> foundApkSigSchemeIds) {
String signedWithApkSchemes =
sfMainSection.getAttributeValue(
V1SchemeConstants.SF_ATTRIBUTE_NAME_ANDROID_APK_SIGNED_NAME_STR);
// This field contains a comma-separated list of APK signature scheme IDs which were
// used to sign this APK. Android rejects APKs where an ID is known to the platform but
// the APK didn't verify using that scheme.
if (signedWithApkSchemes == null) {
// APK signature (e.g., v2 scheme) stripping protections not enabled.
if (!foundApkSigSchemeIds.isEmpty()) {
// APK is signed with an APK signature scheme such as v2 scheme.
mResult.addWarning(
Issue.JAR_SIG_NO_APK_SIG_STRIP_PROTECTION,
mSignatureFileEntry.getName());
}
return;
}
if (supportedApkSigSchemeNames.isEmpty()) {
return;
}
Set<Integer> supportedApkSigSchemeIds = supportedApkSigSchemeNames.keySet();
Set<Integer> supportedExpectedApkSigSchemeIds = new HashSet<>(1);
StringTokenizer tokenizer = new StringTokenizer(signedWithApkSchemes, ",");
while (tokenizer.hasMoreTokens()) {
String idText = tokenizer.nextToken().trim();
if (idText.isEmpty()) {
continue;
}
int id;
try {
id = Integer.parseInt(idText);
} catch (Exception ignored) {
continue;
}
// This APK was supposed to be signed with the APK signature scheme having
// this ID.
if (supportedApkSigSchemeIds.contains(id)) {
supportedExpectedApkSigSchemeIds.add(id);
} else {
mResult.addWarning(
Issue.JAR_SIG_UNKNOWN_APK_SIG_SCHEME_ID,
mSignatureFileEntry.getName(),
id);
}
}
for (int id : supportedExpectedApkSigSchemeIds) {
if (!foundApkSigSchemeIds.contains(id)) {
String apkSigSchemeName = supportedApkSigSchemeNames.get(id);
mResult.addError(
Issue.JAR_SIG_MISSING_APK_SIG_REFERENCED,
mSignatureFileEntry.getName(),
id,
apkSigSchemeName);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkForStrippedApkSignatures
File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
Repository: android
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-21253 | MEDIUM | 5.5 | android | checkForStrippedApkSignatures | src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java | 41d882324288085fd32ae0bb70dc85f5fd0e2be7 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onPause() {
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPause
File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
Repository: codenameone/CodenameOne
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-4903 | MEDIUM | 5.1 | codenameone/CodenameOne | onPause | Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | public void delete(String table, Criterion filter, Handler<AsyncResult<UpdateResult>> replyHandler) {
client.getConnection(conn -> delete(conn, table, filter, closeAndHandleResult(conn, replyHandler)));
} | 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 | public long getIdleConnectionTimeout() {
return mIdleConnectionTimeout;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIdleConnectionTimeout
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2018-9493 | LOW | 2.1 | android | getIdleConnectionTimeout | core/java/android/database/sqlite/SQLiteDatabase.java | ebc250d16c747f4161167b5ff58b3aea88b37acf | 0 |
Analyze the following code function for security vulnerabilities | public final byte[] getIdentifier() {
if (identifier == null) {
return null;
} else {
return Arrays.copyOf(identifier, identifier.length);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIdentifier
File: java_src/src/main/java/com/google/crypto/tink/PrimitiveSet.java
Repository: tink-crypto/tink
The code follows secure coding practices. | [
"CWE-176"
] | CVE-2020-8929 | MEDIUM | 5 | tink-crypto/tink | getIdentifier | java_src/src/main/java/com/google/crypto/tink/PrimitiveSet.java | 93d839a5865b9d950dffdc9d0bc99b71280a8899 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected AlgorithmParameters engineGetParameters() {
if (iv != null && iv.length > 0) {
try {
AlgorithmParameters params = AlgorithmParameters.getInstance(getBaseCipherName());
params.init(iv);
return params;
} catch (NoSuchAlgorithmException e) {
return null;
} catch (IOException e) {
return null;
}
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: engineGetParameters
File: src/main/java/org/conscrypt/OpenSSLCipher.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-2461 | HIGH | 7.6 | android | engineGetParameters | src/main/java/org/conscrypt/OpenSSLCipher.java | 1638945d4ed9403790962ec7abed1b7a232a9ff8 | 0 |
Analyze the following code function for security vulnerabilities | private boolean isSplitConfigurationChange(int configDiff) {
return (configDiff & (ActivityInfo.CONFIG_LOCALE | ActivityInfo.CONFIG_DENSITY)) != 0;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSplitConfigurationChange
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21292 | MEDIUM | 5.5 | android | isSplitConfigurationChange | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean isSystemReady() {
// no need to synchronize(this) just to read & return the value
return mSystemReady;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSystemReady
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 | isSystemReady | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void setDeviceOwnerUid(int uid) {
mDeviceOwnerUid = uid;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDeviceOwnerUid
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21292 | MEDIUM | 5.5 | android | setDeviceOwnerUid | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | @SuppressWarnings("AndroidFrameworkCompatChange")
private boolean fullyCustomViewRequiresDecoration(boolean fromStyle) {
// Custom views which come from a platform style class are safe, and thus do not need to
// be wrapped. Any subclass of those styles has the opportunity to make arbitrary
// changes to the RemoteViews, and thus can't be trusted as a fully vetted view.
if (fromStyle && PLATFORM_STYLE_CLASSES.contains(mStyle.getClass())) {
return false;
}
return mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.S;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fullyCustomViewRequiresDecoration
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | fullyCustomViewRequiresDecoration | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | private UnitType getUnitType(final Element element, final String attribute, final boolean mustFind)
throws GameParseException {
return getValidatedObject(element, attribute, mustFind, data.getUnitTypeList()::getUnitType, "unitType");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUnitType
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2018-1000546 | MEDIUM | 6.8 | triplea-game/triplea | getUnitType | game-core/src/main/java/games/strategy/engine/data/GameParser.java | 0f23875a4c6e166218859a63c884995f15c53895 | 0 |
Analyze the following code function for security vulnerabilities | @XmlElement
public URI getResourceViewUrl() {
return resourceViewUrl;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResourceViewUrl
File: core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2023-47324 | MEDIUM | 5.4 | Silverpeas/Silverpeas-Core | getResourceViewUrl | core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java | 9a55728729a3b431847045c674b3e883507d1e1a | 0 |
Analyze the following code function for security vulnerabilities | int read(byte[] b, int offset, int length) throws IOException {
if (mSocketIS == null) throw new IOException("read is called on null InputStream");
if (VDBG) Log.d(TAG, "read in: " + mSocketIS + " len: " + length);
int ret = mSocketIS.read(b, offset, length);
if(ret < 0)
throw new IOException("bt socket closed, read return: " + ret);
if (VDBG) Log.d(TAG, "read out: " + mSocketIS + " ret: " + ret);
return ret;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: read
File: core/java/android/bluetooth/BluetoothSocket.java
Repository: Genymobile/f2ut_platform_frameworks_base
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2014-9908 | LOW | 3.3 | Genymobile/f2ut_platform_frameworks_base | read | core/java/android/bluetooth/BluetoothSocket.java | f24cec326f5f65c693544fb0b92c37f633bacda2 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected void onCreate(Bundle savedInstanceState) {
((NewsReaderApplication) getApplication()).getAppComponent().injectActivity(this);
SharedPreferences defaultValueSp = getSharedPreferences(PreferenceManager.KEY_HAS_SET_DEFAULT_VALUES, Context.MODE_PRIVATE);
if (!defaultValueSp.getBoolean(PreferenceManager.KEY_HAS_SET_DEFAULT_VALUES, false)) {
PreferenceManager.setDefaultValues(this, sharedPreferencesFileName, Context.MODE_PRIVATE, R.xml.pref_data_sync, true);
PreferenceManager.setDefaultValues(this, sharedPreferencesFileName, Context.MODE_PRIVATE, R.xml.pref_display, true);
PreferenceManager.setDefaultValues(this, sharedPreferencesFileName, Context.MODE_PRIVATE, R.xml.pref_general, true);
}
super.onCreate(savedInstanceState);
binding = ActivityNewsreaderBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.toolbarLayout.toolbar);
initAccountManager();
binding.toolbarLayout.avatar.setVisibility(View.VISIBLE);
binding.toolbarLayout.avatar.setOnClickListener((v) -> startActivityForResult(new Intent(this, LoginDialogActivity.class), RESULT_LOGIN));
// Init config --> if nothing is configured start the login dialog.
if (!isUserLoggedIn()) {
startLoginActivity();
}
Bundle args = new Bundle();
String userName = mPrefs.getString(SettingsActivity.EDT_USERNAME_STRING, null);
String url = mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING, null);
args.putString("accountName", String.format("%s\n%s", userName, url));
NewsReaderListFragment newsReaderListFragment = new NewsReaderListFragment();
newsReaderListFragment.setArguments(args);
// Insert the fragment by replacing any existing fragment
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.left_drawer, newsReaderListFragment)
.commit();
if (binding.drawerLayout != null) {
drawerToggle = new ActionBarDrawerToggle(this, binding.drawerLayout, binding.toolbarLayout.toolbar, R.string.news_list_drawer_text, R.string.news_list_drawer_text) {
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
syncState();
EventBus.getDefault().post(new FeedPanelSlideEvent(false));
}
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
reloadCountNumbersOfSlidingPaneAdapter();
syncState();
}
};
binding.drawerLayout.addDrawerListener(drawerToggle);
adjustEdgeSizeOfDrawer();
}
setSupportActionBar(binding.toolbarLayout.toolbar);
Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
if (drawerToggle != null) {
drawerToggle.syncState();
}
//AppRater.app_launched(this);
//AppRater.rateNow(this);
if (savedInstanceState == null) { //When the app starts (no orientation change)
updateDetailFragment(SubscriptionExpandableListAdapter.SPECIAL_FOLDERS.ALL_UNREAD_ITEMS.getValue(), true, null, true);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreate
File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
Repository: nextcloud/news-android
The code follows secure coding practices. | [
"CWE-829"
] | CVE-2021-41256 | MEDIUM | 5.8 | nextcloud/news-android | onCreate | News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java | 05449cb666059af7de2302df9d5c02997a23df85 | 0 |
Analyze the following code function for security vulnerabilities | private static List<String> listPolicyExemptAppsUnchecked(Context context) {
// TODO(b/181238156): decide whether it should only list the apps set by the resources,
// or also the "critical" apps defined by PersonalAppsSuspensionHelper (like SMS app).
// If it's the latter, refactor PersonalAppsSuspensionHelper so it (or a superclass) takes
// the resources on constructor.
String[] core = context.getResources().getStringArray(R.array.policy_exempt_apps);
String[] vendor = context.getResources().getStringArray(R.array.vendor_policy_exempt_apps);
int size = core.length + vendor.length;
Set<String> apps = new ArraySet<>(size);
for (String app : core) {
apps.add(app);
}
for (String app : vendor) {
apps.add(app);
}
return new ArrayList<>(apps);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: listPolicyExemptAppsUnchecked
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-40089 | HIGH | 7.8 | android | listPolicyExemptAppsUnchecked | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Rect getBounds() {
if (mSizeCompatBounds != null) {
return mSizeCompatBounds;
}
return super.getBounds();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBounds
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 | getBounds | services/core/java/com/android/server/wm/ActivityRecord.java | 44aeef1b82ecf21187d4903c9e3666a118bdeaf3 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean supports(String url) {
return url.toLowerCase().startsWith("http");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: supports
File: kie-server-parent/kie-server-controller/kie-server-controller-impl/src/main/java/org/kie/server/controller/impl/client/RestKieServicesClientProvider.java
Repository: kiegroup/droolsjbpm-integration
The code follows secure coding practices. | [
"CWE-260"
] | CVE-2016-7043 | MEDIUM | 5 | kiegroup/droolsjbpm-integration | supports | kie-server-parent/kie-server-controller/kie-server-controller-impl/src/main/java/org/kie/server/controller/impl/client/RestKieServicesClientProvider.java | e916032edd47aa46d15f3a11909b4804ee20a7e8 | 0 |
Analyze the following code function for security vulnerabilities | private static int subWord(int x)
{
return (S[x&255]&255 | ((S[(x>>8)&255]&255)<<8) | ((S[(x>>16)&255]&255)<<16) | S[(x>>24)&255]<<24);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: subWord
File: core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java
Repository: bcgit/bc-java
The code follows secure coding practices. | [
"CWE-310"
] | CVE-2016-1000339 | MEDIUM | 5 | bcgit/bc-java | subWord | core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java | 413b42f4d770456508585c830cfcde95f9b0e93b | 0 |
Analyze the following code function for security vulnerabilities | public void checkPermission(Permission permission) {
Jenkins.getInstance().checkPermission(permission);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkPermission
File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
Repository: jenkinsci/jenkins
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2014-2064 | MEDIUM | 5 | jenkinsci/jenkins | checkPermission | core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java | fbf96734470caba9364f04e0b77b0bae7293a1ec | 0 |
Analyze the following code function for security vulnerabilities | @GuardedBy("getLockObject()")
private void addPendingChangeByOwnerLocked(int userId) {
mUserIdsWithPendingChangesByOwner.add(userId);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addPendingChangeByOwnerLocked
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 | addPendingChangeByOwnerLocked | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | void notifyActivityDrawnForKeyguard() {
if (DEBUG_LOCKSCREEN) mService.logLockScreen("");
mWindowManager.notifyActivityDrawnForKeyguard();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyActivityDrawnForKeyguard
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices. | [
"CWE-284"
] | CVE-2016-3838 | MEDIUM | 4.3 | android | notifyActivityDrawnForKeyguard | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 468651c86a8adb7aa56c708d2348e99022088af3 | 0 |
Analyze the following code function for security vulnerabilities | PackageParser.Package findSharedNonSystemLibrary(String libName) {
synchronized (mPackages) {
PackageManagerService.SharedLibraryEntry lib = mSharedLibraries.get(libName);
if (lib != null && lib.apk != null) {
return mPackages.get(lib.apk);
}
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findSharedNonSystemLibrary
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 | findSharedNonSystemLibrary | services/core/java/com/android/server/pm/PackageManagerService.java | a75537b496e9df71c74c1d045ba5569631a16298 | 0 |
Analyze the following code function for security vulnerabilities | private String createResource(Map<Object, Object> resourceDef, Collection<String> secretsToMask, TaskLogger jobLogger) {
Commandline kubectl = newKubeCtl();
File file = null;
try {
AtomicReference<String> resourceNameRef = new AtomicReference<String>(null);
file = File.createTempFile("k8s", ".yaml");
String resourceYaml = new Yaml().dump(resourceDef);
String maskedYaml = resourceYaml;
for (String secret: secretsToMask)
maskedYaml = StringUtils.replace(maskedYaml, secret, SecretInput.MASK);
logger.trace("Creating resource:\n" + maskedYaml);
FileUtils.writeFile(file, resourceYaml, StandardCharsets.UTF_8.name());
kubectl.addArgs("create", "-f", file.getAbsolutePath(), "-o", "jsonpath={.metadata.name}");
kubectl.execute(new LineConsumer() {
@Override
public void consume(String line) {
resourceNameRef.set(line);
}
}, new LineConsumer() {
@Override
public void consume(String line) {
jobLogger.error("Kubernetes: " + line);
}
}).checkReturnCode();
return Preconditions.checkNotNull(resourceNameRef.get());
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
if (file != null)
file.delete();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createResource
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 | createResource | 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 | protected B encoderIgnoreMaxHeaderListSize(boolean ignoreMaxHeaderListSize) {
enforceNonCodecConstraints("encoderIgnoreMaxHeaderListSize");
encoderIgnoreMaxHeaderListSize = ignoreMaxHeaderListSize;
return self();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encoderIgnoreMaxHeaderListSize
File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
Repository: netty
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-44487 | HIGH | 7.5 | netty | encoderIgnoreMaxHeaderListSize | codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java | 58f75f665aa81a8cbcf6ffa74820042a285c5e61 | 0 |
Analyze the following code function for security vulnerabilities | public boolean isAllowMultiple() {
return allowMultiple;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAllowMultiple
File: server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
Repository: theonedev/onedev
The code follows secure coding practices. | [
"CWE-94"
] | CVE-2021-21248 | MEDIUM | 6.5 | theonedev/onedev | isAllowMultiple | server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java | 39d95ab8122c5d9ed18e69dc024870cae08d2d60 | 0 |
Analyze the following code function for security vulnerabilities | public static ResourceEvaluation evaluate(File file, String filename) {
ResourceEvaluation eval = new ResourceEvaluation();
try {
ImsManifestFileFilter visitor = new ImsManifestFileFilter();
Path fPath = PathUtils.visit(file, filename, visitor);
if(visitor.isValid()) {
Path realManifestPath = visitor.getManifestPath();
Path manifestPath = fPath.resolve(realManifestPath);
RootSearcher rootSearcher = new RootSearcher();
Files.walkFileTree(fPath, rootSearcher);
if(rootSearcher.foundRoot()) {
manifestPath = rootSearcher.getRoot().resolve(IMS_MANIFEST);
} else {
manifestPath = fPath.resolve(IMS_MANIFEST);
}
Document doc = IMSLoader.loadIMSDocument(manifestPath);
if(validateImsManifest(doc)) {
eval.setValid(true);
} else {
eval.setValid(false);
}
} else {
eval.setValid(false);
}
PathUtils.closeSubsequentFS(fPath);
} catch (IOException | IllegalArgumentException e) {
log.error("", e);
eval.setValid(false);
}
return eval;
} | Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-39180
- Severity: HIGH
- CVSS Score: 9.0
Description: OO-5549: fix the wiki import and add some unit tests
Function: evaluate
File: src/main/java/org/olat/fileresource/types/ScormCPFileResource.java
Repository: OpenOLAT
Fixed Code:
public static ResourceEvaluation evaluate(File file, String filename) {
ResourceEvaluation eval = new ResourceEvaluation();
try {
ImsManifestFileFilter visitor = new ImsManifestFileFilter();
Path fPath = PathUtils.visit(file, filename, visitor);
if(visitor.isValid()) {
Path realManifestPath = visitor.getManifestPath();
Path manifestPath = fPath.resolve(realManifestPath);
RootSearcher rootSearcher = new RootSearcher();
Files.walkFileTree(fPath, EnumSet.noneOf(FileVisitOption.class), 16, rootSearcher);
if(rootSearcher.foundRoot()) {
manifestPath = rootSearcher.getRoot().resolve(IMS_MANIFEST);
} else {
manifestPath = fPath.resolve(IMS_MANIFEST);
}
Document doc = IMSLoader.loadIMSDocument(manifestPath);
if(validateImsManifest(doc)) {
eval.setValid(true);
} else {
eval.setValid(false);
}
} else {
eval.setValid(false);
}
PathUtils.closeSubsequentFS(fPath);
} catch (IOException | IllegalArgumentException e) {
log.error("", e);
eval.setValid(false);
}
return eval;
} | [
"CWE-22"
] | CVE-2021-39180 | HIGH | 9 | OpenOLAT | evaluate | src/main/java/org/olat/fileresource/types/ScormCPFileResource.java | 699490be8e931af0ef1f135c55384db1f4232637 | 1 |
Analyze the following code function for security vulnerabilities | @Override
public CharSequence convertObject(Object value) {
CharSequence seq = super.convertObject(value);
int state = 0;
// Start looping through each of the character
for (int index = 0; index < seq.length(); index++) {
state = validateValueChar(seq, state, seq.charAt(index));
}
if (state != 0) {
throw new IllegalArgumentException("a header value must not end with '\\r' or '\\n':" + seq);
}
return seq;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertObject
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices. | [
"CWE-444"
] | CVE-2021-43797 | MEDIUM | 4.3 | netty | convertObject | codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java | 07aa6b5938a8b6ed7a6586e066400e2643897323 | 0 |
Analyze the following code function for security vulnerabilities | public void write(XMLStreamWriter writer) throws XMLStreamException
{
writer.writeStartElement(XarModel.ELEMENT_PACKAGE);
writer.writeStartElement(XarModel.ELEMENT_INFOS);
writeElement(writer, XarModel.ELEMENT_INFOS_NAME, getPackageName(), true);
writeElement(writer, XarModel.ELEMENT_INFOS_DESCRIPTION, getPackageDescription(), true);
writeElement(writer, XarModel.ELEMENT_INFOS_LICENSE, getPackageLicense(), true);
writeElement(writer, XarModel.ELEMENT_INFOS_AUTHOR, getPackageAuthor(), true);
writeElement(writer, XarModel.ELEMENT_INFOS_VERSION, getPackageVersion(), true);
writeElement(writer, XarModel.ELEMENT_INFOS_ISBACKUPPACK, String.valueOf(isPackageBackupPack()), true);
writeElement(writer, XarModel.ELEMENT_INFOS_ISPRESERVEVERSION, String.valueOf(isPackagePreserveVersion()),
true);
writeElement(writer, XarModel.ELEMENT_INFOS_EXTENSIONID, getPackageExtensionId(), false);
writer.writeEndElement();
writer.writeStartElement(XarModel.ELEMENT_FILES);
for (XarEntry entry : this.entries.values()) {
writer.writeStartElement(XarModel.ELEMENT_FILES_FILE);
writer.writeAttribute(XarModel.ATTRIBUTE_DEFAULTACTION, String.valueOf(entry.getDefaultAction()));
writer.writeAttribute(XarModel.ATTRIBUTE_LOCALE, Objects.toString(entry.getLocale(), ""));
if (entry.getEntryType() != null) {
writer.writeAttribute(XarModel.ATTRIBUTE_TYPE, entry.getEntryType());
}
writer.writeCharacters(TOSTRING_SERIALIZER.serialize(entry));
writer.writeEndElement();
}
writer.writeEndElement();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: write
File: xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2023-27480 | HIGH | 7.7 | xwiki/xwiki-platform | write | xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java | e3527b98fdd8dc8179c24dc55e662b2c55199434 | 0 |
Analyze the following code function for security vulnerabilities | ObjectStreamField[] fields() {
if (fields == null) {
Class<?> forCl = forClass();
if (forCl != null && isSerializable() && !forCl.isArray()) {
buildFieldDescriptors(forCl.getDeclaredFields());
} else {
// Externalizables or arrays do not need FieldDesc info
setFields(NO_FIELDS);
}
}
return fields;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fields
File: luni/src/main/java/java/io/ObjectStreamClass.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2014-7911 | HIGH | 7.2 | android | fields | luni/src/main/java/java/io/ObjectStreamClass.java | 738c833d38d41f8f76eb7e77ab39add82b1ae1e2 | 0 |
Analyze the following code function for security vulnerabilities | private void deregisterForWifiMonitorEvents() {
for (int event : WIFI_MONITOR_EVENTS) {
mWifiMonitor.deregisterHandler(mInterfaceName, event, getHandler());
}
mWifiMetrics.deregisterForWifiMonitorEvents(mInterfaceName);
mWifiLastResortWatchdog.deregisterForWifiMonitorEvents(mInterfaceName);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deregisterForWifiMonitorEvents
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 | deregisterForWifiMonitorEvents | service/java/com/android/server/wifi/ClientModeImpl.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Analyze the following code function for security vulnerabilities | public void doCreateFirstAccount(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if(hasSomeUser()) {
rsp.sendError(SC_UNAUTHORIZED,"First user was already created");
return;
}
User u = createAccount(req, rsp, false, "firstUser.jelly");
if (u!=null) {
tryToMakeAdmin(u);
loginAndTakeBack(req, rsp, u);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doCreateFirstAccount
File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
Repository: jenkinsci/jenkins
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2014-2064 | MEDIUM | 5 | jenkinsci/jenkins | doCreateFirstAccount | core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java | fbf96734470caba9364f04e0b77b0bae7293a1ec | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void writeChar(char value) throws JMSException {
writePrimitive(value);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeChar
File: src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
Repository: rabbitmq/rabbitmq-jms-client
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2020-36282 | HIGH | 7.5 | rabbitmq/rabbitmq-jms-client | writeChar | src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java | f647e5dbfe055a2ca8cbb16dd70f9d50d888b638 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Object scale(Object nativeImage, int width, int height) {
return Bitmap.createScaledBitmap((Bitmap) nativeImage, width, height,
false);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scale
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-4903 | MEDIUM | 5.1 | codenameone/CodenameOne | scale | Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public IChunkSet getCachedSet(int chunkX, int chunkZ) {
return cacheSet.get(chunkX, chunkZ);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCachedSet
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 | getCachedSet | worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java | 3a8dfb4f7b858a439c35f7af1d56d21f796f61f5 | 0 |
Analyze the following code function for security vulnerabilities | public static CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadata(
PulsarService pulsar, String clientAppId, String originalPrincipal,
AuthenticationDataSource authenticationData, TopicName topicName) {
CompletableFuture<PartitionedTopicMetadata> metadataFuture = new CompletableFuture<>();
try {
// (1) authorize client
try {
checkAuthorization(pulsar, topicName, clientAppId, authenticationData);
} catch (RestException e) {
try {
validateAdminAccessForTenant(pulsar,
clientAppId, originalPrincipal, topicName.getTenant(), authenticationData);
} catch (RestException authException) {
log.warn("Failed to authorize {} on cluster {}", clientAppId, topicName.toString());
throw new PulsarClientException(String.format("Authorization failed %s on topic %s with error %s",
clientAppId, topicName.toString(), authException.getMessage()));
}
} catch (Exception ex) {
// throw without wrapping to PulsarClientException that considers: unknown error marked as internal
// server error
log.warn("Failed to authorize {} on cluster {} with unexpected exception {}", clientAppId,
topicName.toString(), ex.getMessage(), ex);
throw ex;
}
// validates global-namespace contains local/peer cluster: if peer/local cluster present then lookup can
// serve/redirect request else fail partitioned-metadata-request so, client fails while creating
// producer/consumer
checkLocalOrGetPeerReplicationCluster(pulsar, topicName.getNamespaceObject())
.thenCompose(res -> pulsar.getBrokerService()
.fetchPartitionedTopicMetadataCheckAllowAutoCreationAsync(topicName))
.thenAccept(metadata -> {
if (log.isDebugEnabled()) {
log.debug("[{}] Total number of partitions for topic {} is {}", clientAppId, topicName,
metadata.partitions);
}
metadataFuture.complete(metadata);
}).exceptionally(ex -> {
metadataFuture.completeExceptionally(ex.getCause());
return null;
});
} catch (Exception ex) {
metadataFuture.completeExceptionally(ex);
}
return metadataFuture;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPartitionedTopicMetadata
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 | getPartitionedTopicMetadata | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java | 5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52 | 0 |
Analyze the following code function for security vulnerabilities | @Exported(visibility = 3)
public String getUserId() {
return userId;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserId
File: core/src/main/java/hudson/model/Cause.java
Repository: jenkinsci/jenkins
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2014-2067 | LOW | 3.5 | jenkinsci/jenkins | getUserId | core/src/main/java/hudson/model/Cause.java | 5d57c855f3147bfc5e7fda9252317b428a700014 | 0 |
Analyze the following code function for security vulnerabilities | public Integer getServerIndex() {
return serverIndex;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServerIndex
File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2021-21430 | LOW | 2.1 | OpenAPITools/openapi-generator | getServerIndex | samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | private void userActivity() {
long now = SystemClock.uptimeMillis();
mPowerManager.userActivity(now, PowerManager.USER_ACTIVITY_EVENT_TOUCH, 0);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: userActivity
File: services/core/java/com/android/server/fingerprint/FingerprintService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3917 | HIGH | 7.2 | android | userActivity | services/core/java/com/android/server/fingerprint/FingerprintService.java | f5334952131afa835dd3f08601fb3bced7b781cd | 0 |
Analyze the following code function for security vulnerabilities | public static PluggableSCMMaterial pluggableSCMMaterial() {
ConfigurationProperty k1 = ConfigurationPropertyMother.create("k1", false, "v1");
ConfigurationProperty k2 = ConfigurationPropertyMother.create("k2", false, "v2");
return pluggableSCMMaterial("scm-id", "scm-name", k1, k2);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pluggableSCMMaterial
File: domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
Repository: gocd
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-39309 | MEDIUM | 6.5 | gocd | pluggableSCMMaterial | domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java | 691b479f1310034992da141760e9c5d1f5b60e8a | 0 |
Analyze the following code function for security vulnerabilities | public void startDownloadable(Message message) {
if (!hasPermissions(REQUEST_START_DOWNLOAD, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
this.mPendingDownloadableMessage = message;
return;
}
Transferable transferable = message.getTransferable();
if (transferable != null) {
if (transferable instanceof TransferablePlaceholder && message.hasFileOnRemoteHost()) {
createNewConnection(message);
return;
}
if (!transferable.start()) {
Log.d(Config.LOGTAG, "type: " + transferable.getClass().getName());
Toast.makeText(getActivity(), R.string.not_connected_try_again, Toast.LENGTH_SHORT).show();
}
} else if (message.treatAsDownloadable()) {
createNewConnection(message);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startDownloadable
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2018-18467 | MEDIUM | 5 | iNPUTmice/Conversations | startDownloadable | src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 7177c523a1b31988666b9337249a4f1d0c36f479 | 0 |
Analyze the following code function for security vulnerabilities | public Map<String, Long> getApiKeysExpirations() {
return API_KEYS.keySet().stream().collect(Collectors.toMap(k -> k, k -> {
try {
Date exp = SignedJWT.parse((String) API_KEYS.get(k)).getJWTClaimsSet().getExpirationTime();
if (exp != null) {
return exp.getTime();
}
} catch (ParseException ex) {
logger.error(null, ex);
}
return 0L;
}));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApiKeysExpirations
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices. | [
"CWE-130"
] | CVE-2022-1543 | MEDIUM | 6.5 | Erudika/scoold | getApiKeysExpirations | src/main/java/com/erudika/scoold/utils/ScooldUtils.java | 62a0e92e1486ddc17676a7ead2c07ff653d167ce | 0 |
Analyze the following code function for security vulnerabilities | public static DirectoryCheckResults testDirectoryPermissions(File file) {
try {
file = file.getCanonicalFile();
} catch (final IOException e) {
LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, e);
return null;
}
if (file == null || file.getParentFile() == null || !file.getParentFile().exists()) {
return null;
}
final List<File> policyDirectory = new ArrayList<>();
policyDirectory.add(file.getParentFile());
final DirectoryValidator validator = new DirectoryValidator(policyDirectory);
final DirectoryCheckResults result = validator.ensureDirs();
return result;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testDirectoryPermissions
File: core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices. | [
"CWE-345",
"CWE-94",
"CWE-22"
] | CVE-2019-10182 | MEDIUM | 5.8 | AdoptOpenJDK/IcedTea-Web | testDirectoryPermissions | core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java | 2ab070cdac087bd208f64fa8138bb709f8d7680c | 0 |
Analyze the following code function for security vulnerabilities | public ApiClient setClientConfig(ClientConfig clientConfig) {
this.clientConfig = clientConfig;
// Rebuild HTTP Client according to the new "clientConfig" value.
this.httpClient = buildHttpClient();
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setClientConfig
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 | setClientConfig | samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | protected CurrentService initializeCurrentService() {
return new CurrentService(this);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initializeCurrentService
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices. | [
"CWE-354"
] | CVE-2023-48795 | MEDIUM | 5.9 | apache/mina-sshd | initializeCurrentService | sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java | 6b0fd46f64bcb75eeeee31d65f10242660aad7c1 | 0 |
Analyze the following code function for security vulnerabilities | protected boolean supportsVariableSizeIv() {
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: supportsVariableSizeIv
File: src/main/java/org/conscrypt/OpenSSLCipher.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-2461 | HIGH | 7.6 | android | supportsVariableSizeIv | src/main/java/org/conscrypt/OpenSSLCipher.java | 1638945d4ed9403790962ec7abed1b7a232a9ff8 | 0 |
Analyze the following code function for security vulnerabilities | static void parseDatabase(String path, Map<String, String> params) {
if (!ClickHouseChecker.isNullOrEmpty(path) && path.length() > 1) {
params.put(ClickHouseClientOption.DATABASE.getKey(), path.substring(1));
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseDatabase
File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
Repository: ClickHouse/clickhouse-java
The code follows secure coding practices. | [
"CWE-209"
] | CVE-2024-23689 | HIGH | 8.8 | ClickHouse/clickhouse-java | parseDatabase | clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java | 4f8d9303eb991b39ec7e7e34825241efa082238a | 0 |
Analyze the following code function for security vulnerabilities | public void setAccessToken(BearerAccessToken accessToken)
{
setSessionAttribute(PROP_SESSION_ACCESSTOKEN, accessToken);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAccessToken
File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
Repository: xwiki-contrib/oidc
The code follows secure coding practices. | [
"CWE-287"
] | CVE-2022-39387 | HIGH | 7.5 | xwiki-contrib/oidc | setAccessToken | oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java | 0247af1417925b9734ab106ad7cd934ee870ac89 | 0 |
Analyze the following code function for security vulnerabilities | private Task createTaskLocked(int taskId, int stackId, int userId, AppWindowToken atoken) {
if (DEBUG_STACK) Slog.i(TAG, "createTaskLocked: taskId=" + taskId + " stackId=" + stackId
+ " atoken=" + atoken);
final TaskStack stack = mStackIdToStack.get(stackId);
if (stack == null) {
throw new IllegalArgumentException("addAppToken: invalid stackId=" + stackId);
}
EventLog.writeEvent(EventLogTags.WM_TASK_CREATED, taskId, stackId);
Task task = new Task(taskId, stack, userId, this);
mTaskIdToTask.put(taskId, task);
stack.addTask(task, !atoken.mLaunchTaskBehind /* toTop */, atoken.showForAllUsers);
return task;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createTaskLocked
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 | createTaskLocked | services/core/java/com/android/server/wm/WindowManagerService.java | 69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c | 0 |
Analyze the following code function for security vulnerabilities | @PostConstruct
public void initializeBaseDN() throws LDAPException
{
baseDN = new DN(settings.getBaseDN());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initializeBaseDN
File: src/main/java/com/unboundid/webapp/ssam/SSAMController.java
Repository: pingidentity/ssam
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2018-25084 | MEDIUM | 4 | pingidentity/ssam | initializeBaseDN | src/main/java/com/unboundid/webapp/ssam/SSAMController.java | f64b10d63bb19ca2228b0c2d561a1a6e5a3bf251 | 0 |
Analyze the following code function for security vulnerabilities | private void handleUnloadUser() throws CommandException {
synchronized (mLock) {
parseOptionsLocked(/* takeUser =*/ true);
Slog.i(TAG, "cmd: handleUnloadUser: user=" + mUserId);
ShortcutService.this.handleStopUser(mUserId);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleUnloadUser
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-40079 | HIGH | 7.8 | android | handleUnloadUser | services/core/java/com/android/server/pm/ShortcutService.java | 96e0524c48c6e58af7d15a2caf35082186fc8de2 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public int countCollectionsWithSubmit(String q, Context context, Community community)
throws SQLException, SearchServiceException {
DiscoverQuery discoverQuery = new DiscoverQuery();
discoverQuery.setMaxResults(0);
discoverQuery.setDSpaceObjectFilter(IndexableCollection.TYPE);
DiscoverResult resp = retrieveCollectionsWithSubmit(context, discoverQuery, null, community, q);
return (int)resp.getTotalSearchResults();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: countCollectionsWithSubmit
File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
Repository: DSpace
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-41189 | HIGH | 9 | DSpace | countCollectionsWithSubmit | dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java | 277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041 | 0 |
Analyze the following code function for security vulnerabilities | public void addConverter(String converterId, String converterClass) {
notNull("converterId", converterId);
notNull("converterClass", converterClass);
if (LOGGER.isLoggable(FINE) && converterIdMap.containsKey(converterId)) {
LOGGER.log(FINE, "converterId {0} has already been registered. Replacing existing converter class type {1} with {2}.",
new Object[] { converterId, converterIdMap.get(converterId), converterClass });
}
converterIdMap.put(converterId, converterClass);
Class<?>[] types = STANDARD_CONV_ID_TO_TYPE_MAP.get(converterId);
if (types != null) {
for (Class<?> clazz : types) {
// go directly against map to prevent cyclic method calls
converterTypeMap.put(clazz, converterClass);
addPropertyEditorIfNecessary(clazz);
}
}
if (LOGGER.isLoggable(FINE)) {
LOGGER.fine(format("added converter of type ''{0}'' and class ''{1}''", converterId, converterClass));
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addConverter
File: impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2018-14371 | MEDIUM | 5 | eclipse-ee4j/mojarra | addConverter | impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java | 1b434748d9239f42eae8aa7d37d7a0930c061e24 | 0 |
Analyze the following code function for security vulnerabilities | private void readRestrictionsLocked(XmlPullParser parser, Bundle restrictions)
throws IOException {
readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_WIFI);
readBoolean(parser, restrictions, UserManager.DISALLOW_MODIFY_ACCOUNTS);
readBoolean(parser, restrictions, UserManager.DISALLOW_INSTALL_APPS);
readBoolean(parser, restrictions, UserManager.DISALLOW_UNINSTALL_APPS);
readBoolean(parser, restrictions, UserManager.DISALLOW_SHARE_LOCATION);
readBoolean(parser, restrictions,
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES);
readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_BLUETOOTH);
readBoolean(parser, restrictions, UserManager.DISALLOW_USB_FILE_TRANSFER);
readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_CREDENTIALS);
readBoolean(parser, restrictions, UserManager.DISALLOW_REMOVE_USER);
readBoolean(parser, restrictions, UserManager.DISALLOW_DEBUGGING_FEATURES);
readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_VPN);
readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_TETHERING);
readBoolean(parser, restrictions, UserManager.DISALLOW_NETWORK_RESET);
readBoolean(parser, restrictions, UserManager.DISALLOW_FACTORY_RESET);
readBoolean(parser, restrictions, UserManager.DISALLOW_ADD_USER);
readBoolean(parser, restrictions, UserManager.ENSURE_VERIFY_APPS);
readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_CELL_BROADCASTS);
readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
readBoolean(parser, restrictions, UserManager.DISALLOW_APPS_CONTROL);
readBoolean(parser, restrictions,
UserManager.DISALLOW_MOUNT_PHYSICAL_MEDIA);
readBoolean(parser, restrictions, UserManager.DISALLOW_UNMUTE_MICROPHONE);
readBoolean(parser, restrictions, UserManager.DISALLOW_ADJUST_VOLUME);
readBoolean(parser, restrictions, UserManager.DISALLOW_OUTGOING_CALLS);
readBoolean(parser, restrictions, UserManager.DISALLOW_SMS);
readBoolean(parser, restrictions, UserManager.DISALLOW_FUN);
readBoolean(parser, restrictions, UserManager.DISALLOW_CREATE_WINDOWS);
readBoolean(parser, restrictions, UserManager.DISALLOW_CROSS_PROFILE_COPY_PASTE);
readBoolean(parser, restrictions, UserManager.DISALLOW_OUTGOING_BEAM);
readBoolean(parser, restrictions, UserManager.DISALLOW_WALLPAPER);
readBoolean(parser, restrictions, UserManager.DISALLOW_SAFE_BOOT);
readBoolean(parser, restrictions, UserManager.ALLOW_PARENT_PROFILE_APP_LINKING);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readRestrictionsLocked
File: services/core/java/com/android/server/pm/UserManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-2457 | LOW | 2.1 | android | readRestrictionsLocked | services/core/java/com/android/server/pm/UserManagerService.java | 12332e05f632794e18ea8c4ac52c98e82532e5db | 0 |
Analyze the following code function for security vulnerabilities | static JsonNumber getJsonNumber(Number value, int bigIntegerScaleLimit) {
if (value == null) {
throw new NullPointerException("Value is null");
}
if (value instanceof Integer) {
return getJsonNumber(value.intValue(), bigIntegerScaleLimit);
} else if (value instanceof Long) {
return getJsonNumber(value.longValue(), bigIntegerScaleLimit);
} else if (value instanceof Double) {
return getJsonNumber(value.doubleValue(), bigIntegerScaleLimit);
} else if (value instanceof BigInteger) {
return getJsonNumber((BigInteger) value, bigIntegerScaleLimit);
} else if (value instanceof BigDecimal) {
return getJsonNumber((BigDecimal) value, bigIntegerScaleLimit);
} else {
return new JsonNumberNumber(value, bigIntegerScaleLimit);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getJsonNumber
File: impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
Repository: eclipse-ee4j/parsson
The code follows secure coding practices. | [
"CWE-834"
] | CVE-2023-4043 | HIGH | 7.5 | eclipse-ee4j/parsson | getJsonNumber | impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java | 84764ffbe3d0376da242b27a9a526138d0dfb8e6 | 0 |
Analyze the following code function for security vulnerabilities | protected void associateConversationContext(HttpServletRequest request) {
httpConversationContext().associate(request);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: associateConversationContext
File: impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
Repository: weld/core
The code follows secure coding practices. | [
"CWE-362"
] | CVE-2014-8122 | MEDIUM | 4.3 | weld/core | associateConversationContext | impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java | 8e413202fa1af08c09c580f444e4fd16874f9c65 | 0 |
Analyze the following code function for security vulnerabilities | public boolean isReportedFeature(Class<? extends NodeFeature> featureType) {
return featureSet.reportedFeatures.contains(featureType);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isReportedFeature
File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
Repository: vaadin/flow
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2023-25499 | MEDIUM | 6.5 | vaadin/flow | isReportedFeature | flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java | 428cc97eaa9c89b1124e39f0089bbb741b6b21cc | 0 |
Analyze the following code function for security vulnerabilities | @ApiOperation(value = "Fetch the all the maching models for any specified model")
@RequestMapping(value = "/getMatchingModels", method = RequestMethod.GET, produces = "text/plain")
@ResponseBody
public String getMatchingModels(@RequestParam(value = "userId", required = false) String userId,
@RequestParam(value = "solutionId", required = false) String solutionId,
@RequestParam(value = "solutionVersion", required = false) String solutionVersion,
@RequestParam(value = "cid", required = false) String cid,
@RequestParam(value = "portType", required = true) String portType,
@RequestParam(value = "protobufJsonString", required = true) JSONArray protobufJsonString) {
logger.debug(EELFLoggerDelegator.debugLogger, " getMatchingModels() : Begin");
String result = "";
String resultTemplate = "{\"success\" : %s,\"matchingModels\" : %s}";
String error = "{\"error\" : %s";
try {
result = solutionService.getMatchingModels(userId, portType, protobufJsonString);
if (!result.equals("false")) {
result = String.format(resultTemplate, "true", result);
} else {
result = String.format(resultTemplate, "false", "No matching models found");
}
} catch (Exception e) {
logger.error(EELFLoggerDelegator.errorLogger, " Exception in getMatchingModels() ", e);
result = String.format(error, e.getMessage());
}
logger.debug(EELFLoggerDelegator.debugLogger, " getMatchingModels() : End");
return result;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMatchingModels
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 | getMatchingModels | ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java | 0df8a5e8722188744973168648e4c74c69ce67fd | 0 |
Analyze the following code function for security vulnerabilities | public void loadArchive(XWikiContext context) throws XWikiException
{
if ((this.archive == null || this.archive.get() == null)) {
XWikiDocumentArchive arch;
// A document not comming from the database cannot have an archive stored in the database
if (this.isNew()) {
arch = new XWikiDocumentArchive(getDocumentReference().getWikiReference(), getId());
} else {
arch = getVersioningStore(context).getXWikiDocumentArchive(this, context);
}
// We are using a SoftReference which will allow the archive to be
// discarded by the Garbage collector as long as the context is closed (usually during
// the request)
this.archive = new SoftReference<>(arch);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadArchive
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-74"
] | CVE-2023-29523 | HIGH | 8.8 | xwiki/xwiki-platform | loadArchive | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | 0d547181389f7941e53291af940966413823f61c | 0 |
Analyze the following code function for security vulnerabilities | private static AsciiString create(String name) {
return AsciiString.cached(Ascii.toLowerCase(name));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: create
File: core/src/main/java/com/linecorp/armeria/common/HttpHeaderNames.java
Repository: line/armeria
The code follows secure coding practices. | [
"CWE-74"
] | CVE-2019-16771 | MEDIUM | 5 | line/armeria | create | core/src/main/java/com/linecorp/armeria/common/HttpHeaderNames.java | b597f7a865a527a84ee3d6937075cfbb4470ed20 | 0 |
Analyze the following code function for security vulnerabilities | public static AndroidLocationPlayServiceManager getInstance() {
return instance;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInstance
File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
Repository: codenameone/CodenameOne
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-4903 | MEDIUM | 5.1 | codenameone/CodenameOne | getInstance | Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | public void upsert(String table, String id, Object entity, boolean convertEntity,
Handler<AsyncResult<String>> replyHandler) {
client.getConnection(conn -> save(conn, table, id, entity,
/* returnId */ true, /* upsert */ true, /* convertEntity */ convertEntity,
closeAndHandleResult(conn, replyHandler)));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: upsert
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 | upsert | domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java | b7ef741133e57add40aa4cb19430a0065f378a94 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public String getDescription() {
return "A universal responsive Userview Theme based on Material Design";
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDescription
File: wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
Repository: jogetworkflow/jw-community
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2022-4560 | MEDIUM | 6.1 | jogetworkflow/jw-community | getDescription | wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java | ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b | 0 |
Analyze the following code function for security vulnerabilities | @GuardedBy("this")
private String isProcStartValidLocked(ProcessRecord app, long expectedStartSeq) {
StringBuilder sb = null;
if (app.killedByAm) {
if (sb == null) sb = new StringBuilder();
sb.append("killedByAm=true;");
}
if (mProcessNames.get(app.processName, app.uid) != app) {
if (sb == null) sb = new StringBuilder();
sb.append("No entry in mProcessNames;");
}
if (!app.pendingStart) {
if (sb == null) sb = new StringBuilder();
sb.append("pendingStart=false;");
}
if (app.startSeq > expectedStartSeq) {
if (sb == null) sb = new StringBuilder();
sb.append("seq=" + app.startSeq + ",expected=" + expectedStartSeq + ";");
}
return sb == null ? null : sb.toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isProcStartValidLocked
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 | isProcStartValidLocked | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | final void status(HttpStatus status) {
requireNonNull(status, "status");
set(HttpHeaderNames.STATUS, status.codeAsText());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: status
File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
Repository: line/armeria
The code follows secure coding practices. | [
"CWE-74"
] | CVE-2019-16771 | MEDIUM | 5 | line/armeria | status | core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java | b597f7a865a527a84ee3d6937075cfbb4470ed20 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void serialize(
AttributeList attributes,
JsonGenerator generator,
SerializerProvider provider
) throws IOException, JsonProcessingException {
generator.writeStartObject();
generator.writeArrayFieldStart("Attribute");
for (Attribute attribute : attributes.attrs) {
generator.writeStartObject();
generator.writeStringField("name", attribute.name);
generator.writeStringField("value", attribute.value);
generator.writeEndObject();
}
generator.writeEndArray();
generator.writeEndObject();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: serialize
File: base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java
Repository: dogtagpki/pki
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-2414 | HIGH | 7.5 | dogtagpki/pki | serialize | base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | public void skipCurrentReceiverLocked(ProcessRecord app) {
BroadcastRecord r = null;
if (mOrderedBroadcasts.size() > 0) {
BroadcastRecord br = mOrderedBroadcasts.get(0);
if (br.curApp == app) {
r = br;
}
}
if (r == null && mPendingBroadcast != null && mPendingBroadcast.curApp == app) {
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
"[" + mQueueName + "] skip & discard pending app " + r);
r = mPendingBroadcast;
}
if (r != null) {
skipReceiverLocked(r);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: skipCurrentReceiverLocked
File: services/core/java/com/android/server/am/BroadcastQueue.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3912 | HIGH | 9.3 | android | skipCurrentReceiverLocked | services/core/java/com/android/server/am/BroadcastQueue.java | 6c049120c2d749f0c0289d822ec7d0aa692f55c5 | 0 |
Analyze the following code function for security vulnerabilities | @RequestMapping(value = "/repository/restful/artifact/POST/*", method = RequestMethod.POST)
public ModelAndView postArtifact(@RequestParam("pipelineName") String pipelineName,
@RequestParam("pipelineCounter") String pipelineCounter,
@RequestParam("stageName") String stageName,
@RequestParam(value = "stageCounter", required = false) String stageCounter,
@RequestParam("buildName") String buildName,
@RequestParam(value = "buildId", required = false) Long buildId,
@RequestParam("filePath") String filePath,
@RequestParam(value = "attempt", required = false) Integer attempt,
MultipartHttpServletRequest request) throws Exception {
JobIdentifier jobIdentifier;
if (!headerConstraint.isSatisfied(request)) {
return ResponseCodeView.create(HttpServletResponse.SC_BAD_REQUEST, "Missing required header 'Confirm'");
}
try {
jobIdentifier = restfulService.findJob(pipelineName, pipelineCounter, stageName, stageCounter,
buildName, buildId);
} catch (Exception e) {
return buildNotFound(pipelineName, pipelineCounter, stageName, stageCounter,
buildName);
}
int convertedAttempt = attempt == null ? 1 : attempt;
try {
File artifact = artifactsService.findArtifact(jobIdentifier, filePath);
if (artifact.exists() && artifact.isFile()) {
return FileModelAndView.fileAlreadyExists(filePath);
}
MultipartFile multipartFile = multipartFile(request);
if (multipartFile == null) {
return FileModelAndView.invalidUploadRequest();
}
boolean success = saveFile(convertedAttempt, artifact, multipartFile, shouldUnzipStream(multipartFile));
if (!success) {
return FileModelAndView.errorSavingFile(filePath);
}
success = updateChecksumFile(request, jobIdentifier, filePath);
if (!success) {
return FileModelAndView.errorSavingChecksumFile(filePath);
}
return FileModelAndView.fileCreated(filePath);
} catch (IllegalArtifactLocationException e) {
return FileModelAndView.forbiddenUrl(filePath);
}
} | Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-43289
- Severity: MEDIUM
- CVSS Score: 5.0
Description: #000 - Validate stage counter during upload artifacts
Function: postArtifact
File: server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java
Repository: gocd
Fixed Code:
@RequestMapping(value = "/repository/restful/artifact/POST/*", method = RequestMethod.POST)
public ModelAndView postArtifact(@RequestParam("pipelineName") String pipelineName,
@RequestParam("pipelineCounter") String pipelineCounter,
@RequestParam("stageName") String stageName,
@RequestParam(value = "stageCounter", required = false) String stageCounter,
@RequestParam("buildName") String buildName,
@RequestParam(value = "buildId", required = false) Long buildId,
@RequestParam("filePath") String filePath,
@RequestParam(value = "attempt", required = false) Integer attempt,
MultipartHttpServletRequest request) throws Exception {
JobIdentifier jobIdentifier;
if (!headerConstraint.isSatisfied(request)) {
return ResponseCodeView.create(HttpServletResponse.SC_BAD_REQUEST, "Missing required header 'Confirm'");
}
if (!isValidStageCounter(stageCounter)) {
return buildNotFound(pipelineName, pipelineCounter, stageName, stageCounter, buildName);
}
try {
jobIdentifier = restfulService.findJob(pipelineName, pipelineCounter, stageName, stageCounter,
buildName, buildId);
} catch (Exception e) {
return buildNotFound(pipelineName, pipelineCounter, stageName, stageCounter,
buildName);
}
int convertedAttempt = attempt == null ? 1 : attempt;
try {
File artifact = artifactsService.findArtifact(jobIdentifier, filePath);
if (artifact.exists() && artifact.isFile()) {
return FileModelAndView.fileAlreadyExists(filePath);
}
MultipartFile multipartFile = multipartFile(request);
if (multipartFile == null) {
return FileModelAndView.invalidUploadRequest();
}
boolean success = saveFile(convertedAttempt, artifact, multipartFile, shouldUnzipStream(multipartFile));
if (!success) {
return FileModelAndView.errorSavingFile(filePath);
}
success = updateChecksumFile(request, jobIdentifier, filePath);
if (!success) {
return FileModelAndView.errorSavingChecksumFile(filePath);
}
return FileModelAndView.fileCreated(filePath);
} catch (IllegalArtifactLocationException e) {
return FileModelAndView.forbiddenUrl(filePath);
}
} | [
"CWE-22"
] | CVE-2021-43289 | MEDIUM | 5 | gocd | postArtifact | server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java | c22e0428164af25d3e91baabd3f538a41cadc82f | 1 |
Analyze the following code function for security vulnerabilities | @RequiresPermissions("topic:top")
@GetMapping("/top")
@ResponseBody
public Result top(Integer id) {
Topic topic = topicService.selectById(id);
topic.setTop(!topic.getTop());
topicService.update(topic, null);
return success();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: top
File: src/main/java/co/yiiu/pybbs/controller/admin/TopicAdminController.java
Repository: atjiu/pybbs
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2022-23391 | MEDIUM | 4.3 | atjiu/pybbs | top | src/main/java/co/yiiu/pybbs/controller/admin/TopicAdminController.java | 7d83b97d19f5fed9f29f72e654ef3c2818021b4d | 0 |
Analyze the following code function for security vulnerabilities | public static String buildFormattedSubject(Resources res, String subject, int action) {
final String prefix;
final String correctedSubject;
if (action == ComposeActivity.COMPOSE) {
prefix = "";
} else if (action == ComposeActivity.FORWARD) {
prefix = res.getString(R.string.forward_subject_label);
} else {
prefix = res.getString(R.string.reply_subject_label);
}
if (TextUtils.isEmpty(subject)) {
correctedSubject = prefix;
} else {
// Don't duplicate the prefix
if (subject.toLowerCase().startsWith(prefix.toLowerCase())) {
correctedSubject = subject;
} else {
correctedSubject = String.format(
res.getString(R.string.formatted_subject), prefix, subject);
}
}
return correctedSubject;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildFormattedSubject
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2016-2425 | MEDIUM | 4.3 | android | buildFormattedSubject | src/com/android/mail/compose/ComposeActivity.java | 0d9dfd649bae9c181e3afc5d571903f1eb5dc46f | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean isInitialized(){
// Removing the check for null view to prevent strange things from happening when
// calling from a Service context.
// if(getActivity() != null && myView == null){
// //if the view is null deinitialize the Display
// if(super.isInitialized()){
// syncDeinitialize();
// }
// return false;
// }
return super.isInitialized();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isInitialized
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-4903 | MEDIUM | 5.1 | codenameone/CodenameOne | isInitialized | Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | protected boolean validateIssuerAudienceAndAzp(@NonNull JwtClaims claims,
@NonNull String iss,
@NonNull List<String> audiences,
@NonNull OauthClientConfiguration oauthClientConfiguration) {
Optional<OpenIdClientConfiguration> openIdClientConfigurationOptional = oauthClientConfiguration.getOpenid();
if (openIdClientConfigurationOptional.isPresent()) {
OpenIdClientConfiguration openIdClientConfiguration = openIdClientConfigurationOptional.get();
return validateIssuerAudienceAndAzp(claims, iss, audiences, oauthClientConfiguration.getClientId(), openIdClientConfiguration);
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateIssuerAudienceAndAzp
File: security-oauth2/src/main/java/io/micronaut/security/oauth2/client/IdTokenClaimsValidator.java
Repository: micronaut-projects/micronaut-security
The code follows secure coding practices. | [
"CWE-284"
] | CVE-2023-36820 | MEDIUM | 6.5 | micronaut-projects/micronaut-security | validateIssuerAudienceAndAzp | security-oauth2/src/main/java/io/micronaut/security/oauth2/client/IdTokenClaimsValidator.java | 9728b925221a0d87798ccf250657a3c214b7e980 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public float getFloat(K name, float defaultValue) {
Float v = getFloat(name);
return v != null ? v : defaultValue;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFloat
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices. | [
"CWE-436",
"CWE-113"
] | CVE-2022-41915 | MEDIUM | 6.5 | netty | getFloat | codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java | fe18adff1c2b333acb135ab779a3b9ba3295a1c4 | 0 |
Analyze the following code function for security vulnerabilities | private void checkIsDeviceOwner(CallerIdentity caller) {
Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller), caller.getUid()
+ " is not device owner");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkIsDeviceOwner
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 | checkIsDeviceOwner | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean updateDisplayOverrideConfiguration(Configuration values, int displayId) {
enforceCallingPermission(CHANGE_CONFIGURATION, "updateDisplayOverrideConfiguration()");
synchronized (this) {
// Check if display is initialized in AM.
if (!mStackSupervisor.isDisplayAdded(displayId)) {
// Call might come when display is not yet added or has already been removed.
if (DEBUG_CONFIGURATION) {
Slog.w(TAG, "Trying to update display configuration for non-existing displayId="
+ displayId);
}
return false;
}
if (values == null && mWindowManager != null) {
// sentinel: fetch the current configuration from the window manager
values = mWindowManager.computeNewConfiguration(displayId);
}
if (mWindowManager != null) {
// Update OOM levels based on display size.
mProcessList.applyDisplaySize(mWindowManager);
}
final long origId = Binder.clearCallingIdentity();
try {
if (values != null) {
Settings.System.clearConfiguration(values);
}
updateDisplayOverrideConfigurationLocked(values, null /* starting */,
false /* deferResume */, displayId, mTmpUpdateConfigurationResult);
return mTmpUpdateConfigurationResult.changes != 0;
} finally {
Binder.restoreCallingIdentity(origId);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateDisplayOverrideConfiguration
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 | updateDisplayOverrideConfiguration | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | public Descriptor getItemTypeDescriptor() {
return Jenkins.getInstance().getDescriptor(getItemType());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getItemTypeDescriptor
File: core/src/main/java/hudson/model/Descriptor.java
Repository: jenkinsci/jenkins
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2013-7330 | MEDIUM | 4 | jenkinsci/jenkins | getItemTypeDescriptor | core/src/main/java/hudson/model/Descriptor.java | 36342d71e29e0620f803a7470ce96c61761648d8 | 0 |
Analyze the following code function for security vulnerabilities | @Unstable
public void setRestricted(boolean restricted)
{
setIntValue("restricted", restricted ? 1 : 0);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRestricted
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-41046 | MEDIUM | 6.3 | xwiki/xwiki-platform | setRestricted | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java | edc52579eeaab1b4514785c134044671a1ecd839 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.