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
private boolean checkPackagePolicyAccess(String pkg) { return mPolicyAccess.isPackageGranted(pkg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPackagePolicyAccess File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
checkPackagePolicyAccess
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public MainHeader getMainHeader() { return this.newMhd; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMainHeader File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2022-23596
MEDIUM
5
junrar
getMainHeader
src/main/java/com/github/junrar/Archive.java
7b16b3d90b91445fd6af0adfed22c07413d4fab7
0
Analyze the following code function for security vulnerabilities
protected Restrictor createRestrictor(String pLocation) { LogHandler log = getLogHandler(); try { Restrictor newRestrictor = RestrictorFactory.lookupPolicyRestrictor(pLocation); if (newRestrictor != null) { log.info("Using access restrictor " + pLocation); return newRestrictor; } else { log.info("No access restrictor found at " + pLocation + ", access to all MBeans is allowed"); return new AllowAllRestrictor(); } } catch (IOException e) { log.error("Error while accessing access restrictor at " + pLocation + ". Denying all access to MBeans for security reasons. Exception: " + e, e); return new DenyAllRestrictor(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRestrictor File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
createRestrictor
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
@Deprecated public static String escapeAttributeValue(Object content) { if (content == null) { return null; } return escapeAttributeValue(String.valueOf(content)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escapeAttributeValue File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java Repository: xwiki/xwiki-commons The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-24898
MEDIUM
4
xwiki/xwiki-commons
escapeAttributeValue
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
947e8921ebd95462d5a7928f397dd1b64f77c7d5
0
Analyze the following code function for security vulnerabilities
private boolean hasActiveClearableNotifications() { int childCount = mStackScroller.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mStackScroller.getChildAt(i); if (!(child instanceof ExpandableNotificationRow)) { continue; } if (((ExpandableNotificationRow) child).canViewBeDismissed()) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasActiveClearableNotifications File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
hasActiveClearableNotifications
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static boolean verifyResponse(Response response, String requestUrl, HttpServletRequest request) { if (!response.isSignatureValid()) { debug.message("verifyResponse: Response's signature is invalid."); return false; } // check Recipient == this server's POST profile URL(requestURL) String recipient = response.getRecipient(); if ((recipient == null) || (recipient.length() == 0) || ((!equalURL(recipient, requestUrl)) && (!equalURL(recipient,getLBURL(requestUrl, request))))) { debug.error("verifyResponse : Incorrect Recipient."); return false; } // check status of the Response if (!response.getStatus().getStatusCode().getValue().endsWith( SAMLConstants.STATUS_CODE_SUCCESS_NO_PREFIX)) { debug.error("verifyResponse : Incorrect StatusCode value."); return false; } return true; }
Vulnerability Classification: - CWE: CWE-287 - CVE: CVE-2023-37471 - Severity: CRITICAL - CVSS Score: 9.8 Description: GHSL-2023-143, GHSL-2023-144, deny unsigned SAML response (#624) Function: verifyResponse File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java Repository: OpenIdentityPlatform/OpenAM Fixed Code: public static boolean verifyResponse(Response response, String requestUrl, HttpServletRequest request) { if(!response.isSigned()) { debug.message("verifyResponse: Response is not signed"); return false; } if (!response.isSignatureValid()) { debug.message("verifyResponse: Response's signature is invalid."); return false; } // check Recipient == this server's POST profile URL(requestURL) String recipient = response.getRecipient(); if ((recipient == null) || (recipient.length() == 0) || ((!equalURL(recipient, requestUrl)) && (!equalURL(recipient,getLBURL(requestUrl, request))))) { debug.error("verifyResponse : Incorrect Recipient."); return false; } // check status of the Response if (!response.getStatus().getStatusCode().getValue().endsWith( SAMLConstants.STATUS_CODE_SUCCESS_NO_PREFIX)) { debug.error("verifyResponse : Incorrect StatusCode value."); return false; } return true; }
[ "CWE-287" ]
CVE-2023-37471
CRITICAL
9.8
OpenIdentityPlatform/OpenAM
verifyResponse
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
7c18543d126e8a567b83bb4535631825aaa9d742
1
Analyze the following code function for security vulnerabilities
protected void processAndAddLastClientInvocation(GenericClient theClient, ResultType theResultType, ModelMap theModelMap, long theLatency, String outcomeDescription, CaptureInterceptor theInterceptor, HomeRequest theRequest) { try { // ApacheHttpRequest lastRequest = theInterceptor.getLastRequest(); // HttpResponse lastResponse = theInterceptor.getLastResponse(); // String requestBody = null; // String requestUrl = lastRequest != null ? lastRequest.getApacheRequest().getURI().toASCIIString() : null; // String action = lastRequest != null ? lastRequest.getApacheRequest().getMethod() : null; // String resultStatus = lastResponse != null ? lastResponse.getStatusLine().toString() : null; // String resultBody = StringUtils.defaultString(theInterceptor.getLastResponseBody()); // // if (lastRequest instanceof HttpEntityEnclosingRequest) { // HttpEntity entity = ((HttpEntityEnclosingRequest) lastRequest).getEntity(); // if (entity.isRepeatable()) { // requestBody = IOUtils.toString(entity.getContent()); // } // } // // ContentType ct = lastResponse != null ? ContentType.get(lastResponse.getEntity()) : null; // String mimeType = ct != null ? ct.getMimeType() : null; IHttpRequest lastRequest = theInterceptor.getLastRequest(); IHttpResponse lastResponse = theInterceptor.getLastResponse(); String requestBody = null; String requestUrl = null; String action = null; String resultStatus = null; String resultBody = null; String mimeType = null; ContentType ct = null; if (lastRequest != null) { requestBody = lastRequest.getRequestBodyFromStream(); requestUrl = lastRequest.getUri(); action = lastRequest.getHttpVerbName(); } if (lastResponse != null) { resultStatus = "HTTP " + lastResponse.getStatus() + " " + lastResponse.getStatusInfo(); lastResponse.bufferEntity(); try (InputStream input = lastResponse.readEntity()) { resultBody = IOUtils.toString(input, Constants.CHARSET_UTF8); } List<String> ctStrings = lastResponse.getHeaders(Constants.HEADER_CONTENT_TYPE); if (ctStrings != null && ctStrings.isEmpty() == false) { ct = ContentType.parse(ctStrings.get(0)); mimeType = ct.getMimeType(); } } EncodingEnum ctEnum = EncodingEnum.forContentType(mimeType); String narrativeString = ""; StringBuilder resultDescription = new StringBuilder(); IBaseResource riBundle = null; FhirContext context = getContext(theRequest); if (ctEnum == null) { resultDescription.append("Non-FHIR response"); } else { switch (ctEnum) { case JSON: if (theResultType == ResultType.RESOURCE) { narrativeString = parseNarrative(theRequest, ctEnum, resultBody); resultDescription.append("JSON resource"); } else if (theResultType == ResultType.BUNDLE) { resultDescription.append("JSON bundle"); riBundle = context.newJsonParser().parseResource(resultBody); } break; case XML: default: if (theResultType == ResultType.RESOURCE) { narrativeString = parseNarrative(theRequest, ctEnum, resultBody); resultDescription.append("XML resource"); } else if (theResultType == ResultType.BUNDLE) { resultDescription.append("XML bundle"); riBundle = context.newXmlParser().parseResource(resultBody); } break; } } resultDescription.append(" (").append(defaultString(resultBody).length() + " bytes)"); Header[] requestHeaders = lastRequest != null ? applyHeaderFilters(lastRequest.getAllHeaders()) : new Header[0]; Header[] responseHeaders = lastResponse != null ? applyHeaderFilters(lastResponse.getAllHeaders()) : new Header[0]; theModelMap.put("outcomeDescription", outcomeDescription); theModelMap.put("resultDescription", resultDescription.toString()); theModelMap.put("action", action); theModelMap.put("ri", riBundle instanceof IAnyResource); theModelMap.put("riBundle", riBundle); theModelMap.put("resultStatus", resultStatus); theModelMap.put("requestUrl", requestUrl); theModelMap.put("requestUrlText", formatUrl(theClient.getUrlBase(), requestUrl)); String requestBodyText = format(requestBody, ctEnum); theModelMap.put("requestBody", requestBodyText); String resultBodyText = format(resultBody, ctEnum); theModelMap.put("resultBody", resultBodyText); theModelMap.put("resultBodyIsLong", resultBodyText.length() > 1000); theModelMap.put("requestHeaders", requestHeaders); theModelMap.put("responseHeaders", responseHeaders); theModelMap.put("narrative", narrativeString); theModelMap.put("latencyMs", theLatency); } catch (Exception e) { ourLog.error("Failure during processing", e); theModelMap.put("errorMsg", toDisplayError("Error during processing: " + e.getMessage(), e)); } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-24301 - Severity: MEDIUM - CVSS Score: 4.3 Description: Resolve XSS vulnerability Function: processAndAddLastClientInvocation File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java Repository: hapifhir/hapi-fhir Fixed Code: protected void processAndAddLastClientInvocation(GenericClient theClient, ResultType theResultType, ModelMap theModelMap, long theLatency, String outcomeDescription, CaptureInterceptor theInterceptor, HomeRequest theRequest) { try { IHttpRequest lastRequest = theInterceptor.getLastRequest(); IHttpResponse lastResponse = theInterceptor.getLastResponse(); String requestBody = null; String requestUrl = null; String action = null; String resultStatus = null; String resultBody = null; String mimeType = null; ContentType ct = null; if (lastRequest != null) { requestBody = lastRequest.getRequestBodyFromStream(); requestUrl = lastRequest.getUri(); action = lastRequest.getHttpVerbName(); } if (lastResponse != null) { resultStatus = "HTTP " + lastResponse.getStatus() + " " + lastResponse.getStatusInfo(); lastResponse.bufferEntity(); try (InputStream input = lastResponse.readEntity()) { resultBody = IOUtils.toString(input, Constants.CHARSET_UTF8); } List<String> ctStrings = lastResponse.getHeaders(Constants.HEADER_CONTENT_TYPE); if (ctStrings != null && ctStrings.isEmpty() == false) { ct = ContentType.parse(ctStrings.get(0)); mimeType = ct.getMimeType(); } } EncodingEnum ctEnum = EncodingEnum.forContentType(mimeType); String narrativeString = ""; StringBuilder resultDescription = new StringBuilder(); IBaseResource riBundle = null; FhirContext context = getContext(theRequest); if (ctEnum == null) { resultDescription.append("Non-FHIR response"); } else { switch (ctEnum) { case JSON: if (theResultType == ResultType.RESOURCE) { narrativeString = parseNarrative(theRequest, ctEnum, resultBody); resultDescription.append("JSON resource"); } else if (theResultType == ResultType.BUNDLE) { resultDescription.append("JSON bundle"); riBundle = context.newJsonParser().parseResource(resultBody); } break; case XML: default: if (theResultType == ResultType.RESOURCE) { narrativeString = parseNarrative(theRequest, ctEnum, resultBody); resultDescription.append("XML resource"); } else if (theResultType == ResultType.BUNDLE) { resultDescription.append("XML bundle"); riBundle = context.newXmlParser().parseResource(resultBody); } break; } } resultDescription.append(" (").append(defaultString(resultBody).length() + " bytes)"); Header[] requestHeaders = lastRequest != null ? applyHeaderFilters(lastRequest.getAllHeaders()) : new Header[0]; Header[] responseHeaders = lastResponse != null ? applyHeaderFilters(lastResponse.getAllHeaders()) : new Header[0]; theModelMap.put("outcomeDescription", outcomeDescription); theModelMap.put("resultDescription", resultDescription.toString()); theModelMap.put("action", action); theModelMap.put("ri", riBundle instanceof IAnyResource); theModelMap.put("riBundle", riBundle); theModelMap.put("resultStatus", resultStatus); theModelMap.put("requestUrl", requestUrl); theModelMap.put("requestUrlText", formatUrl(theClient.getUrlBase(), requestUrl)); String requestBodyText = format(requestBody, ctEnum); theModelMap.put("requestBody", requestBodyText); String resultBodyText = format(resultBody, ctEnum); theModelMap.put("resultBody", resultBodyText); theModelMap.put("resultBodyIsLong", resultBodyText.length() > 1000); theModelMap.put("requestHeaders", requestHeaders); theModelMap.put("responseHeaders", responseHeaders); theModelMap.put("narrative", narrativeString); theModelMap.put("latencyMs", theLatency); } catch (Exception e) { ourLog.error("Failure during processing", e); theModelMap.put("errorMsg", toDisplayError("Error during processing: " + e.getMessage(), e)); } }
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
processAndAddLastClientInvocation
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
1
Analyze the following code function for security vulnerabilities
public String getWysiwygToolbars(XWikiContext context) { return getConfiguration().getProperty("xwiki.wysiwyg.toolbars", ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWysiwygToolbars File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getWysiwygToolbars
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private <E extends EntityReference> E intern(E reference) { EntityReferenceFactory factory = getEntityReferenceFactory(); return factory != null ? factory.getReference(reference) : reference; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: intern File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
intern
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private void processCachePut(MethodInvocationContext<?, ?> context, ValueWrapper wrapper, String[] cacheNames, CacheKeyGenerator keyGenerator, Object[] parameterValues, boolean isAsync) { if (!ArrayUtils.isEmpty(cacheNames)) { Object v = wrapper.value; if (isAsync) { ioExecutor.submit(() -> { try { Object key = keyGenerator.generateKey(context, parameterValues); for (String cacheName : cacheNames) { SyncCache cache = cacheManager.getCache(cacheName); AsyncCache<?> asyncCache = cache.async(); CompletableFuture<Boolean> putFuture = asyncCache.put(key, v); putFuture.whenCompleteAsync((aBoolean, throwable) -> { if (throwable != null) { asyncCacheErrorHandler.handlePutError(cache, key, v, asRuntimeException(throwable)); } }, ioExecutor); } } catch (Exception e) { throw new CacheSystemException("Cache put operation failed: " + e.getMessage(), e); } }); } else { Object key = keyGenerator.generateKey(context, parameterValues); syncPut(cacheNames, key, v); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processCachePut File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
processCachePut
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public void post(int what) { post(what, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: post 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
post
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
ActivityStarter setFilterCallingUid(int filterCallingUid) { mRequest.filterCallingUid = filterCallingUid; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFilterCallingUid File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
setFilterCallingUid
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
@NonNull private Dialog createDialog(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(v).setPositiveButton(R.string.common_ok, null) .setNeutralButton(R.string.common_cancel, null) .setTitle(R.string.end_to_end_encryption_title); Dialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(false); dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(final DialogInterface dialog) { Button button = ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { switch (keyResult) { case KEY_CREATED: Log_OC.d(TAG, "New keys generated and stored."); dialog.dismiss(); Intent intentCreated = new Intent(); intentCreated.putExtra(SUCCESS, true); intentCreated.putExtra(ARG_POSITION, getArguments().getInt(ARG_POSITION)); getTargetFragment().onActivityResult(getTargetRequestCode(), SETUP_ENCRYPTION_RESULT_CODE, intentCreated); break; case KEY_EXISTING_USED: Log_OC.d(TAG, "Decrypt private key"); textView.setText(R.string.end_to_end_encryption_decrypting); try { String privateKey = task.get(); String mnemonicUnchanged = passwordField.getText().toString(); String mnemonic = passwordField.getText().toString().replaceAll("\\s", "") .toLowerCase(Locale.ROOT); String decryptedPrivateKey = EncryptionUtils.decryptPrivateKey(privateKey, mnemonic); arbitraryDataProvider.storeOrUpdateKeyValue(user.getAccountName(), EncryptionUtils.PRIVATE_KEY, decryptedPrivateKey); dialog.dismiss(); Log_OC.d(TAG, "Private key successfully decrypted and stored"); arbitraryDataProvider.storeOrUpdateKeyValue(user.getAccountName(), EncryptionUtils.MNEMONIC, mnemonicUnchanged); Intent intentExisting = new Intent(); intentExisting.putExtra(SUCCESS, true); intentExisting.putExtra(ARG_POSITION, getArguments().getInt(ARG_POSITION)); getTargetFragment().onActivityResult(getTargetRequestCode(), SETUP_ENCRYPTION_RESULT_CODE, intentExisting); } catch (Exception e) { textView.setText(R.string.end_to_end_encryption_wrong_password); Log_OC.d(TAG, "Error while decrypting private key: " + e.getMessage()); } break; case KEY_GENERATE: passphraseTextView.setVisibility(View.GONE); positiveButton.setVisibility(View.GONE); neutralButton.setVisibility(View.GONE); getDialog().setTitle(R.string.end_to_end_encryption_storing_keys); GenerateNewKeysAsyncTask newKeysTask = new GenerateNewKeysAsyncTask(); newKeysTask.execute(); break; default: dialog.dismiss(); break; } } }); } }); return dialog; }
Vulnerability Classification: - CWE: CWE-295 - CVE: CVE-2021-32727 - Severity: MEDIUM - CVSS Score: 5.0 Description: check e2e keys Signed-off-by: tobiasKaminsky <tobias@kaminsky.me> Function: createDialog File: src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java Repository: nextcloud/android Fixed Code: @NonNull private Dialog createDialog(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(v).setPositiveButton(R.string.common_ok, null) .setNeutralButton(R.string.common_cancel, null) .setTitle(R.string.end_to_end_encryption_title); Dialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(false); dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(final DialogInterface dialog) { Button button = ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { switch (keyResult) { case KEY_CREATED: Log_OC.d(TAG, "New keys generated and stored."); dialog.dismiss(); Intent intentCreated = new Intent(); intentCreated.putExtra(SUCCESS, true); intentCreated.putExtra(ARG_POSITION, getArguments().getInt(ARG_POSITION)); getTargetFragment().onActivityResult(getTargetRequestCode(), SETUP_ENCRYPTION_RESULT_CODE, intentCreated); break; case KEY_EXISTING_USED: Log_OC.d(TAG, "Decrypt private key"); textView.setText(R.string.end_to_end_encryption_decrypting); try { String privateKey = task.get(); String mnemonicUnchanged = passwordField.getText().toString(); String mnemonic = passwordField.getText().toString().replaceAll("\\s", "") .toLowerCase(Locale.ROOT); String decryptedPrivateKey = EncryptionUtils.decryptPrivateKey(privateKey, mnemonic); arbitraryDataProvider.storeOrUpdateKeyValue(user.getAccountName(), EncryptionUtils.PRIVATE_KEY, decryptedPrivateKey); dialog.dismiss(); Log_OC.d(TAG, "Private key successfully decrypted and stored"); arbitraryDataProvider.storeOrUpdateKeyValue(user.getAccountName(), EncryptionUtils.MNEMONIC, mnemonicUnchanged); // check if private key and public key match String publicKey = arbitraryDataProvider.getValue(user.getAccountName(), EncryptionUtils.PUBLIC_KEY); byte[] key1 = generateKey(); String base64encodedKey = encodeBytesToBase64String(key1); String encryptedString = EncryptionUtils.encryptStringAsymmetric(base64encodedKey, publicKey); String decryptedString = decryptStringAsymmetric(encryptedString, decryptedPrivateKey); byte[] key2 = decodeStringToBase64Bytes(decryptedString); if (!Arrays.equals(key1, key2)) { throw new Exception("Keys do not match"); } Intent intentExisting = new Intent(); intentExisting.putExtra(SUCCESS, true); intentExisting.putExtra(ARG_POSITION, getArguments().getInt(ARG_POSITION)); getTargetFragment().onActivityResult(getTargetRequestCode(), SETUP_ENCRYPTION_RESULT_CODE, intentExisting); } catch (Exception e) { textView.setText(R.string.end_to_end_encryption_wrong_password); Log_OC.d(TAG, "Error while decrypting private key: " + e.getMessage()); } break; case KEY_GENERATE: passphraseTextView.setVisibility(View.GONE); positiveButton.setVisibility(View.GONE); neutralButton.setVisibility(View.GONE); getDialog().setTitle(R.string.end_to_end_encryption_storing_keys); GenerateNewKeysAsyncTask newKeysTask = new GenerateNewKeysAsyncTask(); newKeysTask.execute(); break; default: dialog.dismiss(); break; } } }); } }); return dialog; }
[ "CWE-295" ]
CVE-2021-32727
MEDIUM
5
nextcloud/android
createDialog
src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java
df2714ffaddf9be4b7babf23a078c984bf8388a3
1
Analyze the following code function for security vulnerabilities
private static String generateSessionId() { byte[] buff = MathUtils.secureRandomBytes(16); return StringUtils.convertBytesToHex(buff); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateSessionId File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
generateSessionId
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
private String xmlRefToJavaName(final String name) { if (name.equals("quorum-ref")) { return "quorumName"; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: xmlRefToJavaName File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
xmlRefToJavaName
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public void reassociate() { sendMessage(CMD_REASSOCIATE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reassociate 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
reassociate
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
protected boolean isRekeyDataSizeExceeded() { if (maxRekeyBytes <= 0L) { return false; } boolean rekey = (inBytesCount.get() > maxRekeyBytes) || (outBytesCount.get() > maxRekeyBytes); if (rekey) { if (log.isDebugEnabled()) { log.debug("isRekeyDataSizeExceeded({}) re-keying: in={}, out={}, max={}", this, inBytesCount, outBytesCount, maxRekeyBytes); } } return rekey; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRekeyDataSizeExceeded 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
isRekeyDataSizeExceeded
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
private String getRoutes(BeforeEnterEvent event) { List<RouteData> routes = event.getSource().getRegistry() .getRegisteredRoutes(); return routes.stream() .sorted((route1, route2) -> route1.getUrl() .compareTo(route2.getUrl())) .map(this::routeToHtml).map(Element::outerHtml) .collect(Collectors.joining()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRoutes File: flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25027
MEDIUM
4.3
vaadin/flow
getRoutes
flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java
cde1389507aac2dc8aa6ae39296765c1ca457b69
0
Analyze the following code function for security vulnerabilities
public Column<T, ?> addColumn(String propertyName) { return addColumn(propertyName, new TextRenderer()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addColumn File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
addColumn
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
private boolean isForegroundApp(String pkgName) { ActivityManager am = getContext().getSystemService(ActivityManager.class); List<ActivityManager.RunningTaskInfo> tasks = am.getRunningTasks(1); return !tasks.isEmpty() && pkgName.equals(tasks.get(0).topActivity.getPackageName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isForegroundApp File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
isForegroundApp
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveTaskToFront File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
moveTaskToFront
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public String getClassName() { return getClass().getName(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClassName 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
getClassName
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
public boolean pageExists(List<String> spaces, String page) throws Exception { return rest().exists(new LocalDocumentReference(spaces, page)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pageExists 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
pageExists
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private void iteratePages(PRIndirectReference rpage) throws IOException { PdfDictionary page = (PdfDictionary)getPdfObject(rpage); PdfArray kidsPR = page.getAsArray(PdfName.KIDS); // reference to a leaf if (kidsPR == null) { page.put(PdfName.TYPE, PdfName.PAGE); PdfDictionary dic = (PdfDictionary)pageInh.get(pageInh.size() - 1); PdfName key; for (Iterator i = dic.getKeys().iterator(); i.hasNext();) { key = (PdfName)i.next(); if (page.get(key) == null) page.put(key, dic.get(key)); } if (page.get(PdfName.MEDIABOX) == null) { PdfArray arr = new PdfArray(new float[]{0,0,PageSize.LETTER.width(),PageSize.LETTER.height()}); page.put(PdfName.MEDIABOX, arr); } refsn.add(rpage); } // reference to a branch else { page.put(PdfName.TYPE, PdfName.PAGES); pushPageAttributes(page); for (int k = 0; k < kidsPR.size(); ++k){ PdfObject obj = kidsPR.getPdfObject(k); if (!obj.isIndirect()) { while (k < kidsPR.size()) kidsPR.remove(k); break; } int rpageObjectNumber = rpage.getNumber(); PRIndirectReference kidObjIndirectRef = (PRIndirectReference)obj; int kidObjectNumber = kidObjIndirectRef.getNumber(); if (rpageObjectNumber == kidObjectNumber) { System.err.println("Error: Invalid referece on Kids: "); System.exit(0); } iteratePages((PRIndirectReference)obj); } popPageAttributes(); } }
Vulnerability Classification: - CWE: CWE-835 - CVE: CVE-2021-37819 - Severity: HIGH - CVSS Score: 7.5 Description: Replace exit() with exception Function: iteratePages File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk Fixed Code: private void iteratePages(PRIndirectReference rpage) throws IOException { PdfDictionary page = (PdfDictionary)getPdfObject(rpage); PdfArray kidsPR = page.getAsArray(PdfName.KIDS); // reference to a leaf if (kidsPR == null) { page.put(PdfName.TYPE, PdfName.PAGE); PdfDictionary dic = (PdfDictionary)pageInh.get(pageInh.size() - 1); PdfName key; for (Iterator i = dic.getKeys().iterator(); i.hasNext();) { key = (PdfName)i.next(); if (page.get(key) == null) page.put(key, dic.get(key)); } if (page.get(PdfName.MEDIABOX) == null) { PdfArray arr = new PdfArray(new float[]{0,0,PageSize.LETTER.width(),PageSize.LETTER.height()}); page.put(PdfName.MEDIABOX, arr); } refsn.add(rpage); } // reference to a branch else { page.put(PdfName.TYPE, PdfName.PAGES); pushPageAttributes(page); for (int k = 0; k < kidsPR.size(); ++k){ PdfObject obj = kidsPR.getPdfObject(k); if (!obj.isIndirect()) { while (k < kidsPR.size()) kidsPR.remove(k); break; } int rpageObjectNumber = rpage.getNumber(); PRIndirectReference kidObjIndirectRef = (PRIndirectReference)obj; int kidObjectNumber = kidObjIndirectRef.getNumber(); if (rpageObjectNumber == kidObjectNumber) { throw new InvalidPdfException("Invalid reference on Kids: " + kidObjectNumber); } iteratePages((PRIndirectReference)obj); } popPageAttributes(); } }
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
iteratePages
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
1
Analyze the following code function for security vulnerabilities
void prepareOperationTimeout(int token, long interval, BackupRestoreTask callback) { if (MORE_DEBUG) Slog.v(TAG, "starting timeout: token=" + Integer.toHexString(token) + " interval=" + interval); synchronized (mCurrentOpLock) { mCurrentOperations.put(token, new Operation(OP_PENDING, callback)); Message msg = mBackupHandler.obtainMessage(MSG_TIMEOUT, token, 0, callback); mBackupHandler.sendMessageDelayed(msg, interval); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepareOperationTimeout File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
prepareOperationTimeout
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public static Collection<File> listFiles(File directory, String[] extensions, boolean recursive) { return org.apache.commons.io.FileUtils.listFiles(directory, extensions, recursive); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listFiles File: src/main/java/com/openkm/util/FileUtils.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-377" ]
CVE-2022-3969
MEDIUM
5.5
openkm/document-management-system
listFiles
src/main/java/com/openkm/util/FileUtils.java
c069e4d73ab8864345c25119d8459495f45453e1
0
Analyze the following code function for security vulnerabilities
protected List<Link> getLinksByRelation(LinkCollection linkCollection, String relation) { List<Link> result = new ArrayList<Link>(); if (linkCollection.getLinks() == null) { return result; } for (Link link : linkCollection.getLinks()) { if (link.getRel().equals(relation)) { result.add(link); } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLinksByRelation File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
getLinksByRelation
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
@Override public void unregisterIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { mPendingIntentController.unregisterIntentSenderCancelListener(sender, receiver); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterIntentSenderCancelListener 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
unregisterIntentSenderCancelListener
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override @DeviceOwnerType public int getDeviceOwnerType(@NonNull ComponentName admin) { synchronized (getLockObject()) { verifyDeviceOwnerTypePreconditionsLocked(admin); return getDeviceOwnerTypeLocked(admin.getPackageName()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeviceOwnerType 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
getDeviceOwnerType
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setAllowEmpty(boolean allowEmpty) { this.allowEmpty = allowEmpty; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowEmpty 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
setAllowEmpty
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
@Override protected Logger getLogger() { return LOG; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLogger File: graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
getLogger
graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
0
Analyze the following code function for security vulnerabilities
public static CharSource asCharSource(File file, Charset charset) { return asByteSource(file).asCharSource(charset); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asCharSource File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
asCharSource
android/guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
@Override public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, String reportPackage) { if (processName != null) { enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP, "setDumpHeapDebugLimit()"); } else { synchronized (mPidsSelfLocked) { ProcessRecord proc = mPidsSelfLocked.get(Binder.getCallingPid()); if (proc == null) { throw new SecurityException("No process found for calling pid " + Binder.getCallingPid()); } enforceDebuggable(proc); processName = proc.processName; uid = proc.uid; if (reportPackage != null && !proc.getPkgList().containsKey(reportPackage)) { throw new SecurityException("Package " + reportPackage + " is not running in " + proc); } } } mAppProfiler.setDumpHeapDebugLimit(processName, uid, maxMemSize, reportPackage); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDumpHeapDebugLimit 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
setDumpHeapDebugLimit
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void scrollToStart() { getRpcProxy(GridClientRpc.class).scrollToStart(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scrollToStart File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
scrollToStart
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
void callConnectionClosedListener() { for (ConnectionListener listener : connectionListeners) { try { listener.connectionClosed(); } catch (Exception e) { // Catch and print any exception so we can recover // from a faulty listener and finish the shutdown process LOGGER.log(Level.SEVERE, "Error in listener while closing connection", e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: callConnectionClosedListener File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
callConnectionClosedListener
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
@Override public void updateLastModified(Context context, Collection collection) throws SQLException, AuthorizeException { //Also fire a modified event since the collection HAS been modified context.addEvent(new Event(Event.MODIFY, Constants.COLLECTION, collection.getID(), null, getIdentifiers(context, collection))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLastModified 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
updateLastModified
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
void updateUsageStats(ActivityRecord component, boolean resumed) { if (DEBUG_SWITCH) Slog.d(TAG_SWITCH, "updateUsageStats: comp=" + component + "res=" + resumed); final BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics(); if (resumed) { if (mUsageStatsService != null) { mUsageStatsService.reportEvent(component.realActivity, component.userId, UsageEvents.Event.MOVE_TO_FOREGROUND); } synchronized (stats) { stats.noteActivityResumedLocked(component.app.uid); } } else { if (mUsageStatsService != null) { mUsageStatsService.reportEvent(component.realActivity, component.userId, UsageEvents.Event.MOVE_TO_BACKGROUND); } synchronized (stats) { stats.noteActivityPausedLocked(component.app.uid); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateUsageStats File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
updateUsageStats
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public void processUploadedPresentation(final UploadedPresentation uploadedPres) { /** * We delay processing of the presentation to make sure that the meeting has already been created. * Otherwise, the meeting won't get the conversion events. */ ScheduledFuture scheduledFuture = scheduledThreadPool.schedule(new Runnable() { public void run() { documentConversionService.processDocument(uploadedPres); } }, 5, TimeUnit.SECONDS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processUploadedPresentation File: bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43798
MEDIUM
5.4
bigbluebutton
processUploadedPresentation
bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
02ba4c6ff8e78a0f4384ad1b7c7367c5a90376e8
0
Analyze the following code function for security vulnerabilities
public static DevModeHandler start(int runningPort, DeploymentConfiguration configuration, File npmFolder, CompletableFuture<Void> waitFor) { if (configuration.isProductionMode() || !configuration.enableDevServer()) { return null; } if (atomicHandler.get() == null) { atomicHandler.compareAndSet(null, createInstance(runningPort, configuration, npmFolder, waitFor)); } return getDevModeHandler(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
start
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) { this.messageAuthorizationPolicy = messageAuthorizationPolicy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMessageAuthorizationPolicy File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
setMessageAuthorizationPolicy
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
@Override public boolean shouldUseIndexing(HttpString headerName, String value) { //content length and date change all the time //no need to index them, or they will churn the table return !headerName.equals(Headers.CONTENT_LENGTH) && !headerName.equals(Headers.DATE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldUseIndexing File: core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
shouldUseIndexing
core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
public String serializeToString(Object obj, Map<String, Object> formParams, String contentType, boolean isBodyNullable) throws ApiException { try { if (contentType.startsWith("multipart/form-data")) { throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { String formString = ""; for (Entry<String, Object> param : formParams.entrySet()) { formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; } if (formString.length() == 0) { // empty string return formString; } else { return formString.substring(0, formString.length() - 1); } } else { if (isBodyNullable) { return obj == null ? "null" : json.getMapper().writeValueAsString(obj); } else { return obj == null ? "" : json.getMapper().writeValueAsString(obj); } } } catch (Exception ex) { throw new ApiException("Failed to perform serializeToString: " + ex.toString()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serializeToString File: samples/client/petstore/java/okhttp-gson-dynamicOperations/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
serializeToString
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void setCorsHeader(HttpServletRequest pReq, HttpServletResponse pResp) { String origin = requestHandler.extractCorsOrigin(pReq.getHeader("Origin")); if (origin != null) { pResp.setHeader("Access-Control-Allow-Origin", origin); pResp.setHeader("Access-Control-Allow-Credentials","true"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCorsHeader File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
setCorsHeader
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
public List<MetaDataDiff> getMetaDataDiff(String fromRev, XWikiContext context) throws XWikiException { XWikiDocument revdoc = context.getWiki().getDocument(this, fromRev, context); return getMetaDataDiff(revdoc, this, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaDataDiff File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getMetaDataDiff
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { continue; } auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateParamsForAuth File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
updateParamsForAuth
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public List<MetaDataDiff> getMetaDataDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context) throws XWikiException { List<MetaDataDiff> list = new ArrayList<MetaDataDiff>(); if (fromDoc == null || toDoc == null) { return list; } if (!fromDoc.getTitle().equals(toDoc.getTitle())) { list.add(new MetaDataDiff("title", fromDoc.getTitle(), toDoc.getTitle())); } if (ObjectUtils.notEqual(fromDoc.getRelativeParentReference(), toDoc.getRelativeParentReference())) { list.add(new MetaDataDiff("parent", fromDoc.getParent(), toDoc.getParent())); } UserReference fromDocOriginalAuthor = fromDoc.getAuthors().getOriginalMetadataAuthor(); UserReference toDocOriginalAuthor = toDoc.getAuthors().getOriginalMetadataAuthor(); if (ObjectUtils.notEqual(fromDocOriginalAuthor, toDocOriginalAuthor)) { list.add(new MetaDataDiff("author", userReferenceToString(fromDocOriginalAuthor), userReferenceToString(toDocOriginalAuthor))); } if (ObjectUtils.notEqual(fromDoc.getDocumentReference(), toDoc.getDocumentReference())) { list.add(new MetaDataDiff("reference", fromDoc.getDocumentReference(), toDoc.getDocumentReference())); } if (!fromDoc.getSpace().equals(toDoc.getSpace())) { list.add(new MetaDataDiff("web", fromDoc.getSpace(), toDoc.getSpace())); } if (!fromDoc.getName().equals(toDoc.getName())) { list.add(new MetaDataDiff("name", fromDoc.getName(), toDoc.getName())); } if (ObjectUtils.notEqual(fromDoc.getLocale(), toDoc.getLocale())) { list.add(new MetaDataDiff("language", fromDoc.getLanguage(), toDoc.getLanguage())); } if (ObjectUtils.notEqual(fromDoc.getDefaultLocale(), toDoc.getDefaultLocale())) { list.add(new MetaDataDiff("defaultLanguage", fromDoc.getDefaultLanguage(), toDoc.getDefaultLanguage())); } if (ObjectUtils.notEqual(fromDoc.getSyntax(), toDoc.getSyntax())) { list.add(new MetaDataDiff("syntax", fromDoc.getSyntax(), toDoc.getSyntax())); } if (fromDoc.isHidden() != toDoc.isHidden()) { list.add(new MetaDataDiff("hidden", fromDoc.isHidden(), toDoc.isHidden())); } return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaDataDiff 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
getMetaDataDiff
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
public String getAttachmentURL(String space, String page, String attachment) { return getAttachmentURL(space, page, attachment, "download"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachmentURL 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
getAttachmentURL
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 void findAll(@NonNull List<ShortcutInfo> result, @Nullable Predicate<ShortcutInfo> filter, int cloneFlag) { findAll(result, filter, cloneFlag, null, 0, /*getPinnedByAnyLauncher=*/ false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findAll File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
findAll
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
private void put(String key, String value, JsonObject object) { if (value != null && !value.isEmpty()) { object.put(key, value); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
put
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public boolean serveDevModeRequest(HttpServletRequest request, HttpServletResponse response) throws IOException { // Do not serve requests if dev server starting or failed to start. if (isDevServerFailedToStart.get() || !devServerStartFuture.isDone()) { return false; } // Since we have 'publicPath=/VAADIN/' in webpack config, // a valid request for webpack-dev-server should start with '/VAADIN/' String requestFilename = request.getPathInfo(); HttpURLConnection connection = prepareConnection(requestFilename, request.getMethod()); // Copies all the headers from the original request Enumeration<String> headerNames = request.getHeaderNames(); while (headerNames.hasMoreElements()) { String header = headerNames.nextElement(); connection.setRequestProperty(header, // Exclude keep-alive "Connect".equals(header) ? "close" : request.getHeader(header)); } // Send the request getLogger().debug("Requesting resource to webpack {}", connection.getURL()); int responseCode = connection.getResponseCode(); if (responseCode == HTTP_NOT_FOUND) { getLogger().debug("Resource not served by webpack {}", requestFilename); // webpack cannot access the resource, return false so as flow can // handle it return false; } getLogger().debug("Served resource by webpack: {} {}", responseCode, requestFilename); // Copies response headers connection.getHeaderFields().forEach((header, values) -> { if (header != null) { response.addHeader(header, values.get(0)); } }); if (responseCode == HTTP_OK) { // Copies response payload writeStream(response.getOutputStream(), connection.getInputStream()); } else if (responseCode < 400) { response.setStatus(responseCode); } else { // Copies response code response.sendError(responseCode); } // Close request to avoid issues in CI and Chrome response.getOutputStream().close(); return true; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2020-36321 - Severity: MEDIUM - CVSS Score: 5.0 Description: fix: check if Url path is safe in Dev Mode Function: serveDevModeRequest File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow Fixed Code: public boolean serveDevModeRequest(HttpServletRequest request, HttpServletResponse response) throws IOException { // Do not serve requests if dev server starting or failed to start. if (isDevServerFailedToStart.get() || !devServerStartFuture.isDone()) { return false; } // Since we have 'publicPath=/VAADIN/' in webpack config, // a valid request for webpack-dev-server should start with '/VAADIN/' String requestFilename = request.getPathInfo(); if (HandlerHelper.isPathUnsafe(requestFilename)) { getLogger().info(HandlerHelper.UNSAFE_PATH_ERROR_MESSAGE_PATTERN, requestFilename); response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return true; } HttpURLConnection connection = prepareConnection(requestFilename, request.getMethod()); // Copies all the headers from the original request Enumeration<String> headerNames = request.getHeaderNames(); while (headerNames.hasMoreElements()) { String header = headerNames.nextElement(); connection.setRequestProperty(header, // Exclude keep-alive "Connect".equals(header) ? "close" : request.getHeader(header)); } // Send the request getLogger().debug("Requesting resource to webpack {}", connection.getURL()); int responseCode = connection.getResponseCode(); if (responseCode == HTTP_NOT_FOUND) { getLogger().debug("Resource not served by webpack {}", requestFilename); // webpack cannot access the resource, return false so as flow can // handle it return false; } getLogger().debug("Served resource by webpack: {} {}", responseCode, requestFilename); // Copies response headers connection.getHeaderFields().forEach((header, values) -> { if (header != null) { response.addHeader(header, values.get(0)); } }); if (responseCode == HTTP_OK) { // Copies response payload writeStream(response.getOutputStream(), connection.getInputStream()); } else if (responseCode < 400) { response.setStatus(responseCode); } else { // Copies response code response.sendError(responseCode); } // Close request to avoid issues in CI and Chrome response.getOutputStream().close(); return true; }
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
serveDevModeRequest
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
1a31bf11e923e2a182e10b9babbcd4795ca75da5
1
Analyze the following code function for security vulnerabilities
public void closingOutput(OutputStream s) { // For some reasons the Android guys chose not doing this by default: // http://android-developers.blogspot.com/2010/12/saving-data-safely.html // this seems to be a mistake of sacrificing stability for minor performance // gains which will only be noticeable on a server. if (s != null) { if (s instanceof FileOutputStream) { try { FileDescriptor fd = ((FileOutputStream) s).getFD(); if (fd != null) { fd.sync(); } } catch (IOException ex) { // this exception doesn't help us ex.printStackTrace(); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closingOutput 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
closingOutput
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public abstract String getUrl();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUrl File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
getUrl
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
public static boolean isConfigForWapiPskNetwork(WifiConfiguration config) { return config.isSecurityType(WifiConfiguration.SECURITY_TYPE_WAPI_PSK); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isConfigForWapiPskNetwork File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
isConfigForWapiPskNetwork
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
0
Analyze the following code function for security vulnerabilities
private static void findMissingFields( final MessageOrBuilder message, final String prefix, final List<String> results) { for (final Descriptors.FieldDescriptor field : message.getDescriptorForType().getFields()) { if (field.isRequired() && !message.hasField(field)) { results.add(prefix + field.getName()); } } for (final Map.Entry<Descriptors.FieldDescriptor, Object> entry : message.getAllFields().entrySet()) { final Descriptors.FieldDescriptor field = entry.getKey(); final Object value = entry.getValue(); if (field.getJavaType() == Descriptors.FieldDescriptor.JavaType.MESSAGE) { if (field.isRepeated()) { int i = 0; for (final Object element : (List) value) { findMissingFields( (MessageOrBuilder) element, subMessagePrefix(prefix, field, i++), results); } } else { if (message.hasField(field)) { findMissingFields( (MessageOrBuilder) value, subMessagePrefix(prefix, field, -1), results); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findMissingFields File: java/core/src/main/java/com/google/protobuf/MessageReflection.java Repository: protocolbuffers/protobuf The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-3509
HIGH
7.5
protocolbuffers/protobuf
findMissingFields
java/core/src/main/java/com/google/protobuf/MessageReflection.java
a3888f53317a8018e7a439bac4abeb8f3425d5e9
0
Analyze the following code function for security vulnerabilities
protected void addFieldValueOnce(SolrInputDocument solrDocument, String fieldName, Object fieldValue) { Collection<Object> fieldValues = solrDocument.getFieldValues(fieldName); if (fieldValues == null || !fieldValues.contains(fieldValue)) { solrDocument.addField(fieldName, fieldValue); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addFieldValueOnce File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
addFieldValueOnce
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
public List<String> getIncludedMacros(String defaultSpace, String content) { return this.xwiki.getIncludedMacros(defaultSpace, content, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIncludedMacros File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getIncludedMacros
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
@Override public String getContentType() { return this.contentType; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentType File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
getContentType
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
@Beta public static Predicate<File> isFile() { return FilePredicate.IS_FILE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFile File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-8908
LOW
2.1
google/guava
isFile
android/guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
public boolean isInClassEditMode() { return getDriver().getCurrentUrl().contains("editor=class"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInClassEditMode 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
isInClassEditMode
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
@Test public void testDeserializationWithTypeInfo02() throws Exception { Instant date = Instant.ofEpochSecond(123456789L, 0); ObjectMapper m = newMapper() .enable(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS) .addMixIn(Temporal.class, MockObjectConfiguration.class); Temporal value = m.readValue( "[\"" + Instant.class.getName() + "\",123456789]", Temporal.class ); assertTrue("The value should be an Instant.", value instanceof Instant); assertEquals("The value is not correct.", date, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testDeserializationWithTypeInfo02 File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testDeserializationWithTypeInfo02
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
@Id @GeneratedValue(generator = "cmsGenerator") @GenericGenerator(name = "cmsGenerator", strategy = CmsUpgrader.IDENTIFIER_GENERATOR) @Column(name = "id", unique = true, nullable = false) public Long getId() { return this.id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getId File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogUpload.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
getId
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogUpload.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
@Override public void verify(Record record) { // 自动只读字段忽略非空检查 final Set<String> autoReadonlyFields = EasyMetaFactory.getAutoReadonlyFields(entity.getName()); List<String> notNulls = new ArrayList<>(); // 非空 List<String> notWells = new ArrayList<>(); // 格式 // 新建 if (record.getPrimary() == null) { for (Field field : entity.getFields()) { if (MetadataHelper.isCommonsField(field)) continue; EasyField easyField = EasyMetaFactory.valueOf(field); if (easyField.getDisplayType() == DisplayType.SERIES || easyField.getDisplayType() == DisplayType.BARCODE) { continue; } Object hasVal = record.getObjectValue(field.getName()); boolean canNull = field.isNullable() || autoReadonlyFields.contains(field.getName()); if (NullValue.isNull(hasVal)) { if (!canNull) { notNulls.add(easyField.getLabel()); } } else { if (field.isCreatable()) { if (!patternMatches(easyField, hasVal)) { notWells.add(easyField.getLabel()); } } else { if (!isForceCreateable(field)) { log.warn("Remove non-creatable field : " + field); record.removeValue(field.getName()); } } } } } // 更新 else { for (String fieldName : record.getAvailableFields()) { Field field = entity.getField(fieldName); if (MetadataHelper.isCommonsField(field)) continue; Object hasVal = record.getObjectValue(field.getName()); boolean canNull = field.isNullable() || autoReadonlyFields.contains(field.getName()); EasyField easyField = EasyMetaFactory.valueOf(field); if (NullValue.isNull(hasVal)) { if (!canNull) { notNulls.add(easyField.getLabel()); } } else { if (field.isUpdatable()) { if (!patternMatches(easyField, hasVal)) { notWells.add(easyField.getLabel()); } } else { log.warn("Remove non-updatable field : " + field); record.removeValue(fieldName); } } } } if (!notNulls.isEmpty()) { throw new DataSpecificationException( Language.L("%s 不允许为空", StringUtils.join(notNulls, " / "))); } if (!notWells.isEmpty()) { throw new DataSpecificationException( Language.L("%s 格式不正确", StringUtils.join(notWells, " / "))); } // TODO 检查引用字段的ID是否正确(是否是其他实体的ID) }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-1613 - Severity: MEDIUM - CVSS Score: 4.0 Description: Fix long request (#599) * fix: `trigger/exec-manual` async * fix: lang * fix: #596 Function: verify File: src/main/java/com/rebuild/core/metadata/EntityRecordCreator.java Repository: getrebuild/rebuild Fixed Code: @Override public void verify(Record record) { // 自动只读字段忽略非空检查 final Set<String> autoReadonlyFields = EasyMetaFactory.getAutoReadonlyFields(entity.getName()); List<String> notNulls = new ArrayList<>(); // 非空 List<String> notWells = new ArrayList<>(); // 格式 // 新建 if (record.getPrimary() == null) { for (Field field : entity.getFields()) { if (MetadataHelper.isCommonsField(field)) continue; EasyField easyField = EasyMetaFactory.valueOf(field); if (easyField.getDisplayType() == DisplayType.SERIES || easyField.getDisplayType() == DisplayType.BARCODE) { continue; } Object hasVal = record.getObjectValue(field.getName()); boolean canNull = field.isNullable() || autoReadonlyFields.contains(field.getName()); if (NullValue.isNull(hasVal)) { if (!canNull) { notNulls.add(easyField.getLabel()); } } else { if (field.isCreatable()) { if (!patternMatches(easyField, hasVal)) { notWells.add(easyField.getLabel()); } } else { if (!isForceCreateable(field)) { log.warn("Remove non-creatable field : {}", field); record.removeValue(field.getName()); } } } } } // 更新 else { for (String fieldName : record.getAvailableFields()) { Field field = entity.getField(fieldName); if (MetadataHelper.isCommonsField(field)) continue; Object hasVal = record.getObjectValue(field.getName()); boolean canNull = field.isNullable() || autoReadonlyFields.contains(field.getName()); EasyField easyField = EasyMetaFactory.valueOf(field); if (NullValue.isNull(hasVal)) { if (!canNull) { notNulls.add(easyField.getLabel()); } } else { if (field.isUpdatable()) { if (!patternMatches(easyField, hasVal)) { notWells.add(easyField.getLabel()); } } else { log.warn("Remove non-updatable field : {}", field); record.removeValue(fieldName); } } } } if (!notNulls.isEmpty()) { throw new DataSpecificationException( Language.L("%s 不允许为空", StringUtils.join(notNulls, " / "))); } if (!notWells.isEmpty()) { throw new DataSpecificationException( Language.L("%s 格式不正确", StringUtils.join(notWells, " / "))); } removeFieldIfSafeCheck(record); // TODO 检查引用字段的ID是否正确(是否是其他实体的ID) }
[ "CWE-79" ]
CVE-2023-1613
MEDIUM
4
getrebuild/rebuild
verify
src/main/java/com/rebuild/core/metadata/EntityRecordCreator.java
d0de4cc35303168f44ca57712c824b5cb9525e54
1
Analyze the following code function for security vulnerabilities
public static void putLong(byte[] data, int index, long value) { PlatformDependent0.putLong(data, index, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putLong File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
putLong
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
public void setAllowSecureCreation(boolean allowSecureCreation) { if (!allowOthers) { this.allowSecureCreation = allowSecureCreation; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowSecureCreation File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
setAllowSecureCreation
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public void setIntHeader(String arg0, int arg1) { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIntHeader File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
setIntHeader
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
default void removeData(UUID JobId, String key) { throw new UnsupportedOperationException(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeData File: portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/storage/TemporaryPerJobDataStore.java Repository: google/data-transfer-project The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-22572
LOW
2.1
google/data-transfer-project
removeData
portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/storage/TemporaryPerJobDataStore.java
013edb6c2d5a4e472988ea29a7cb5b1fdaf9c635
0
Analyze the following code function for security vulnerabilities
public String getURL(EntityReference reference, XWikiContext context) { String action = "view"; if (reference.getType() == EntityType.ATTACHMENT) { action = "download"; } return getURL(reference, action, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public void setIssuedOnInUse(boolean issuedOnInUse) { this.issuedOnInUse = issuedOnInUse; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIssuedOnInUse File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setIssuedOnInUse
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private UserInfo createUserInternal(String name, int flags, int parentId) { if (getUserRestrictions(UserHandle.getCallingUserId()).getBoolean( UserManager.DISALLOW_ADD_USER, false)) { Log.w(LOG_TAG, "Cannot add user. DISALLOW_ADD_USER is enabled."); return null; } if (ActivityManager.isLowRamDeviceStatic()) { return null; } final boolean isGuest = (flags & UserInfo.FLAG_GUEST) != 0; final boolean isManagedProfile = (flags & UserInfo.FLAG_MANAGED_PROFILE) != 0; final long ident = Binder.clearCallingIdentity(); UserInfo userInfo = null; final int userId; try { synchronized (mInstallLock) { synchronized (mPackagesLock) { UserInfo parent = null; if (parentId != UserHandle.USER_NULL) { parent = getUserInfoLocked(parentId); if (parent == null) return null; } if (isManagedProfile && !canAddMoreManagedProfiles()) { return null; } if (!isGuest && !isManagedProfile && isUserLimitReachedLocked()) { // If we're not adding a guest user or a managed profile and the limit has // been reached, cannot add a user. return null; } // If we're adding a guest and there already exists one, bail. if (isGuest && findCurrentGuestUserLocked() != null) { return null; } userId = getNextAvailableIdLocked(); userInfo = new UserInfo(userId, name, null, flags); userInfo.serialNumber = mNextSerialNumber++; long now = System.currentTimeMillis(); userInfo.creationTime = (now > EPOCH_PLUS_30_YEARS) ? now : 0; userInfo.partial = true; Environment.getUserSystemDirectory(userInfo.id).mkdirs(); mUsers.put(userId, userInfo); writeUserListLocked(); if (parent != null) { if (parent.profileGroupId == UserInfo.NO_PROFILE_GROUP_ID) { parent.profileGroupId = parent.id; scheduleWriteUserLocked(parent); } userInfo.profileGroupId = parent.profileGroupId; } final StorageManager storage = mContext.getSystemService(StorageManager.class); for (VolumeInfo vol : storage.getWritablePrivateVolumes()) { final String volumeUuid = vol.getFsUuid(); try { final File userDir = Environment.getDataUserDirectory(volumeUuid, userId); prepareUserDirectory(mContext, volumeUuid, userId); enforceSerialNumber(userDir, userInfo.serialNumber); } catch (IOException e) { Log.wtf(LOG_TAG, "Failed to create user directory on " + volumeUuid, e); } } mPm.createNewUserLILPw(userId); userInfo.partial = false; scheduleWriteUserLocked(userInfo); updateUserIdsLocked(); Bundle restrictions = new Bundle(); mUserRestrictions.append(userId, restrictions); } } mPm.newUserCreated(userId); if (userInfo != null) { Intent addedIntent = new Intent(Intent.ACTION_USER_ADDED); addedIntent.putExtra(Intent.EXTRA_USER_HANDLE, userInfo.id); mContext.sendBroadcastAsUser(addedIntent, UserHandle.ALL, android.Manifest.permission.MANAGE_USERS); } } finally { Binder.restoreCallingIdentity(ident); } return userInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createUserInternal 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
createUserInternal
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
@Deprecated public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) { startKeyguardExitAnimation(0, startTime, fadeoutDuration, null, null, null, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startKeyguardExitAnimation File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
startKeyguardExitAnimation
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
private Colors getColors(StandardTemplateParams p) { mColors.resolvePalette(mContext, mN.color, isBackgroundColorized(p), mInNightMode); return mColors; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getColors File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getColors
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public int getUserId(String user){ Account account = null; int id = -1; Driver driver = new SQLServerDriver(); String connectionUrl = "jdbc:sqlserver://n8bu1j6855.database.windows.net:1433;database=VoyagerDB;user=VoyageLogin@n8bu1j6855;password={GroupP@ssword};encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;"; try { Connection con = driver.connect(connectionUrl, new Properties()); PreparedStatement statement = con.prepareStatement("Select userId from UserTable where userName = '" + user + "'"); ResultSet rs = statement.executeQuery(); rs.next(); String storedId = rs.getString("userId"); id = Integer.parseInt(storedId); } catch (SQLException e) { e.printStackTrace(); } return id; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2014-125074 - Severity: MEDIUM - CVSS Score: 5.2 Description: fixed problems in register controller, and worked at preventing sql-injection in database access Function: getUserId File: Voyager/src/models/DatabaseAccess.java Repository: Nayshlok/Voyager Fixed Code: @Override public int getUserId(String user){ int id = -1; Driver driver = new SQLServerDriver(); try { Connection con = driver.connect(connectionUrl, new Properties()); PreparedStatement statement = con.prepareStatement("Select userId from UserTable where userName = ?"); statement.setString(1, user); ResultSet rs = statement.executeQuery(); rs.next(); String storedId = rs.getString("userId"); id = Integer.parseInt(storedId); } catch (SQLException e) { e.printStackTrace(); } return id; }
[ "CWE-89" ]
CVE-2014-125074
MEDIUM
5.2
Nayshlok/Voyager
getUserId
Voyager/src/models/DatabaseAccess.java
f1249f438cd8c39e7ef2f6c8f2ab76b239a02fae
1
Analyze the following code function for security vulnerabilities
private String getUnpauseWorkAppsForTelephonyTitle() { return getUpdatableString( WORK_PROFILE_TELEPHONY_PAUSED_TITLE, R.string.work_profile_telephony_paused_title); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUnpauseWorkAppsForTelephonyTitle 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
getUnpauseWorkAppsForTelephonyTitle
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void denyTypes(String[] names) { denyPermission(new ExplicitTypePermission(names)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: denyTypes File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
denyTypes
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
@Transactional @Override public void delete(Collection<Project> projects) { Collection<Project> independents = new HashSet<>(projects); for (Iterator<Project> it = independents.iterator(); it.hasNext();) { Project independent = it.next(); for (Project each: independents) { if (!each.equals(independent) && each.isSelfOrAncestorOf(independent)) { it.remove(); break; } } } for (Project independent: independents) delete(independent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
delete
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { HttpRequest req = (HttpRequest) msg; List<String> lengthHeaders = req.headers().getAll(HttpHeaderNames.CONTENT_LENGTH); if (lengthHeaders.size() > 1) { ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } else if (lengthHeaders.size() == 1) { expectedContentLength = Long.parseLong(lengthHeaders.get(0)); if (expectedContentLength < 0) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } } if (expectedContentLength != UNSET_CONTENT_LENGTH && HttpUtil.isTransferEncodingChunked(req)) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } } if (msg instanceof HttpContent) { ByteBuf content = ((HttpContent) msg).content(); seenContentLength = Math.addExact(seenContentLength, content.readableBytes()); if (expectedContentLength != UNSET_CONTENT_LENGTH && seenContentLength > expectedContentLength) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } } if (msg instanceof LastHttpContent) { if (expectedContentLength != UNSET_CONTENT_LENGTH && seenContentLength != expectedContentLength) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } } super.channelRead(ctx, msg); }
Vulnerability Classification: - CWE: CWE-444 - CVE: CVE-2021-21295 - Severity: LOW - CVSS Score: 2.6 Description: refactor based on comments Function: channelRead File: zuul-core/src/main/java/com/netflix/zuul/netty/server/http2/Http2ContentLengthEnforcingHandler.java Repository: Netflix/zuul Fixed Code: @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { HttpRequest req = (HttpRequest) msg; List<String> lengthHeaders = req.headers().getAll(HttpHeaderNames.CONTENT_LENGTH); if (lengthHeaders.size() > 1) { ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } else if (lengthHeaders.size() == 1) { expectedContentLength = Long.parseLong(lengthHeaders.get(0)); if (expectedContentLength < 0) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } } if (hasContentLength() && HttpUtil.isTransferEncodingChunked(req)) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } } if (msg instanceof HttpContent) { ByteBuf content = ((HttpContent) msg).content(); incrementSeenContent(content.readableBytes()); if (hasContentLength() && seenContentLength > expectedContentLength) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } } if (msg instanceof LastHttpContent) { if (hasContentLength() && seenContentLength != expectedContentLength) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFlush(new DefaultHttp2ResetFrame(Http2Error.PROTOCOL_ERROR)); return; } } super.channelRead(ctx, msg); }
[ "CWE-444" ]
CVE-2021-21295
LOW
2.6
Netflix/zuul
channelRead
zuul-core/src/main/java/com/netflix/zuul/netty/server/http2/Http2ContentLengthEnforcingHandler.java
c5c2e4a2dd12f61235555ea81a6c96065ced22c9
1
Analyze the following code function for security vulnerabilities
public static String getViewResource(Object it, String path) { Class clazz = it.getClass(); if(it instanceof Class) clazz = (Class)it; if(it instanceof Descriptor) clazz = ((Descriptor)it).clazz; StringBuilder buf = new StringBuilder(Stapler.getCurrentRequest().getContextPath()); buf.append(Jenkins.VIEW_RESOURCE_PATH).append('/'); buf.append(clazz.getName().replace('.','/').replace('$','/')); buf.append('/').append(path); return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getViewResource File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
getViewResource
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public void readFieldEnd() {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readFieldEnd File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
readFieldEnd
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
public String getPlmn() { return getFieldValue(PLMN_KEY, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPlmn File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
getPlmn
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
int broadcastIntentInPackage(String packageName, int uid, Intent intent, String resolvedType, IIntentReceiver resultTo, int resultCode, String resultData, Bundle map, String requiredPermission, boolean serialized, boolean sticky, int userId) { synchronized(this) { intent = verifyBroadcastLocked(intent); final long origId = Binder.clearCallingIdentity(); int res = broadcastIntentLocked(null, packageName, intent, resolvedType, resultTo, resultCode, resultData, map, requiredPermission, AppOpsManager.OP_NONE, serialized, sticky, -1, uid, userId); Binder.restoreCallingIdentity(origId); return res; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastIntentInPackage File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
broadcastIntentInPackage
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private boolean applyAspectRatio(Rect outBounds, Rect containingAppBounds, Rect containingBounds) { return applyAspectRatio(outBounds, containingAppBounds, containingBounds, 0 /* desiredAspectRatio */, false /* fixedOrientationLetterboxed */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyAspectRatio 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
applyAspectRatio
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static void enforceConstraint(String methodName, String rejectorName, Object value) { if (value != null) { throw new IllegalStateException( methodName + "() cannot be called because " + rejectorName + "() has been called already."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceConstraint 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
enforceConstraint
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
0
Analyze the following code function for security vulnerabilities
public RandomAccessFileOrArray getSafeFile() throws IOException { return tokens.getSafeFile(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSafeFile File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getSafeFile
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
private String optimizeIn(Set<String> inVals) { if (inVals == null || inVals.isEmpty()) return null; else return "( " + StringUtils.join(inVals, ",") + " )"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optimizeIn File: src/main/java/com/rebuild/core/service/query/AdvFilterParser.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
optimizeIn
src/main/java/com/rebuild/core/service/query/AdvFilterParser.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
@Override public void onChange(boolean selfChange) { Rlog.i("GsmServiceStateTracker", "Auto time zone state changed"); revertToNitzTimeZone(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onChange File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
onChange
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
@Override public void startElement(final String uri, final String localName, final String name, final Attributes atts) throws SAXException { outputChars(); super.startElement(uri, localName, name, atts); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startElement File: stroom-pipeline/src/test/java/stroom/util/UniqueXMLEvents.java Repository: gchq/stroom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000651
HIGH
7.5
gchq/stroom
startElement
stroom-pipeline/src/test/java/stroom/util/UniqueXMLEvents.java
ba30ffd415bd7d32ee40ba4b04035267ce80b499
0
Analyze the following code function for security vulnerabilities
public Result.SignerInfo getResult() { return mResult; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResult 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
getResult
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
@Subscribe(threadMode = ThreadMode.BACKGROUND) public void onMessageEvent(NetworkEvent networkEvent) { if (networkEvent.getNetworkConnectionEvent() == NetworkEvent.NetworkConnectionEvent.NETWORK_CONNECTED) { if (handler != null) { handler.removeCallbacksAndMessages(null); } } else if (networkEvent.getNetworkConnectionEvent() == NetworkEvent.NetworkConnectionEvent.NETWORK_DISCONNECTED) { if (handler != null) { handler.removeCallbacksAndMessages(null); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onMessageEvent File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
onMessageEvent
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
private void buildRedAuthURD(Integer type, List<Long> redIds, AuthURD authURD) { if (type == 0) { authURD.setUserIds(redIds); } if (type == 1) { authURD.setRoleIds(redIds); } if (type == 2) { authURD.setDeptIds(redIds); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildRedAuthURD File: backend/src/main/java/io/dataease/service/panel/ShareService.java Repository: dataease The code follows secure coding practices.
[ "CWE-639" ]
CVE-2023-32310
HIGH
8.1
dataease
buildRedAuthURD
backend/src/main/java/io/dataease/service/panel/ShareService.java
72f428e87b5395c03d2f94ef6185fc247ddbc8dc
0
Analyze the following code function for security vulnerabilities
@Override public void dumpDebug(ProtoOutputStream proto, long fieldId, @WindowTraceLogLevel int logLevel) { // Critical log level logs only visible elements to mitigate performance overheard if (logLevel == WindowTraceLogLevel.CRITICAL && !isVisible()) { return; } final long token = proto.start(fieldId); dumpDebug(proto, logLevel); proto.end(token); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpDebug 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
dumpDebug
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
UserManagerService getUserManager() { if (mUserManager == null) { IBinder b = ServiceManager.getService(Context.USER_SERVICE); mUserManager = (UserManagerService) IUserManager.Stub.asInterface(b); } return mUserManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserManager File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getUserManager
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private static void readEntry(Bundle restrictions, ArrayList<String> values, XmlPullParser parser) throws XmlPullParserException, IOException { int type = parser.getEventType(); if (type == XmlPullParser.START_TAG && parser.getName().equals(TAG_ENTRY)) { String key = parser.getAttributeValue(null, ATTR_KEY); String valType = parser.getAttributeValue(null, ATTR_VALUE_TYPE); String multiple = parser.getAttributeValue(null, ATTR_MULTIPLE); if (multiple != null) { values.clear(); int count = Integer.parseInt(multiple); while (count > 0 && (type = parser.next()) != XmlPullParser.END_DOCUMENT) { if (type == XmlPullParser.START_TAG && parser.getName().equals(TAG_VALUE)) { values.add(parser.nextText().trim()); count--; } } String [] valueStrings = new String[values.size()]; values.toArray(valueStrings); restrictions.putStringArray(key, valueStrings); } else if (ATTR_TYPE_BUNDLE.equals(valType)) { restrictions.putBundle(key, readBundleEntry(parser, values)); } else if (ATTR_TYPE_BUNDLE_ARRAY.equals(valType)) { final int outerDepth = parser.getDepth(); ArrayList<Bundle> bundleList = new ArrayList<>(); while (XmlUtils.nextElementWithin(parser, outerDepth)) { Bundle childBundle = readBundleEntry(parser, values); bundleList.add(childBundle); } restrictions.putParcelableArray(key, bundleList.toArray(new Bundle[bundleList.size()])); } else { String value = parser.nextText().trim(); if (ATTR_TYPE_BOOLEAN.equals(valType)) { restrictions.putBoolean(key, Boolean.parseBoolean(value)); } else if (ATTR_TYPE_INTEGER.equals(valType)) { restrictions.putInt(key, Integer.parseInt(value)); } else { restrictions.putString(key, value); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readEntry 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
readEntry
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public String getVersion() { return this.doc.getVersion(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVersion File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getVersion
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
private boolean isEphemeralLocked(int uid) { final String[] packages = mContext.getPackageManager().getPackagesForUid(uid); if (packages == null || packages.length != 1) { // Ephemeral apps cannot share uid return false; } return getPackageManagerInternal().isPackageEphemeral( UserHandle.getUserId(uid), packages[0]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEphemeralLocked 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
isEphemeralLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public List<String> getIncludedMacros() { return this.doc.getIncludedMacros(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIncludedMacros File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getIncludedMacros
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
@Override public void batchSaveNewBeeMallGoods(List<NewBeeMallGoods> newBeeMallGoodsList) { if (!CollectionUtils.isEmpty(newBeeMallGoodsList)) { goodsMapper.batchInsert(newBeeMallGoodsList); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: batchSaveNewBeeMallGoods File: src/main/java/ltd/newbee/mall/service/impl/NewBeeMallGoodsServiceImpl.java Repository: newbee-ltd/newbee-mall The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-27476
MEDIUM
4.3
newbee-ltd/newbee-mall
batchSaveNewBeeMallGoods
src/main/java/ltd/newbee/mall/service/impl/NewBeeMallGoodsServiceImpl.java
0d1ff1b9f4aedc0ccdac5d22014a351554dfb81e
0
Analyze the following code function for security vulnerabilities
public void setUserDefaultGroup(String fullwikiname, XWikiContext context) throws XWikiException { String groupsPreference = isAllGroupImplicit() ? getConfiguration().getProperty("xwiki.users.initialGroups") : getConfiguration().getProperty("xwiki.users.initialGroups", "XWiki.XWikiAllGroup"); if (groupsPreference != null) { String[] groups = groupsPreference.split(","); for (String groupName : groups) { if (StringUtils.isNotBlank(groupName)) { addUserToGroup(fullwikiname, groupName.trim(), context); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserDefaultGroup File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
setUserDefaultGroup
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityFromRecents File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startActivityFromRecents
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private void startClockAnimation(int y) { if (mClockAnimationTarget == y) { return; } mClockAnimationTarget = y; getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { @Override public boolean onPreDraw() { getViewTreeObserver().removeOnPreDrawListener(this); if (mClockAnimator != null) { mClockAnimator.removeAllListeners(); mClockAnimator.cancel(); } mClockAnimator = ObjectAnimator .ofFloat(mKeyguardStatusView, View.Y, mClockAnimationTarget); mClockAnimator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); mClockAnimator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); mClockAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mClockAnimator = null; mClockAnimationTarget = -1; } }); mClockAnimator.start(); return true; } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startClockAnimation File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
startClockAnimation
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected T _fromLong(DeserializationContext context, long timestamp) { if(context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)){ return fromNanoseconds.apply(new FromDecimalArguments( timestamp, 0, this.getZone(context) )); } return fromMilliseconds.apply(new FromIntegerArguments( timestamp, this.getZone(context))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _fromLong File: datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
_fromLong
datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0