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 static String createChecksum(final InputStream data) throws IOException { return DigestUtils.md5Hex(data); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createChecksum File: src/main/java/cloudsync/connector/LocalFilesystemConnector.java Repository: HolgerHees/cloudsync The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-4773
LOW
3.3
HolgerHees/cloudsync
createChecksum
src/main/java/cloudsync/connector/LocalFilesystemConnector.java
3ad796833398af257c28e0ebeade68518e0e612a
0
Analyze the following code function for security vulnerabilities
private static ParaClient client() { return ScooldUtils.getInstance().getParaClient(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: client File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
client
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public boolean canTaskOverlayResume() { return mTaskOverlayCanResume; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canTaskOverlayResume File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
canTaskOverlayResume
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public void setCoordinator(CoordinatorManager coord){ coordinator = coord; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCoordinator File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
setCoordinator
src/main/java/org/olat/modules/wiki/WikiManager.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
private void setPage(final SgmlPage newPage) { if (page_ == newPage) { return; // nothing to do } page_ = newPage; for (final DomNode node : getChildren()) { node.setPage(newPage); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPage File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
setPage
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M1") @Override public String getPageName() { return this.getName(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageName File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
getPageName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
@Test public void getByIds(TestContext context) { Async async = context.async(); String id1 = randomUuid(); String id2 = randomUuid(); JsonArray ids = new JsonArray().add(id1).add(id2); insertXAndSingleQuotePojo(context, ids).getById(FOO, ids, get -> { assertSuccess(context, get); context.assertEquals(2, get.result().size()); context.assertEquals("x", get.result().get(id1).getString("key")); context.assertEquals("'", get.result().get(id2).getString("key")); async.complete(); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getByIds File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
getByIds
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public boolean publishRecording(File destDir, String recordingId, File recordingDir, String format) { File metadataXml = recordingServiceHelper.getMetadataXmlLocation(recordingDir.getPath()); RecordingMetadata r = recordingServiceHelper.getRecordingMetadata(metadataXml); if (r != null) { if (!destDir.exists()) destDir.mkdirs(); try { FileUtils.moveDirectory(recordingDir, new File(destDir.getPath() + File.separatorChar + recordingId)); r.setState(Recording.STATE_PUBLISHED); r.setPublished(true); File medataXmlFile = recordingServiceHelper.getMetadataXmlLocation( destDir.getAbsolutePath() + File.separatorChar + recordingId); // Process the changes by saving the recording into metadata.xml return recordingServiceHelper.saveRecordingMetadata(medataXmlFile, r); } catch (IOException e) { log.error("Failed to publish recording : " + recordingId, e); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: publishRecording File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
publishRecording
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
public void addTrigger(Trigger<?> trigger) throws IOException { addToList(trigger,triggers()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addTrigger File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
addTrigger
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override protected Buffer buffer(final boolean fullRequest) { // INITIALIZATION // host port if (header(HEADER_HOST) == null) { setHostHeader(); } // form final Buffer formBuffer = formBuffer(); // query string final String queryString = queryString(); // user-agent // if (header("User-Agent") == null) { // header("User-Agent", Defaults.userAgent); // } // POST method requires Content-Type to be set if (method.equals("POST") && (contentLength() == null)) { contentLength(0); } // BUILD OUT final Buffer request = new Buffer(); request.append(method) .append(SPACE) .append(path); if (query != null && !query.isEmpty()) { request.append('?'); request.append(queryString); } request.append(SPACE) .append(httpVersion) .append(CRLF); populateHeaderAndBody(request, formBuffer, fullRequest); return request; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buffer File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
buffer
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
@RequestMapping("/") @ResponseBody public String list(Model model, // TODO model should no longer be injected @RequestParam(required = false, defaultValue = "FILENAME") SortBy sortBy, @RequestParam(required = false, defaultValue = "false") boolean desc, @RequestParam(required = false) String base) throws IOException, TemplateException { securityCheck(base); Path currentFolder = loggingPath(base); List<FileEntry> files = getFileProvider(currentFolder).getFileEntries(currentFolder); List<FileEntry> sortedFiles = sortFiles(files, sortBy, desc); model.addAttribute("sortBy", sortBy); model.addAttribute("desc", desc); model.addAttribute("files", sortedFiles); model.addAttribute("currentFolder", currentFolder.toAbsolutePath().toString()); model.addAttribute("base", base != null ? URLEncoder.encode(base, "UTF-8") : ""); model.addAttribute("parent", getParent(currentFolder)); model.addAttribute("stylesheets", stylesheets); return FreeMarkerTemplateUtils.processTemplateIntoString(freemarkerConfig.getTemplate("logview.ftl"), model); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-21234 - Severity: MEDIUM - CVSS Score: 4.0 Description: backport directory traversal vulnerability fix Function: list File: lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpoint.java Repository: lukashinsch/spring-boot-actuator-logview Fixed Code: @RequestMapping("/") @ResponseBody public String list(Model model, // TODO model should no longer be injected @RequestParam(required = false, defaultValue = "FILENAME") SortBy sortBy, @RequestParam(required = false, defaultValue = "false") boolean desc, @RequestParam(required = false) String base) throws IOException, TemplateException { Path currentFolder = loggingPath(base); securityCheck(currentFolder, null); List<FileEntry> files = getFileProvider(currentFolder).getFileEntries(currentFolder); List<FileEntry> sortedFiles = sortFiles(files, sortBy, desc); model.addAttribute("sortBy", sortBy); model.addAttribute("desc", desc); model.addAttribute("files", sortedFiles); model.addAttribute("currentFolder", currentFolder.toAbsolutePath().toString()); model.addAttribute("base", base != null ? URLEncoder.encode(base, "UTF-8") : ""); model.addAttribute("parent", getParent(currentFolder)); model.addAttribute("stylesheets", stylesheets); return FreeMarkerTemplateUtils.processTemplateIntoString(freemarkerConfig.getTemplate("logview.ftl"), model); }
[ "CWE-22" ]
CVE-2021-21234
MEDIUM
4
lukashinsch/spring-boot-actuator-logview
list
lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpoint.java
760acbb939a8d1f7d1a7dfcd51ca848eea04e772
1
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder d(byte[] data) { return cdata(data); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: d File: src/main/java/com/jamesmurty/utils/XMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
d
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public void stopFilteringMulticastPackets() { setMulticastFilter(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopFilteringMulticastPackets File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
stopFilteringMulticastPackets
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public static License getLicense() { return copyright.getLicense(CommonConstants.CMS_FILEPATH + CommonConstants.LICENSE_FILENAME); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLicense File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-29784
MEDIUM
5
sanluan/PublicCMS
getLicense
publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
d8d7626cf51e4968fb384e1637a3c0c9921f33e9
0
Analyze the following code function for security vulnerabilities
public boolean isScaledImageDrawingSupported() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isScaledImageDrawingSupported File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
isScaledImageDrawingSupported
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void stopIpClient() { if (mVerboseLoggingEnabled) { Log.v(getTag(), "stopIpClient IpClientWithPreConnection: " + mIpClientWithPreConnection); } if (mIpClient != null) { if (mIpClientWithPreConnection) { mIpClient.notifyPreconnectionComplete(false); } mIpClient.stop(); } mIpClientWithPreConnection = false; mSentHLPs = false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopIpClient File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
stopIpClient
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private static String replaceTextVar(String template, Map<String, Object> parameters, User user) { String finalMessageStr = template; Set<String> keys = parameters.keySet(); for(String key : keys) { if(getMapValue(key, parameters) instanceof String) { String value = (String)getMapValue(key, parameters); value = (value != null ? value : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/"+ key +"(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))" + key + "(\")?( )*/*( )*(>|(&gt;))",value); } } if(UtilMethods.isSet(user)) { Address address = new Address(); try { List<Address> adds = PublicAddressFactory.getAddressesByUserId(user.getUserId()); if (adds != null && adds.size() > 0) { address = (Address) adds.get(0); } } catch(Exception e) { Logger.error(EmailFactory.class, "Send To Friend Failed" + e); } //Variables replacement from user object finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varName(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varName(\")?( )*/*( )*(>|(&gt;))", (user.getFirstName()!=null) ? user.getFirstName() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varEmail(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varEmail(\")?( )*/*( )*(>|(&gt;))", (user.getEmailAddress()!=null) ? user.getEmailAddress() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varMiddleName(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varMiddleName(\")?( )*/*( )*(>|(&gt;))", (user.getMiddleName()!=null) ? user.getMiddleName() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varLastName(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varLastName(\")?( )*/*( )*(>|(&gt;))", (user.getLastName()!=null) ? user.getLastName() : ""); UserProxy userproxy; try { userproxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false); } catch (Exception e) { Logger.error(EmailFactory.class, e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varLastMessage(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varLastMessage(\")?( )*/*( )*(>|(&gt;))", (userproxy.getLastMessage()!=null) ? userproxy.getLastMessage() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varAddress1(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varAddress1(\")?( )*/*( )*(>|(&gt;))", (address.getStreet1()!=null) ? address.getStreet1() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varAddress2(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varAddress2(\")?( )*/*( )*(>|(&gt;))", (address.getStreet2()!=null) ? address.getStreet2() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varPhone(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varPhone(\")?( )*/*( )*(>|(&gt;))", (address.getPhone()!=null) ? address.getPhone() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varState(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varState(\")?( )*/*( )*(>|(&gt;))", (address.getState()!=null) ? address.getState() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varCity(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varCity(\")?( )*/*( )*(>|(&gt;))", (address.getCity()!=null) ? address.getCity() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varCountry(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varCountry(\")?( )*/*( )*(>|(&gt;))", (address.getCountry()!=null) ? address.getCountry() : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/varZip(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))varZip(\")?( )*/*( )*(>|(&gt;))", (address.getZip()!=null) ? address.getZip() : ""); //gets default company to get locale Company comp = PublicCompanyFactory.getDefaultCompany(); try { int varCounter = 1; for (;varCounter < 26;varCounter++) { String var = LanguageUtil.get(comp.getCompanyId(), comp.getLocale(), "user.profile.var" + varCounter); if (var!=null) var = var.replaceAll(" ","_"); String value = ""; try { value = BeanUtils.getSimpleProperty(userproxy, "var" + varCounter); } catch (Exception e) { Logger.error(EmailFactory.class, "An error as ocurred trying to access the variable var" + varCounter + " from the user proxy.", e); } finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/"+var+"(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))" + var + "(\")?( )*/*( )*(>|(&gt;))", (value != null) ? value : ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))/var" + varCounter + "(>|(&gt;))", ""); finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(&lt;))var" + varCounter + "(\")?( )*/*( )*(>|(&gt;))", (value != null) ? value : ""); } } catch(LanguageException le) { Logger.error(EmailFactory.class, le.getMessage()); } } return finalMessageStr; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replaceTextVar File: src/com/dotmarketing/factories/EmailFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
replaceTextVar
src/com/dotmarketing/factories/EmailFactory.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
private boolean enableAdminAndSetProfileOwner( @UserIdInt int userId, @UserIdInt int callingUserId, ComponentName adminComponent, String ownerName) { enableAndSetActiveAdmin(userId, callingUserId, adminComponent); return setProfileOwner(adminComponent, ownerName, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enableAdminAndSetProfileOwner 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
enableAdminAndSetProfileOwner
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void startTx(Handler<AsyncResult<SQLConnection>> done) { client.getConnection(res -> { if (res.succeeded()) { SQLConnection connection = res.result(); try { connection.setAutoCommit(false, res1 -> { if (res1.failed()) { connection.close(); done.handle(Future.failedFuture(res1.cause())); } else { done.handle(Future.succeededFuture(connection)); } }); } catch (Exception e) { log.error(e.getMessage(), e); if (connection != null) { connection.close(); } done.handle(Future.failedFuture(e)); } } else{ log.error(res.cause().getMessage(), res.cause()); done.handle(Future.failedFuture(res.cause())); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startTx 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
startTx
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private boolean isSystemApp(IPackageManager pm, String packageName, int userId) throws RemoteException { ApplicationInfo appInfo = pm.getApplicationInfo(packageName, MATCH_UNINSTALLED_PACKAGES, userId); if (appInfo == null) { throw new IllegalArgumentException("The application " + packageName + " is not present on this device"); } return (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSystemApp 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
isSystemApp
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void setObjectProperty(String name, Object value) throws JMSException { try { if (RMQConnectionMetaData.JMSX_GROUP_SEQ_LABEL.equals(name)) { /** * Special case property, this property must be * an integer and it must be larger than 0 */ if (!(value instanceof Integer)) { throw new MessageFormatException(String.format("Property [%s] can only be of type int", RMQConnectionMetaData.JMSX_GROUP_SEQ_LABEL)); } else { int val = (Integer) value; if (val<=0) throw new JMSException(String.format("Property [%s] must be >0", RMQConnectionMetaData.JMSX_GROUP_SEQ_LABEL)); } } else if (RMQConnectionMetaData.JMSX_GROUP_ID_LABEL.equals(name)) { /** * Special case property must be a string */ if (value!=null && (!(value instanceof String))) { throw new MessageFormatException(String.format("Property [%s] can only be of type String", RMQConnectionMetaData.JMSX_GROUP_ID_LABEL)); } } if (name!=null && name.startsWith(PREFIX)) { if (value==null) { this.rmqProperties.remove(name); } else { this.rmqProperties.put(name, (Serializable) value); } } else { if (isReadOnlyProperties()) throw new MessageNotWriteableException(NOT_WRITEABLE); checkName(name); if (value==null) { this.userJmsProperties.remove(name); } else if (validPropertyValueType(value)) { this.userJmsProperties.put(name, (Serializable) value); } else { throw new MessageFormatException(String.format("Property [%s] has incorrect value type.", name)); } } } catch (ClassCastException x) { throw new RMQJMSException("Property value not serializable.", x); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setObjectProperty 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
setObjectProperty
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting void dumpNoCheck(FileDescriptor fd, PrintWriter pw, String[] args) { final DumpFilter filter = parseDumpArgs(args); if (filter.shouldDumpCheckIn()) { // Other flags are not supported for checkin. dumpCheckin(pw, filter.shouldCheckInClear()); } else { if (filter.shouldDumpMain()) { dumpInner(pw, filter); pw.println(); } if (filter.shouldDumpUid()) { dumpUid(pw); pw.println(); } if (filter.shouldDumpFiles()) { dumpDumpFiles(pw); pw.println(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpNoCheck File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
dumpNoCheck
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private void handleActivityResult(ActivityResult activityResult) { if (activityResult.resultCode == Activity.RESULT_OK) { handlePositiveActivityResult(activityResult.requestCode, activityResult.data); } else { handleNegativeActivityResult(activityResult.requestCode); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleActivityResult File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
handleActivityResult
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void addOrRemoveTestCallCompanionApp(String packageName, boolean isAdded) { try { Log.startSession("TSI.aORTCCA"); enforceModifyPermission(); enforceShellOnly(Binder.getCallingUid(), "addOrRemoveTestCallCompanionApp"); synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { mCallsManager.getRoleManagerAdapter().addOrRemoveTestCallCompanionApp( packageName, isAdded); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addOrRemoveTestCallCompanionApp File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
addOrRemoveTestCallCompanionApp
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public abstract boolean get(String name, boolean defaultValue) throws IOException, IllegalArgumentException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
get
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public static Server createTcpServer(String... args) throws SQLException { TcpServer service = new TcpServer(); Server server = new Server(service, args); service.setShutdownHandler(server); return server; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createTcpServer File: h2/src/main/org/h2/tools/Server.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
createTcpServer
h2/src/main/org/h2/tools/Server.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
void dumpPendingIntentsLocked(FileDescriptor fd, PrintWriter pw, String[] args, int opti, boolean dumpAll, String dumpPackage) { boolean printed = false; pw.println("ACTIVITY MANAGER PENDING INTENTS (dumpsys activity intents)"); if (mIntentSenderRecords.size() > 0) { Iterator<WeakReference<PendingIntentRecord>> it = mIntentSenderRecords.values().iterator(); while (it.hasNext()) { WeakReference<PendingIntentRecord> ref = it.next(); PendingIntentRecord rec = ref != null ? ref.get(): null; if (dumpPackage != null && (rec == null || !dumpPackage.equals(rec.key.packageName))) { continue; } printed = true; if (rec != null) { pw.print(" * "); pw.println(rec); if (dumpAll) { rec.dump(pw, " "); } } else { pw.print(" * "); pw.println(ref); } } } if (!printed) { pw.println(" (nothing)"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpPendingIntentsLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
dumpPendingIntentsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setResizable(boolean resizable) { checkColumnIsAttached(); if (resizable != isResizable()) { getState().resizable = resizable; getGrid().markAsDirty(); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResizable File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setResizable
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public static boolean shouldBeVisible(@Nullable String path) { if (path == null) return false; final Matcher m = PATTERN_VISIBLE.matcher(path); return m.matches(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldBeVisible 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
shouldBeVisible
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
public void setValidityLengthInUse(boolean validityLengthInUse) { this.validityLengthInUse = validityLengthInUse; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValidityLengthInUse File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setValidityLengthInUse
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public String getHelpFile() { return getHelpFile(null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHelpFile File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getHelpFile
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
private void removeTasksByPackageNameLocked(String packageName, int userId) { // Remove all tasks with activities in the specified package from the list of recent tasks for (int i = mRecentTasks.size() - 1; i >= 0; i--) { TaskRecord tr = mRecentTasks.get(i); if (tr.userId != userId) continue; ComponentName cn = tr.intent.getComponent(); if (cn != null && cn.getPackageName().equals(packageName)) { // If the package name matches, remove the task. removeTaskByIdLocked(tr.taskId, true); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeTasksByPackageNameLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
removeTasksByPackageNameLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public boolean isLockPasswordEnabled(int userId) { return isLockPasswordEnabled(getKeyguardStoredPasswordQuality(userId), userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLockPasswordEnabled 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
isLockPasswordEnabled
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
private void registerTranslationBundle(XWikiDocument document) throws TranslationBundleDoesNotExistsException, ComponentRepositoryException, AccessDeniedException { Scope scope = getScope(document); if (scope != null && scope != Scope.ON_DEMAND) { checkRegistrationAuthorization(document, scope); ComponentDescriptor<TranslationBundle> descriptor = createComponentDescriptor(document.getDocumentReference()); ComponentDocumentTranslationBundle bundle = createComponentDocumentBundle(document, descriptor); getComponentManager(document, scope, true).registerComponent(descriptor, bundle); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerTranslationBundle File: xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29510
HIGH
8.8
xwiki/xwiki-platform
registerTranslationBundle
xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java
d06ff8a58480abc7f63eb1d4b8b366024d990643
0
Analyze the following code function for security vulnerabilities
@Override public void onDozeAmountChanged(float linear, float interpolated) { // If we were animating the screen off, and we've completed the doze animation (doze amount // is 1f), then show the activity lock screen. if (mAnimatingScreenOff && mDozing && linear == 1f) { mAnimatingScreenOff = false; setShowingLocked(mShowing, true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDozeAmountChanged File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
onDozeAmountChanged
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public boolean isKexDone() { return kexer.isKexDone(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isKexDone File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
isKexDone
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
@Override public SaReactorFilter setExcludeList(List<String> pathList) { excludeList = pathList; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExcludeList File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
setExcludeList
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
CompatibilityInfo compatibilityInfoForPackageLocked(ApplicationInfo ai) { return mCompatModePackages.compatibilityInfoForPackageLocked(ai); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compatibilityInfoForPackageLocked 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
compatibilityInfoForPackageLocked
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMaxLines(Integer.MAX_VALUE); super.onMeasure(widthMeasureSpec, heightMeasureSpec); assert mProfile != null : "setProfile() must be called before layout."; // Lay out the URL in a StaticLayout that is the same size as our final // container. Layout layout = getLayout(); int originEndIndex = OmniboxUrlEmphasizer.getOriginEndIndex(getText().toString(), mProfile); // Find the range of lines containing the origin. int originEndLineIndex = 0; while (originEndLineIndex < layout.getLineCount() && layout.getLineEnd(originEndLineIndex) < originEndIndex) { originEndLineIndex++; } // Display an extra line so we don't accidentally hide the origin with // ellipses int lastLineIndexToDisplay = originEndLineIndex + 1; // Since lastLineToDisplay is an index, add 1 to get the maximum number // of lines. This will always be at least 2 lines (when the origin is // fully contained on line 0). mTruncatedUrlLinesToDisplay = lastLineIndexToDisplay + 1; if (updateMaxLines()) super.onMeasure(widthMeasureSpec, heightMeasureSpec); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2015-1261 - Severity: MEDIUM - CVSS Score: 5.0 Description: Truncate long URL fragments in Android page info popup This replaces percent-encoding whitespace as a method to combat the use of crafted URL fragments to inject messages into the page info popup. By truncating the URL so that at most two lines of the fragment are shown, we prevent lengthy messages from being injected while minimising the effect on most URLs. BUG=466351 Review URL: https://codereview.chromium.org/1077483002 Cr-Commit-Position: refs/heads/master@{#325358} Function: onMeasure File: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java Repository: chromium Fixed Code: @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMaxLines(Integer.MAX_VALUE); super.onMeasure(widthMeasureSpec, heightMeasureSpec); assert mProfile != null : "setProfile() must be called before layout."; String urlText = getText().toString(); // Lay out the URL in a StaticLayout that is the same size as our final // container. int originEndIndex = OmniboxUrlEmphasizer.getOriginEndIndex(urlText, mProfile); // Find the range of lines containing the origin. int originEndLine = getLineForIndex(originEndIndex); // Display an extra line so we don't accidentally hide the origin with // ellipses mTruncatedUrlLinesToDisplay = originEndLine + 1; // Find the line where the fragment starts. Since # is a reserved character, it is safe // to just search for the first # to appear in the url. int fragmentStartIndex = urlText.indexOf('#'); if (fragmentStartIndex == -1) fragmentStartIndex = urlText.length(); int fragmentStartLine = getLineForIndex(fragmentStartIndex); mFullLinesToDisplay = fragmentStartLine + 1; // If there is no origin (according to OmniboxUrlEmphasizer), make sure the fragment is // still hidden correctly. if (mFullLinesToDisplay < mTruncatedUrlLinesToDisplay) { mTruncatedUrlLinesToDisplay = mFullLinesToDisplay; } if (updateMaxLines()) super.onMeasure(widthMeasureSpec, heightMeasureSpec); }
[ "CWE-20" ]
CVE-2015-1261
MEDIUM
5
chromium
onMeasure
chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
5bf8a2dccf4777c5f065d918d1d9a2bbaa013f9f
1
Analyze the following code function for security vulnerabilities
@GuardedBy("this") void setResumedActivityUncheckLocked(ActivityRecord r, String reason) { final TaskRecord task = r.getTask(); if (task.isActivityTypeStandard()) { if (mCurAppTimeTracker != r.appTimeTracker) { // We are switching app tracking. Complete the current one. if (mCurAppTimeTracker != null) { mCurAppTimeTracker.stop(); mHandler.obtainMessage( REPORT_TIME_TRACKER_MSG, mCurAppTimeTracker).sendToTarget(); mStackSupervisor.clearOtherAppTimeTrackers(r.appTimeTracker); mCurAppTimeTracker = null; } if (r.appTimeTracker != null) { mCurAppTimeTracker = r.appTimeTracker; startTimeTrackingFocusedActivityLocked(); } } else { startTimeTrackingFocusedActivityLocked(); } } else { r.appTimeTracker = null; } // TODO: VI Maybe r.task.voiceInteractor || r.voiceInteractor != null // TODO: Probably not, because we don't want to resume voice on switching // back to this activity if (task.voiceInteractor != null) { startRunningVoiceLocked(task.voiceSession, r.info.applicationInfo.uid); } else { finishRunningVoiceLocked(); if (mLastResumedActivity != null) { final IVoiceInteractionSession session; final TaskRecord lastResumedActivityTask = mLastResumedActivity.getTask(); if (lastResumedActivityTask != null && lastResumedActivityTask.voiceSession != null) { session = lastResumedActivityTask.voiceSession; } else { session = mLastResumedActivity.voiceSession; } if (session != null) { // We had been in a voice interaction session, but now focused has // move to something different. Just finish the session, we can't // return to it and retain the proper state and synchronization with // the voice interaction service. finishVoiceTask(session); } } } if (mLastResumedActivity != null && r.userId != mLastResumedActivity.userId) { mUserController.sendForegroundProfileChanged(r.userId); } updateResumedAppTrace(r); mLastResumedActivity = r; mWindowManager.setFocusedApp(r.appToken, true); applyUpdateLockStateLocked(r); applyUpdateVrModeLocked(r); EventLogTags.writeAmSetResumedActivity( r == null ? -1 : r.userId, r == null ? "NULL" : r.shortComponentName, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResumedActivityUncheckLocked 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
setResumedActivityUncheckLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public Long getLastseen() { return lastseen; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastseen File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getLastseen
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
protected Boolean findFormatFeature(DeserializationContext ctxt, BeanProperty prop, Class<?> typeForDefaults, JsonFormat.Feature feat) { JsonFormat.Value format = findFormatOverrides(ctxt, prop, typeForDefaults); if (format != null) { return format.getFeature(feat); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findFormatFeature File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
findFormatFeature
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
@Override public void onResume() { super.onResume(); if (mFirstResume) { if (mIcicle == null) { Log.d(LOG_TAG, "start to init "); CallForwardEditPreference pref = mPreferences.get(mInitIndex); pref.init(this, mPhone, mReplaceInvalidCFNumbers, mCallForwardByUssd); pref.startCallForwardOptionsQuery(); } else { mInitIndex = mPreferences.size(); for (CallForwardEditPreference pref : mPreferences) { Bundle bundle = mIcicle.getParcelable(pref.getKey()); pref.setToggled(bundle.getBoolean(KEY_TOGGLE)); pref.setEnabled(bundle.getBoolean(KEY_ENABLE)); CallForwardInfo cf = new CallForwardInfo(); cf.number = bundle.getString(KEY_NUMBER); cf.status = bundle.getInt(KEY_STATUS); pref.init(this, mPhone, mReplaceInvalidCFNumbers, mCallForwardByUssd); pref.restoreCallForwardInfo(cf); } } mFirstResume = false; mIcicle = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onResume File: src/com/android/phone/GsmUmtsCallForwardOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
onResume
src/com/android/phone/GsmUmtsCallForwardOptions.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
public static Property getProperty(String name, org.xwiki.rest.model.jaxb.Object preferencesObject, boolean create) { for (Property property : preferencesObject.getProperties()) { if (property.getName().equals(name)) { return property; } } if (create) { Property property = property(name, null); preferencesObject.getProperties().add(property); return property; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProperty 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
getProperty
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public int getInitialSendWindowSize() { return initialSendWindowSize; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInitialSendWindowSize 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
getInitialSendWindowSize
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@Override public PageResult searchNewBeeMallGoods(PageQueryUtil pageUtil) { List<NewBeeMallGoods> goodsList = goodsMapper.findNewBeeMallGoodsListBySearch(pageUtil); int total = goodsMapper.getTotalNewBeeMallGoodsBySearch(pageUtil); List<NewBeeMallSearchGoodsVO> newBeeMallSearchGoodsVOS = new ArrayList<>(); if (!CollectionUtils.isEmpty(goodsList)) { newBeeMallSearchGoodsVOS = BeanUtil.copyList(goodsList, NewBeeMallSearchGoodsVO.class); for (NewBeeMallSearchGoodsVO newBeeMallSearchGoodsVO : newBeeMallSearchGoodsVOS) { String goodsName = newBeeMallSearchGoodsVO.getGoodsName(); String goodsIntro = newBeeMallSearchGoodsVO.getGoodsIntro(); // 字符串过长导致文字超出的问题 if (goodsName.length() > 28) { goodsName = goodsName.substring(0, 28) + "..."; newBeeMallSearchGoodsVO.setGoodsName(goodsName); } if (goodsIntro.length() > 30) { goodsIntro = goodsIntro.substring(0, 30) + "..."; newBeeMallSearchGoodsVO.setGoodsIntro(goodsIntro); } } } PageResult pageResult = new PageResult(newBeeMallSearchGoodsVOS, total, pageUtil.getLimit(), pageUtil.getPage()); return pageResult; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: searchNewBeeMallGoods File: src/main/java/ltd/newbee/mall/service/impl/NewBeeMallGoodsServiceImpl.java Repository: newbee-ltd/newbee-mall The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-27476
MEDIUM
4.3
newbee-ltd/newbee-mall
searchNewBeeMallGoods
src/main/java/ltd/newbee/mall/service/impl/NewBeeMallGoodsServiceImpl.java
0d1ff1b9f4aedc0ccdac5d22014a351554dfb81e
0
Analyze the following code function for security vulnerabilities
@Override public String getOrderByStatement(Select select) { return "ORDER BY"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOrderByStatement File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
getOrderByStatement
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
protected final Map<String, String> getCustomParameters() { return this.customParameters; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCustomParameters File: cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java Repository: apereo/java-cas-client The code follows secure coding practices.
[ "CWE-74" ]
CVE-2014-4172
HIGH
7.5
apereo/java-cas-client
getCustomParameters
cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
ae37092100c8eaec610dab6d83e5e05a8ee58814
0
Analyze the following code function for security vulnerabilities
private static void addHttp2Scheme(io.netty.handler.codec.http.HttpHeaders in, URI uri, RequestHeadersBuilder out) { final String value = uri.getScheme(); if (value != null) { out.add(HttpHeaderNames.SCHEME, value); return; } // Consume the Scheme extension header if present final CharSequence cValue = in.get(ExtensionHeaderNames.SCHEME.text()); if (cValue != null) { out.add(HttpHeaderNames.SCHEME, cValue.toString()); } else { out.add(HttpHeaderNames.SCHEME, "unknown"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addHttp2Scheme File: core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
addHttp2Scheme
core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
protected String computeFromForAccount(ReplyFromAccount selectedReplyFromAccount) { final String email = selectedReplyFromAccount != null ? selectedReplyFromAccount.address : mAccount != null ? mAccount.getEmailAddress() : null; final String senderName = selectedReplyFromAccount != null ? selectedReplyFromAccount.name : mAccount != null ? mAccount.getSenderName() : null; final Address address = new Address(email, senderName); return address.toHeader(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: computeFromForAccount 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
computeFromForAccount
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public boolean checkUserPassword(String userId, String password) { if (StringUtils.isBlank(userId)) { MSException.throwException(Translator.get("user_name_is_null")); } if (StringUtils.isBlank(password)) { MSException.throwException(Translator.get("password_is_null")); } UserExample example = new UserExample(); example.createCriteria().andIdEqualTo(userId).andPasswordEqualTo(CodingUtil.md5(password)); return userMapper.countByExample(example) > 0; }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2023-32699 - Severity: MEDIUM - CVSS Score: 6.5 Description: refactor(系统设置): 登录认证信息长度验证 Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com> Function: checkUserPassword File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java Repository: metersphere Fixed Code: public boolean checkUserPassword(String userId, String password) { if (StringUtils.isBlank(userId)) { MSException.throwException(Translator.get("user_name_is_null")); } if (StringUtils.isBlank(password)) { MSException.throwException(Translator.get("password_is_null")); } if (userId.length() > 64) { MSException.throwException(Translator.get("user_id_length_too_long")); } if (password.length() > 30) { MSException.throwException(Translator.get("password_length_too_long")); } UserExample example = new UserExample(); example.createCriteria().andIdEqualTo(userId).andPasswordEqualTo(CodingUtil.md5(password)); return userMapper.countByExample(example) > 0; }
[ "CWE-770" ]
CVE-2023-32699
MEDIUM
6.5
metersphere
checkUserPassword
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
c59e381d368990214813085a1a4877c5ef865411
1
Analyze the following code function for security vulnerabilities
private boolean compareFirstOfNameList(String[] a, String[] b) { if (a == null || b == null) throw new IllegalArgumentException(); if ((a.length == 0) && (b.length == 0)) return true; if ((a.length == 0) || (b.length == 0)) return false; return (a[0].equals(b[0])); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compareFirstOfNameList File: src/main/java/com/trilead/ssh2/transport/KexManager.java Repository: connectbot/sshlib The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
connectbot/sshlib
compareFirstOfNameList
src/main/java/com/trilead/ssh2/transport/KexManager.java
5c8b534f6e97db7ac0e0e579331213aa25c173ab
0
Analyze the following code function for security vulnerabilities
@Override public boolean isOverwrite() { return overwrite; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOverwrite File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java Repository: codehaus-plexus/plexus-archiver The code follows secure coding practices.
[ "CWE-22", "CWE-61" ]
CVE-2023-37460
CRITICAL
9.8
codehaus-plexus/plexus-archiver
isOverwrite
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
54759839fbdf85caf8442076f001d5fd64e0dcb2
0
Analyze the following code function for security vulnerabilities
private ExtMXSerializer getResXmlSerializer() { ExtMXSerializer serial = new ExtMXSerializer(); serial.setProperty(ExtXmlSerializer.PROPERTY_SERIALIZER_INDENTATION, " "); serial.setProperty(ExtXmlSerializer.PROPERTY_SERIALIZER_LINE_SEPARATOR, System.getProperty("line.separator")); serial.setProperty(ExtXmlSerializer.PROPERTY_DEFAULT_ENCODING, "utf-8"); serial.setDisabledAttrEscape(true); return serial; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResXmlSerializer File: brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
getResXmlSerializer
brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
public void fromXML(String source, boolean withArchive) throws XWikiException { fromXML(new StringInputSource(source), withArchive); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromXML File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
fromXML
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private static boolean isValidGlobalKey(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_POWER: case KeyEvent.KEYCODE_WAKEUP: case KeyEvent.KEYCODE_SLEEP: return false; default: return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidGlobalKey File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
isValidGlobalKey
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
private void migrateAccountManagementDisabledPolicyLocked() { Binder.withCleanCallingIdentity(() -> { List<UserInfo> users = mUserManager.getUsers(); for (UserInfo userInfo : users) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(userInfo.id); if (admin != null) { EnforcingAdmin enforcingAdmin = EnforcingAdmin.createEnterpriseEnforcingAdmin( admin.info.getComponent(), admin.getUserHandle().getIdentifier(), admin); for (String accountType : admin.accountTypesWithManagementDisabled) { mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.ACCOUNT_MANAGEMENT_DISABLED(accountType), enforcingAdmin, new BooleanPolicyValue(true), admin.getUserHandle().getIdentifier()); } if (admin.getParentActiveAdmin() != null) { for (String accountType : admin.getParentActiveAdmin() .accountTypesWithManagementDisabled) { mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.ACCOUNT_MANAGEMENT_DISABLED(accountType), enforcingAdmin, new BooleanPolicyValue(true), getProfileParentId(admin.getUserHandle().getIdentifier())); } } } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrateAccountManagementDisabledPolicyLocked 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
migrateAccountManagementDisabledPolicyLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void purgeProject(String name, AsyncMethodCallback resultHandler) { handleAsVoidResult(executor.execute(Command.purgeProject(SYSTEM, name)), resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: purgeProject File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
purgeProject
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
@POST @Path("task/{nodeId}/configuration") @Operation(summary = "This attaches the run-time configuration", description = "This attaches the run-time configuration onto a given task element") @ApiResponse(responseCode = "200", description = "The task node configuration", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = SurveyConfigVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = SurveyConfigVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or task node not found") @ApiResponse(responseCode = "406", description = "The call is not applicable to task course node") @ApiResponse(responseCode = "409", description = "The configuration is not valid ") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response addTaskConfigurationPost(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @QueryParam("enableAssignment") Boolean enableAssignment, @QueryParam("taskAssignmentType") String taskAssignmentType, @QueryParam("taskAssignmentText") String taskAssignmentText, @QueryParam("enableTaskPreview") Boolean enableTaskPreview, @QueryParam("enableTaskDeselect") Boolean enableTaskDeselect, @QueryParam("onlyOneUserPerTask") Boolean onyOneUserPerTask, @QueryParam("enableDropbox") Boolean enableDropbox, @QueryParam("enableDropboxConfirmationMail") Boolean enableDropboxConfirmationMail, @QueryParam("dropboxConfirmationText") String dropboxConfirmationText, @QueryParam("enableReturnbox") Boolean enableReturnbox, @QueryParam("enableScoring") Boolean enableScoring, @QueryParam("grantScoring") Boolean grantScoring, @QueryParam("scoreMin") Float scoreMin, @QueryParam("scoreMax") Float scoreMax, @QueryParam("grantPassing") Boolean grantPassing, @QueryParam("scorePassingThreshold") Float scorePassingThreshold, @QueryParam("enableCommentField") Boolean enableCommentField, @QueryParam("commentForUser") String commentForUser, @QueryParam("commentForCoaches") String commentForCoaches, @QueryParam("enableSolution") Boolean enableSolution, @QueryParam("accessExpertRuleTask") String accessExpertRuleTask, @QueryParam("accessExpertRuleDropbox") String accessExpertRuleDropbox, @QueryParam("accessExpertRuleReturnbox") String accessExpertRuleReturnbox, @QueryParam("accessExpertRuleScoring") String accessExpertRuleScoring, @QueryParam("accessExpertRuleSolution") String accessExpertRuleSolution, @Context HttpServletRequest request) { return addTaskConfiguration(courseId, nodeId, enableAssignment, taskAssignmentType, taskAssignmentText, enableTaskPreview, enableTaskDeselect, onyOneUserPerTask, enableDropbox, enableDropboxConfirmationMail, dropboxConfirmationText, enableReturnbox, enableScoring, grantScoring, scoreMin, scoreMax, grantPassing, scorePassingThreshold, enableCommentField, commentForUser, commentForCoaches, enableSolution, accessExpertRuleTask, accessExpertRuleDropbox, accessExpertRuleReturnbox, accessExpertRuleScoring, accessExpertRuleSolution, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addTaskConfigurationPost File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
addTaskConfigurationPost
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public List<DocumentSymbol> findDocumentSymbols(DOMDocument xmlDocument) { return findDocumentSymbols(xmlDocument, NULL_CHECKER); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findDocumentSymbols File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
findDocumentSymbols
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
@Override protected boolean isReadOnly() { SelectionMode selectionMode = getSelectionMode(); if (SelectionMode.SINGLE.equals(selectionMode)) { return asSingleSelect().isReadOnly(); } if (SelectionMode.MULTI.equals(selectionMode)) { return asMultiSelect().isReadOnly(); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isReadOnly File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
isReadOnly
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override public int getMaxRunningUsers() { return mUserController.mMaxRunningUsers; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxRunningUsers 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
getMaxRunningUsers
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override protected void doStart() { dnsClient = new DnsClient(config.requestTimeout()); dnsClient.start(config.serverIps()); }
Vulnerability Classification: - CWE: CWE-345 - CVE: CVE-2023-41045 - Severity: MEDIUM - CVSS Score: 5.3 Description: Merge pull request from GHSA-g96c-x7rh-99r3 * Add support for randomizing DNS Lookup source port * Clarify purpose of lease * Skip initial refresh Previously, the pool was being refreshed immediately upon initialization. Now, the refresh waits until the `poolRefreshSeconds` duration has elapsed. * Ensure thread safety, skip unused poller refreshes * Add change log Function: doStart File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java Repository: Graylog2/graylog2-server Fixed Code: @Override protected void doStart() { dnsClient = new DnsClient(config.requestTimeout(), adapterConfiguration.getPoolSize(), adapterConfiguration.getPoolRefreshInterval().toSeconds()); dnsClient.start(config.serverIps()); }
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
doStart
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
466af814523cffae9fbc7e77bab7472988f03c3e
1
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private void start(final String[] args, final Consumer<List<Route.Definition>> routes) throws Throwable { long start = System.currentTimeMillis(); started.set(true); this.injector = bootstrap(args(args), routes); // shutdown hook Runtime.getRuntime().addShutdownHook(new Thread(this::stop)); Config conf = injector.getInstance(Config.class); Logger log = logger(this); // inject class injector.injectMembers(this); // onStart callbacks via .conf if (conf.hasPath("jooby.internal.onStart")) { ClassLoader loader = getClass().getClassLoader(); Object internalOnStart = loader.loadClass(conf.getString("jooby.internal.onStart")) .newInstance(); onStart.add((Throwing.Consumer<Registry>) internalOnStart); } // start services for (Throwing.Consumer<Registry> onStart : this.onStart) { onStart.accept(this); } // route mapper Set<Route.Definition> routeDefs = injector.getInstance(Route.KEY); Set<WebSocket.Definition> sockets = injector.getInstance(WebSocket.KEY); if (mapper != null) { routeDefs.forEach(it -> it.map(mapper)); } AppPrinter printer = new AppPrinter(routeDefs, sockets, conf); printer.printConf(log, conf); // Start server Server server = injector.getInstance(Server.class); String serverName = server.getClass().getSimpleName().replace("Server", "").toLowerCase(); server.start(); long end = System.currentTimeMillis(); log.info("[{}@{}]: Server started in {}ms\n\n{}\n", conf.getString("application.env"), serverName, end - start, printer); // started services for (Throwing.Consumer<Registry> onStarted : this.onStarted) { onStarted.accept(this); } boolean join = conf.hasPath("server.join") ? conf.getBoolean("server.join") : true; if (join) { server.join(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start 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
start
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
final void scheduleAppGcsLocked() { mHandler.removeMessages(GC_BACKGROUND_PROCESSES_MSG); if (mProcessesToGc.size() > 0) { // Schedule a GC for the time to the next process. ProcessRecord proc = mProcessesToGc.get(0); Message msg = mHandler.obtainMessage(GC_BACKGROUND_PROCESSES_MSG); long when = proc.lastRequestedGc + GC_MIN_INTERVAL; long now = SystemClock.uptimeMillis(); if (when < (now+GC_TIMEOUT)) { when = now + GC_TIMEOUT; } mHandler.sendMessageAtTime(msg, when); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleAppGcsLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
scheduleAppGcsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { String filename = file.getFileName().toString(); if(IMS_MANIFEST.equals(filename)) { manifestFile = true; manifestPath = file; } if(CourseHandler.EDITOR_XML.equals(filename)) { course = true; editorTreeModelPath = file; } return manifestFile ? FileVisitResult.TERMINATE : FileVisitResult.CONTINUE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: visitFile File: src/main/java/org/olat/fileresource/types/ImsCPFileResource.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
visitFile
src/main/java/org/olat/fileresource/types/ImsCPFileResource.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
private void startConversationSettingsActivity(int uid, ExpandableNotificationRow row) { final Intent intent = new Intent(Settings.ACTION_CONVERSATION_SETTINGS); mNotificationActivityStarter.startNotificationGutsIntent(intent, uid, row); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startConversationSettingsActivity File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
startConversationSettingsActivity
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
@Override public void getHistory(String projectName, String repositoryName, Revision from, Revision to, String pathPattern, AsyncMethodCallback resultHandler) { handle(projectManager.get(projectName).repos().get(repositoryName) .history(convert(from), convert(to), pathPattern) .thenApply(commits -> commits.stream() .map(Converter::convert) .collect(toList())), resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHistory File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
getHistory
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
protected HashMap<Integer,String> getSectionLabels(String sectionIds) { HashMap<Integer,String> labels = new HashMap<Integer,String>(); this.setSectionLabelsTypesExpected(); ArrayList rows = this.select(this.getSectionLabelsSql(sectionIds)); Iterator it = rows.iterator(); while(it.hasNext()) { HashMap row = (HashMap) it.next(); Integer secId = (Integer) row.get("section_id"); String label = (String) row.get("label"); labels.put(secId, label); } return labels; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSectionLabels File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getSectionLabels
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public Object query(String jsonPointer) { return query(new JSONPointer(jsonPointer)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: query File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
query
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
@Override public boolean dispatchGenericMotionEvent(MotionEvent event) { if (mAllowMenuTimeout) { repostDelayedHide(POST_INTERACTION_DISMISS_DELAY); } return super.dispatchGenericMotionEvent(event); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchGenericMotionEvent File: libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40123
MEDIUM
5.5
android
dispatchGenericMotionEvent
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
7212a4bec2d2f1a74fa54a12a04255d6a183baa9
0
Analyze the following code function for security vulnerabilities
@Override public void onAppTransitionFinishedLocked(IBinder token) { AppWindowToken atoken = findAppWindowToken(token); if (atoken == null) { return; } if (atoken.mLaunchTaskBehind) { try { mActivityManager.notifyLaunchTaskBehindComplete(atoken.token); } catch (RemoteException e) { } atoken.mLaunchTaskBehind = false; } else { atoken.updateReportedVisibilityLocked(); if (atoken.mEnteringAnimation) { atoken.mEnteringAnimation = false; try { mActivityManager.notifyEnterAnimationComplete(atoken.token); } catch (RemoteException e) { } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAppTransitionFinishedLocked 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
onAppTransitionFinishedLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public static List<String> getAllStructuresNames() { String orderBy = "name"; int limit = -1; List<Structure> temp = getStructures(orderBy,limit); List<String> results = new ArrayList<String>(); for(Structure st : temp){ results.add(st.getName()); } return results; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllStructuresNames File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getAllStructuresNames
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public static KeyArchivalRequest fromDOM(Element element) { KeyArchivalRequest request = new KeyArchivalRequest(); fromDOM(element, request); return request; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void destroyDecoder() { if (request != null) { try { // Release any temporary files request.releasePostFileUploadParams(); } catch (Exception e) { } } if (decoder != null) { try { decoder.cleanFiles(); decoder.destroy(); decoder = null; } catch (Exception e) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroyDecoder File: src/gribbit/request/HttpRequestHandler.java Repository: lukehutch/gribbit The code follows secure coding practices.
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
destroyDecoder
src/gribbit/request/HttpRequestHandler.java
620418df247aebda3dd4be1dda10fe229ea505dd
0
Analyze the following code function for security vulnerabilities
private synchronized InputStream openInputStream() throws IOException { if (file != null) { return new FileInputStream(file); } else { // requireNonNull is safe because we always have either `file` or `memory`. requireNonNull(memory); return new ByteArrayInputStream(memory.getBuffer(), 0, memory.getCount()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openInputStream File: android/guava/src/com/google/common/io/FileBackedOutputStream.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
openInputStream
android/guava/src/com/google/common/io/FileBackedOutputStream.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
@Override public void onUpgrade(final SQLiteDatabase db, int oldV, final int newV) { if (oldV == 31) { // 31 and 100 are identical, just in different codelines. Upgrading from 31 is the // same as upgrading from 100. oldV = 100; } else if (oldV < 100) { // no logic to upgrade from these older version, just recreate the DB Log.i(Constants.TAG, "Upgrading downloads database from version " + oldV + " to version " + newV + ", which will destroy all old data"); oldV = 99; } else if (oldV > newV) { // user must have downgraded software; we have no way to know how to downgrade the // DB, so just recreate it Log.i(Constants.TAG, "Downgrading downloads database from version " + oldV + " (current version is " + newV + "), destroying all old data"); oldV = 99; } for (int version = oldV + 1; version <= newV; version++) { upgradeTo(db, version); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUpgrade File: src/com/android/providers/downloads/DownloadProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
onUpgrade
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
private void setVersion(String version) { ScalarNode versionNode = null; for (NodeTuple tuple: getValue()) { ScalarNode keyNode = (ScalarNode) tuple.getKeyNode(); if (keyNode.getValue().equals("version")) { ((ScalarNode) tuple.getValueNode()).setValue(version); break; } } if (versionNode == null) { ScalarNode keyNode = new ScalarNode(Tag.STR, "version", null, null, DumperOptions.ScalarStyle.PLAIN); versionNode = new ScalarNode(Tag.INT, version, null, null, DumperOptions.ScalarStyle.PLAIN); getValue().add(0, new NodeTuple(keyNode, versionNode)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVersion File: server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-21249
MEDIUM
6.5
theonedev/onedev
setVersion
server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
d6fc4212b1ac1e9bbe3ce444e95f9af1e3ab8b66
0
Analyze the following code function for security vulnerabilities
private boolean isPathWhitelisted(Path pa, PathActionLevel pathActionLevel) { var pathWhitelist = configuration.whitelistedPaths(); if (pathWhitelist.isEmpty()) return pa.startsWith(configuration.executionPath()); return pathWhitelist.get().stream().anyMatch(pm -> pm.matchesWithLevel(pa, pathActionLevel)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPathWhitelisted File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
isPathWhitelisted
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
private static String getCanonicalPath(String path) { if (path == null) { return null; } return getCanonicalPath(new File(path)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCanonicalPath File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getCanonicalPath
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
public void setSource(File source) { this.source = source; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSource File: pf4j/src/main/java/org/pf4j/util/Unzip.java Repository: pf4j The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-40827
HIGH
7.5
pf4j
setSource
pf4j/src/main/java/org/pf4j/util/Unzip.java
ed9392069fe14c6c30d9f876710e5ad40f7ea8c1
0
Analyze the following code function for security vulnerabilities
public static synchronized AdapterService getAdapterService(){ if (sAdapterService != null && !sAdapterService.mCleaningUp) { Log.d(TAG, "getAdapterService() - returning " + sAdapterService); return sAdapterService; } if (DBG) { if (sAdapterService == null) { Log.d(TAG, "getAdapterService() - Service not available"); } else if (sAdapterService.mCleaningUp) { Log.d(TAG,"getAdapterService() - Service is cleaning up"); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAdapterService File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
getAdapterService
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
private void addStopSaverAction(Notification.Builder nb) { nb.addAction(0, mContext.getString(R.string.battery_saver_notification_action_text), pendingBroadcast(ACTION_STOP_SAVER)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addStopSaverAction File: packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3854
MEDIUM
5
android
addStopSaverAction
packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
05e0705177d2078fa9f940ce6df723312cfab976
0
Analyze the following code function for security vulnerabilities
public String getEscapedContent() throws XWikiException { return this.doc.getEscapedContent(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEscapedContent 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
getEscapedContent
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 makeInitialized(int userId) { checkManageUsersPermission("makeInitialized"); synchronized (mPackagesLock) { UserInfo info = mUsers.get(userId); if (info == null || info.partial) { Slog.w(LOG_TAG, "makeInitialized: unknown user #" + userId); } if ((info.flags&UserInfo.FLAG_INITIALIZED) == 0) { info.flags |= UserInfo.FLAG_INITIALIZED; scheduleWriteUserLocked(info); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeInitialized File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
makeInitialized
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
private boolean setAccountVisibility(Account account, String packageName, int newVisibility, boolean notify, UserAccounts accounts) { synchronized (accounts.dbLock) { synchronized (accounts.cacheLock) { Map<String, Integer> packagesToVisibility; List<String> accountRemovedReceivers; if (notify) { if (isSpecialPackageKey(packageName)) { packagesToVisibility = getRequestingPackages(account, accounts); accountRemovedReceivers = getAccountRemovedReceivers(account, accounts); } else { if (!packageExistsForUser(packageName, accounts.userId)) { return false; // package is not installed. } packagesToVisibility = new HashMap<>(); packagesToVisibility.put(packageName, resolveAccountVisibility(account, packageName, accounts)); accountRemovedReceivers = new ArrayList<>(); if (shouldNotifyPackageOnAccountRemoval(account, packageName, accounts)) { accountRemovedReceivers.add(packageName); } } } else { // Notifications will not be send - only used during add account. if (!isSpecialPackageKey(packageName) && !packageExistsForUser(packageName, accounts.userId)) { // package is not installed and not meta value. return false; } packagesToVisibility = Collections.emptyMap(); accountRemovedReceivers = Collections.emptyList(); } if (!updateAccountVisibilityLocked(account, packageName, newVisibility, accounts)) { return false; } if (notify) { for (Entry<String, Integer> packageToVisibility : packagesToVisibility .entrySet()) { int oldVisibility = packageToVisibility.getValue(); int currentVisibility = resolveAccountVisibility(account, packageName, accounts); if (isVisible(oldVisibility) != isVisible(currentVisibility)) { notifyPackage(packageToVisibility.getKey(), accounts); } } for (String packageNameToNotify : accountRemovedReceivers) { sendAccountRemovedBroadcast(account, packageNameToNotify, accounts.userId); } sendAccountsChangedBroadcast(accounts.userId); } return true; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAccountVisibility 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
setAccountVisibility
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public void addAccept(String name) { if (name == null || name.length() == 0) { return; } long hash = TypeUtils.fnv1a_64(name); if (Arrays.binarySearch(this.acceptHashCodes, hash) >= 0) { return; } long[] hashCodes = new long[this.acceptHashCodes.length + 1]; hashCodes[hashCodes.length - 1] = hash; System.arraycopy(this.acceptHashCodes, 0, hashCodes, 0, this.acceptHashCodes.length); Arrays.sort(hashCodes); this.acceptHashCodes = hashCodes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAccept File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
addAccept
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
void settingsSecurePutStringForUser(String name, String value, int userHandle) { Settings.Secure.putStringForUser(mContext.getContentResolver(), name, value, userHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: settingsSecurePutStringForUser 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
settingsSecurePutStringForUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
TransitionController getTransitionController() { return mWindowOrganizerController.getTransitionController(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransitionController 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
getTransitionController
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private String getRequestAccept(RoutingContext ctx) { ParsedHeaderValues parsedHeaders = ctx.parsedHeaders(); if (parsedHeaders != null && parsedHeaders.accept() != null && !parsedHeaders.accept().isEmpty()) { List<MIMEHeader> acceptList = parsedHeaders.accept(); for (MIMEHeader a : acceptList) { if (isValidAcceptRequest(a.rawValue())) { return a.rawValue(); } } // Seems like an unknown accept is passed in String accept = ctx.request().getHeader("Accept"); if (accept != null && !accept.isEmpty() && !accept.startsWith("*/*")) { return accept; } } return DEFAULT_RESPONSE_CONTENT_TYPE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequestAccept File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-444" ]
CVE-2022-2466
CRITICAL
9.8
quarkusio/quarkus
getRequestAccept
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java
08e5c3106ce4bfb18b24a38514eeba6464668b07
0
Analyze the following code function for security vulnerabilities
public boolean hasAttachmentRecycleBin(XWikiContext context) { return getStoreConfiguration().isAttachmentRecycleBinEnabled(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasAttachmentRecycleBin 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
hasAttachmentRecycleBin
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public static CertData fromDOM(Element dataElement) { CertData data = new CertData(); String id = dataElement.getAttribute("id"); data.setSerialNumber(StringUtils.isEmpty(id) ? null : new CertId(id)); NodeList issuerDNList = dataElement.getElementsByTagName("IssuerDN"); if (issuerDNList.getLength() > 0) { String value = issuerDNList.item(0).getTextContent(); data.setIssuerDN(value); } NodeList subjectDNList = dataElement.getElementsByTagName("SubjectDN"); if (subjectDNList.getLength() > 0) { String value = subjectDNList.item(0).getTextContent(); data.setSubjectDN(value); } NodeList prettyPrintList = dataElement.getElementsByTagName("PrettyPrint"); if (prettyPrintList.getLength() > 0) { String value = prettyPrintList.item(0).getTextContent(); data.setPrettyPrint(value); } NodeList encodedList = dataElement.getElementsByTagName("Encoded"); if (encodedList.getLength() > 0) { String value = encodedList.item(0).getTextContent(); data.setEncoded(value); } NodeList pkcs7CertChainList = dataElement.getElementsByTagName("PKCS7CertChain"); if (pkcs7CertChainList.getLength() > 0) { String value = pkcs7CertChainList.item(0).getTextContent(); data.setPkcs7CertChain(value); } NodeList notBeforeList = dataElement.getElementsByTagName("NotBefore"); if (notBeforeList.getLength() > 0) { String value = notBeforeList.item(0).getTextContent(); data.setNotBefore(value); } NodeList notAfterList = dataElement.getElementsByTagName("NotAfter"); if (notAfterList.getLength() > 0) { String value = notAfterList.item(0).getTextContent(); data.setNotAfter(value); } NodeList statusList = dataElement.getElementsByTagName("Status"); if (statusList.getLength() > 0) { String value = statusList.item(0).getTextContent(); data.setStatus(value); } NodeList nonceList = dataElement.getElementsByTagName("Nonce"); if (nonceList.getLength() > 0) { String value = nonceList.item(0).getTextContent(); data.setNonce(Long.parseLong(value)); } NodeList revokedOnList = dataElement.getElementsByTagName("RevokedOn"); if (revokedOnList.getLength() > 0) { String value = revokedOnList.item(0).getTextContent(); data.setRevokedOn(new Date(Long.parseLong(value))); } NodeList revokedByList = dataElement.getElementsByTagName("RevokedBy"); if (revokedByList.getLength() > 0) { String value = revokedByList.item(0).getTextContent(); data.setRevokedBy(value); } NodeList revocationReasonList = dataElement.getElementsByTagName("RevocationReason"); if (revocationReasonList.getLength() > 0) { String value = revocationReasonList.item(0).getTextContent(); data.setRevocationReason(Integer.parseInt(value)); } return data; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void buildLibrary(String folder) throws AndrolibException { File working = new File(mApkDir, folder); if (!working.exists()) { return; } File stored = new File(mApkDir, APK_DIRNAME + "/" + folder); if (mConfig.forceBuildAll || isModified(working, stored)) { LOGGER.info("Copying libs... (/" + folder + ")"); try { OS.rmdir(stored); OS.cpdir(working, stored); } catch (BrutException ex) { throw new AndrolibException(ex); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildLibrary File: brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
buildLibrary
brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
public String getTranslatedContent(String locale) throws XWikiException { return this.doc.getTranslatedContent(locale, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTranslatedContent 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
getTranslatedContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
private static Loader loader(final Path basedir, final ClassLoader classloader) { if (Files.exists(basedir)) { return name -> { Path path = basedir.resolve(name).normalize(); if (Files.exists(path) && path.startsWith(basedir)) { try { return path.toUri().toURL(); } catch (MalformedURLException x) { // shh } } return classloader.getResource(name); }; } return classloader::getResource; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2020-7647 - Severity: MEDIUM - CVSS Score: 5.0 Description: asset: path traversal fix #1639 Function: loader File: jooby/src/main/java/org/jooby/handlers/AssetHandler.java Repository: jooby-project/jooby Fixed Code: private static Loader loader(final Path basedir, Loader classpath) { if (basedir != null && Files.exists(basedir)) { return name -> { Path path = basedir.resolve(name).normalize(); if (Files.exists(path) && path.startsWith(basedir)) { try { return path.toUri().toURL(); } catch (MalformedURLException x) { // shh } } return classpath.getResource(name); }; } return classpath; }
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
loader
jooby/src/main/java/org/jooby/handlers/AssetHandler.java
34f526028e6cd0652125baa33936ffb6a8a4a009
1
Analyze the following code function for security vulnerabilities
@PostMapping({"/upload/file"}) @ResponseBody public Result upload(HttpServletRequest httpServletRequest, @RequestParam("file") MultipartFile file) throws URISyntaxException { String fileName = file.getOriginalFilename(); String suffixName = fileName.substring(fileName.lastIndexOf(".")); //生成文件名称通用方法 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss"); Random r = new Random(); StringBuilder tempName = new StringBuilder(); tempName.append(sdf.format(new Date())).append(r.nextInt(100)).append(suffixName); String newFileName = tempName.toString(); File fileDirectory = new File(Constants.FILE_UPLOAD_DIC); //创建文件 File destFile = new File(Constants.FILE_UPLOAD_DIC + newFileName); try { if (!fileDirectory.exists()) { if (!fileDirectory.mkdir()) { throw new IOException("文件夹创建失败,路径为:" + fileDirectory); } } file.transferTo(destFile); Result resultSuccess = ResultGenerator.genSuccessResult(); resultSuccess.setData(NewBeeMallUtils.getHost(new URI(httpServletRequest.getRequestURL() + "")) + "/upload/" + newFileName); return resultSuccess; } catch (IOException e) { e.printStackTrace(); return ResultGenerator.genFailResult("文件上传失败"); } }
Vulnerability Classification: - CWE: CWE-434 - CVE: CVE-2022-27477 - Severity: HIGH - CVSS Score: 7.5 Description: :bug: Fixing a bug ##https://github.com/newbee-ltd/newbee-mall/issues/63 Function: upload File: src/main/java/ltd/newbee/mall/controller/common/UploadController.java Repository: newbee-ltd/newbee-mall Fixed Code: @PostMapping({"/upload/file"}) @ResponseBody public Result upload(HttpServletRequest httpServletRequest, @RequestParam("file") MultipartFile file) throws URISyntaxException, IOException { String fileName = file.getOriginalFilename(); BufferedImage bufferedImage = ImageIO.read(file.getInputStream()); if (bufferedImage == null) { return ResultGenerator.genFailResult("请上传图片类型的文件"); } String suffixName = fileName.substring(fileName.lastIndexOf(".")); //生成文件名称通用方法 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss"); Random r = new Random(); StringBuilder tempName = new StringBuilder(); tempName.append(sdf.format(new Date())).append(r.nextInt(100)).append(suffixName); String newFileName = tempName.toString(); File fileDirectory = new File(Constants.FILE_UPLOAD_DIC); //创建文件 File destFile = new File(Constants.FILE_UPLOAD_DIC + newFileName); try { if (!fileDirectory.exists()) { if (!fileDirectory.mkdir()) { throw new IOException("文件夹创建失败,路径为:" + fileDirectory); } } file.transferTo(destFile); Result resultSuccess = ResultGenerator.genSuccessResult(); resultSuccess.setData(NewBeeMallUtils.getHost(new URI(httpServletRequest.getRequestURL() + "")) + "/upload/" + newFileName); return resultSuccess; } catch (IOException e) { e.printStackTrace(); return ResultGenerator.genFailResult("文件上传失败"); } }
[ "CWE-434" ]
CVE-2022-27477
HIGH
7.5
newbee-ltd/newbee-mall
upload
src/main/java/ltd/newbee/mall/controller/common/UploadController.java
a3aff8b6223c348eb723beda78c918a27941b1b2
1
Analyze the following code function for security vulnerabilities
void grantUriPermissionFromIntentLocked(int callingUid, String targetPkg, Intent intent, UriPermissionOwner owner, int targetUserId) { NeededUriGrants needed = checkGrantUriPermissionFromIntentLocked(callingUid, targetPkg, intent, intent != null ? intent.getFlags() : 0, null, targetUserId); if (needed == null) { return; } grantUriPermissionUncheckedFromIntentLocked(needed, owner); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grantUriPermissionFromIntentLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
grantUriPermissionFromIntentLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private void sendAcquiredResult(long deviceId, int acquireInfo) { if (mAuthenticationCallback != null) { mAuthenticationCallback.onAuthenticationAcquired(acquireInfo); } final String msg = getAcquiredString(acquireInfo); if (msg == null) { return; } if (mEnrollmentCallback != null) { mEnrollmentCallback.onEnrollmentHelp(acquireInfo, msg); } else if (mAuthenticationCallback != null) { mAuthenticationCallback.onAuthenticationHelp(acquireInfo, msg); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendAcquiredResult File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
sendAcquiredResult
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private void sendUserInfoChangedBroadcast(int userId) { Intent changedIntent = new Intent(Intent.ACTION_USER_INFO_CHANGED); changedIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId); changedIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); mContext.sendBroadcastAsUser(changedIntent, UserHandle.ALL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendUserInfoChangedBroadcast File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
sendUserInfoChangedBroadcast
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public static void withSshdContainer(SshdContainer.Builder builder, @NotNull ThrowingConsumer<SshdContainer> consumer) throws Throwable { SshdContainer sshdContainer = new SshdContainer(builder.buildInner()); sshdContainer.start(); try { consumer.accept(sshdContainer); } finally { sshdContainer.stop(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withSshdContainer File: src/itest/java/com/hierynomus/sshj/SshdContainer.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
withSshdContainer
src/itest/java/com/hierynomus/sshj/SshdContainer.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0