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
@Override public TransceiveResult transceive(int nativeHandle, byte[] data, boolean raw) throws RemoteException { NfcPermissions.enforceUserPermissions(mContext); TagEndpoint tag = null; byte[] response; // Check if NFC is enabled if (!isNfcEnabled()) { return null; } /* find the tag in the hmap */ tag = (TagEndpoint) findObject(nativeHandle); if (tag != null) { // Check if length is within limits if (data.length > getMaxTransceiveLength(tag.getConnectedTechnology())) { return new TransceiveResult(TransceiveResult.RESULT_EXCEEDED_LENGTH, null); } int[] targetLost = new int[1]; response = tag.transceive(data, raw, targetLost); int result; if (response != null) { result = TransceiveResult.RESULT_SUCCESS; } else if (targetLost[0] == 1) { result = TransceiveResult.RESULT_TAGLOST; } else { result = TransceiveResult.RESULT_FAILURE; } return new TransceiveResult(result, response); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: transceive File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
transceive
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
void requestPssAllProcsLocked(long now, boolean always, boolean memLowered) { if (!always) { if (now < (mLastFullPssTime + (memLowered ? FULL_PSS_LOWERED_INTERVAL : FULL_PSS_MIN_INTERVAL))) { return; } } if (DEBUG_PSS) Slog.d(TAG, "Requesting PSS of all procs! memLowered=" + memLowered); mLastFullPssTime = now; mFullPssPending = true; mPendingPssProcesses.ensureCapacity(mLruProcesses.size()); mPendingPssProcesses.clear(); for (int i=mLruProcesses.size()-1; i>=0; i--) { ProcessRecord app = mLruProcesses.get(i); if (memLowered || now > (app.lastStateTime+ProcessList.PSS_ALL_INTERVAL)) { app.pssProcState = app.setProcState; app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, true, mTestPssMode, isSleeping(), now); mPendingPssProcesses.add(app); } } mBgHandler.sendEmptyMessage(COLLECT_PSS_BG_MSG); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestPssAllProcsLocked 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
requestPssAllProcsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@MediumTest @Test public void testSendConnectionEventNull() throws Exception { IdPair ids = startAndMakeActiveIncomingCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); assertEquals(Call.STATE_ACTIVE, mInCallServiceFixtureX.getCall(ids.mCallId).getState()); mConnectionServiceFixtureA.sendConnectionEvent(ids.mConnectionId, TEST_EVENT, null); verify(mInCallServiceFixtureX.getTestDouble(), timeout(TEST_TIMEOUT)) .onConnectionEvent(ids.mCallId, TEST_EVENT, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testSendConnectionEventNull File: tests/src/com/android/server/telecom/tests/BasicCallTests.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testSendConnectionEventNull
tests/src/com/android/server/telecom/tests/BasicCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public void restoreFromRecycleBin(final XWikiDocument doc, String comment, XWikiContext context) throws XWikiException { XWikiDeletedDocument[] deletedDocuments = getRecycleBinStore().getAllDeletedDocuments(doc, context, true); if (deletedDocuments != null && deletedDocuments.length > 0) { long index = deletedDocuments[0].getId(); restoreFromRecycleBin(doc, index, comment, context); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restoreFromRecycleBin 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
restoreFromRecycleBin
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
protected InputStream getInputStream(String fileName) { return this.classLoadHelper.getResourceAsStream(fileName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInputStream File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java Repository: quartz-scheduler/quartz The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-13990
HIGH
7.5
quartz-scheduler/quartz
getInputStream
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
0
Analyze the following code function for security vulnerabilities
public static boolean jsFunction_isSelfSignupEnabled() { APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration(); return Boolean.parseBoolean(config.getFirstProperty(APIConstants.SELF_SIGN_UP_ENABLED)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_isSelfSignupEnabled File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_isSelfSignupEnabled
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
protected Properties createBaseProperties() { Properties env = new Properties(); Iterator iter = options.entrySet().iterator(); while (iter.hasNext()) { Entry entry = (Entry) iter.next(); env.put(entry.getKey(), entry.getValue()); } return env; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createBaseProperties File: jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java Repository: wildfly-security/jboss-negotiation The code follows secure coding practices.
[ "CWE-200" ]
CVE-2015-1849
MEDIUM
4.3
wildfly-security/jboss-negotiation
createBaseProperties
jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java
0dc9d191b6eb1d13b8f0189c5b02ba6576f4722e
0
Analyze the following code function for security vulnerabilities
public JSONArray put(int value) { put(Integer.valueOf(value)); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
put
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public String getAttachmentRevisionURL(String filename, String revision, XWikiContext context) { return getAttachmentRevisionURL(filename, revision, null, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachmentRevisionURL 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
getAttachmentRevisionURL
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 int runListPermissions() { try { boolean labels = false; boolean groups = false; boolean userOnly = false; boolean summary = false; boolean dangerousOnly = false; String opt; while ((opt=nextOption()) != null) { if (opt.equals("-f")) { labels = true; } else if (opt.equals("-g")) { groups = true; } else if (opt.equals("-s")) { groups = true; labels = true; summary = true; } else if (opt.equals("-u")) { userOnly = true; } else if (opt.equals("-d")) { dangerousOnly = true; } else { System.err.println("Error: Unknown option: " + opt); return 1; } } String grp = nextOption(); ArrayList<String> groupList = new ArrayList<String>(); if (groups) { List<PermissionGroupInfo> infos = mPm.getAllPermissionGroups(0); for (int i=0; i<infos.size(); i++) { groupList.add(infos.get(i).name); } groupList.add(null); } else { groupList.add(grp); } if (dangerousOnly) { System.out.println("Dangerous Permissions:"); System.out.println(""); doListPermissions(groupList, groups, labels, summary, PermissionInfo.PROTECTION_DANGEROUS, PermissionInfo.PROTECTION_DANGEROUS); if (userOnly) { System.out.println("Normal Permissions:"); System.out.println(""); doListPermissions(groupList, groups, labels, summary, PermissionInfo.PROTECTION_NORMAL, PermissionInfo.PROTECTION_NORMAL); } } else if (userOnly) { System.out.println("Dangerous and Normal Permissions:"); System.out.println(""); doListPermissions(groupList, groups, labels, summary, PermissionInfo.PROTECTION_NORMAL, PermissionInfo.PROTECTION_DANGEROUS); } else { System.out.println("All Permissions:"); System.out.println(""); doListPermissions(groupList, groups, labels, summary, -10000, 10000); } return 0; } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(PM_NOT_RUNNING_ERR); return 1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runListPermissions File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runListPermissions
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
private BigInteger[] derDecode( byte[] encoding) throws IOException { ASN1Sequence s = (ASN1Sequence)ASN1Primitive.fromByteArray(encoding); return new BigInteger[]{ ((ASN1Integer)s.getObjectAt(0)).getValue(), ((ASN1Integer)s.getObjectAt(1)).getValue() }; }
Vulnerability Classification: - CWE: CWE-347 - CVE: CVE-2016-1000338 - Severity: MEDIUM - CVSS Score: 5.0 Description: added length check for sequence in DSA signatures Function: derDecode File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/DSASigner.java Repository: bcgit/bc-java Fixed Code: private BigInteger[] derDecode( byte[] encoding) throws IOException { ASN1Sequence s = (ASN1Sequence)ASN1Primitive.fromByteArray(encoding); if (s.size() != 2) { throw new IOException("malformed signature"); } return new BigInteger[]{ ((ASN1Integer)s.getObjectAt(0)).getValue(), ((ASN1Integer)s.getObjectAt(1)).getValue() }; }
[ "CWE-347" ]
CVE-2016-1000338
MEDIUM
5
bcgit/bc-java
derDecode
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/DSASigner.java
b0c3ce99d43d73a096268831d0d120ffc89eac7f
1
Analyze the following code function for security vulnerabilities
public void setYoungestFileModificationTime(long youngestFileModificationTime) { this.youngestFileModificationTime = youngestFileModificationTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setYoungestFileModificationTime File: src/main/java/emissary/pickup/WorkBundle.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
setYoungestFileModificationTime
src/main/java/emissary/pickup/WorkBundle.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
@Override public List<ProcessMemoryState> getMemoryStateForProcesses() { List<ProcessMemoryState> processMemoryStates = new ArrayList<>(); synchronized (mPidsSelfLocked) { for (int i = 0, size = mPidsSelfLocked.size(); i < size; i++) { final ProcessRecord r = mPidsSelfLocked.valueAt(i); processMemoryStates.add(new ProcessMemoryState( r.uid, r.getPid(), r.processName, r.mState.getCurAdj(), r.mServices.hasForegroundServices())); } } return processMemoryStates; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMemoryStateForProcesses 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
getMemoryStateForProcesses
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public Rectangle getCropBox(int index) { return getCropBox(pageRefs.getPageNRelease(index)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCropBox 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
getCropBox
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public static boolean isResponseCompatibleWithRequest(Method request, Method response) { // make a best effort attempt to ensure the reply was intended for this rpc request // Ideally each rpc request would tag an id on it that could be returned and referenced on its reply. // But because that would be a very large undertaking to add passively this logic at least protects against ClassCastExceptions if (request != null) { if (request instanceof Basic.Qos) { return response instanceof Basic.QosOk; } else if (request instanceof Basic.Get) { return response instanceof Basic.GetOk || response instanceof Basic.GetEmpty; } else if (request instanceof Basic.Consume) { if (!(response instanceof Basic.ConsumeOk)) return false; // can also check the consumer tags match here. handle case where request consumer tag is empty and server-generated. final String consumerTag = ((Basic.Consume) request).getConsumerTag(); return consumerTag == null || consumerTag.equals("") || consumerTag.equals(((Basic.ConsumeOk) response).getConsumerTag()); } else if (request instanceof Basic.Cancel) { if (!(response instanceof Basic.CancelOk)) return false; // can also check the consumer tags match here return ((Basic.Cancel) request).getConsumerTag().equals(((Basic.CancelOk) response).getConsumerTag()); } else if (request instanceof Basic.Recover) { return response instanceof Basic.RecoverOk; } else if (request instanceof Exchange.Declare) { return response instanceof Exchange.DeclareOk; } else if (request instanceof Exchange.Delete) { return response instanceof Exchange.DeleteOk; } else if (request instanceof Exchange.Bind) { return response instanceof Exchange.BindOk; } else if (request instanceof Exchange.Unbind) { return response instanceof Exchange.UnbindOk; } else if (request instanceof Queue.Declare) { // we cannot check the queue name, as the server can strip some characters // see QueueLifecycle test and https://github.com/rabbitmq/rabbitmq-server/issues/710 return response instanceof Queue.DeclareOk; } else if (request instanceof Queue.Delete) { return response instanceof Queue.DeleteOk; } else if (request instanceof Queue.Bind) { return response instanceof Queue.BindOk; } else if (request instanceof Queue.Unbind) { return response instanceof Queue.UnbindOk; } else if (request instanceof Queue.Purge) { return response instanceof Queue.PurgeOk; } else if (request instanceof Tx.Select) { return response instanceof Tx.SelectOk; } else if (request instanceof Tx.Commit) { return response instanceof Tx.CommitOk; } else if (request instanceof Tx.Rollback) { return response instanceof Tx.RollbackOk; } else if (request instanceof Confirm.Select) { return response instanceof Confirm.SelectOk; } } // for passivity default to true return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isResponseCompatibleWithRequest File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
isResponseCompatibleWithRequest
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Override public void updateLockTaskPackages(int userId, String[] packages) { final int callingUid = Binder.getCallingUid(); if (callingUid != 0 && callingUid != SYSTEM_UID) { mAmInternal.enforceCallingPermission(Manifest.permission.UPDATE_LOCK_TASK_PACKAGES, "updateLockTaskPackages()"); } synchronized (mGlobalLock) { ProtoLog.w(WM_DEBUG_LOCKTASK, "Allowlisting %d:%s", userId, Arrays.toString(packages)); getLockTaskController().updateLockTaskPackages(userId, packages); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLockTaskPackages 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
updateLockTaskPackages
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public static @NonNull String getVolumeName(@NonNull Context context, @NonNull File path) throws FileNotFoundException { if (contains(Environment.getStorageDirectory(), path)) { StorageVolume volume = getStorageVolume(context, path); return volume.getMediaStoreVolumeName(); } else { return MediaStore.VOLUME_INTERNAL; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVolumeName File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
getVolumeName
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
public static AccountManagerService getSingleton() { return sThis.get(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSingleton File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
getSingleton
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public void animateCloseQs() { if (mQsExpansionAnimator != null) { if (!mQsAnimatorExpand) { return; } float height = mQsExpansionHeight; mQsExpansionAnimator.cancel(); setQsExpansion(height); } flingSettings(0 /* vel */, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: animateCloseQs 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
animateCloseQs
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void setDateAndCacheHeaders(HttpHeaders httpHeaders, ZonedDateTime timeNow, long lastModifiedEpochSeconds, long hashKeyMaxRemainingAgeSeconds, String hashKey) { // Date header uses server time, and should use the same clock as Expires and Last-Modified httpHeaders.set(DATE, timeNow.format(DateTimeFormatter.RFC_1123_DATE_TIME)); // Last-Modified is used to determine whether a Not Modified response should be returned on the next request if (lastModifiedEpochSeconds > 0) { // Add last modified header to cacheable resources. This is needed because Chrome sends // "Cache-Control: max-age=0" when the user types in a URL and hits enter, or hits refresh. // In these circumstances, sending back "Cache-Control: public, max-age=31536000" does // no good, because the browser has already requested the resource rather than relying on // its cache. By setting the last modified header for all cacheable resources, we can // at least send "Not Modified" as a response if the resource has not been modified, // which doesn't save on roundtrips, but at least saves on re-transferring the resources // to the browser when they're already in the browser's cache. httpHeaders.set( LAST_MODIFIED, ZonedDateTime.ofInstant(Instant.ofEpochSecond(lastModifiedEpochSeconds), ZoneId.of("UTC")).format( DateTimeFormatter.RFC_1123_DATE_TIME)); } // Cache hashed URIs forever (or for the specified amount of time) if (hashKey != null) { // Negative max age => cache indefinitely (although the spec only allows for one year, or 31536000 seconds) long maxAgeSeconds = hashKeyMaxRemainingAgeSeconds < 0 ? 31536000 : hashKeyMaxRemainingAgeSeconds; // Cache hash URIs for one year httpHeaders.set(CACHE_CONTROL, "public, max-age=" + maxAgeSeconds); httpHeaders.set(EXPIRES, timeNow.plusSeconds(maxAgeSeconds).format(DateTimeFormatter.RFC_1123_DATE_TIME)); httpHeaders.set(ETAG, hashKey); } if (hashKey == null && lastModifiedEpochSeconds == 0) { // Disable caching for all resources that don't have a last modified time (all static file // resources have a last modified time, so these headers will never be set for files, and // they won't be set for dynamic resources that don't manually set a last modified time). // Without these headers, the server will not have a last modified timestamp to check // against its own timestamp on subsequent requests, so cannot return Not Modified. // This is the minimum necessary set of headers for disabling caching, see http://goo.gl/yXGd2x httpHeaders.add(CACHE_CONTROL, "no-cache, no-store, must-revalidate"); // HTTP 1.1 httpHeaders.add(PRAGMA, "no-cache"); // HTTP 1.0 httpHeaders.add(EXPIRES, "0"); // Proxies } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDateAndCacheHeaders File: src/gribbit/request/HttpRequestHandler.java Repository: lukehutch/gribbit The code follows secure coding practices.
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
setDateAndCacheHeaders
src/gribbit/request/HttpRequestHandler.java
620418df247aebda3dd4be1dda10fe229ea505dd
0
Analyze the following code function for security vulnerabilities
public List search(Query query, int nb, int start, XWikiContext inputxcontext) throws XWikiException { if (query == null) { return null; } return executeRead(inputxcontext, session -> { try { if (start > 0) { query.setFirstResult(start); } if (nb > 0) { query.setMaxResults(nb); } Iterator it = query.list().iterator(); List list = new ArrayList<>(); while (it.hasNext()) { list.add(it.next()); } return list; } catch (Exception e) { Object[] args = {query.toString()}; throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_HIBERNATE_SEARCH, "Exception while searching documents with sql {0}", e, args); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: search File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
search
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
public EntityEnclosingMethod save(Page page, boolean release, int... expectedCodes) throws Exception { if (expectedCodes.length == 0) { // Allow create or modify by default expectedCodes = STATUS_CREATED_ACCEPTED; } Class resourceClass = StringUtils.isEmpty(page.getLanguage()) ? PageResource.class : PageTranslationResource.class; return TestUtils.assertStatusCodes(executePut(resourceClass, page, toElements(page)), release, expectedCodes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save 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
save
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
@Override public boolean moveNext() { raiseIfKilled(); try { if (currentReader != null) { String line; try { line = getLine(currentReader); } catch (SocketException | SocketTimeoutException e) { if (backOffPolicy.hasNext()) { return false; } throw e; } if (line == null) { closeReader(); return moveNext(); } cursor.line = line; cursor.failure = null; return true; } else if (currentInputUriIterator != null && currentInputUriIterator.hasNext()) { advanceToNextUri(currentInput); return moveNext(); } else if (fileInputsIterator != null && fileInputsIterator.hasNext()) { advanceToNextFileInput(); return moveNext(); } else { reset(); return false; } } catch (IOException e) { cursor.failure = e; closeReader(); // If IOError happens on file opening, let consumers collect the error // This is mostly for RETURN SUMMARY of COPY FROM if (cursor.lineNumber == 0) { return true; } return moveNext(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveNext File: server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java Repository: crate The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-24565
MEDIUM
6.5
crate
moveNext
server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java
4e857d675683095945dd524d6ba03e692c70ecd6
0
Analyze the following code function for security vulnerabilities
private void sendNfcEeAccessProtectedBroadcast(Intent intent) { intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); // Resume app switches so the receivers can start activites without delay mNfcDispatcher.resumeAppSwitches(); ArrayList<String> matchingPackages = new ArrayList<String>(); ArrayList<String> preferredPackages = new ArrayList<String>(); synchronized (this) { for (PackageInfo pkg : mInstalledPackages) { if (pkg != null && pkg.applicationInfo != null) { if (mNfceeAccessControl.check(pkg.applicationInfo)) { matchingPackages.add(pkg.packageName); if (mCardEmulationManager != null && mCardEmulationManager.packageHasPreferredService(pkg.packageName)) { preferredPackages.add(pkg.packageName); } } } } if (preferredPackages.size() > 0) { // If there's any packages in here which are preferred, only // send field events to those packages, to prevent other apps // with signatures in nfcee_access.xml from acting upon the events. for (String packageName : preferredPackages){ intent.setPackage(packageName); mContext.sendBroadcast(intent); } } else { for (String packageName : matchingPackages){ intent.setPackage(packageName); mContext.sendBroadcast(intent); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendNfcEeAccessProtectedBroadcast File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
sendNfcEeAccessProtectedBroadcast
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
@Override public void join() throws TransportException { close.await(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: join File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
join
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
static void openAccess(AccessibleObject object, boolean isAccessible) { if (isAccessible) { SecurityCheck.LIMITER.preOpenAccessible(object); } openAccess0(object, isAccessible); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openAccess File: api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java Repository: Karlatemp/UnsafeAccessor The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-31139
MEDIUM
4.3
Karlatemp/UnsafeAccessor
openAccess
api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java
4ef83000184e8f13239a1ea2847ee401d81585fd
0
Analyze the following code function for security vulnerabilities
@Override public boolean isSupported(final String namespace, final String featureName) { throw new UnsupportedOperationException("DomNode.isSupported is not yet implemented."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSupported File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
isSupported
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
protected void filter(String needle) { if (xmppConnectionServiceBound) { this.filterContacts(needle); this.filterConferences(needle); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filter File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
filter
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void executeAppTransition() { if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, "executeAppTransition()")) { throw new SecurityException("Requires MANAGE_APP_TOKENS permission"); } synchronized(mWindowMap) { if (DEBUG_APP_TRANSITIONS) Slog.w(TAG, "Execute app transition: " + mAppTransition + " Callers=" + Debug.getCallers(5)); if (mAppTransition.isTransitionSet()) { mAppTransition.setReady(); final long origId = Binder.clearCallingIdentity(); try { performLayoutAndPlaceSurfacesLocked(); } finally { Binder.restoreCallingIdentity(origId); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeAppTransition File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
executeAppTransition
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void displayVerificationWarningDialog(final Contact contact, final Invite invite) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.verify_omemo_keys); View view = getLayoutInflater().inflate(R.layout.dialog_verify_fingerprints, null); final CheckBox isTrustedSource = view.findViewById(R.id.trusted_source); TextView warning = view.findViewById(R.id.warning); warning.setText(JidDialog.style(this, R.string.verifying_omemo_keys_trusted_source, contact.getJid().asBareJid().toEscapedString(), contact.getDisplayName())); builder.setView(view); builder.setPositiveButton(R.string.confirm, (dialog, which) -> { if (isTrustedSource.isChecked() && invite.hasFingerprints()) { xmppConnectionService.verifyFingerprints(contact, invite.getFingerprints()); } switchToConversation(contact, invite.getBody()); }); builder.setNegativeButton(R.string.cancel, (dialog, which) -> StartConversationActivity.this.finish()); AlertDialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(false); dialog.setOnCancelListener(dialog1 -> StartConversationActivity.this.finish()); dialog.show(); }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2018-18467 - Severity: MEDIUM - CVSS Score: 5.0 Description: Do not insert text shared over XMPP uri when already drafting message XMPP uris in the style of `xmpp:test@domain.tld?body=Something` can be used to directly share a message with a specific contact. Previously the text was always appended to the message currently in draft. The message was never send automatically. Essentially those links where treated like normal text share intents (for example when sharing a URL from the browser) but without the contact selection. There is a concern (CVE-2018-18467) that when this URI is invoked automatically and the user is currently drafting a long message to that particular contact the text could be inserted in the draft field (input box) without the user noticing. To circumvent that the text shared over XMPP uris that contain a particular contact is now appended only if the draft box is currently empty. Sharing text normally (**with** manual contact selection) is still treated the same; meaning the shared text will be appended to the current draft. This is intended behaviour to make the 'Hey I have this cool link here;' *open browser*, *share link* - secenario work. Function: displayVerificationWarningDialog File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations Fixed Code: private void displayVerificationWarningDialog(final Contact contact, final Invite invite) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.verify_omemo_keys); View view = getLayoutInflater().inflate(R.layout.dialog_verify_fingerprints, null); final CheckBox isTrustedSource = view.findViewById(R.id.trusted_source); TextView warning = view.findViewById(R.id.warning); warning.setText(JidDialog.style(this, R.string.verifying_omemo_keys_trusted_source, contact.getJid().asBareJid().toEscapedString(), contact.getDisplayName())); builder.setView(view); builder.setPositiveButton(R.string.confirm, (dialog, which) -> { if (isTrustedSource.isChecked() && invite.hasFingerprints()) { xmppConnectionService.verifyFingerprints(contact, invite.getFingerprints()); } switchToConversationDoNotAppend(contact, invite.getBody()); }); builder.setNegativeButton(R.string.cancel, (dialog, which) -> StartConversationActivity.this.finish()); AlertDialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(false); dialog.setOnCancelListener(dialog1 -> StartConversationActivity.this.finish()); dialog.show(); }
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
displayVerificationWarningDialog
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
1
Analyze the following code function for security vulnerabilities
public static InputSource resolveEntity(final String systemId, URL baseUrl) throws IOException, SAXException { InputSource source; // Can't resolve public id, but might be able to resolve relative // system id, since we have a base URI. if (systemId != null && baseUrl != null) { URL url; try { url = new URL(baseUrl, systemId); source = new InputSource(url.openStream()); source.setSystemId(systemId); return source; } catch (MalformedURLException except) { try { String absURL = URIUtils.resolveAsString(systemId, baseUrl.toString()); url = new URL(absURL); source = new InputSource(url.openStream()); source.setSystemId(systemId); return source; } catch (MalformedURLException ex2) { // nothing to do } } catch (java.io.FileNotFoundException fnfe) { try { String absURL = URIUtils.resolveAsString(systemId, baseUrl.toString()); url = new URL(absURL); source = new InputSource(url.openStream()); source.setSystemId(systemId); return source; } catch (MalformedURLException ex2) { // nothing to do } } return null; } // No resolving. return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveEntity File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
resolveEntity
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
@Override public boolean setApplicationRestrictionsManagingPackage(ComponentName admin, String packageName) { try { setDelegatedScopePreO(admin, packageName, DELEGATION_APP_RESTRICTIONS); } catch (IllegalArgumentException e) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setApplicationRestrictionsManagingPackage 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
setApplicationRestrictionsManagingPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void initPk8( @UnderInitialization(WrappedFactory.class) LibPQFactory this, String sslkeyfile, String defaultdir, Properties info) throws PSQLException { // Load the client's certificate and key String sslcertfile = PGProperty.SSL_CERT.get(info); if (sslcertfile == null) { // Fall back to default defaultfile = true; sslcertfile = defaultdir + "postgresql.crt"; } // If the properties are empty, give null to prevent client key selection km = new LazyKeyManager(("".equals(sslcertfile) ? null : sslcertfile), ("".equals(sslkeyfile) ? null : sslkeyfile), getCallbackHandler(info), defaultfile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initPk8 File: pgjdbc/src/main/java/org/postgresql/ssl/LibPQFactory.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-665" ]
CVE-2022-21724
HIGH
7.5
pgjdbc
initPk8
pgjdbc/src/main/java/org/postgresql/ssl/LibPQFactory.java
f4d0ed69c0b3aae8531d83d6af4c57f22312c813
0
Analyze the following code function for security vulnerabilities
private static void checkAndFillCacheWriterFactoryConfigXml(XmlGenerator gen, String cacheWriter) { if (isNullOrEmpty(cacheWriter)) { return; } gen.node("cache-writer-factory", null, "class-name", cacheWriter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkAndFillCacheWriterFactoryConfigXml File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
checkAndFillCacheWriterFactoryConfigXml
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public abstract String getProjectId(String projectId);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProjectId File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getProjectId
test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
boolean invite() { if (!isJidValid()) { Toast.makeText(StartConversationActivity.this, R.string.invalid_jid, Toast.LENGTH_SHORT).show(); return false; } if (getJid() != null) { return handleJid(this); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invite File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
invite
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public List<V1SchemeSignerInfo> getV1SchemeIgnoredSigners() { return mV1SchemeIgnoredSigners; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getV1SchemeIgnoredSigners File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getV1SchemeIgnoredSigners
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
InputStream decodeAesHeaderAndInitialize(String encryptionName, boolean pbkdf2Fallback, InputStream rawInStream) { InputStream result = null; try { if (encryptionName.equals(ENCRYPTION_ALGORITHM_NAME)) { String userSaltHex = readHeaderLine(rawInStream); // 5 byte[] userSalt = hexToByteArray(userSaltHex); String ckSaltHex = readHeaderLine(rawInStream); // 6 byte[] ckSalt = hexToByteArray(ckSaltHex); int rounds = Integer.parseInt(readHeaderLine(rawInStream)); // 7 String userIvHex = readHeaderLine(rawInStream); // 8 String masterKeyBlobHex = readHeaderLine(rawInStream); // 9 // decrypt the master key blob result = attemptMasterKeyDecryption(PBKDF_CURRENT, userSalt, ckSalt, rounds, userIvHex, masterKeyBlobHex, rawInStream, false); if (result == null && pbkdf2Fallback) { result = attemptMasterKeyDecryption(PBKDF_FALLBACK, userSalt, ckSalt, rounds, userIvHex, masterKeyBlobHex, rawInStream, true); } } else Slog.w(TAG, "Unsupported encryption method: " + encryptionName); } catch (NumberFormatException e) { Slog.w(TAG, "Can't parse restore data header"); } catch (IOException e) { Slog.w(TAG, "Can't read input header"); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decodeAesHeaderAndInitialize 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
decodeAesHeaderAndInitialize
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public static HostRange parse(String addressStr, String prefixSizeStr) { int prefixSize; try { prefixSize = Integer.parseInt(prefixSizeStr); } catch (NumberFormatException e) { throw new InvalidRuleException(String.format( "Invalid host host '%s': Cannot extract size of CIDR mask from '%s'.", addressStr + '/' + prefixSizeStr, prefixSizeStr )); } InetAddress address; try { address = InetAddresses.forString(addressStr); } catch (IllegalArgumentException e) { throw new InvalidRuleException(String.format( "Invalid host '%s': Cannot extract IP address from '%s'.", addressStr + '/' + prefixSizeStr, addressStr )); } // Mask the bytes of the IP address. byte[] minBytes = address.getAddress(), maxBytes = address.getAddress(); var size = prefixSize; for (var i = 0; i < minBytes.length; i++) { if (size <= 0) { minBytes[i] = (byte) 0; maxBytes[i] = (byte) 0xFF; } else if (size < 8) { minBytes[i] = (byte) (minBytes[i] & 0xFF << (8 - size)); maxBytes[i] = (byte) (maxBytes[i] | ~(0xFF << (8 - size))); } size -= 8; } return new HostRange(minBytes, maxBytes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parse File: projects/core/src/main/java/dan200/computercraft/core/apis/http/options/AddressPredicate.java Repository: cc-tweaked/CC-Tweaked The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-37262
HIGH
8.8
cc-tweaked/CC-Tweaked
parse
projects/core/src/main/java/dan200/computercraft/core/apis/http/options/AddressPredicate.java
4bbde8c50c00bc572578ab2cff609b3443d10ddf
0
Analyze the following code function for security vulnerabilities
@Override public String getTransportProtocol() { return "mock"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransportProtocol File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
getTransportProtocol
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
public boolean equals(Object obj) { if (obj == null || getClass() != obj.getClass()) { return false; } return Objects.equals(getName(), ((Profile) obj).getName()) && Objects.equals(getLocation(), ((Profile) obj).getLocation()) && Objects.equals(getId(), ((Profile) obj).getId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
equals
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { StringBuilder sb = new StringBuilder(); ArrayList<Annotation> annotationList = new ArrayList<Annotation>(); for (ArrayList<Annotation> list : geneAnnotationMap.values()) { annotationList.addAll(list); } for (Annotation annotation : annotationList) { sb.append(chr).append(","); sb.append(position).append(","); sb.append(ref).append(","); sb.append(allele).append(","); sb.append(type).append(","); sb.append(isMinorRef).append(","); sb.append(major_hom).append(","); sb.append(het).append(","); sb.append(minor_hom).append(","); sb.append(qcFailedSamples).append(","); sb.append(maf).append(","); sb.append(hweP).append(","); sb.append(FormatManager.getString(exacGlobalMaf)).append(","); sb.append(FormatManager.getString(exacAfrMaf)).append(","); sb.append(FormatManager.getString(exacAmrMaf)).append(","); sb.append(FormatManager.getString(exacEasMaf)).append(","); sb.append(FormatManager.getString(exacSasMaf)).append(","); sb.append(FormatManager.getString(exacFinMaf)).append(","); sb.append(FormatManager.getString(exacNfeMaf)).append(","); sb.append(FormatManager.getString(exacOthMaf)).append(","); sb.append(FormatManager.getString(evsEurMaf)).append(","); sb.append(FormatManager.getString(evsAfrMaf)).append(","); sb.append(FormatManager.getString(evsAllMaf)).append(","); sb.append(annotation.getGeneName()).append(","); sb.append(annotation.getTranscript()).append(","); sb.append(annotation.getCanonical()).append(","); sb.append(annotation.getCodonChange()).append(","); sb.append(annotation.getAaChange()).append(","); sb.append(annotation.getCcds()).append(","); sb.append(annotation.getConsequence()).append(","); sb.append(FormatManager.getString(cScore)).append(","); sb.append(annotation.getPolyphenHumvar()).append(","); sb.append(annotation.getSift()).append(","); sb.append(evsFilter).append(","); sb.append(annodbFilter).append(","); sb.append(hweFilter).append("\n"); } return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: src/main/java/object/Variant.java Repository: nickzren/alsdb The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15021
MEDIUM
5.2
nickzren/alsdb
toString
src/main/java/object/Variant.java
cbc79a68145e845f951113d184b4de207c341599
0
Analyze the following code function for security vulnerabilities
public String buildQuery( String[] projectionIn, String selection, String groupBy, String having, String sortOrder, String limit) { String[] projection = computeProjection(projectionIn); StringBuilder where = new StringBuilder(); boolean hasBaseWhereClause = mWhereClause != null && mWhereClause.length() > 0; if (hasBaseWhereClause) { where.append(mWhereClause.toString()); where.append(')'); } // Tack on the user's selection, if present. if (selection != null && selection.length() > 0) { if (hasBaseWhereClause) { where.append(" AND "); } where.append('('); where.append(selection); where.append(')'); } return buildQueryString( mDistinct, mTables, projection, where.toString(), groupBy, having, sortOrder, limit); }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2018-9493 - Severity: LOW - CVSS Score: 2.1 Description: DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete. Developers often accept selection clauses from untrusted code, and SQLiteQueryBuilder already supports a "strict" mode to help catch SQL injection attacks. This change extends the builder to support update() and delete() calls, so that we can help secure those selection clauses too. Bug: 111085900 Test: atest packages/providers/DownloadProvider/tests/ Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java Change-Id: Ib4fc8400f184755ee7e971ab5f2095186341730c Merged-In: Ib4fc8400f184755ee7e971ab5f2095186341730c (cherry picked from commit 506994268bc4fa07d8798b7737a2952f74b8fd04) Function: buildQuery File: core/java/android/database/sqlite/SQLiteQueryBuilder.java Repository: android Fixed Code: public String buildQuery( String[] projectionIn, String selection, String groupBy, String having, String sortOrder, String limit) { String[] projection = computeProjection(projectionIn); String where = computeWhere(selection); return buildQueryString( mDistinct, mTables, projection, where, groupBy, having, sortOrder, limit); }
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
buildQuery
core/java/android/database/sqlite/SQLiteQueryBuilder.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
1
Analyze the following code function for security vulnerabilities
public long count() { return findFirst("select count(1) as count from " + TABLE_NAME + " where rubbish=? and privacy=?", false, false).getLong("count"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: count File: data/src/main/java/com/zrlog/model/Log.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-17420
MEDIUM
6.5
94fzb/zrlog
count
data/src/main/java/com/zrlog/model/Log.java
157b8fbbb64eb22ddb52e7c5754e88180b7c3d4f
0
Analyze the following code function for security vulnerabilities
private void doStep(Context context, HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo, int stepNumber) throws ServletException, IOException, SQLException, AuthorizeException { SubmissionStepConfig currentStepConfig = null; if (subInfo.getSubmissionConfig() != null) { // get step to perform currentStepConfig = subInfo.getSubmissionConfig().getStep(stepNumber); } else { log.fatal(LogManager.getHeader(context, "no_submission_process", "trying to load step=" + stepNumber + ", but submission process is null")); JSPManager.showInternalError(request, response); } // if this is the furthest step the user has been to, save that info if (!subInfo.isInWorkflow() && (currentStepConfig.getStepNumber() > getStepReached(subInfo))) { // update submission info userHasReached(subInfo, currentStepConfig.getStepNumber()); // commit changes to database context.commit(); // flag that we just started this step (for JSPStepManager class) setBeginningOfStep(request, true); } // save current step to request attribute saveCurrentStepConfig(request, currentStepConfig); log.debug("Calling Step Class: '" + currentStepConfig.getProcessingClassName() + "'"); try { JSPStepManager stepManager = JSPStepManager.loadStep(currentStepConfig); //tell the step class to do its processing boolean stepFinished = stepManager.processStep(context, request, response, subInfo); //if this step is finished, continue to next step if(stepFinished) { // If we finished up an upload, then we need to change // the FileUploadRequest object back to a normal HTTPServletRequest if(request instanceof FileUploadRequest) { request = ((FileUploadRequest)request).getOriginalRequest(); } //retrieve any changes to the SubmissionInfo object subInfo = getSubmissionInfo(context, request); //do the next step! doNextStep(context, request, response, subInfo, currentStepConfig); } else { //commit & close context context.complete(); } } catch (Exception e) { log.error("Error loading step class'" + currentStepConfig.getProcessingClassName() + "':", e); JSPManager.showInternalError(request, response); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doStep File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
doStep
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
boolean resumeHomeStackTask(int homeStackTaskType, ActivityRecord prev, String reason) { if (!mService.mBooting && !mService.mBooted) { // Not ready yet! return false; } if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) { mWindowManager.showRecentApps(); return false; } if (prev != null) { prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE); } mHomeStack.moveHomeStackTaskToTop(homeStackTaskType); ActivityRecord r = getHomeActivity(); if (r != null) { mService.setFocusedActivityLocked(r, reason); return resumeTopActivitiesLocked(mHomeStack, prev, null); } return mService.startHomeActivityLocked(mCurrentUser, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resumeHomeStackTask File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
resumeHomeStackTask
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
private static String getFileName(@NonNull String path) { final int sep = path.lastIndexOf(File.separatorChar); if (sep == -1) { return path; } else { return path.substring(sep + 1); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileName 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
getFileName
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
@Override protected void onFullBinaryMessage(WebSocketChannel channel, BufferedBinaryMessage message) { if(session.isSessionClosed()) { //to bad, the channel has already been closed //we just ignore messages that are received after we have closed, as the endpoint is no longer in a valid state to deal with them //this this should only happen if a message was on the wire when we called close() message.getData().close(); return; } HandlerWrapper handler = getHandler(FrameType.BYTE); if (handler != null) { invokeBinaryHandler(message, handler, true); } else { message.getData().close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onFullBinaryMessage File: websockets-jsr/src/main/java/io/undertow/websockets/jsr/FrameHandler.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-3690
HIGH
7.5
undertow-io/undertow
onFullBinaryMessage
websockets-jsr/src/main/java/io/undertow/websockets/jsr/FrameHandler.java
c7e84a0b7efced38506d7d1dfea5902366973877
0
Analyze the following code function for security vulnerabilities
@Override public void setUsbDataSignalingEnabled(String packageName, boolean enabled) { Objects.requireNonNull(packageName, "Admin package name must be provided"); final CallerIdentity caller = getCallerIdentity(packageName); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller), "USB data signaling can only be controlled by a device owner or " + "a profile owner on an organization-owned device."); Preconditions.checkState(canUsbDataSignalingBeDisabled(), "USB data signaling cannot be disabled."); synchronized (getLockObject()) { final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); if (admin.mUsbDataSignalingEnabled != enabled) { admin.mUsbDataSignalingEnabled = enabled; saveSettingsLocked(caller.getUserId()); updateUsbDataSignal(); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_USB_DATA_SIGNALING) .setAdmin(packageName) .setBoolean(enabled) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUsbDataSignalingEnabled 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
setUsbDataSignalingEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static int defaultRequestCompressionLevel() { return Integer.getInteger(ASYNC_CLIENT + "requestCompressionLevel", -1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultRequestCompressionLevel File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7398
MEDIUM
4.3
AsyncHttpClient/async-http-client
defaultRequestCompressionLevel
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
public static CiphertextHeader decode(final InputStream input) throws EncodingException, StreamException { final int length = ByteUtil.readInt(input); if (length < 0) { throw new EncodingException("Invalid ciphertext header length: " + length); } final byte[] nonce; int nonceLen = 0; try { nonceLen = ByteUtil.readInt(input); nonce = new byte[nonceLen]; input.read(nonce); } catch (ArrayIndexOutOfBoundsException e) { throw new EncodingException("Invalid nonce length: " + nonceLen); } catch (IOException e) { throw new StreamException(e); } String keyName = null; if (length > nonce.length + 8) { final byte[] b; int keyLen = 0; try { keyLen = ByteUtil.readInt(input); b = new byte[keyLen]; input.read(b); } catch (ArrayIndexOutOfBoundsException e) { throw new EncodingException("Invalid key length: " + keyLen); } catch (IOException e) { throw new StreamException(e); } keyName = new String(b); } return new CiphertextHeader(nonce, keyName); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2020-7226 - Severity: MEDIUM - CVSS Score: 5.0 Description: Define new ciphertext header format. New format does not allocate any memory until HMAC check passes, which guards against untrusted input. All encryption components have been updated to use the new header, while preserving backward compatibility to decrypt messages encrypted with the old format. The decoding process for the old header has been hardened to impose reasonable limits on header fields: nonce sizes up to 255 bytes, key names up to 500 bytes. Fixes #52. Function: decode File: src/main/java/org/cryptacular/CiphertextHeader.java Repository: vt-middleware/cryptacular Fixed Code: public static CiphertextHeader decode(final InputStream input) throws EncodingException, StreamException { final int length = ByteUtil.readInt(input); if (length < 0) { throw new EncodingException("Bad ciphertext header"); } final byte[] nonce; int nonceLen = 0; try { nonceLen = ByteUtil.readInt(input); if (nonceLen > MAX_NONCE_LEN) { throw new EncodingException("Bad ciphertext header: maximum nonce size exceeded"); } nonce = new byte[nonceLen]; input.read(nonce); } catch (ArrayIndexOutOfBoundsException e) { throw new EncodingException("Bad ciphertext header"); } catch (IOException e) { throw new StreamException(e); } String keyName = null; if (length > nonce.length + 8) { final byte[] b; int keyLen = 0; try { keyLen = ByteUtil.readInt(input); if (keyLen > MAX_KEYNAME_LEN) { throw new EncodingException("Bad ciphertext header: maximum key length exceeded"); } b = new byte[keyLen]; input.read(b); } catch (ArrayIndexOutOfBoundsException e) { throw new EncodingException("Bad ciphertext header"); } catch (IOException e) { throw new StreamException(e); } keyName = new String(b); } return new CiphertextHeader(nonce, keyName); }
[ "CWE-770" ]
CVE-2020-7226
MEDIUM
5
vt-middleware/cryptacular
decode
src/main/java/org/cryptacular/CiphertextHeader.java
8c6c7528f1e24c6b71f3e36db0cb8a697256ce25
1
Analyze the following code function for security vulnerabilities
private void startL3Provisioning() { WifiConfiguration currentConfig = getConnectedWifiConfigurationInternal(); if (mIpClientWithPreConnection && mIpClient != null) { mIpClient.notifyPreconnectionComplete(mSentHLPs); mIpClientWithPreConnection = false; mSentHLPs = false; } else { startIpClient(currentConfig, false); } // Get Link layer stats so as we get fresh tx packet counters getWifiLinkLayerStats(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startL3Provisioning 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
startL3Provisioning
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void addField(String field) { this.fields.add(field); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addField File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34602
HIGH
7.5
jeecgboot/jeecg-boot
addField
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java
dd7bf104e7ed59142909567ecd004335c3442ec5
0
Analyze the following code function for security vulnerabilities
public void startListening() { int[] updatedIds; ArrayList<RemoteViews> updatedViews = new ArrayList<RemoteViews>(); try { updatedIds = sService.startListening(mCallbacks, mContextOpPackageName, mHostId, updatedViews); } catch (RemoteException e) { throw new RuntimeException("system server dead?", e); } final int N = updatedIds.length; for (int i = 0; i < N; i++) { updateAppWidgetView(updatedIds[i], updatedViews.get(i)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startListening File: core/java/android/appwidget/AppWidgetHost.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
startListening
core/java/android/appwidget/AppWidgetHost.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
CacheKeyGenerator getCachePutKeyGenerator(AnnotationValue<CachePut> cacheConfig) { return cacheConfig.get(MEMBER_KEY_GENERATOR, CacheKeyGenerator.class).orElseGet(() -> getKeyGenerator(cacheConfig.get(MEMBER_KEY_GENERATOR, Class.class).orElse(null)) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCachePutKeyGenerator 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
getCachePutKeyGenerator
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") static List<External> parseExternalsFile(AbstractProject project) throws IOException { File file = getExternalsFile(project); if(file.exists()) { try { return (List<External>)new XmlFile(External.XSTREAM,file).read(); } catch (IOException e) { // in < 1.180 this file was a text file, so it may fail to parse as XML, // in which case let's just fall back } } return Collections.emptyList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseExternalsFile File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
parseExternalsFile
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
public boolean rowDeleted() throws SQLException { checkClosed(); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rowDeleted File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
rowDeleted
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
protected boolean isFromChangeRequest(HttpServletRequest request) { return StringUtils.equals(request.getParameter(FROM_CHANGE_REQUEST_PARAMETER), "1"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFromChangeRequest File: application-changerequest-default/src/main/java/org/xwiki/contrib/changerequest/internal/handlers/AbstractChangeRequestActionHandler.java Repository: xwiki-contrib/application-changerequest The code follows secure coding practices.
[ "CWE-522" ]
CVE-2023-49280
MEDIUM
6.5
xwiki-contrib/application-changerequest
isFromChangeRequest
application-changerequest-default/src/main/java/org/xwiki/contrib/changerequest/internal/handlers/AbstractChangeRequestActionHandler.java
ff0f5368ea04f0e4aa7b33821c707dc68a8c5ca8
0
Analyze the following code function for security vulnerabilities
@Override public boolean isKeyguardSecure() { long origId = Binder.clearCallingIdentity(); try { return mPolicy.isKeyguardSecure(); } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isKeyguardSecure File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
isKeyguardSecure
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@SuppressFBWarnings("EI_EXPOSE_REP") public SgmlPage getPage() { return page_; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPage File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
getPage
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
public static String fixName(final String name) { return fixName(null, name, null); }
Vulnerability Classification: - CWE: CWE-917 - CVE: CVE-2022-24818 - Severity: HIGH - CVSS Score: 7.5 Description: [GEOT-7115] Streamline JNDI lookups Function: fixName File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java Repository: geotools Fixed Code: @Deprecated public static String fixName(final String name) { return fixName(null, name, null); }
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
fixName
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
1
Analyze the following code function for security vulnerabilities
@Override public void initialize(SQLiteDatabase db) { // Get the lockscreen default from a system property, if available boolean lockScreenDisable = SystemProperties.getBoolean( "ro.lockscreen.disable.default", false); if (lockScreenDisable) { mStorage.writeKeyValue(db, LockPatternUtils.DISABLE_LOCKSCREEN_KEY, "1", 0); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialize File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
initialize
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
@Override public int getFlagsForUid(int uid) { synchronized (mPackages) { Object obj = mSettings.getUserIdLPr(UserHandle.getAppId(uid)); if (obj instanceof SharedUserSetting) { final SharedUserSetting sus = (SharedUserSetting) obj; return sus.pkgFlags; } else if (obj instanceof PackageSetting) { final PackageSetting ps = (PackageSetting) obj; return ps.pkgFlags; } } return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFlagsForUid File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
getFlagsForUid
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public int getConnectionTimeoutInMs() { return connectionTimeOutInMs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectionTimeoutInMs File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
getConnectionTimeoutInMs
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@NonNull public Builder setRemoteInputHistory(RemoteInputHistoryItem[] items) { if (items == null) { mN.extras.putParcelableArray(EXTRA_REMOTE_INPUT_HISTORY_ITEMS, null); } else { final int itemCount = Math.min(MAX_REPLY_HISTORY, items.length); RemoteInputHistoryItem[] history = new RemoteInputHistoryItem[itemCount]; for (int i = 0; i < itemCount; i++) { history[i] = items[i]; } mN.extras.putParcelableArray(EXTRA_REMOTE_INPUT_HISTORY_ITEMS, history); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRemoteInputHistory File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setRemoteInputHistory
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public void startActivity(Intent intent, boolean onlyProvisioned, boolean dismissShade) { startActivityDismissingKeyguard(intent, onlyProvisioned, dismissShade); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivity 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
startActivity
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String urlParam = request.getParameter("url"); if (Utils.sanitizeUrl(urlParam)) { // build the UML source from the compressed request parameter String ref = request.getHeader("referer"); String ua = request.getHeader("User-Agent"); String auth = request.getHeader("Authorization"); String dom = getCorsDomain(ref, ua); try(OutputStream out = response.getOutputStream()) { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); URL url = new URL(urlParam); URLConnection connection = url.openConnection(); connection.setConnectTimeout(TIMEOUT); connection.setReadTimeout(TIMEOUT); response.setHeader("Cache-Control", "private, max-age=86400"); // Workaround for 451 response from Iconfinder CDN connection.setRequestProperty("User-Agent", "draw.io"); //Forward auth header (Only in GAE and not protected by AUTH itself) if (IS_GAE && auth != null) { connection.setRequestProperty("Authorization", auth); } if (dom != null && dom.length() > 0) { response.addHeader("Access-Control-Allow-Origin", dom); } // Status code pass-through and follow redirects if (connection instanceof HttpURLConnection) { ((HttpURLConnection) connection) .setInstanceFollowRedirects(false); int status = ((HttpURLConnection) connection) .getResponseCode(); int counter = 0; // Follows a maximum of 6 redirects while (counter++ <= 6 && (int)(status / 10) == 30) //Any redirect status 30x { String redirectUrl = connection.getHeaderField("Location"); if (!Utils.sanitizeUrl(redirectUrl)) { break; } url = new URL(redirectUrl); connection = url.openConnection(); ((HttpURLConnection) connection) .setInstanceFollowRedirects(false); connection.setConnectTimeout(TIMEOUT); connection.setReadTimeout(TIMEOUT); // Workaround for 451 response from Iconfinder CDN connection.setRequestProperty("User-Agent", "draw.io"); status = ((HttpURLConnection) connection) .getResponseCode(); } if (status >= 200 && status <= 299) { response.setStatus(status); String contentLength = connection.getHeaderField("Content-Length"); // If content length is available, use it to enforce maximum size if (contentLength != null && Long.parseLong(contentLength) > Utils.MAX_SIZE) { throw new SizeLimitExceededException(); } // Copies input stream to output stream InputStream is = connection.getInputStream(); byte[] head = (contentAlwaysAllowed(urlParam)) ? emptyBytes : Utils.checkStreamContent(is); response.setContentType("application/octet-stream"); String base64 = request.getParameter("base64"); copyResponse(is, out, head, base64 != null && base64.equals("1")); } else { response.setStatus(HttpURLConnection.HTTP_PRECON_FAILED); } } else { response.setStatus(HttpURLConnection.HTTP_UNSUPPORTED_TYPE); } out.flush(); log.log(Level.FINEST, "processed proxy request: url=" + ((urlParam != null) ? urlParam : "[null]") + ", referer=" + ((ref != null) ? ref : "[null]") + ", user agent=" + ((ua != null) ? ua : "[null]")); } catch (DeadlineExceededException e) { response.setStatus(HttpServletResponse.SC_REQUEST_TIMEOUT); } catch (UnknownHostException | FileNotFoundException e) { // do not log 404 and DNS errors response.setStatus(HttpServletResponse.SC_NOT_FOUND); } catch (UnsupportedContentException e) { response.setStatus(HttpServletResponse.SC_FORBIDDEN); log.log(Level.SEVERE, "proxy request with invalid content: url=" + ((urlParam != null) ? urlParam : "[null]") + ", referer=" + ((ref != null) ? ref : "[null]") + ", user agent=" + ((ua != null) ? ua : "[null]")); } catch (SizeLimitExceededException e) { response.setStatus(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE); throw e; } catch (Exception e) { response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR); log.log(Level.FINE, "proxy request failed: url=" + ((urlParam != null) ? urlParam : "[null]") + ", referer=" + ((ref != null) ? ref : "[null]") + ", user agent=" + ((ua != null) ? ua : "[null]")); e.printStackTrace(); throw e; } } else { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); log.log(Level.SEVERE, "proxy request with invalid URL parameter: url=" + ((urlParam != null) ? urlParam : "[null]")); } }
Vulnerability Classification: - CWE: CWE-284, CWE-79 - CVE: CVE-2022-3065 - Severity: HIGH - CVSS Score: 7.5 Description: 20.2.8 release Function: doGet File: src/main/java/com/mxgraph/online/ProxyServlet.java Repository: jgraph/drawio Fixed Code: protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String urlParam = request.getParameter("url"); if (!"1".equals(System.getenv("ENABLE_DRAWIO_PROXY"))) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); } else if (Utils.sanitizeUrl(urlParam)) { // build the UML source from the compressed request parameter String ref = request.getHeader("referer"); String ua = request.getHeader("User-Agent"); String auth = request.getHeader("Authorization"); String dom = getCorsDomain(ref, ua); try(OutputStream out = response.getOutputStream()) { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); URL url = new URL(urlParam); URLConnection connection = url.openConnection(); connection.setConnectTimeout(TIMEOUT); connection.setReadTimeout(TIMEOUT); response.setHeader("Cache-Control", "private, max-age=86400"); // Workaround for 451 response from Iconfinder CDN connection.setRequestProperty("User-Agent", "draw.io"); //Forward auth header (Only in GAE and not protected by AUTH itself) if (IS_GAE && auth != null) { connection.setRequestProperty("Authorization", auth); } if (dom != null && dom.length() > 0) { response.addHeader("Access-Control-Allow-Origin", dom); } // Status code pass-through and follow redirects if (connection instanceof HttpURLConnection) { ((HttpURLConnection) connection) .setInstanceFollowRedirects(false); int status = ((HttpURLConnection) connection) .getResponseCode(); int counter = 0; // Follows a maximum of 6 redirects while (counter++ <= 6 && (int)(status / 10) == 30) //Any redirect status 30x { String redirectUrl = connection.getHeaderField("Location"); if (!Utils.sanitizeUrl(redirectUrl)) { break; } url = new URL(redirectUrl); connection = url.openConnection(); ((HttpURLConnection) connection) .setInstanceFollowRedirects(false); connection.setConnectTimeout(TIMEOUT); connection.setReadTimeout(TIMEOUT); // Workaround for 451 response from Iconfinder CDN connection.setRequestProperty("User-Agent", "draw.io"); status = ((HttpURLConnection) connection) .getResponseCode(); } if (status >= 200 && status <= 299) { response.setStatus(status); String contentLength = connection.getHeaderField("Content-Length"); // If content length is available, use it to enforce maximum size if (contentLength != null && Long.parseLong(contentLength) > Utils.MAX_SIZE) { throw new SizeLimitExceededException(); } // Copies input stream to output stream InputStream is = connection.getInputStream(); byte[] head = (contentAlwaysAllowed(urlParam)) ? emptyBytes : Utils.checkStreamContent(is); response.setContentType("application/octet-stream"); String base64 = request.getParameter("base64"); copyResponse(is, out, head, base64 != null && base64.equals("1")); } else { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } else { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } out.flush(); log.log(Level.FINEST, "processed proxy request: url=" + ((urlParam != null) ? urlParam : "[null]") + ", referer=" + ((ref != null) ? ref : "[null]") + ", user agent=" + ((ua != null) ? ua : "[null]")); } catch (DeadlineExceededException e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } catch (UnknownHostException | FileNotFoundException e) { // do not log 404 and DNS errors response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } catch (UnsupportedContentException e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); log.log(Level.SEVERE, "proxy request with invalid content: url=" + ((urlParam != null) ? urlParam : "[null]") + ", referer=" + ((ref != null) ? ref : "[null]") + ", user agent=" + ((ua != null) ? ua : "[null]")); } catch (SizeLimitExceededException e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); throw e; } catch (Exception e) { response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR); log.log(Level.FINE, "proxy request failed: url=" + ((urlParam != null) ? urlParam : "[null]") + ", referer=" + ((ref != null) ? ref : "[null]") + ", user agent=" + ((ua != null) ? ua : "[null]")); e.printStackTrace(); throw e; } } else { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); log.log(Level.SEVERE, "proxy request with invalid URL parameter: url=" + ((urlParam != null) ? urlParam : "[null]")); } }
[ "CWE-284", "CWE-79" ]
CVE-2022-3065
HIGH
7.5
jgraph/drawio
doGet
src/main/java/com/mxgraph/online/ProxyServlet.java
59887e45b36f06c8dd4919a32bacd994d9f084da
1
Analyze the following code function for security vulnerabilities
public boolean resourceAvailableLocally(String s) { return jarEntries.contains(s); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resourceAvailableLocally File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
resourceAvailableLocally
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
protected void setEnableSessionCreation(boolean flag) { enable_session_creation = flag; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEnableSessionCreation File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
setEnableSessionCreation
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
private static List<Element> getChildren(final String name, final Node node) { final NodeList children = node.getChildNodes(); return IntStream.range(0, children.getLength()) .mapToObj(children::item) .filter(current -> current.getNodeName().equals(name)) .map(Element.class::cast) .collect(Collectors.toList()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChildren File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
getChildren
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
protected void addAvailable() { // go through available, check tracker for it and all of its // part brothers being available immediately, add them. for (int i = 1; i < loaders.length; i++) { loaders[i].addAvailable(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAvailable File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
addAvailable
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
private void buildCustomField(IssuesDao data) { CustomFieldIssuesExample example = new CustomFieldIssuesExample(); example.createCriteria().andResourceIdEqualTo(data.getId()); List<CustomFieldIssues> customFieldTestCases = customFieldIssuesMapper.selectByExample(example); List<CustomFieldDao> fields = new ArrayList<>(); customFieldTestCases.forEach(i -> { CustomFieldDao customFieldDao = new CustomFieldDao(); customFieldDao.setId(i.getFieldId()); customFieldDao.setValue(i.getValue()); customFieldDao.setTextValue(i.getTextValue()); fields.add(customFieldDao); }); data.setFields(fields); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildCustomField File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
buildCustomField
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public Map<?, ?> expand() { if (!isExpandable()) { throw new RuntimeException(name + " is not expandable"); } return (Map<?, ?>) getValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: expand File: varexport/src/main/java/com/indeed/util/varexport/Variable.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
expand
varexport/src/main/java/com/indeed/util/varexport/Variable.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
protected void onActivityResult(int requestCode, int resultCode, final Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_INVITE_TO_CONVERSATION && resultCode == RESULT_OK) { mPendingConferenceInvite = ConferenceInvite.parse(data); if (xmppConnectionServiceBound && mPendingConferenceInvite != null) { if (mPendingConferenceInvite.execute(this)) { mToast = Toast.makeText(this, R.string.creating_conference, Toast.LENGTH_LONG); mToast.show(); } mPendingConferenceInvite = null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onActivityResult File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onActivityResult
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public void setServerSideKeygenP12Passwd(String serverSideKeygenP12Passwd) { this.serverSideKeygenP12Passwd = serverSideKeygenP12Passwd; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServerSideKeygenP12Passwd File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setServerSideKeygenP12Passwd
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public void setPermissionPolicy(@NonNull ComponentName admin, int policy) { throwIfParentInstance("setPermissionPolicy"); try { mService.setPermissionPolicy(admin, mContext.getPackageName(), policy); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPermissionPolicy File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setPermissionPolicy
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void fixUpIncomingShortcutInfo(@NonNull ShortcutInfo shortcut, boolean forUpdate, boolean forPinRequest) { if (shortcut.isReturnedByServer()) { Log.w(TAG, "Re-publishing ShortcutInfo returned by server is not supported." + " Some information such as icon may lost from shortcut."); } Objects.requireNonNull(shortcut, "Null shortcut detected"); if (shortcut.getActivity() != null) { Preconditions.checkState( shortcut.getPackage().equals(shortcut.getActivity().getPackageName()), "Cannot publish shortcut: activity " + shortcut.getActivity() + " does not" + " belong to package " + shortcut.getPackage()); Preconditions.checkState( injectIsMainActivity(shortcut.getActivity(), shortcut.getUserId()), "Cannot publish shortcut: activity " + shortcut.getActivity() + " is not" + " main activity"); } if (!forUpdate) { shortcut.enforceMandatoryFields(/* forPinned= */ forPinRequest); if (!forPinRequest) { Preconditions.checkState(shortcut.getActivity() != null, "Cannot publish shortcut: target activity is not set"); } } if (shortcut.getIcon() != null) { ShortcutInfo.validateIcon(shortcut.getIcon()); } shortcut.replaceFlags(shortcut.getFlags() & ShortcutInfo.FLAG_LONG_LIVED); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-45774 - Severity: HIGH - CVSS Score: 7.8 Description: Validate URI-based shortcut icon at creation time. Bug: 288113797 Test: manual (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3d41fb7620ffb9c81b23977c8367c323e4721e65) Merged-In: I392f8e923923bf40827a2b6207c4eaa262694fbc Change-Id: I392f8e923923bf40827a2b6207c4eaa262694fbc Function: fixUpIncomingShortcutInfo File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android Fixed Code: private void fixUpIncomingShortcutInfo(@NonNull ShortcutInfo shortcut, boolean forUpdate, boolean forPinRequest) { if (shortcut.isReturnedByServer()) { Log.w(TAG, "Re-publishing ShortcutInfo returned by server is not supported." + " Some information such as icon may lost from shortcut."); } Objects.requireNonNull(shortcut, "Null shortcut detected"); if (shortcut.getActivity() != null) { Preconditions.checkState( shortcut.getPackage().equals(shortcut.getActivity().getPackageName()), "Cannot publish shortcut: activity " + shortcut.getActivity() + " does not" + " belong to package " + shortcut.getPackage()); Preconditions.checkState( injectIsMainActivity(shortcut.getActivity(), shortcut.getUserId()), "Cannot publish shortcut: activity " + shortcut.getActivity() + " is not" + " main activity"); } if (!forUpdate) { shortcut.enforceMandatoryFields(/* forPinned= */ forPinRequest); if (!forPinRequest) { Preconditions.checkState(shortcut.getActivity() != null, "Cannot publish shortcut: target activity is not set"); } } if (shortcut.getIcon() != null) { ShortcutInfo.validateIcon(shortcut.getIcon()); validateIconURI(shortcut); } shortcut.replaceFlags(shortcut.getFlags() & ShortcutInfo.FLAG_LONG_LIVED); }
[ "CWE-Other" ]
CVE-2023-45774
HIGH
7.8
android
fixUpIncomingShortcutInfo
services/core/java/com/android/server/pm/ShortcutService.java
f229f0e55b07416badaca0e3493db5af0943c9eb
1
Analyze the following code function for security vulnerabilities
protected Object resolveSchemaSource() { InputSource inputSource = null; InputStream is = null; try { is = classLoadHelper.getResourceAsStream(QUARTZ_XSD_PATH_IN_JAR); } finally { if (is != null) { inputSource = new InputSource(is); inputSource.setSystemId(QUARTZ_SCHEMA_WEB_URL); log.debug("Utilizing schema packaged in local quartz distribution jar."); } else { log.info("Unable to load local schema packaged in quartz distribution jar. Utilizing schema online at " + QUARTZ_SCHEMA_WEB_URL); return QUARTZ_SCHEMA_WEB_URL; } } return inputSource; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveSchemaSource File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java Repository: quartz-scheduler/quartz The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-13990
HIGH
7.5
quartz-scheduler/quartz
resolveSchemaSource
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
0
Analyze the following code function for security vulnerabilities
public static boolean isValidCompressedBuffer(byte[] input, int offset, int length) throws IOException { if (input == null) { throw new NullPointerException("input is null"); } return impl.isValidCompressedBuffer(input, offset, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidCompressedBuffer File: src/main/java/org/xerial/snappy/Snappy.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34454
HIGH
7.5
xerial/snappy-java
isValidCompressedBuffer
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
public void refreshLinks() throws XWikiException { if (hasAdminRights()) { this.xwiki.refreshLinks(getXWikiContext()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: refreshLinks 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
refreshLinks
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 int getTypeId() { return JAVA_DEFAULT_TYPE_ENUM; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTypeId File: hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
getTypeId
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private void showEncryptionNotification(UserHandle user) { Resources r = mContext.getResources(); CharSequence title = r.getText( com.android.internal.R.string.user_encrypted_title); CharSequence message = r.getText( com.android.internal.R.string.user_encrypted_message); CharSequence detail = r.getText( com.android.internal.R.string.user_encrypted_detail); PendingIntent intent = PendingIntent.getBroadcast(mContext, 0, ACTION_NULL, PendingIntent.FLAG_UPDATE_CURRENT); showEncryptionNotification(user, title, message, detail, intent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showEncryptionNotification File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
showEncryptionNotification
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
protected void handleFinishedGoingToSleep(int arg1) { mGoingToSleep = false; final int count = mCallbacks.size(); for (int i = 0; i < count; i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onFinishedGoingToSleep(arg1); } } updateFingerprintListeningState(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleFinishedGoingToSleep File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
handleFinishedGoingToSleep
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public void failJob(Stage stage, JobInstance instance) { instance.completing(Failed); instance.completed(new Date()); jobInstanceDao.updateStateAndResult(instance); stage.calculateResult(); updateResultInTransaction(stage, stage.getResult()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: failJob File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
failJob
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
boolean canResumeByCompat() { return app == null || app.updateTopResumingActivityInProcessIfNeeded(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canResumeByCompat 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
canResumeByCompat
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public Builder setSpdyMaxConcurrentStreams(int spdyMaxConcurrentStreams) { this.spdyMaxConcurrentStreams = spdyMaxConcurrentStreams; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSpdyMaxConcurrentStreams File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setSpdyMaxConcurrentStreams
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@Override public void init(boolean forward) throws CertPathValidatorException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: src/platform/java/org/conscrypt/TrustManagerImpl.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-345" ]
CVE-2016-0818
MEDIUM
4.3
android
init
src/platform/java/org/conscrypt/TrustManagerImpl.java
c4ab1b959280413fb11bf4fd7f6b4c2ba38bd779
0
Analyze the following code function for security vulnerabilities
public ParceledListSlice<ConversationChannelWrapper> getConversations(String pkg, int uid) { try { return sINM.getConversationsForPackage(pkg, uid); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return ParceledListSlice.emptyList(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConversations File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
getConversations
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
@Override RemoteAnimationDefinition getRemoteAnimationDefinition() { return mRemoteAnimationDefinition; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRemoteAnimationDefinition 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
getRemoteAnimationDefinition
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public long replace(ContentValues values) { return insertInternal(values, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replace File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
replace
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
@NonNull public Builder addOpenFlags(@DatabaseOpenFlags int openFlags) { mOpenFlags |= openFlags; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addOpenFlags File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
addOpenFlags
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public JsonNode errorsAsJson(Lang lang) { Map<String, List<String>> allMessages = new HashMap<>(); errors.forEach( error -> { if (error != null) { final List<String> messages = new ArrayList<>(); if (messagesApi != null && lang != null) { final List<String> reversedMessages = new ArrayList<>(error.messages()); Collections.reverse(reversedMessages); messages.add( messagesApi.get( lang, reversedMessages, translate(error.arguments(), new MessagesImpl(lang, this.messagesApi)))); } else { messages.add(error.message()); } allMessages.put(error.key(), messages); } }); return play.libs.Json.toJson(allMessages); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: errorsAsJson File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
errorsAsJson
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
public static int defaultIoThreadMultiplier() { return Integer.getInteger(ASYNC_CLIENT + "ioThreadMultiplier", 2); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultIoThreadMultiplier File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7398
MEDIUM
4.3
AsyncHttpClient/async-http-client
defaultIoThreadMultiplier
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
public void addListenerLocked(IOnPermissionsChangeListener listener) { mPermissionListeners.register(listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addListenerLocked File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
addListenerLocked
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
protected LdapContext constructLdapContext(String namingProviderURL, String dn, Object credential, String authentication) throws LoginException { try { Properties env = constructLdapContextEnvironment(namingProviderURL, dn, credential, authentication); return new InitialLdapContext(env, null); } catch (NamingException e) { LoginException le = new LoginException("Unable to create new InitialLdapContext"); le.initCause(e); throw le; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: constructLdapContext File: jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java Repository: wildfly-security/jboss-negotiation The code follows secure coding practices.
[ "CWE-200" ]
CVE-2015-1849
MEDIUM
4.3
wildfly-security/jboss-negotiation
constructLdapContext
jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java
0dc9d191b6eb1d13b8f0189c5b02ba6576f4722e
0
Analyze the following code function for security vulnerabilities
public void pause() { this.paused = true; if (singleDownloadRunnable != null) singleDownloadRunnable.pause(); @SuppressWarnings("unchecked") ArrayList<DownloadRunnable> pauseList = (ArrayList<DownloadRunnable>) downloadRunnableList.clone(); for (DownloadRunnable runnable : pauseList) { if (runnable != null) { runnable.pause(); // if runnable is null, then that one must be completed and removed } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pause File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
pause
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
@PutMapping(value = "/{id}") public Result edit(@PathVariable Integer id, @RequestBody Map<String, String> body) { User user = getApiUser(); String title = body.get("title"); String content = body.get("content"); ApiAssert.notEmpty(title, "请输入标题"); // 更新话题 Topic topic = topicService.selectById(id); ApiAssert.isTrue(topic.getUserId().equals(user.getId()), "谁给你的权限修改别人的话题的?"); topic.setTitle(Jsoup.clean(title, Whitelist.none().addTags("video"))); topic.setContent(content); topic.setModifyTime(new Date()); topicService.update(topic, null); topic.setContent(SensitiveWordUtil.replaceSensitiveWord(topic.getContent(), "*", SensitiveWordUtil.MinMatchType)); return success(topic); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: edit File: src/main/java/co/yiiu/pybbs/controller/api/TopicApiController.java Repository: atjiu/pybbs The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
edit
src/main/java/co/yiiu/pybbs/controller/api/TopicApiController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
0
Analyze the following code function for security vulnerabilities
@Override public boolean stop() { if (scheduledExecutorService != null) { scheduledExecutorService.shutdown(); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stop File: web/src/main/java/com/zrlog/web/plugin/UpdateVersionPlugin.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
stop
web/src/main/java/com/zrlog/web/plugin/UpdateVersionPlugin.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
public static boolean zip(String sourceFilePath, String zipFilePath) throws IOException { return zip(sourceFilePath, zipFilePath, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: zip File: publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/ZipUtils.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-434" ]
CVE-2018-12914
HIGH
7.5
sanluan/PublicCMS
zip
publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/ZipUtils.java
c19fe66378c75725f3e3a380a6cb9f8b8a7dcb71
0
Analyze the following code function for security vulnerabilities
public boolean getUseDesktopUserAgent() { if (mNativeContentViewCore != 0) { return nativeGetUseDesktopUserAgent(mNativeContentViewCore); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUseDesktopUserAgent File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getUseDesktopUserAgent
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0