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
protected static ByteBuffer toBuffer(ByteBuffer... payload) { if (payload.length == 1) { return payload[0]; } int size = (int) Buffers.remaining(payload); if (size == 0) { return Buffers.EMPTY_BYTE_BUFFER; } ByteBuffer buffer = ByteBuffer.allocate(size); for (ByteBuffer buf : payload) { buffer.put(buf); } buffer.flip(); return buffer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toBuffer 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
toBuffer
websockets-jsr/src/main/java/io/undertow/websockets/jsr/FrameHandler.java
c7e84a0b7efced38506d7d1dfea5902366973877
0
Analyze the following code function for security vulnerabilities
@PUT @Path("test/{nodeId}/configuration") @Operation(summary = "Attach the run-time configuration", description = "This attaches the run-time configuration onto a given survey element") @ApiResponse(responseCode = "200", description = "The test node configuration", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = SurveyConfigVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = SurveyConfigVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or task node not found") @ApiResponse(responseCode = "406", description = "The call is not applicable to survey course node") @ApiResponse(responseCode = "409", description = "The configuration is not valid") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response addTestConfiguration(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @QueryParam("allowCancel") @DefaultValue("false") Boolean allowCancel, @QueryParam("allowNavigation") @DefaultValue("false") Boolean allowNavigation, @QueryParam("allowSuspend") @DefaultValue("false") Boolean allowSuspend, @QueryParam("numAttempts") @DefaultValue("0") int numAttempts, @QueryParam("sequencePresentation") @DefaultValue(AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM) String sequencePresentation, @QueryParam("showNavigation") @DefaultValue("true") Boolean showNavigation, @QueryParam("showQuestionTitle") @DefaultValue("true") Boolean showQuestionTitle, @QueryParam("showResultsAfterFinish") @DefaultValue("true") Boolean showResultsAfterFinish, @QueryParam("showResultsDependendOnDate") @DefaultValue("false") String showResultsDependendOnDate, @QueryParam("showResultsOnHomepage") @DefaultValue("false") Boolean showResultsOnHomepage, @QueryParam("showScoreInfo") @DefaultValue("true") Boolean showScoreInfo, @QueryParam("showQuestionProgress") @DefaultValue("true") Boolean showQuestionProgress, @QueryParam("showScoreProgress") @DefaultValue("true") Boolean showScoreProgress, @QueryParam("showSectionsOnly") @DefaultValue("false") Boolean showSectionsOnly, @QueryParam("summaryPresentation") @DefaultValue(AssessmentInstance.QMD_ENTRY_SUMMARY_COMPACT) String summaryPresentation, @QueryParam("startDate") Long startDate, @QueryParam("endDate") Long endDate, @Context HttpServletRequest request) { TestFullConfig config = new TestFullConfig(allowCancel, allowNavigation, allowSuspend, numAttempts, sequencePresentation, showNavigation, showQuestionTitle, showResultsAfterFinish, showResultsDependendOnDate, showResultsOnHomepage, showScoreInfo, showQuestionProgress, showScoreProgress, showSectionsOnly, summaryPresentation, startDate, endDate); return attachNodeConfig(courseId, nodeId, config, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addTestConfiguration File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
addTestConfiguration
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
@Override public void setCallback(Callback qsPanelCallback) { mHeaderQsPanel.setCallback(qsPanelCallback); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCallback File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3886
HIGH
7.2
android
setCallback
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
0
Analyze the following code function for security vulnerabilities
@Override public List<SplitPermissionInfoParcelable> getSplitPermissions() { return mPermissionManagerServiceImpl.getSplitPermissions(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSplitPermissions File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
getSplitPermissions
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
private void UpdateListView() { getNewsReaderDetailFragment().notifyDataSetChangedOnAdapter(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: UpdateListView File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java Repository: nextcloud/news-android The code follows secure coding practices.
[ "CWE-829" ]
CVE-2021-41256
MEDIUM
5.8
nextcloud/news-android
UpdateListView
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
private void dispatchNextRestore() { UnifiedRestoreState nextState = UnifiedRestoreState.FINAL; try { mRestoreDescription = mTransport.nextRestorePackage(); final String pkgName = (mRestoreDescription != null) ? mRestoreDescription.getPackageName() : null; if (pkgName == null) { Slog.e(TAG, "Failure getting next package name"); EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE); nextState = UnifiedRestoreState.FINAL; return; } else if (mRestoreDescription == RestoreDescription.NO_MORE_PACKAGES) { // Yay we've reached the end cleanly if (DEBUG) { Slog.v(TAG, "No more packages; finishing restore"); } int millis = (int) (SystemClock.elapsedRealtime() - mStartRealtime); EventLog.writeEvent(EventLogTags.RESTORE_SUCCESS, mCount, millis); nextState = UnifiedRestoreState.FINAL; return; } if (DEBUG) { Slog.i(TAG, "Next restore package: " + mRestoreDescription); } sendOnRestorePackage(pkgName); Metadata metaInfo = mPmAgent.getRestoredMetadata(pkgName); if (metaInfo == null) { Slog.e(TAG, "No metadata for " + pkgName); EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, pkgName, "Package metadata missing"); nextState = UnifiedRestoreState.RUNNING_QUEUE; return; } try { mCurrentPackage = mPackageManager.getPackageInfo( pkgName, PackageManager.GET_SIGNATURES); } catch (NameNotFoundException e) { // Whoops, we thought we could restore this package but it // turns out not to be present. Skip it. Slog.e(TAG, "Package not present: " + pkgName); EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, pkgName, "Package missing on device"); nextState = UnifiedRestoreState.RUNNING_QUEUE; return; } if (metaInfo.versionCode > mCurrentPackage.versionCode) { // Data is from a "newer" version of the app than we have currently // installed. If the app has not declared that it is prepared to // handle this case, we do not attempt the restore. if ((mCurrentPackage.applicationInfo.flags & ApplicationInfo.FLAG_RESTORE_ANY_VERSION) == 0) { String message = "Version " + metaInfo.versionCode + " > installed version " + mCurrentPackage.versionCode; Slog.w(TAG, "Package " + pkgName + ": " + message); EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, pkgName, message); nextState = UnifiedRestoreState.RUNNING_QUEUE; return; } else { if (DEBUG) Slog.v(TAG, "Version " + metaInfo.versionCode + " > installed " + mCurrentPackage.versionCode + " but restoreAnyVersion"); } } if (MORE_DEBUG) Slog.v(TAG, "Package " + pkgName + " restore version [" + metaInfo.versionCode + "] is compatible with installed version [" + mCurrentPackage.versionCode + "]"); // Reset per-package preconditions and fire the appropriate next state mWidgetData = null; final int type = mRestoreDescription.getDataType(); if (type == RestoreDescription.TYPE_KEY_VALUE) { nextState = UnifiedRestoreState.RESTORE_KEYVALUE; } else if (type == RestoreDescription.TYPE_FULL_STREAM) { nextState = UnifiedRestoreState.RESTORE_FULL; } else { // Unknown restore type; ignore this package and move on Slog.e(TAG, "Unrecognized restore type " + type); nextState = UnifiedRestoreState.RUNNING_QUEUE; return; } } catch (RemoteException e) { Slog.e(TAG, "Can't get next target from transport; ending restore"); EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE); nextState = UnifiedRestoreState.FINAL; return; } finally { executeNextState(nextState); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchNextRestore 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
dispatchNextRestore
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
void setAdminPassword(String password) { if (password == null || password.isEmpty()) { adminPassword = null; return; } if (password.length() == 128) { try { adminPassword = StringUtils.convertHexToBytes(password); return; } catch (Exception ex) {} } byte[] salt = MathUtils.secureRandomBytes(32); byte[] hash = SHA256.getHashWithSalt(password.getBytes(StandardCharsets.UTF_8), salt); byte[] total = Arrays.copyOf(salt, 64); System.arraycopy(hash, 0, total, 32, 32); adminPassword = total; }
Vulnerability Classification: - CWE: CWE-312 - CVE: CVE-2022-45868 - Severity: HIGH - CVSS Score: 7.8 Description: Disallow plain webAdminPassword values to force usage of hashes Function: setAdminPassword File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database Fixed Code: void setAdminPassword(String password) { if (password == null || password.isEmpty()) { adminPassword = null; return; } if (password.length() != 128) { throw new IllegalArgumentException( "Use result of org.h2.server.web.WebServer.encodeAdminPassword(String)"); } adminPassword = StringUtils.convertHexToBytes(password); }
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
setAdminPassword
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
1
Analyze the following code function for security vulnerabilities
private void checkThread() { if (Thread.currentThread() != currentThread && currentThread != null) { throw new UnsupportedOperationException( "This class must be used from a single thread. Use multiple queues for concurrent operations"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkThread File: worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
checkThread
worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
@Override public void disconnect(DisconnectReason reason) { disconnect(reason, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disconnect 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
disconnect
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
public String extractText(InputStream stream, String type, String encoding) throws IOException { try { CharArrayWriter writer = new CharArrayWriter(); ExtractorHandler handler = new ExtractorHandler(writer); // TODO: Use a pull parser to avoid the memory overhead SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = factory.newSAXParser(); XMLReader reader = parser.getXMLReader(); reader.setContentHandler(handler); reader.setErrorHandler(handler); // It is unspecified whether the XML parser closes the stream when // done parsing. To ensure that the stream gets closed just once, // we prevent the parser from closing it by catching the close() // call and explicitly close the stream in a finally block. InputSource source = new InputSource(new FilterInputStream(stream) { public void close() { } }); if (encoding != null) { try { Charset.forName(encoding); source.setEncoding(encoding); } catch (Exception e) { logger.warn("Unsupported encoding '{}', using default ({}) instead.", new Object[]{encoding, System.getProperty("file.encoding")}); } } reader.parse(source); return writer.toString(); } catch (ParserConfigurationException | SAXException e) { logger.warn("Failed to extract XML text content", e); throw new IOException(e.getMessage(), e); } finally { stream.close(); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2021-33950 - Severity: HIGH - CVSS Score: 7.5 Description: XXE injection security vulnerability Fix #287 Function: extractText File: src/main/java/com/openkm/extractor/XMLTextExtractor.java Repository: openkm/document-management-system Fixed Code: public String extractText(InputStream stream, String type, String encoding) throws IOException { try { CharArrayWriter writer = new CharArrayWriter(); ExtractorHandler handler = new ExtractorHandler(writer); // TODO: Use a pull parser to avoid the memory overhead SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = factory.newSAXParser(); XMLReader reader = parser.getXMLReader(); reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); reader.setFeature("http://xml.org/sax/features/external-general-entities", false); reader.setFeature("http://xml.org/sax/features/validation", false); reader.setContentHandler(handler); reader.setErrorHandler(handler); // It is unspecified whether the XML parser closes the stream when // done parsing. To ensure that the stream gets closed just once, // we prevent the parser from closing it by catching the close() // call and explicitly close the stream in a finally block. InputSource source = new InputSource(new FilterInputStream(stream) { public void close() { } }); if (encoding != null) { try { Charset.forName(encoding); source.setEncoding(encoding); } catch (Exception e) { logger.warn("Unsupported encoding '{}', using default ({}) instead.", new Object[]{encoding, System.getProperty("file.encoding")}); } } reader.parse(source); return writer.toString(); } catch (ParserConfigurationException | SAXException e) { logger.warn("Failed to extract XML text content", e); throw new IOException(e.getMessage(), e); } finally { stream.close(); } }
[ "CWE-611" ]
CVE-2021-33950
HIGH
7.5
openkm/document-management-system
extractText
src/main/java/com/openkm/extractor/XMLTextExtractor.java
ce1d82329615aea6aa9f2cc6508c1fe7891e34b5
1
Analyze the following code function for security vulnerabilities
public void setExpungeBatchSize(int theExpungeBatchSize) { myExpungeBatchSize = theExpungeBatchSize; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExpungeBatchSize File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setExpungeBatchSize
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
private void dispatchProcessDied(int pid, int uid) { int i = mProcessObservers.beginBroadcast(); while (i > 0) { i--; final IProcessObserver observer = mProcessObservers.getBroadcastItem(i); if (observer != null) { try { observer.onProcessDied(pid, uid); } catch (RemoteException e) { } } } mProcessObservers.finishBroadcast(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchProcessDied File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
dispatchProcessDied
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static String defaultUserAgent() { return System.getProperty(ASYNC_CLIENT + "userAgent", "NING/1.0"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultUserAgent 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
defaultUserAgent
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
void initPrivateFields(ObjectStreamClass desc) { methodWriteReplace = desc.methodWriteReplace; methodReadResolve = desc.methodReadResolve; methodWriteObject = desc.methodWriteObject; methodReadObject = desc.methodReadObject; methodReadObjectNoData = desc.methodReadObjectNoData; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initPrivateFields File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
initPrivateFields
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public boolean unpublishRecording(File destDir, String recordingId, File recordingDir, String format) { File metadataXml = recordingServiceHelper.getMetadataXmlLocation(recordingDir.getPath()); RecordingMetadata r = recordingServiceHelper.getRecordingMetadata(metadataXml); if (r != null) { if (!destDir.exists()) destDir.mkdirs(); try { FileUtils.moveDirectory(recordingDir, new File(destDir.getPath() + File.separatorChar + recordingId)); r.setState(Recording.STATE_UNPUBLISHED); r.setPublished(false); File medataXmlFile = recordingServiceHelper.getMetadataXmlLocation( destDir.getAbsolutePath() + File.separatorChar + recordingId); // Process the changes by saving the recording into metadata.xml return recordingServiceHelper.saveRecordingMetadata(medataXmlFile, r); } catch (IOException e) { log.error("Failed to unpublish recording : " + recordingId, e); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unpublishRecording File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
unpublishRecording
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
public void serviceTransportException(IOException e) { BrokerService bService = connector.getBrokerService(); if (bService.isShutdownOnSlaveFailure()) { if (brokerInfo != null) { if (brokerInfo.isSlaveBroker()) { LOG.error("Slave has exception: {} shutting down master now.", e.getMessage(), e); try { doStop(); bService.stop(); } catch (Exception ex) { LOG.warn("Failed to stop the master", ex); } } } } if (!stopping.get() && !pendingStop) { transportException.set(e); if (TRANSPORTLOG.isDebugEnabled()) { TRANSPORTLOG.debug(this + " failed: " + e, e); } else if (TRANSPORTLOG.isWarnEnabled() && !expected(e)) { TRANSPORTLOG.warn(this + " failed: " + e); } stopAsync(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serviceTransportException File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
serviceTransportException
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
private KeyguardInputViewController<KeyguardInputView> changeSecurityMode( SecurityMode securityMode) { mCurrentSecurityMode = securityMode; return getCurrentSecurityController(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: changeSecurityMode File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21245
HIGH
7.8
android
changeSecurityMode
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
a33159e8cb297b9eee6fa5c63c0e343d05fad622
0
Analyze the following code function for security vulnerabilities
public void SetClientCert(X509Certificate cert) throws IllegalArgumentException { if (!(cert instanceof PK11Cert)) { throw new IllegalArgumentException("Unable to cast given certificate to PK11Cert: " + cert.getClass().getName()); } clientCert = (PK11Cert)cert; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: SetClientCert File: src/main/java/org/mozilla/jss/nss/SSLFDProxy.java Repository: dogtagpki/jss The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
SetClientCert
src/main/java/org/mozilla/jss/nss/SSLFDProxy.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
public List<IssuesWithBLOBs> getIssuesByPlatformIds(List<String> platformIds, String projectId) { if (CollectionUtils.isEmpty(platformIds)) return new ArrayList<>(); IssuesExample example = new IssuesExample(); example.createCriteria() .andPlatformIdIn(platformIds) .andProjectIdEqualTo(projectId); return issuesMapper.selectByExampleWithBLOBs(example); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIssuesByPlatformIds 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
getIssuesByPlatformIds
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { if (auth instanceof ApiKeyAuth) { ((ApiKeyAuth) auth).setApiKey(apiKey); return this; } } throw new RuntimeException("No API key authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setApiKey File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setApiKey
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Pure public @Nullable Blob getBlob(int i) throws SQLException { byte[] value = getRawValue(i); if (value == null) { return null; } return makeBlob(getLong(i)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBlob 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
getBlob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public boolean isGroupConversation() { // When target SDK version is < P, a non-null conversation title dictates if this is // as group conversation. if (mBuilder != null && mBuilder.mContext.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.P) { return mConversationTitle != null; } return mIsGroupConversation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isGroupConversation File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
isGroupConversation
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, Intent intent, String resolvedType, IVoiceInteractionSession session, IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(callingPackage); data.writeInt(callingPid); data.writeInt(callingUid); intent.writeToParcel(data, 0); data.writeString(resolvedType); data.writeStrongBinder(session.asBinder()); data.writeStrongBinder(interactor.asBinder()); data.writeInt(startFlags); if (profilerInfo != null) { data.writeInt(1); profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { data.writeInt(0); } if (options != null) { data.writeInt(1); options.writeToParcel(data, 0); } else { data.writeInt(0); } data.writeInt(userId); mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); reply.readException(); int result = reply.readInt(); reply.recycle(); data.recycle(); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startVoiceActivity File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startVoiceActivity
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public Button getNextButton() { return mNextButton; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNextButton File: src/com/android/settings/SettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
getNextButton
src/com/android/settings/SettingsActivity.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
public void addImplicitCollection(Class ownerType, String fieldName, Class itemType) { addImplicitCollection(ownerType, fieldName, null, itemType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addImplicitCollection File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
addImplicitCollection
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
private void grantRequestedRuntimePermissionsForUser(PackageParser.Package pkg, int userId, String[] grantedPermissions) { SettingBase sb = (SettingBase) pkg.mExtras; if (sb == null) { return; } synchronized (mPackages) { for (String permission : pkg.requestedPermissions) { BasePermission bp = mSettings.mPermissions.get(permission); if (bp != null && (bp.isRuntime() || bp.isDevelopment()) && (grantedPermissions == null || ArrayUtils.contains(grantedPermissions, permission)) && (getPermissionFlags(permission, pkg.packageName, userId) & PackageManager.FLAG_PERMISSION_SYSTEM_FIXED) == 0) { grantRuntimePermission(pkg.packageName, permission, userId); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grantRequestedRuntimePermissionsForUser 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
grantRequestedRuntimePermissionsForUser
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public boolean isJSDispatchThread() { if (useJSDispatchThread()) { return jsDispatchThread().isThisIt(); } else { return (Looper.getMainLooper().getThread() == Thread.currentThread()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isJSDispatchThread File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
isJSDispatchThread
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void updateBlob(String columnName, @Nullable InputStream inputStream, long length) throws SQLException { updateBlob(findColumn(columnName), inputStream, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBlob 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
updateBlob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void onTransferProgress( long progressRate, long totalTransferredSoFar, long totalToTransfer, String filePath ) { int percent = (int) (100.0 * ((double) totalTransferredSoFar) / ((double) totalToTransfer)); if (percent != mLastPercent) { mNotificationBuilder.setProgress(100, percent, false); String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1); String text = String.format(getString(R.string.uploader_upload_in_progress_content), percent, fileName); mNotificationBuilder.setContentText(text); if (mNotificationManager == null) { mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); } mNotificationManager.notify(FOREGROUND_SERVICE_ID, mNotificationBuilder.build()); } mLastPercent = percent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTransferProgress File: src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
onTransferProgress
src/main/java/com/owncloud/android/files/services/FileUploader.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
0
Analyze the following code function for security vulnerabilities
public void onLeServiceUp() { Message m = mAdapterStateMachine.obtainMessage(AdapterState.USER_TURN_ON); mAdapterStateMachine.sendMessage(m); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLeServiceUp File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
onLeServiceUp
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public static void setResponseNoCacheHeaders( BiConsumer<String, String> headerSetter, BiConsumer<String, Long> longHeaderSetter) { headerSetter.accept("Cache-Control", "no-cache, no-store"); headerSetter.accept("Pragma", "no-cache"); longHeaderSetter.accept("Expires", 0L); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResponseNoCacheHeaders File: flow-server/src/main/java/com/vaadin/flow/server/HandlerHelper.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
setResponseNoCacheHeaders
flow-server/src/main/java/com/vaadin/flow/server/HandlerHelper.java
e0dcaf86b63dbcab3adbbe107d1c49d490ead8eb
0
Analyze the following code function for security vulnerabilities
@Override protected void handleClick(@Nullable View view) { ActivityLaunchAnimator.Controller animationController = view == null ? null : ActivityLaunchAnimator.Controller.fromView(view, InteractionJankMonitor.CUJ_SHADE_APP_LAUNCH_FROM_QS_TILE); mUiHandler.post( () -> mController.startQuickAccessUiIntent( mActivityStarter, animationController, mSelectedCard != null)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleClick File: packages/SystemUI/src/com/android/systemui/qs/tiles/QuickAccessWalletTile.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21289
MEDIUM
5.5
android
handleClick
packages/SystemUI/src/com/android/systemui/qs/tiles/QuickAccessWalletTile.java
7a5e51c918b7097be3c7e669e1825a4d159c4185
0
Analyze the following code function for security vulnerabilities
@Override public void removePacketCollector(PacketCollector collector) { collectors.remove(collector); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removePacketCollector File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
removePacketCollector
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
private boolean isFwdChangeSuccess() { if (mForwardingChangeResults == null) { return true; } for (AsyncResult result : mForwardingChangeResults.values()) { Throwable exception = result.exception; if (exception != null) { String msg = exception.getMessage(); msg = (msg != null) ? msg : ""; Log.w(LOG_TAG, "Failed to change forwarding setting. Reason: " + msg); return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFwdChangeSuccess File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
isFwdChangeSuccess
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<DispatchRate> internalGetSubscriptionDispatchRate(boolean applied) { return getTopicPoliciesAsyncWithRetry(topicName) .thenApply(op -> op.map(TopicPolicies::getSubscriptionDispatchRate) .orElseGet(() -> { if (applied) { DispatchRateImpl namespacePolicy = getNamespacePolicies(namespaceName) .subscriptionDispatchRate.get(pulsar().getConfiguration().getClusterName()); return namespacePolicy == null ? subscriptionDispatchRate() : namespacePolicy; } return null; })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalGetSubscriptionDispatchRate File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalGetSubscriptionDispatchRate
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public static int hashCodeAscii(byte[] bytes, int startPos, int length) { return !hasUnsafe() || !unalignedAccess() ? hashCodeAsciiSafe(bytes, startPos, length) : PlatformDependent0.hashCodeAscii(bytes, startPos, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCodeAscii File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
hashCodeAscii
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
@Override public void serializeWithType(Object bean, JsonGenerator gen, SerializerProvider provider, TypeSerializer typeSer) throws IOException { if (_objectIdWriter != null) { gen.setCurrentValue(bean); // [databind#631] _serializeWithObjectId(bean, gen, provider, typeSer); return; } gen.setCurrentValue(bean); // [databind#631] WritableTypeId typeIdDef = _typeIdDef(typeSer, bean, JsonToken.START_OBJECT); typeSer.writeTypePrefix(gen, typeIdDef); if (_propertyFilterId != null) { serializeFieldsFiltered(bean, gen, provider); } else { serializeFields(bean, gen, provider); } typeSer.writeTypeSuffix(gen, typeIdDef); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serializeWithType File: src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
serializeWithType
src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public ServerBuilder gracefulShutdownTimeout(Duration quietPeriod, Duration timeout) { requireNonNull(quietPeriod, "quietPeriod"); requireNonNull(timeout, "timeout"); gracefulShutdownQuietPeriod = validateNonNegative(quietPeriod, "quietPeriod"); gracefulShutdownTimeout = validateNonNegative(timeout, "timeout"); validateGreaterThanOrEqual(gracefulShutdownTimeout, "quietPeriod", gracefulShutdownQuietPeriod, "timeout"); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gracefulShutdownTimeout File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
gracefulShutdownTimeout
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
private void unloadPrivatePackagesInner(VolumeInfo vol) { final ArrayList<ApplicationInfo> unloaded = new ArrayList<>(); synchronized (mInstallLock) { synchronized (mPackages) { final List<PackageSetting> packages = mSettings.getVolumePackagesLPr(vol.fsUuid); for (PackageSetting ps : packages) { if (ps.pkg == null) continue; final ApplicationInfo info = ps.pkg.applicationInfo; final PackageRemovedInfo outInfo = new PackageRemovedInfo(); if (deletePackageLI(ps.name, null, false, null, null, PackageManager.DELETE_KEEP_DATA, outInfo, false)) { unloaded.add(info); } else { Slog.w(TAG, "Failed to unload " + ps.codePath); } } mSettings.writeLPr(); } } if (DEBUG_INSTALL) Slog.d(TAG, "Unloaded packages " + unloaded); sendResourcesChangedBroadcast(false, false, unloaded, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unloadPrivatePackagesInner 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
unloadPrivatePackagesInner
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void saveRequestMap() { // TODO: store the request map in user preferences. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveRequestMap File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
saveRequestMap
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public void readFieldEnd() throws TException {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readFieldEnd File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
readFieldEnd
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
void setShellArgs( String[] shellArgs ) { this.shellArgs.clear(); this.shellArgs.addAll( Arrays.asList( shellArgs ) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShellArgs File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
setShellArgs
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
@Override public void setEncoding(String encoding) { fEncoding = encoding; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEncoding File: ext/java/nokogiri/XmlSchema.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
setEncoding
ext/java/nokogiri/XmlSchema.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
0
Analyze the following code function for security vulnerabilities
public void flushBuffer() throws IOException { if (this.outputWriter != null) { this.outputWriter.flush(); } try { this.outputStream.flush(); } catch (ClientSocketException e) { // ignore this error as it's not interesting enough to log } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: flushBuffer File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
flushBuffer
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
@CalledByNative public boolean addMessageToConsole(int level, String message, int lineNumber, String sourceId) { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addMessageToConsole File: components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
addMessageToConsole
components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private static void copyDirectory(File source, File target) { if (target.exists() && !target.isDirectory()) { throw new IllegalArgumentException("Cannot copy source directory since the target already exists," + " but it is not a directory"); } final File targetSubDir = new File(target, source.getName()); if (!targetSubDir.exists() && !targetSubDir.mkdirs()) { throw new HazelcastException("Could not create the target directory " + target); } final File[] sourceFiles = source.listFiles(); if (sourceFiles == null) { throw new HazelcastException("Error occurred while listing directory contents for copy"); } for (File file : sourceFiles) { copy(file, targetSubDir); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyDirectory File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
copyDirectory
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override protected Contentlet findContentletForLanguage(long languageId, Identifier identifier) throws DotDataException { return findContentletByIdentifier(identifier.getId(), false, languageId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findContentletForLanguage File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
findContentletForLanguage
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public String[] getParticipants() { return mParticipants; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParticipants File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getParticipants
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public String toString() { return " at character " + this.myIndex + " of " + this.mySource; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: src/main/java/org/codehaus/jettison/json/JSONTokener.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
toString
src/main/java/org/codehaus/jettison/json/JSONTokener.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public Class<?> findClass(String name) throws ClassNotFoundException { // Calls JNLPClassLoader#findClass which may call into this.findClassNonRecursive Class<?> c = getParentJNLPClassLoader().findClass(name); parentJNLPClassLoader.checkPartialSigningWithUser(); return c; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findClass 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
findClass
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
public void dump(IndentingPrintWriter pw) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG); if (mCalls != null) { pw.println("mCalls: "); pw.increaseIndent(); for (Call call : mCalls) { pw.println(call); } pw.decreaseIndent(); } pw.println("mForegroundCall: " + (mForegroundCall == null ? "none" : mForegroundCall)); if (mCallAudioManager != null) { pw.println("mCallAudioManager:"); pw.increaseIndent(); mCallAudioManager.dump(pw); pw.decreaseIndent(); } if (mTtyManager != null) { pw.println("mTtyManager:"); pw.increaseIndent(); mTtyManager.dump(pw); pw.decreaseIndent(); } if (mInCallController != null) { pw.println("mInCallController:"); pw.increaseIndent(); mInCallController.dump(pw); pw.decreaseIndent(); } if (mConnectionServiceRepository != null) { pw.println("mConnectionServiceRepository:"); pw.increaseIndent(); mConnectionServiceRepository.dump(pw); pw.decreaseIndent(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
dump
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
@Override public void endElement(final String uri, final String localName, final String name) throws SAXException { if (localName.equals("EventID")) { final String id = content.toString().trim(); if (idSet.contains(id)) { duplicate = true; } else { idSet.add(id); } } outputChars(); super.endElement(uri, localName, name); if (localName.equals("Event")) { if (duplicate) { duplicate = false; } else { stopBuffer(getContentHandler()); } startBuffer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: endElement File: stroom-pipeline/src/test/java/stroom/util/UniqueXMLEvents.java Repository: gchq/stroom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000651
HIGH
7.5
gchq/stroom
endElement
stroom-pipeline/src/test/java/stroom/util/UniqueXMLEvents.java
ba30ffd415bd7d32ee40ba4b04035267ce80b499
0
Analyze the following code function for security vulnerabilities
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){ List<Pair> params = new ArrayList<Pair>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; Collection valueCollection; if (value instanceof Collection) { valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; } if (valueCollection.isEmpty()){ return params; } // get the collection format (default: csv) String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // create the params based on the collection format if ("multi".equals(format)) { for (Object item : valueCollection) { params.add(new Pair(name, parameterToString(item))); } return params; } String delimiter = ","; if ("csv".equals(format)) { delimiter = ","; } else if ("ssv".equals(format)) { delimiter = " "; } else if ("tsv".equals(format)) { delimiter = "\t"; } else if ("pipes".equals(format)) { delimiter = "|"; } StringBuilder sb = new StringBuilder() ; for (Object item : valueCollection) { sb.append(delimiter); sb.append(parameterToString(item)); } params.add(new Pair(name, sb.substring(1))); return params; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToPairs File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
parameterToPairs
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void initCache(Controller baseController) { BaseDataInitVO cacheInit = (BaseDataInitVO) JFinal.me().getServletContext().getAttribute(Constants.CACHE_KEY); if (cacheInit == null) { cacheInit = new BaseDataInitVO(); Map<String, Object> website = new WebSite().getWebSite(); //兼容早期模板判断方式 website.put("user_comment_pluginStatus", "on".equals(website.get("duoshuo_status"))); BaseDataInitVO.Statistics statistics = new BaseDataInitVO.Statistics(); statistics.setTotalArticleSize(new Log().count()); cacheInit.setStatistics(statistics); cacheInit.setWebSite(website); cacheInit.setLinks(new Link().find()); cacheInit.setTypes(new Type().find()); statistics.setTotalTypeSize(cacheInit.getTypes().size()); cacheInit.setLogNavs(new LogNav().find()); cacheInit.setPlugins(new Plugin().find()); cacheInit.setArchives(new Log().getArchives()); cacheInit.setTags(new Tag().find()); statistics.setTotalTagSize(cacheInit.getTags().size()); List<Type> types = cacheInit.getTypes(); cacheInit.setHotLogs((List<Log>) new Log().find(1, 6).get("rows")); Map<Map<String, Object>, List<Log>> indexHotLog = new LinkedHashMap<>(); for (Type type : types) { Map<String, Object> typeMap = new TreeMap<>(); typeMap.put("typeName", type.getStr("typeName")); typeMap.put("alias", type.getStr("alias")); indexHotLog.put(typeMap, (List<Log>) new Log().findByTypeAlias(1, 6, type.getStr("alias")).get("rows")); } cacheInit.setIndexHotLogs(indexHotLog); //存放公共数据到ServletContext JFinal.me().getServletContext().setAttribute("WEB_SITE", website); JFinal.me().getServletContext().setAttribute(Constants.CACHE_KEY, cacheInit); List<File> staticFiles = new ArrayList<>(); FileUtils.getAllFiles(PathKit.getWebRootPath(), staticFiles); for (File file : staticFiles) { String uri = file.toString().substring(PathKit.getWebRootPath().length()); cacheFileMap.put(uri, file.lastModified() + ""); } } if (baseController != null) { baseController.setAttr("init", cacheInit); baseController.setAttr("website", cacheInit.getWebSite()); //默认开启文章封面 cacheInit.getWebSite().putIfAbsent("article_thumbnail_status", "1"); Constants.WEB_SITE.clear(); Constants.WEB_SITE.putAll(cacheInit.getWebSite()); } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2019-16643 - Severity: LOW - CVSS Score: 3.5 Description: Upgrade jar version & fix #54 Signed-off-by: xiaochun <xchun90@163.com> Function: initCache File: web/src/main/java/com/zrlog/web/cache/CacheService.java Repository: 94fzb/zrlog Fixed Code: private void initCache(Controller baseController) { BaseDataInitVO cacheInit = (BaseDataInitVO) JFinal.me().getServletContext().getAttribute(Constants.CACHE_KEY); if (cacheInit == null) { cacheInit = new BaseDataInitVO(); Map<String, Object> website = new WebSite().getWebSite(); //兼容早期模板判断方式 website.put("user_comment_pluginStatus", "on".equals(website.get("duoshuo_status"))); BaseDataInitVO.Statistics statistics = new BaseDataInitVO.Statistics(); statistics.setTotalArticleSize(new Log().count()); cacheInit.setStatistics(statistics); cacheInit.setWebSite(website); cacheInit.setLinks(new Link().find()); cacheInit.setTypes(new Type().find()); statistics.setTotalTypeSize(cacheInit.getTypes().size()); cacheInit.setLogNavs(new LogNav().find()); cacheInit.setPlugins(new Plugin().find()); cacheInit.setArchives(new Log().getArchives()); cacheInit.setTags(new Tag().find()); statistics.setTotalTagSize(cacheInit.getTags().size()); List<Type> types = cacheInit.getTypes(); cacheInit.setHotLogs((List<Log>) new Log().find(1, 6).get("rows")); Map<Map<String, Object>, List<Log>> indexHotLog = new LinkedHashMap<>(); for (Type type : types) { Map<String, Object> typeMap = new TreeMap<>(); typeMap.put("typeName", type.getStr("typeName")); typeMap.put("alias", type.getStr("alias")); indexHotLog.put(typeMap, (List<Log>) new Log().findByTypeAlias(1, 6, type.getStr("alias")).get("rows")); } cacheInit.setIndexHotLogs(indexHotLog); //存放公共数据到ServletContext JFinal.me().getServletContext().setAttribute("WEB_SITE", website); JFinal.me().getServletContext().setAttribute(Constants.CACHE_KEY, cacheInit); List<File> staticFiles = new ArrayList<>(); FileUtils.getAllFiles(PathKit.getWebRootPath(), staticFiles); for (File file : staticFiles) { String uri = file.toString().substring(PathKit.getWebRootPath().length()); cacheFileMap.put(uri, file.lastModified() + ""); } if(cacheInit.getTags() == null || cacheInit.getTags().isEmpty()){ cacheInit.getPlugins().remove("tags"); } if(cacheInit.getArchives() == null || cacheInit.getArchives().isEmpty()){ cacheInit.getPlugins().remove("archives"); } if(cacheInit.getTypes() == null || cacheInit.getTypes().isEmpty()){ cacheInit.getPlugins().remove("types"); } if(cacheInit.getLinks() == null || cacheInit.getLinks().isEmpty()){ cacheInit.getPlugins().remove("links"); } } if (baseController != null) { baseController.setAttr("init", cacheInit); baseController.setAttr("website", cacheInit.getWebSite()); //默认开启文章封面 cacheInit.getWebSite().putIfAbsent("article_thumbnail_status", "1"); Constants.WEB_SITE.clear(); Constants.WEB_SITE.putAll(cacheInit.getWebSite()); } }
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
initCache
web/src/main/java/com/zrlog/web/cache/CacheService.java
4a91c83af669e31a22297c14f089d8911d353fa1
1
Analyze the following code function for security vulnerabilities
public void setNullValueCVsTypesExpected() { this.unsetTypeExpected(); int i = 1; this.setTypeExpected(i, TypeNames.STRING); // study_event_definition oc_oid ++i; this.setTypeExpected(i, TypeNames.STRING); // crf_version oc_oid ++i; this.setTypeExpected(i, TypeNames.STRING); // null_values }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNullValueCVsTypesExpected File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
setNullValueCVsTypesExpected
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public void writeStringResponse(VaadinResponse response, String contentType, String responseString) throws IOException { response.setContentType(contentType); final OutputStream out = response.getOutputStream(); try (PrintWriter outWriter = new PrintWriter( new BufferedWriter(new OutputStreamWriter(out, UTF_8)))) { outWriter.print(responseString); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeStringResponse File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
writeStringResponse
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
public void stopSyncEvent(long historyId, long elapsedTime, String resultMessage, long downstreamActivity, long upstreamActivity) { synchronized (mAuthorities) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "stopSyncEvent: historyId=" + historyId); } SyncHistoryItem item = null; int i = mSyncHistory.size(); while (i > 0) { i--; item = mSyncHistory.get(i); if (item.historyId == historyId) { break; } item = null; } if (item == null) { Log.w(TAG, "stopSyncEvent: no history for id " + historyId); return; } item.elapsedTime = elapsedTime; item.event = EVENT_STOP; item.mesg = resultMessage; item.downstreamActivity = downstreamActivity; item.upstreamActivity = upstreamActivity; SyncStatusInfo status = getOrCreateSyncStatusLocked(item.authorityId); status.numSyncs++; status.totalElapsedTime += elapsedTime; switch (item.source) { case SOURCE_LOCAL: status.numSourceLocal++; break; case SOURCE_POLL: status.numSourcePoll++; break; case SOURCE_USER: status.numSourceUser++; break; case SOURCE_SERVER: status.numSourceServer++; break; case SOURCE_PERIODIC: status.numSourcePeriodic++; break; } boolean writeStatisticsNow = false; int day = getCurrentDayLocked(); if (mDayStats[0] == null) { mDayStats[0] = new DayStats(day); } else if (day != mDayStats[0].day) { System.arraycopy(mDayStats, 0, mDayStats, 1, mDayStats.length-1); mDayStats[0] = new DayStats(day); writeStatisticsNow = true; } else if (mDayStats[0] == null) { } final DayStats ds = mDayStats[0]; final long lastSyncTime = (item.eventTime + elapsedTime); boolean writeStatusNow = false; if (MESG_SUCCESS.equals(resultMessage)) { // - if successful, update the successful columns if (status.lastSuccessTime == 0 || status.lastFailureTime != 0) { writeStatusNow = true; } status.lastSuccessTime = lastSyncTime; status.lastSuccessSource = item.source; status.lastFailureTime = 0; status.lastFailureSource = -1; status.lastFailureMesg = null; status.initialFailureTime = 0; ds.successCount++; ds.successTime += elapsedTime; } else if (!MESG_CANCELED.equals(resultMessage)) { if (status.lastFailureTime == 0) { writeStatusNow = true; } status.lastFailureTime = lastSyncTime; status.lastFailureSource = item.source; status.lastFailureMesg = resultMessage; if (status.initialFailureTime == 0) { status.initialFailureTime = lastSyncTime; } ds.failureCount++; ds.failureTime += elapsedTime; } if (writeStatusNow) { writeStatusLocked(); } else if (!hasMessages(MSG_WRITE_STATUS)) { sendMessageDelayed(obtainMessage(MSG_WRITE_STATUS), WRITE_STATUS_DELAY); } if (writeStatisticsNow) { writeStatisticsLocked(); } else if (!hasMessages(MSG_WRITE_STATISTICS)) { sendMessageDelayed(obtainMessage(MSG_WRITE_STATISTICS), WRITE_STATISTICS_DELAY); } } reportChange(ContentResolver.SYNC_OBSERVER_TYPE_STATUS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopSyncEvent File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
stopSyncEvent
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public int getReadTimeout() { return readTimeout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReadTimeout File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getReadTimeout
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public Object getValue(ELContext context, Object base, Object property) { Object result = super.getValue(context, base, validatePropertyName(property)); return result instanceof Class ? null : result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValue File: src/main/java/com/hubspot/jinjava/el/ext/JinjavaBeanELResolver.java Repository: HubSpot/jinjava The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-12668
MEDIUM
6.8
HubSpot/jinjava
getValue
src/main/java/com/hubspot/jinjava/el/ext/JinjavaBeanELResolver.java
5dfa5b87318744a4d020b66d5f7747acc36b213b
0
Analyze the following code function for security vulnerabilities
protected void maybeThrowValidationException() throws ValidationException { if (validationExceptions.size() > 0) { throw new ValidationException("Encountered " + validationExceptions.size() + " validation exceptions.", validationExceptions); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeThrowValidationException 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
maybeThrowValidationException
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
0
Analyze the following code function for security vulnerabilities
public void fireSessionDestroy(VaadinSession vaadinSession) { final VaadinSession session = vaadinSession; session.access(() -> { if (session.getState() == VaadinSessionState.CLOSED) { return; } if (session.getState() == VaadinSessionState.OPEN) { closeSession(session); } List<UI> uis = new ArrayList<>(session.getUIs()); for (final UI ui : uis) { ui.accessSynchronously(() -> { /* * close() called here for consistency so that it is always * called before a UI is removed. UI.isClosing() is thus * always true in UI.detach() and associated detach * listeners. */ if (!ui.isClosing()) { ui.close(); } session.removeUI(ui); }); } SessionDestroyEvent event = new SessionDestroyEvent( VaadinService.this, session); for (SessionDestroyListener listener : sessionDestroyListeners) { try { listener.sessionDestroy(event); } catch (Exception e) { /* * for now, use the session error handler; in the future, * could have an API for using some other handler for * session init and destroy listeners */ session.getErrorHandler().error(new ErrorEvent(e)); } } session.setState(VaadinSessionState.CLOSED); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fireSessionDestroy File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
fireSessionDestroy
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0