instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private void afterSave(XWikiDocument document, XWikiContext context) { ObservationManager om = getObservationManager(); if (om != null) { if (document.getOriginalDocument().isNew()) { om.notify(new DocumentCreatedEvent(document.getDocumentReference()), document, context); } else { om.notify(new DocumentUpdatedEvent(document.getDocumentReference()), document, context); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: afterSave 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
afterSave
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private boolean shouldAnimateWakeup() { return mAnimateWakeup; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldAnimateWakeup 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
shouldAnimateWakeup
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void requireCredentialEntry(int userId) { requireStrongAuth(StrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_USER_REQUEST, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requireCredentialEntry File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
requireCredentialEntry
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public Entry<P> getPrimary() { return primary; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPrimary File: java_src/src/main/java/com/google/crypto/tink/PrimitiveSet.java Repository: tink-crypto/tink The code follows secure coding practices.
[ "CWE-176" ]
CVE-2020-8929
MEDIUM
5
tink-crypto/tink
getPrimary
java_src/src/main/java/com/google/crypto/tink/PrimitiveSet.java
93d839a5865b9d950dffdc9d0bc99b71280a8899
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Void> internalRemoveMaxProducers() { return getTopicPoliciesAsyncWithRetry(topicName) .thenCompose(op -> { if (!op.isPresent()) { return CompletableFuture.completedFuture(null); } op.get().setMaxProducerPerTopic(null); return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, op.get()); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalRemoveMaxProducers 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
internalRemoveMaxProducers
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public void addContent(ByteBuf buffer, boolean last) throws IOException { if (buffer != null) { try { int localsize = buffer.readableBytes(); checkSize(size + localsize); if (definedSize > 0 && definedSize < size + localsize) { throw new IOException("Out of size: " + (size + localsize) + " > " + definedSize); } if (file == null) { file = tempFile(); } if (fileChannel == null) { RandomAccessFile accessFile = new RandomAccessFile(file, "rw"); fileChannel = accessFile.getChannel(); } int remaining = localsize; long position = fileChannel.position(); int index = buffer.readerIndex(); while (remaining > 0) { int written = buffer.getBytes(index, fileChannel, position, remaining); if (written < 0) { break; } remaining -= written; position += written; index += written; } fileChannel.position(position); buffer.readerIndex(index); size += localsize - remaining; } finally { // Release the buffer as it was retained before and we not need a reference to it at all // See https://github.com/netty/netty/issues/1516 buffer.release(); } } if (last) { if (file == null) { file = tempFile(); } if (fileChannel == null) { RandomAccessFile accessFile = new RandomAccessFile(file, "rw"); fileChannel = accessFile.getChannel(); } try { fileChannel.force(false); } finally { fileChannel.close(); } fileChannel = null; setCompleted(); } else { ObjectUtil.checkNotNull(buffer, "buffer"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addContent File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java Repository: netty The code follows secure coding practices.
[ "CWE-378", "CWE-379" ]
CVE-2021-21290
LOW
1.9
netty
addContent
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
c735357bf29d07856ad171c6611a2e1a0e0000ec
0
Analyze the following code function for security vulnerabilities
@Override protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { PriorityDump.dump(mPriorityDumper, fd, pw, args); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump 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
dump
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Nullable public URI getUrl() { return url; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUrl File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getUrl
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@Override public org.apache.lucene.search.Query getPathMatchQuery(String fieldName, String pathPattern) { cacheLock.readLock().lock(); try { return Criteria.forManyValues(fieldName, getMatchingIds(pathPattern), cache.keySet()); } finally { cacheLock.readLock().unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPathMatchQuery File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
getPathMatchQuery
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
@Override public OnGoingLogicalCondition endsWith(String toMatch) { return getOnGoingLogicalCondition(createLike(LikeCondition.Type.ENDSWITH, toMatch)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: endsWith File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java Repository: xjodoin/torpedoquery The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2019-11343
HIGH
7.5
xjodoin/torpedoquery
endsWith
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
3c20b874fba9cc2a78b9ace10208de1602b56c3f
0
Analyze the following code function for security vulnerabilities
public void attachApplication(IApplicationThread app) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(app.asBinder()); mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachApplication File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
attachApplication
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public Path getResource(final String resourceURI) throws IOException { Path resourceCachePath = getResourceCachePath(resourceURI); if (Files.exists(resourceCachePath)) { return resourceCachePath; } if(unavailableURICache.getIfPresent(resourceURI) != null) { LOGGER.info("Ignored unavailable schema URI: " + resourceURI + "\n"); return null; } CompletableFuture<Path> f = null; synchronized (resourcesLoading) { if (resourcesLoading.containsKey(resourceURI)) { CompletableFuture<Path> future = resourcesLoading.get(resourceURI); throw new CacheResourceDownloadingException(resourceURI, future); } f = downloadResource(resourceURI, resourceCachePath); resourcesLoading.put(resourceURI, f); } if (f.getNow(null) == null) { throw new CacheResourceDownloadingException(resourceURI, f); } return resourceCachePath; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2019-18212 - Severity: MEDIUM - CVSS Score: 4.0 Description: Reject download of resource which are not in the cache folder (url which uses several ../../). Signed-off-by: azerr <azerr@redhat.com> Function: getResource File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/uriresolver/CacheResourcesManager.java Repository: eclipse/lemminx Fixed Code: public Path getResource(final String resourceURI) throws IOException { Path resourceCachePath = getResourceCachePath(resourceURI); if (Files.exists(resourceCachePath)) { return resourceCachePath; } if (!FilesUtils.isIncludedInDeployedPath(resourceCachePath)) { throw new CacheResourceDownloadingException(resourceURI); } if (unavailableURICache.getIfPresent(resourceURI) != null) { LOGGER.info("Ignored unavailable schema URI: " + resourceURI + "\n"); return null; } CompletableFuture<Path> f = null; synchronized (resourcesLoading) { if (resourcesLoading.containsKey(resourceURI)) { CompletableFuture<Path> future = resourcesLoading.get(resourceURI); throw new CacheResourceDownloadingException(resourceURI, future); } f = downloadResource(resourceURI, resourceCachePath); resourcesLoading.put(resourceURI, f); } if (f.getNow(null) == null) { throw new CacheResourceDownloadingException(resourceURI, f); } return resourceCachePath; }
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
getResource
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/uriresolver/CacheResourcesManager.java
e37c399aa266be1b7a43061d4afc43dc230410d2
1
Analyze the following code function for security vulnerabilities
private void keepTimeComponentOfEncounterIfDateComponentHasNotChanged(Date previousEncounterDate, Encounter formEncounter) { if (previousEncounterDate != null && new DateMidnight(previousEncounterDate).equals(new DateMidnight(formEncounter.getEncounterDatetime()))) { formEncounter.setEncounterDatetime(previousEncounterDate); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keepTimeComponentOfEncounterIfDateComponentHasNotChanged File: omod/src/main/java/org/openmrs/module/htmlformentryui/fragment/controller/htmlform/EnterHtmlFormFragmentController.java Repository: openmrs/openmrs-module-htmlformentryui The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-4284
MEDIUM
6.1
openmrs/openmrs-module-htmlformentryui
keepTimeComponentOfEncounterIfDateComponentHasNotChanged
omod/src/main/java/org/openmrs/module/htmlformentryui/fragment/controller/htmlform/EnterHtmlFormFragmentController.java
811990972ea07649ae33c4b56c61c3b520895f07
0
Analyze the following code function for security vulnerabilities
boolean hasWallpaperBackgroudForLetterbox() { return mLetterboxUiController.hasWallpaperBackgroudForLetterbox(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasWallpaperBackgroudForLetterbox 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
hasWallpaperBackgroudForLetterbox
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
protected boolean isReadonlyBody() { return this.readonlyBody; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isReadonlyBody File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
isReadonlyBody
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public void putCustomHeader(String key, String value) { customHeaders.put(key, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putCustomHeader File: src/main/java/spark/staticfiles/StaticFilesConfiguration.java Repository: perwendel/spark The code follows secure coding practices.
[ "CWE-22" ]
CVE-2016-9177
MEDIUM
5
perwendel/spark
putCustomHeader
src/main/java/spark/staticfiles/StaticFilesConfiguration.java
26b57d0596ee73c14c558463943ef0857e53b91f
0
Analyze the following code function for security vulnerabilities
public int startActivities(IApplicationThread caller, String callingPackage, Intent[] intents, String[] resolvedTypes, IBinder resultTo, Bundle options, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivities File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startActivities
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private static boolean deleteDirectory(File path) { if (path.exists()) { File[] files = path.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { deleteDirectory(files[i]); } else { if (!files[i].delete()) { log.error("Unable to delete file: " + files[i].getName()); } } } } boolean pathDeleted = path.delete(); return (pathDeleted); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteDirectory File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
deleteDirectory
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
boolean updateDisplayOverrideConfigurationLocked(Configuration values, ActivityRecord starting, boolean deferResume, int displayId) { return updateDisplayOverrideConfigurationLocked(values, starting, deferResume /* deferResume */, displayId, null /* result */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDisplayOverrideConfigurationLocked 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
updateDisplayOverrideConfigurationLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Dimension(unit = DP) public int getDesiredHeight() { return mDesiredHeight; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDesiredHeight File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getDesiredHeight
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void deleteBatchUpload(Context c, String uploadId) throws Exception { String uploadDir = null; String mapFilePath = null; uploadDir = ItemImport.getImportUploadableDirectory(c.getCurrentUser().getID()) + File.separator + uploadId; mapFilePath = uploadDir + File.separator + "mapfile"; this.deleteItems(c, mapFilePath); // complete all transactions c.commit(); FileDeleteStrategy.FORCE.delete(new File(uploadDir)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteBatchUpload File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
deleteBatchUpload
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
private void migrate32(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Settings.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String key = element.elementTextTrim("key"); if (key.equals("ISSUE")) element.detach(); } dom.writeToFile(file, false); } else if (file.getName().startsWith("IssueChanges.xml")) { FileUtils.deleteFile(file); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate32 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate32
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public void setBlankPresentation(String blankPresentation) { this.BLANK_PRESENTATION = blankPresentation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBlankPresentation File: bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43798
MEDIUM
5.4
bigbluebutton
setBlankPresentation
bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
02ba4c6ff8e78a0f4384ad1b7c7367c5a90376e8
0
Analyze the following code function for security vulnerabilities
public String toString(int indentFactor) throws JSONException { return toString(indentFactor, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: src/main/java/org/codehaus/jettison/json/JSONObject.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/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public static Element parseElement(String xml) { try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = dbFactory.newDocumentBuilder(); Document doc = docBuilder.parse(new ByteArrayInputStream(xml.getBytes())); return doc.getDocumentElement(); } catch (Exception e) { throw new RuntimeException(e); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2021-3869 - Severity: MEDIUM - CVSS Score: 5.0 Description: Attempt to prevent external document attacks by wrapping DocumentBuilderFactory with a bunch of attribute changes Function: parseElement File: src/edu/stanford/nlp/time/XMLUtils.java Repository: stanfordnlp/CoreNLP Fixed Code: public static Element parseElement(String xml) { try { DocumentBuilderFactory dbFactory = safeDocumentBuilderFactory(); DocumentBuilder docBuilder = dbFactory.newDocumentBuilder(); Document doc = docBuilder.parse(new ByteArrayInputStream(xml.getBytes())); return doc.getDocumentElement(); } catch (Exception e) { throw new RuntimeException(e); } }
[ "CWE-611" ]
CVE-2021-3869
MEDIUM
5
stanfordnlp/CoreNLP
parseElement
src/edu/stanford/nlp/time/XMLUtils.java
5d83f1e8482ca304db8be726cad89554c88f136a
1
Analyze the following code function for security vulnerabilities
@Override public void onRoleHoldersChanged(@NonNull String roleName, @NonNull UserHandle user) { if (!RoleManager.ROLE_DEVICE_POLICY_MANAGEMENT.equals(roleName)) { return; } String newRoleHolder = getRoleHolder(); if (isDefaultRoleHolder(newRoleHolder)) { Slogf.i(LOG_TAG, "onRoleHoldersChanged: Default role holder is set, returning early"); return; } if (newRoleHolder == null) { Slogf.i(LOG_TAG, "onRoleHoldersChanged: New role holder is null, returning early"); return; } if (shouldAllowBypassingDevicePolicyManagementRoleQualificationInternal()) { Slogf.w(LOG_TAG, "onRoleHoldersChanged: Updating current role holder to " + newRoleHolder); setBypassDevicePolicyManagementRoleQualificationStateInternal( newRoleHolder, /* allowBypass= */ true); return; } DevicePolicyData policy = getUserData(UserHandle.USER_SYSTEM); if (!newRoleHolder.equals(policy.mCurrentRoleHolder)) { Slogf.w(LOG_TAG, "onRoleHoldersChanged: You can't set a different role holder, role " + "is getting revoked from " + newRoleHolder); setBypassDevicePolicyManagementRoleQualificationStateInternal( /* currentRoleHolder= */ null, /* allowBypass= */ false); mRm.removeRoleHolderAsUser( RoleManager.ROLE_DEVICE_POLICY_MANAGEMENT, newRoleHolder, /* flags= */ 0, user, mExecutor, successful -> {}); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRoleHoldersChanged 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
onRoleHoldersChanged
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public final void setUserName(String userName) { this.userName = userName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserName File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
setUserName
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
@POST @Produces(MediaType.TEXT_XML) @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("addMediaPackage") @RestQuery(name = "addMediaPackage", description = "<p>Create and ingest media package from media tracks with additional Dublin Core metadata. It is " + "mandatory to set a title for the recording. This can be done with the 'title' form field or by supplying a DC " + "catalog with a title included. The identifier of the newly created media package will be taken from the " + "<em>identifier</em> field or the episode DublinCore catalog (deprecated<sup>*</sup>). If no identifier is " + "set, a new random UUIDv4 will be generated. This endpoint is not meant to be used by capture agents for " + "scheduled recordings. Its primary use is for manual ingests with command line tools like curl.</p> " + "<p>Multiple tracks can be ingested by using multiple form fields. It is important to always set the " + "flavor of the next media file <em>before</em> sending the media file itself.</p>" + "<b>(*)</b> The special treatment of the identifier field is deprecated and may be removed in future versions " + "without further notice in favor of a random UUID generation to ensure uniqueness of identifiers. " + "<h3>Example curl command:</h3>" + "<p>Ingest one video file:</p>" + "<p><pre>\n" + "curl -f -i --digest -u opencast_system_account:CHANGE_ME -H 'X-Requested-Auth: Digest' \\\n" + " http://localhost:8080/ingest/addMediaPackage -F creator='John Doe' -F title='Test Recording' \\\n" + " -F 'flavor=presentation/source' -F 'BODY=@test-recording.mp4' \n" + "</pre></p>" + "<p>Ingest two video files:</p>" + "<p><pre>\n" + "curl -f -i --digest -u opencast_system_account:CHANGE_ME -H 'X-Requested-Auth: Digest' \\\n" + " http://localhost:8080/ingest/addMediaPackage -F creator='John Doe' -F title='Test Recording' \\\n" + " -F 'flavor=presentation/source' -F 'BODY=@test-recording-vga.mp4' \\\n" + " -F 'flavor=presenter/source' -F 'BODY=@test-recording-camera.mp4' \n" + "</pre></p>", restParameters = { @RestParameter(description = "The kind of media track. This has to be specified prior to each media track", isRequired = true, name = "flavor", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "abstract", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "accessRights", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "available", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "contributor", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "coverage", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "created", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "creator", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "date", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "description", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "extent", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "format", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "identifier", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isPartOf", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isReferencedBy", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isReplacedBy", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "language", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "license", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "publisher", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "relation", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "replaces", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "rights", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "rightsHolder", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "source", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "spatial", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "subject", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "temporal", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "title", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "type", type = RestParameter.Type.STRING), @RestParameter(description = "URL of episode DublinCore Catalog", isRequired = false, name = "episodeDCCatalogUri", type = RestParameter.Type.STRING), @RestParameter(description = "Episode DublinCore Catalog", isRequired = false, name = "episodeDCCatalog", type = RestParameter.Type.STRING), @RestParameter(description = "URL of series DublinCore Catalog", isRequired = false, name = "seriesDCCatalogUri", type = RestParameter.Type.STRING), @RestParameter(description = "Series DublinCore Catalog", isRequired = false, name = "seriesDCCatalog", type = RestParameter.Type.STRING), @RestParameter(description = "URL of a media track file", isRequired = false, name = "mediaUri", type = RestParameter.Type.STRING) }, bodyParameter = @RestParameter(description = "The media track file", isRequired = true, name = "BODY", type = RestParameter.Type.FILE), reponses = { @RestResponse(description = "Ingest successfull. Returns workflow instance as xml", responseCode = HttpServletResponse.SC_OK), @RestResponse(description = "Ingest failed due to invalid requests.", responseCode = HttpServletResponse.SC_BAD_REQUEST), @RestResponse(description = "Ingest failed. Something went wrong internally. Please have a look at the log files", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) }, returnDescription = "") public Response addMediaPackage(@Context HttpServletRequest request) { logger.trace("add mediapackage as multipart-form-data"); return addMediaPackage(request, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addMediaPackage File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java Repository: opencast The code follows secure coding practices.
[ "CWE-74" ]
CVE-2020-5230
MEDIUM
5
opencast
addMediaPackage
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
bbb473f34ab95497d6c432c81285efb0c739f317
0
Analyze the following code function for security vulnerabilities
public Connection newConnection(ExecutorService executor, AddressResolver addressResolver, String clientProvidedName) throws IOException, TimeoutException { if(this.metricsCollector == null) { this.metricsCollector = new NoOpMetricsCollector(); } // make sure we respect the provided thread factory FrameHandlerFactory fhFactory = createFrameHandlerFactory(); ConnectionParams params = params(executor); // set client-provided via a client property if (clientProvidedName != null) { Map<String, Object> properties = new HashMap<String, Object>(params.getClientProperties()); properties.put("connection_name", clientProvidedName); params.setClientProperties(properties); } if (isAutomaticRecoveryEnabled()) { // see com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory#newConnection // No Sonar: no need to close this resource because we're the one that creates it // and hands it over to the user AutorecoveringConnection conn = new AutorecoveringConnection(params, fhFactory, addressResolver, metricsCollector); //NOSONAR conn.init(); return conn; } else { List<Address> addrs = addressResolver.getAddresses(); Exception lastException = null; for (Address addr : addrs) { try { FrameHandler handler = fhFactory.create(addr, clientProvidedName); AMQConnection conn = createConnection(params, handler, metricsCollector); conn.start(); this.metricsCollector.newConnection(conn); return conn; } catch (IOException e) { lastException = e; } catch (TimeoutException te) { lastException = te; } } if (lastException != null) { if (lastException instanceof IOException) { throw (IOException) lastException; } else if (lastException instanceof TimeoutException) { throw (TimeoutException) lastException; } } throw new IOException("failed to connect"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newConnection File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
newConnection
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
public void setDefaultTemplate(String dtemplate) { getDoc().setDefaultTemplate(dtemplate); updateAuthor(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultTemplate File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
setDefaultTemplate
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public boolean isEnabled() { return !mServices.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEnabled File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
isEnabled
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public void performDeferredDestroyWindow(Session session, IWindow client) { long origId = Binder.clearCallingIdentity(); try { synchronized (mWindowMap) { WindowState win = windowForClientLocked(session, client, false); if (win == null) { return; } win.mWinAnimator.destroyDeferredSurfaceLocked(); } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performDeferredDestroyWindow 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
performDeferredDestroyWindow
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void adjustAdditionalProperties(final CodegenConfig config) { Map<String, Object> configAdditionalProperties = config.additionalProperties(); Set<String> keySet = configAdditionalProperties.keySet(); for (String key : keySet) { Object value = configAdditionalProperties.get(key); if (value != null) { if (value instanceof String) { String stringValue = (String) value; if (stringValue.equalsIgnoreCase("true")) { configAdditionalProperties.put(key, Boolean.TRUE); } else if (stringValue.equalsIgnoreCase("false")) { configAdditionalProperties.put(key, Boolean.FALSE); } } } else { configAdditionalProperties.put(key, Boolean.FALSE); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: adjustAdditionalProperties File: modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-552" ]
CVE-2021-21429
LOW
2.1
OpenAPITools/openapi-generator
adjustAdditionalProperties
modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
6445ea6511a6ddab64c86ae263937dc90650c98c
0
Analyze the following code function for security vulnerabilities
public Claims validateToken(String token) throws AuthenticationException { try { RsaKeyUtil rsaKeyUtil = new RsaKeyUtil(); PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey); return Jwts.parser().setSigningKey(publicKey).parseJws(token.replace("Bearer ", "")).getBody(); } catch (Exception e){ throw new AuthenticationException(String.format("Failed to check user authorization for token: %s", token), e); } }
Vulnerability Classification: - CWE: CWE-290 - CVE: CVE-2021-32631 - Severity: MEDIUM - CVSS Score: 4.0 Description: Use parseClaimsJws method instead of parseJws Function: validateToken File: utility/src/main/java/eu/nimble/utility/validation/ValidationUtil.java Repository: nimble-platform/common Fixed Code: public Claims validateToken(String token) throws AuthenticationException { try { RsaKeyUtil rsaKeyUtil = new RsaKeyUtil(); PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey); return Jwts.parser().setSigningKey(publicKey).parseClaimsJws(token.replace("Bearer ", "")).getBody(); } catch (Exception e){ throw new AuthenticationException(String.format("Failed to check user authorization for token: %s", token), e); } }
[ "CWE-290" ]
CVE-2021-32631
MEDIUM
4
nimble-platform/common
validateToken
utility/src/main/java/eu/nimble/utility/validation/ValidationUtil.java
a59ad46733912a5580530e39cac0e6ebc83cc563
1
Analyze the following code function for security vulnerabilities
public void sendConnectionEvent(String id, String event, Bundle extras) throws Exception { for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.onConnectionEvent(id, event, extras, null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendConnectionEvent File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
sendConnectionEvent
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception { releaseHandshakeBuffer(); super.handlerRemoved0(ctx); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handlerRemoved0 File: handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-34462
MEDIUM
6.5
netty
handlerRemoved0
handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java
535da17e45201ae4278c0479e6162bb4127d4c32
0
Analyze the following code function for security vulnerabilities
@Provides SessionSerializer sessionValueSerializer(JavaSessionSerializer sessionSerializer) { return sessionSerializer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sessionValueSerializer File: ratpack-session/src/main/java/ratpack/session/SessionModule.java Repository: ratpack The code follows secure coding practices.
[ "CWE-338" ]
CVE-2019-11808
MEDIUM
4.3
ratpack
sessionValueSerializer
ratpack-session/src/main/java/ratpack/session/SessionModule.java
f2b63eb82dd71194319fd3945f5edf29b8f3a42d
0
Analyze the following code function for security vulnerabilities
private static void forwardRequest(String url, HttpServletRequest request, HttpServletResponse response) { try { request.getRequestDispatcher(url).forward(request, response); } catch (ServletException sE) { handleForwardError(url, sE, response); } catch (IOException ioE) { handleForwardError(url, ioE, response); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forwardRequest File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java Repository: OpenIdentityPlatform/OpenAM The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-37471
CRITICAL
9.8
OpenIdentityPlatform/OpenAM
forwardRequest
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
7c18543d126e8a567b83bb4535631825aaa9d742
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private List<ReadableManufacturer> getManufacturersByProductAndCategory(MerchantStore store, Category category, List<Category> categories, Language language) throws Exception { List<ReadableManufacturer> manufacturerList = null; List<Long> subCategoryIds = categories.stream().map(Category::getId).collect(Collectors.toList()); /** List of manufacturers **/ if(subCategoryIds!=null && subCategoryIds.size()>0) { StringBuilder manufacturersKey = new StringBuilder(); manufacturersKey .append(store.getId()) .append("_") .append(Constants.MANUFACTURERS_BY_PRODUCTS_CACHE_KEY) .append("-") .append(language.getCode()); StringBuilder manufacturersKeyMissed = new StringBuilder(); manufacturersKeyMissed .append(manufacturersKey.toString()) .append(Constants.MISSED_CACHE_KEY); if(store.isUseCache()) { //get from the cache manufacturerList = (List<ReadableManufacturer>) cache.getFromCache(manufacturersKey.toString()); if(manufacturerList==null) { //get from missed cache //Boolean missedContent = (Boolean)cache.getFromCache(manufacturersKeyMissed.toString()); //if(missedContent==null) { manufacturerList = this.getManufacturers(store, subCategoryIds, language); if(manufacturerList.isEmpty()) { cache.putInCache(new Boolean(true), manufacturersKeyMissed.toString()); } else { //cache.putInCache(manufacturerList, manufacturersKey.toString()); } //} } } else { manufacturerList = this.getManufacturers(store, subCategoryIds, language); } } return manufacturerList; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getManufacturersByProductAndCategory File: sm-shop/src/main/java/com/salesmanager/shop/store/controller/category/ShoppingCategoryController.java Repository: shopizer-ecommerce/shopizer The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-33561
LOW
3.5
shopizer-ecommerce/shopizer
getManufacturersByProductAndCategory
sm-shop/src/main/java/com/salesmanager/shop/store/controller/category/ShoppingCategoryController.java
197f8c78c8f673b957e41ca2c823afc654c19271
0
Analyze the following code function for security vulnerabilities
public String getDisplayTitle() { return this.doc.getRenderedTitle(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisplayTitle File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getDisplayTitle
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public static int[] uncompressIntArray(byte[] input) throws IOException { return uncompressIntArray(input, 0, input.length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uncompressIntArray 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
uncompressIntArray
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
@Override public void onRingbackRequested(Call call, boolean ringback) { for (CallsManagerListener listener : mListeners) { listener.onRingbackRequested(call, ringback); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRingbackRequested 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
onRingbackRequested
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
public void dump(@NonNull PrintWriter pw, @NonNull String prefix, DumpFilter filter) { pw.println(); pw.print(prefix); pw.print("Package: "); pw.print(getPackageName()); pw.print(" UID: "); pw.print(mPackageUid); pw.println(); pw.print(prefix); pw.print(" "); pw.print("Calls: "); pw.print(getApiCallCount(/*unlimited=*/ false)); pw.println(); // getApiCallCount() may have updated mLastKnownForegroundElapsedTime. pw.print(prefix); pw.print(" "); pw.print("Last known FG: "); pw.print(mLastKnownForegroundElapsedTime); pw.println(); // This should be after getApiCallCount(), which may update it. pw.print(prefix); pw.print(" "); pw.print("Last reset: ["); pw.print(mLastResetTime); pw.print("] "); pw.print(ShortcutService.formatTime(mLastResetTime)); pw.println(); getPackageInfo().dump(pw, prefix + " "); pw.println(); pw.print(prefix); pw.println(" Shortcuts:"); final long[] totalBitmapSize = new long[1]; forEachShortcut(si -> { pw.println(si.toDumpString(prefix + " ")); if (si.getBitmapPath() != null) { final long len = new File(si.getBitmapPath()).length(); pw.print(prefix); pw.print(" "); pw.print("bitmap size="); pw.println(len); totalBitmapSize[0] += len; } }); pw.print(prefix); pw.print(" "); pw.print("Total bitmap size: "); pw.print(totalBitmapSize[0]); pw.print(" ("); pw.print(Formatter.formatFileSize(mShortcutUser.mService.mContext, totalBitmapSize[0])); pw.println(")"); pw.println(); synchronized (mLock) { mShortcutBitmapSaver.dumpLocked(pw, " "); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump 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
dump
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
@HotPath(caller = HotPath.PROCESS_CHANGE) @Override public void onProcessRemoved(String name, int uid) { synchronized (mGlobalLockWithoutBoost) { mProcessNames.remove(name, uid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onProcessRemoved 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
onProcessRemoved
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void setGroupManager(NotificationGroupManager groupManager) { mGroupManager = groupManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setGroupManager 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
setGroupManager
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id, Notification notification, int[] idOut, int userId) throws RemoteException { enqueueNotificationInternal(pkg, opPkg, Binder.getCallingUid(), Binder.getCallingPid(), tag, id, notification, idOut, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enqueueNotificationWithTag File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
enqueueNotificationWithTag
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@Override public void transferOwnership(@NonNull ComponentName admin, @NonNull ComponentName target, @Nullable PersistableBundle bundle) { if (!mHasFeature) { return; } Objects.requireNonNull(admin, "ComponentName is null"); Objects.requireNonNull(target, "Target cannot be null."); Preconditions.checkArgument(!admin.equals(target), "Provided administrator and target are the same object."); Preconditions.checkArgument(!admin.getPackageName().equals(target.getPackageName()), "Provided administrator and target have the same package name."); final CallerIdentity caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); final int callingUserId = caller.getUserId(); final DevicePolicyData policy = getUserData(callingUserId); final DeviceAdminInfo incomingDeviceInfo = findAdmin(target, callingUserId, /* throwForMissingPermission= */ true); checkActiveAdminPrecondition(target, incomingDeviceInfo, policy); Preconditions.checkArgument(incomingDeviceInfo.supportsTransferOwnership(), "Provided target does not support ownership transfer."); final long id = mInjector.binderClearCallingIdentity(); String ownerType = null; try { synchronized (getLockObject()) { /* * We must ensure the whole process is atomic to prevent the device from ending up * in an invalid state (e.g. no active admin). This could happen if the device * is rebooted or work mode is turned off mid-transfer. * In order to guarantee atomicity, we: * * 1. Save an atomic journal file describing the transfer process * 2. Perform the transfer itself * 3. Delete the journal file * * That way if the journal file exists on device boot, we know that the transfer * must be reverted back to the original administrator. This logic is implemented in * revertTransferOwnershipIfNecessaryLocked. * */ if (bundle == null) { bundle = new PersistableBundle(); } if (isProfileOwner(caller)) { ownerType = ADMIN_TYPE_PROFILE_OWNER; prepareTransfer(admin, target, bundle, callingUserId, ADMIN_TYPE_PROFILE_OWNER); transferProfileOwnershipLocked(admin, target, callingUserId); sendProfileOwnerCommand(DeviceAdminReceiver.ACTION_TRANSFER_OWNERSHIP_COMPLETE, getTransferOwnershipAdminExtras(bundle), callingUserId); postTransfer(DevicePolicyManager.ACTION_PROFILE_OWNER_CHANGED, callingUserId); if (isUserAffiliatedWithDeviceLocked(callingUserId)) { notifyAffiliatedProfileTransferOwnershipComplete(callingUserId); } } else if (isDefaultDeviceOwner(caller)) { ownerType = ADMIN_TYPE_DEVICE_OWNER; prepareTransfer(admin, target, bundle, callingUserId, ADMIN_TYPE_DEVICE_OWNER); transferDeviceOwnershipLocked(admin, target, callingUserId); sendDeviceOwnerCommand(DeviceAdminReceiver.ACTION_TRANSFER_OWNERSHIP_COMPLETE, getTransferOwnershipAdminExtras(bundle)); postTransfer(DevicePolicyManager.ACTION_DEVICE_OWNER_CHANGED, callingUserId); } } } finally { mInjector.binderRestoreCallingIdentity(id); } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.TRANSFER_OWNERSHIP) .setAdmin(admin) .setStrings(target.getPackageName(), ownerType) .write(); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2023-21284 - Severity: MEDIUM - CVSS Score: 5.5 Description: Ensure policy has no absurdly long strings The following APIs now enforce limits and throw IllegalArgumentException when limits are violated: * DPM.setTrustAgentConfiguration() limits agent packgage name, component name, and strings within configuration bundle. * DPM.setPermittedAccessibilityServices() limits package names. * DPM.setPermittedInputMethods() limits package names. * DPM.setAccountManagementDisabled() limits account name. * DPM.setLockTaskPackages() limits package names. * DPM.setAffiliationIds() limits id. * DPM.transferOwnership() limits strings inside the bundle. Package names are limited at 223, because they become directory names and it is a filesystem restriction, see FrameworkParsingPackageUtils. All other strings are limited at 65535, because longer ones break binary XML serializer. The following APIs silently truncate strings that are long beyond reason: * DPM.setShortSupportMessage() truncates message at 200. * DPM.setLongSupportMessage() truncates message at 20000. * DPM.setOrganizationName() truncates org name at 200. Bug: 260729089 Test: atest com.android.server.devicepolicy (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5dd3e81347e3c841510094fb5effd51fc0fa995b) Merged-In: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Change-Id: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Function: transferOwnership File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android Fixed Code: @Override public void transferOwnership(@NonNull ComponentName admin, @NonNull ComponentName target, @Nullable PersistableBundle bundle) { if (!mHasFeature) { return; } Objects.requireNonNull(admin, "ComponentName is null"); Objects.requireNonNull(target, "Target cannot be null."); Preconditions.checkArgument(!admin.equals(target), "Provided administrator and target are the same object."); Preconditions.checkArgument(!admin.getPackageName().equals(target.getPackageName()), "Provided administrator and target have the same package name."); if (bundle != null) { enforceMaxStringLength(bundle, "bundle"); } final CallerIdentity caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); final int callingUserId = caller.getUserId(); final DevicePolicyData policy = getUserData(callingUserId); final DeviceAdminInfo incomingDeviceInfo = findAdmin(target, callingUserId, /* throwForMissingPermission= */ true); checkActiveAdminPrecondition(target, incomingDeviceInfo, policy); Preconditions.checkArgument(incomingDeviceInfo.supportsTransferOwnership(), "Provided target does not support ownership transfer."); final long id = mInjector.binderClearCallingIdentity(); String ownerType = null; try { synchronized (getLockObject()) { /* * We must ensure the whole process is atomic to prevent the device from ending up * in an invalid state (e.g. no active admin). This could happen if the device * is rebooted or work mode is turned off mid-transfer. * In order to guarantee atomicity, we: * * 1. Save an atomic journal file describing the transfer process * 2. Perform the transfer itself * 3. Delete the journal file * * That way if the journal file exists on device boot, we know that the transfer * must be reverted back to the original administrator. This logic is implemented in * revertTransferOwnershipIfNecessaryLocked. * */ if (bundle == null) { bundle = new PersistableBundle(); } if (isProfileOwner(caller)) { ownerType = ADMIN_TYPE_PROFILE_OWNER; prepareTransfer(admin, target, bundle, callingUserId, ADMIN_TYPE_PROFILE_OWNER); transferProfileOwnershipLocked(admin, target, callingUserId); sendProfileOwnerCommand(DeviceAdminReceiver.ACTION_TRANSFER_OWNERSHIP_COMPLETE, getTransferOwnershipAdminExtras(bundle), callingUserId); postTransfer(DevicePolicyManager.ACTION_PROFILE_OWNER_CHANGED, callingUserId); if (isUserAffiliatedWithDeviceLocked(callingUserId)) { notifyAffiliatedProfileTransferOwnershipComplete(callingUserId); } } else if (isDefaultDeviceOwner(caller)) { ownerType = ADMIN_TYPE_DEVICE_OWNER; prepareTransfer(admin, target, bundle, callingUserId, ADMIN_TYPE_DEVICE_OWNER); transferDeviceOwnershipLocked(admin, target, callingUserId); sendDeviceOwnerCommand(DeviceAdminReceiver.ACTION_TRANSFER_OWNERSHIP_COMPLETE, getTransferOwnershipAdminExtras(bundle)); postTransfer(DevicePolicyManager.ACTION_DEVICE_OWNER_CHANGED, callingUserId); } } } finally { mInjector.binderRestoreCallingIdentity(id); } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.TRANSFER_OWNERSHIP) .setAdmin(admin) .setStrings(target.getPackageName(), ownerType) .write(); }
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
transferOwnership
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
1
Analyze the following code function for security vulnerabilities
void makeInvisible() { if (!mVisibleRequested) { if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Already invisible: " + this); return; } // Now for any activities that aren't visible to the user, make sure they no longer are // keeping the screen frozen. if (DEBUG_VISIBILITY) { Slog.v(TAG_VISIBILITY, "Making invisible: " + this + ", state=" + getState()); } try { final boolean canEnterPictureInPicture = checkEnterPictureInPictureState( "makeInvisible", true /* beforeStopping */); // Defer telling the client it is hidden if it can enter Pip and isn't current paused, // stopped or stopping. This gives it a chance to enter Pip in onPause(). final boolean deferHidingClient = canEnterPictureInPicture && !isState(STARTED, STOPPING, STOPPED, PAUSED); setDeferHidingClient(deferHidingClient); setVisibility(false); switch (getState()) { case STOPPING: case STOPPED: // Reset the flag indicating that an app can enter picture-in-picture once the // activity is hidden supportsEnterPipOnTaskSwitch = false; break; case RESUMED: case INITIALIZING: case PAUSING: case PAUSED: case STARTED: addToStopping(true /* scheduleIdle */, canEnterPictureInPicture /* idleDelayed */, "makeInvisible"); break; default: break; } } catch (Exception e) { // Just skip on any failure; we'll make it visible when it next restarts. Slog.w(TAG, "Exception thrown making hidden: " + intent.getComponent(), e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeInvisible 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
makeInvisible
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public static void writeString(@NonNull File file, @NonNull Optional<String> value) throws IOException { if (value.isPresent()) { Files.write(file.toPath(), value.get().getBytes(StandardCharsets.UTF_8)); } else { file.delete(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeString 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
writeString
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
private void incrementAesByteBlockPointer(int incrementBy) { aes16ByteBlockPointer += incrementBy; if (aes16ByteBlockPointer >= 15) { aes16ByteBlockPointer = 15; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incrementAesByteBlockPointer File: src/main/java/net/lingala/zip4j/io/inputstream/AesCipherInputStream.java Repository: srikanth-lingala/zip4j The code follows secure coding practices.
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
incrementAesByteBlockPointer
src/main/java/net/lingala/zip4j/io/inputstream/AesCipherInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
0
Analyze the following code function for security vulnerabilities
private void sendOrSaveMessage(SendOrSaveCallback callback, final long messageIdToSave, final SendOrSaveMessage sendOrSaveMessage, final ReplyFromAccount selectedAccount) { final ContentResolver resolver = getContentResolver(); final boolean updateExistingMessage = messageIdToSave != UIProvider.INVALID_MESSAGE_ID; final String accountMethod = sendOrSaveMessage.mSave ? UIProvider.AccountCallMethods.SAVE_MESSAGE : UIProvider.AccountCallMethods.SEND_MESSAGE; try { if (updateExistingMessage) { sendOrSaveMessage.mValues.put(BaseColumns._ID, messageIdToSave); callAccountSendSaveMethod(resolver, selectedAccount.account, accountMethod, sendOrSaveMessage); } else { Uri messageUri = null; final Bundle result = callAccountSendSaveMethod(resolver, selectedAccount.account, accountMethod, sendOrSaveMessage); if (result != null) { // If a non-null value was returned, then the provider handled the call // method messageUri = result.getParcelable(UIProvider.MessageColumns.URI); } if (sendOrSaveMessage.mSave && messageUri != null) { final Cursor messageCursor = resolver.query(messageUri, UIProvider.MESSAGE_PROJECTION, null, null, null); if (messageCursor != null) { try { if (messageCursor.moveToFirst()) { // Broadcast notification that a new message has // been allocated callback.notifyMessageIdAllocated(sendOrSaveMessage, new Message(messageCursor)); } } finally { messageCursor.close(); } } } } } finally { // Close any opened file descriptors closeOpenedAttachmentFds(sendOrSaveMessage); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendOrSaveMessage 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
sendOrSaveMessage
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private void setUserdataInternal(UserAccounts accounts, Account account, String key, String value) { synchronized (accounts.dbLock) { accounts.accountsDb.beginTransaction(); try { long accountId = accounts.accountsDb.findDeAccountId(account); if (accountId < 0) { return; } long extrasId = accounts.accountsDb.findExtrasIdByAccountId(accountId, key); if (extrasId < 0) { extrasId = accounts.accountsDb.insertExtra(accountId, key, value); if (extrasId < 0) { return; } } else if (!accounts.accountsDb.updateExtra(extrasId, value)) { return; } accounts.accountsDb.setTransactionSuccessful(); } finally { accounts.accountsDb.endTransaction(); } synchronized (accounts.cacheLock) { writeUserDataIntoCacheLocked(accounts, account, key, value); AccountManager.invalidateLocalAccountUserDataCaches(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserdataInternal 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
setUserdataInternal
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private void clearUserPoliciesLocked(int userId) { // Reset some of the user-specific policies. final DevicePolicyData policy = getUserData(userId); policy.mPermissionPolicy = DevicePolicyManager.PERMISSION_POLICY_PROMPT; // Clear delegations. policy.mDelegationMap.clear(); policy.mStatusBarDisabled = false; policy.mSecondaryLockscreenEnabled = false; policy.mUserProvisioningState = DevicePolicyManager.STATE_USER_UNMANAGED; policy.mAffiliationIds.clear(); resetAffiliationCacheLocked(); policy.mLockTaskPackages.clear(); if (!isPolicyEngineForFinanceFlagEnabled()) { updateLockTaskPackagesLocked(mContext, policy.mLockTaskPackages, userId); } policy.mLockTaskFeatures = DevicePolicyManager.LOCK_TASK_FEATURE_NONE; saveSettingsLocked(userId); try { mIPermissionManager.updatePermissionFlagsForAllApps( PackageManager.FLAG_PERMISSION_POLICY_FIXED, 0 /* flagValues */, userId); pushUserRestrictions(userId); } catch (RemoteException re) { // Shouldn't happen. Slogf.wtf(LOG_TAG, "Failing in updatePermissionFlagsForAllApps", re); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearUserPoliciesLocked File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
clearUserPoliciesLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
boolean isKeyguardLocked() { return (mDisplayContent != null) ? mDisplayContent.isKeyguardLocked() : mRootWindowContainer.getDefaultDisplay().isKeyguardLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isKeyguardLocked 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
isKeyguardLocked
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public java.io.@Nullable Reader getCharacterStream(int i) throws SQLException { String value = getString(i); if (value == null) { return null; } // Version 7.2 supports AsciiStream for all the PG text types // As the spec/javadoc for this method indicate this is to be used for // large text values (i.e. LONGVARCHAR) PG doesn't have a separate // long string datatype, but with toast the text datatype is capable of // handling very large values. Thus the implementation ends up calling // getString() since there is no current way to stream the value from the server return new CharArrayReader(value.toCharArray()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCharacterStream 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
getCharacterStream
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public void sendHeader(int major, int minor, int revision) throws IOException { synchronized (_outputStream) { _outputStream.write("AMQP".getBytes("US-ASCII")); _outputStream.write(0); _outputStream.write(major); _outputStream.write(minor); _outputStream.write(revision); try { _outputStream.flush(); } catch (SSLHandshakeException e) { LOGGER.error("TLS connection failed: {}", e.getMessage()); throw e; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendHeader File: src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
sendHeader
src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
private void setListening(boolean listening) { mKeyguardStatusBar.setListening(listening); if (mQs == null) return; mQs.setListening(listening); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setListening 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
setListening
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static ObjectStreamClass lookup(Class<?> cl) { ObjectStreamClass osc = lookupStreamClass(cl); return (osc.isSerializable() || osc.isExternalizable()) ? osc : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookup 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
lookup
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Pure private void initSqlType(Field field) throws SQLException { if (field.isTypeInitialized()) { return; } TypeInfo typeInfo = connection.getTypeInfo(); int oid = field.getOID(); String pgType = castNonNull(typeInfo.getPGType(oid)); int sqlType = typeInfo.getSQLType(pgType); field.setSQLType(sqlType); field.setPGType(pgType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initSqlType 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
initSqlType
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
private boolean extractSearchParamsDstu3CapabilityStatement(IBaseResource theConformance, String resourceName, TreeSet<String> includes, TreeSet<String> theRevIncludes, TreeSet<String> sortParams, boolean haveSearchParams, List<List<String>> queryIncludes) { CapabilityStatement conformance = (org.hl7.fhir.dstu3.model.CapabilityStatement) theConformance; for (CapabilityStatementRestComponent nextRest : conformance.getRest()) { for (CapabilityStatementRestResourceComponent nextRes : nextRest.getResource()) { if (nextRes.getTypeElement().getValue().equals(resourceName)) { for (StringType next : nextRes.getSearchInclude()) { if (next.isEmpty() == false) { includes.add(next.getValue()); } } for (CapabilityStatementRestResourceSearchParamComponent next : nextRes.getSearchParam()) { if (next.getTypeElement().getValue() != org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE) { sortParams.add(next.getNameElement().getValue()); } } if (nextRes.getSearchParam().size() > 0) { haveSearchParams = true; } } else { // It's a different resource from the one we're searching, so // scan for revinclude candidates for (CapabilityStatementRestResourceSearchParamComponent next : nextRes.getSearchParam()) { if (next.getTypeElement().getValue() == org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE) { } } } } } return haveSearchParams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractSearchParamsDstu3CapabilityStatement File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
extractSearchParamsDstu3CapabilityStatement
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
0
Analyze the following code function for security vulnerabilities
@Override public String getBreadCrumb() { try { return getTextBreadCrumb(printBreadCrumb()); } catch (IOException e) { SilverLogger.getLogger(this).error(e.getMessage(), e); } return ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBreadCrumb File: core-web/src/main/java/org/silverpeas/core/web/util/viewgenerator/html/browsebars/BrowseBarComplete.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
getBreadCrumb
core-web/src/main/java/org/silverpeas/core/web/util/viewgenerator/html/browsebars/BrowseBarComplete.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
@Override public String getString() throws IOException { return getString(HttpConstants.DEFAULT_CHARSET); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getString File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java Repository: netty The code follows secure coding practices.
[ "CWE-378", "CWE-379" ]
CVE-2021-21290
LOW
1.9
netty
getString
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
c735357bf29d07856ad171c6611a2e1a0e0000ec
0
Analyze the following code function for security vulnerabilities
public String getLockingUser() { try { XWikiLock lock = this.doc.getLock(getXWikiContext()); if (lock != null && !getXWikiContext().getUser().equals(lock.getUserName())) { return lock.getUserName(); } else { return ""; } } catch (XWikiException e) { return ""; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLockingUser File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getLockingUser
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public void setAvoidMoveToFront() { mAvoidMoveToFront = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAvoidMoveToFront File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
setAvoidMoveToFront
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") final ProcessRecord startProcessLocked(String processName, ApplicationInfo info, boolean knownToBeDead, int intentFlags, HostingRecord hostingRecord, int zygotePolicyFlags, boolean allowWhileBooting, boolean isolated) { return mProcessList.startProcessLocked(processName, info, knownToBeDead, intentFlags, hostingRecord, zygotePolicyFlags, allowWhileBooting, isolated, 0 /* isolatedUid */, false /* isSdkSandbox */, 0 /* sdkSandboxClientAppUid */, null /* sdkSandboxClientAppPackage */, null /* ABI override */, null /* entryPoint */, null /* entryPointArgs */, null /* crashHandler */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startProcessLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
startProcessLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public ViewPage createPage(EntityReference reference, String content, String title, String syntaxId) { return createPage(reference, content, title, syntaxId, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createPage 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
createPage
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private static List<Config> modconf(final Collection<Object> bag) { return bag.stream() .filter(it -> it instanceof Jooby.Module) .map(it -> ((Jooby.Module) it).config()) .filter(c -> !c.isEmpty()) .collect(Collectors.toList()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: modconf File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
modconf
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public int getViewportSizeOffsetWidthPix() { return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getViewportSizeOffsetWidthPix File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
getViewportSizeOffsetWidthPix
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setCaption(String caption) { Objects.requireNonNull(caption, "Header caption can't be null"); if (caption.equals(getState(false).caption)) { return this; } getState().caption = caption; HeaderRow row = getGrid().getDefaultHeaderRow(); if (row != null) { row.getCell(this).setText(caption); } return this; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2019-25028 - Severity: MEDIUM - CVSS Score: 4.3 Description: Sanitize input used in Grid header Function: setCaption File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework Fixed Code: public Column<T, V> setCaption(String caption) { Objects.requireNonNull(caption, "Header caption can't be null"); caption = Jsoup.clean(caption, Whitelist.none()); if (caption.equals(getState(false).caption)) { return this; } getState().caption = caption; HeaderRow row = getGrid().getDefaultHeaderRow(); if (row != null) { row.getCell(this).setText(caption); } return this; }
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setCaption
server/src/main/java/com/vaadin/ui/Grid.java
c7cf0a63ce9810a529f4af5b931e7a53809424b2
1
Analyze the following code function for security vulnerabilities
protected String sanitize(String value) { String result = value; try { result = URLEncoder.encode(value, "UTF-8"); } catch (UnsupportedEncodingException ex) { // Should never happen since the UTF-8 encoding is always available in the platform, // see http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/Charset.html } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sanitize File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
sanitize
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
public void setResult(boolean result) { this.result = result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResult File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogLogin.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
setResult
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogLogin.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
@Override public void onPause() { super.onPause(); if (mSaveAndFinishWorker != null) { mSaveAndFinishWorker.setListener(null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPause File: src/com/android/settings/password/ChooseLockPattern.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
onPause
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
String databaseFieldToPojoSetter(String str) { StringBuilder sb = new StringBuilder(str); sb.replace(0, 1, String.valueOf(Character.toUpperCase(sb.charAt(0)))); for (int i = 0; i < sb.length(); i++) { if (sb.charAt(i) == '_') { sb.deleteCharAt(i); sb.replace(i, i + 1, String.valueOf(Character.toUpperCase(sb.charAt(i)))); } } return "set" + sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: databaseFieldToPojoSetter File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
databaseFieldToPojoSetter
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public List<SvnInfoP> invoke(File ws, VirtualChannel channel) throws IOException { List<SvnInfoP> revisions = new ArrayList<SvnInfoP>(); final SvnClientManager manager = createClientManager(authProvider); try { final SVNWCClient svnWc = manager.getWCClient(); // invoke the "svn info" for( ModuleLocation module : locations ) { try { SvnInfo info = new SvnInfo(svnWc.doInfo(new File(ws,module.getLocalDir()), SVNRevision.WORKING)); revisions.add(new SvnInfoP(info, false)); } catch (SVNException e) { e.printStackTrace(listener.error("Failed to parse svn info for "+module.remote)); } } for(External ext : externals){ try { SvnInfo info = new SvnInfo(svnWc.doInfo(new File(ws,ext.path),SVNRevision.WORKING)); revisions.add(new SvnInfoP(info, ext.isRevisionFixed())); } catch (SVNException e) { e.printStackTrace(listener.error("Failed to parse svn info for external "+ext.url+" at "+ext.path)); } } return revisions; } finally { manager.dispose(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invoke 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
invoke
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@TestApi @RequiresPermission(anyOf = { android.Manifest.permission.MARK_DEVICE_ORGANIZATION_OWNED, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS }, conditional = true) public void setProfileOwnerOnOrganizationOwnedDevice(@NonNull ComponentName who, boolean isProfileOwnerOnOrganizationOwnedDevice) { if (mService == null) { return; } try { mService.setProfileOwnerOnOrganizationOwnedDevice(who, myUserId(), isProfileOwnerOnOrganizationOwnedDevice); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProfileOwnerOnOrganizationOwnedDevice 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
setProfileOwnerOnOrganizationOwnedDevice
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public boolean registerForegroundServiceObserver(IForegroundServiceObserver callback) { final int callingUid = Binder.getCallingUid(); final int permActivityTasks = checkCallingPermission(MANAGE_ACTIVITY_TASKS); final int permAcrossUsersFull = checkCallingPermission(INTERACT_ACROSS_USERS_FULL); if (permActivityTasks != PackageManager.PERMISSION_GRANTED || permAcrossUsersFull != PERMISSION_GRANTED) { String msg = "Permission Denial: registerForegroundServiceObserver() from pid=" + Binder.getCallingPid() + ", uid=" + callingUid + " requires " + MANAGE_ACTIVITY_TASKS + " and " + INTERACT_ACROSS_USERS_FULL; Slog.w(TAG, msg); throw new SecurityException(msg); } synchronized (this) { return mServices.registerForegroundServiceObserverLocked(callingUid, callback); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerForegroundServiceObserver 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
registerForegroundServiceObserver
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
protected byte[] doDownload(String url) { if (DEBUG) Log.d(TAG, "Downloading XTRA data from " + url); HttpURLConnection connection = null; try { connection = (HttpURLConnection) (new URL(url)).openConnection(); connection.setRequestProperty( "Accept", "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic"); connection.setRequestProperty( "x-wap-profile", "http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#"); connection.setConnectTimeout(CONNECTION_TIMEOUT_MS); connection.connect(); int statusCode = connection.getResponseCode(); if (statusCode != HttpURLConnection.HTTP_OK) { if (DEBUG) Log.d(TAG, "HTTP error downloading gps XTRA: " + statusCode); return null; } return Streams.readFully(connection.getInputStream()); } catch (IOException ioe) { if (DEBUG) Log.d(TAG, "Error downloading gps XTRA: ", ioe); } finally { if (connection != null) { connection.disconnect(); } } return null; }
Vulnerability Classification: - CWE: CWE-399 - CVE: CVE-2016-5348 - Severity: HIGH - CVSS Score: 7.1 Description: DO NOT MERGE: Fix vulnerability where large GPS XTRA data can be injected. -Can potentially crash system with OOM. Bug: 29555864 Change-Id: I7157f48dddf148a9bcab029cf12e26a58d8054f4 (cherry picked from commit 79375723f0f201a6759ddbfda57d491ff3fea64e) Function: doDownload File: services/core/java/com/android/server/location/GpsXtraDownloader.java Repository: android Fixed Code: protected byte[] doDownload(String url) { if (DEBUG) Log.d(TAG, "Downloading XTRA data from " + url); HttpURLConnection connection = null; try { connection = (HttpURLConnection) (new URL(url)).openConnection(); connection.setRequestProperty( "Accept", "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic"); connection.setRequestProperty( "x-wap-profile", "http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#"); connection.setConnectTimeout(CONNECTION_TIMEOUT_MS); connection.connect(); int statusCode = connection.getResponseCode(); if (statusCode != HttpURLConnection.HTTP_OK) { if (DEBUG) Log.d(TAG, "HTTP error downloading gps XTRA: " + statusCode); return null; } try (InputStream in = connection.getInputStream()) { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int count; while ((count = in.read(buffer)) != -1) { bytes.write(buffer, 0, count); if (bytes.size() > MAXIMUM_CONTENT_LENGTH_BYTES) { if (DEBUG) Log.d(TAG, "XTRA file too large"); return null; } } return bytes.toByteArray(); } } catch (IOException ioe) { if (DEBUG) Log.d(TAG, "Error downloading gps XTRA: ", ioe); } finally { if (connection != null) { connection.disconnect(); } } return null; }
[ "CWE-399" ]
CVE-2016-5348
HIGH
7.1
android
doDownload
services/core/java/com/android/server/location/GpsXtraDownloader.java
218b813d5bc2d7d3952ea1861c38b4aa944ac59b
1
Analyze the following code function for security vulnerabilities
protected ValueConverter<V> valueConverter() { return valueConverter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: valueConverter File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
valueConverter
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
private long toLong(K name, V value) { try { return valueConverter.convertToLong(value); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Failed to convert header value to long for header '" + name + '\''); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toLong File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
toLong
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public void sendSetDisconnected(String id, int disconnectCause) throws Exception { mConnectionById.get(id).state = Connection.STATE_DISCONNECTED; mConnectionById.get(id).disconnectCause = new DisconnectCause(disconnectCause); for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.setDisconnected(id, mConnectionById.get(id).disconnectCause, null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendSetDisconnected File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
sendSetDisconnected
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public static int getEmbeddedPort() { return embeddedPort; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEmbeddedPort File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
getEmbeddedPort
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private void setDarkAmount(float amount) { mDarkAmount = amount; mKeyguardStatusView.setDark(amount == 1); positionClockAndNotifications(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDarkAmount 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
setDarkAmount
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public long optLong(String key, long defaultValue) { Object o = opt(key); if (o == null) { return defaultValue; } else { try { return doGetLong(key, o); } catch (JSONException ex) { throw new RuntimeException(ex); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optLong File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
optLong
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public static LocationTag getLocationTag(String identifier) { LocationTag tag = null; if (identifier != null) { identifier = identifier.trim(); // first try to fetch by id try { Integer id = Integer.valueOf(identifier); tag = Context.getLocationService().getLocationTag(id); if (tag != null) { return tag; } } catch (NumberFormatException e) {} // if not, try to fetch by name tag = Context.getLocationService().getLocationTagByName(identifier); if (tag != null) { return tag; } // TODO add ability to fetch by uuid once we are no longer worried about being compatible with OpenMRS 1.6 (since getLocationTagByUuid is not available in 1.6) } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocationTag File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
getLocationTag
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
public void sendUpdateWindowSize(int streamId, int delta) throws IOException { Http2WindowUpdateStreamSinkChannel windowUpdateStreamSinkChannel = new Http2WindowUpdateStreamSinkChannel(this, streamId, delta); flushChannel(windowUpdateStreamSinkChannel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendUpdateWindowSize File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
sendUpdateWindowSize
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
static void invokeMethod(Component instance, Class<?> clazz, String methodName, JsonArray args, int promiseId) { invokeMethod(instance, clazz, methodName, args, promiseId, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invokeMethod File: flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25500
MEDIUM
4.3
vaadin/flow
invokeMethod
flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
1fa4976902a117455bf2f98b191f8c80692b53c8
0
Analyze the following code function for security vulnerabilities
public Set<String> getAllPermittedIndicesForDashboards(Resolved resolved, User user, String[] actions, IndexNameExpressionResolver resolver, ClusterService cs) { Set<String> retVal = new HashSet<>(); for (SecurityRole sr : roles) { retVal.addAll(sr.getAllResolvedPermittedIndices(Resolved._LOCAL_ALL, user, actions, resolver, cs)); retVal.addAll(resolved.getRemoteIndices()); } return Collections.unmodifiableSet(retVal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllPermittedIndicesForDashboards File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
getAllPermittedIndicesForDashboards
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
void updateUserDepart(@Param("username") String username,@Param("orgCode") String orgCode);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateUserDepart File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
updateUserDepart
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0
Analyze the following code function for security vulnerabilities
public void setProcessLimit(int max) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(max); mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProcessLimit File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setProcessLimit
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
protected void setClientKexData(byte[] data) { ValidateUtils.checkNotNullAndNotEmpty(data, "No client KEX seed"); synchronized (kexState) { clientKexData = data.clone(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClientKexData File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
setClientKexData
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@Override public void setLocale(Locale arg0) { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLocale File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
setLocale
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { ((HttpBearerAuth) auth).setBearerToken(bearerToken); return this; } } throw new RuntimeException("No Bearer authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBearerToken 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
setBearerToken
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
public void setEncoded(String encoded) { this.encoded = encoded; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEncoded File: base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setEncoded
base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) private static boolean componentNameExists( @NonNull ComponentName componentName, @NonNull Context context, int userId) { Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); mediaButtonIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); mediaButtonIntent.setComponent(componentName); UserHandle userHandle = UserHandle.of(userId); PackageManager pm = context.getPackageManager(); List<ResolveInfo> resolveInfos = pm.queryBroadcastReceiversAsUser( mediaButtonIntent, /* flags */ 0, userHandle); return !resolveInfos.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: componentNameExists File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21285
MEDIUM
5.5
android
componentNameExists
services/core/java/com/android/server/media/MediaSessionRecord.java
0c3b7ec3377e7fb645ec366be3be96bb1a252ca1
0
Analyze the following code function for security vulnerabilities
@Deprecated public static String escape(Object content) { return escape(Objects.toString(content, null)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escape File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java Repository: xwiki/xwiki-commons The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-24898
MEDIUM
4
xwiki/xwiki-commons
escape
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
947e8921ebd95462d5a7928f397dd1b64f77c7d5
0
Analyze the following code function for security vulnerabilities
@Override public int getMACLength() { return haskey ? 16 : 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMACLength File: src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
getMACLength
src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
public void broadcastScanResultEvent(String iface) { sendMessage(iface, SCAN_RESULTS_EVENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastScanResultEvent File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
broadcastScanResultEvent
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public boolean isAutoUpdateStateMismatch(MaterialConfigs materialAutoUpdateMap) { if (materialAutoUpdateMap.size() > 1) { for (MaterialConfig otherMaterial : materialAutoUpdateMap) { if (otherMaterial.isAutoUpdate() != this.autoUpdate) { return true; } } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAutoUpdateStateMismatch File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
isAutoUpdateStateMismatch
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
private boolean isLegacy() { if (!mIsLegacyInitialized) { mIsLegacy = mContext.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.LOLLIPOP; mIsLegacyInitialized = true; } return mIsLegacy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLegacy File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
isLegacy
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public String getContentMetadataAsString(File metadataFile) throws Exception { Logger.debug(this.getClass(), "DEBUG --> Parsing Metadata from file: " + metadataFile.getPath() ); //Check if Metadata Max Size is set (in Bytes) int metadataLimitInBytes = Config.getIntProperty("META_DATA_MAX_SIZE", 5) * 1024 * 1024; //If Max Size limit is greater than what Java allows for Int values if(metadataLimitInBytes > Integer.MAX_VALUE){ metadataLimitInBytes = Integer.MAX_VALUE; } //Subtracting 1024 Bytes (buffer size) metadataLimitInBytes = metadataLimitInBytes - 1024; String type=new Tika().detect(metadataFile); InputStream input=new FileInputStream(metadataFile); if(type.equals("application/x-gzip")) { // gzip compression was used input = new GZIPInputStream(input); } else if(type.equals("application/x-bzip2")) { // bzip2 compression was used input = new BZip2CompressorInputStream(input); } //Depending on the max limit of the metadata file size, //we'll get as many bytes as we can so we can parse it //and then they'll be added to the ContentMap ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[1024]; int bytesRead = 0; int copied = 0; while (bytesRead < metadataLimitInBytes && (copied = input.read(buf,0,buf.length)) > -1 ) { baos.write(buf,0,copied); bytesRead = bytesRead + copied; } InputStream limitedInput = new ByteArrayInputStream(baos.toByteArray()); //let's close the original input since it's no longer necessary to keep it open if (input != null) { try { input.close(); } catch (IOException e) { Logger.error(this.getClass(), "There was a problem with parsing a file Metadata: " + e.getMessage(), e); } } return IOUtils.toString(limitedInput); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentMetadataAsString File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
getContentMetadataAsString
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0