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 void evictionConfigXmlGenerator(XmlGenerator gen, EvictionConfig e) { if (e == null) { return; } String comparatorClassName = !isNullOrEmpty(e.getComparatorClassName()) ? e.getComparatorClassName() : null; gen.node("eviction", null, "size", e.getSize(), "max-size-policy", e.getMaximumSizePolicy(), "eviction-policy", e.getEvictionPolicy(), "comparator-class-name", comparatorClassName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: evictionConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
evictionConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public List<MediaType> produces() { return produces; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: produces File: jooby/src/main/java/org/jooby/internal/RouteImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
produces
jooby/src/main/java/org/jooby/internal/RouteImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
public void setPropertyInXWikiCfg(String configuration) throws IOException { Properties properties = new Properties(); properties.load(new ByteArrayInputStream(configuration.getBytes())); StringBuilder sb = new StringBuilder(); sb.append("{{velocity}}\n" + "#set($config = $!services.component.getInstance(\"org.xwiki.configuration." + "ConfigurationSource\", \"xwikicfg\"))\n" + "#set($props = $config.getProperties())\n"); // Since we don't have access to the XWiki object from Selenium tests and since we don't want to restart XWiki // with a different xwiki.cfg file for each test that requires a configuration change, we use the following // trick: We create a document and we access the XWiki object with a Velocity script inside that document. for (Map.Entry<Object, Object> param : properties.entrySet()) { sb.append("#set($discard = $props.put('").append(param.getKey()).append("', '") .append(param.getValue()).append("'))\n"); } sb.append("#set($discard = $config.set($props))\n" + "{{/velocity}}"); createPage("Test", "XWikiConfigurationPageForTest", sb.toString(), "Test page to change xwiki.cfg"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPropertyInXWikiCfg 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
setPropertyInXWikiCfg
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 static Builder builder() { return new AutoValue_DnsLookupDataAdapter_Config.Builder(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: builder File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
builder
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
public ApiClient setServerVariables(Map<String, String> serverVariables) { this.serverVariables = serverVariables; updateBasePath(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServerVariables File: samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setServerVariables
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public Version getLastVersion(boolean fetch) { boolean checkPreview = previewAble(); if (updateVersionTimerTask == null) { updateVersionTimerTask = new UpdateVersionTimerTask(checkPreview); } if (fetch) { try { return updateVersionTimerTask.fetchLastVersion(checkPreview); } catch (Exception e) { LOGGER.error(e); } } return updateVersionTimerTask.getVersion(); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2019-16643 - Severity: LOW - CVSS Score: 3.5 Description: Upgrade jar version & fix #54 Signed-off-by: xiaochun <xchun90@163.com> Function: getLastVersion File: web/src/main/java/com/zrlog/web/plugin/UpdateVersionPlugin.java Repository: 94fzb/zrlog Fixed Code: public Version getLastVersion(boolean fetch) { boolean checkPreview = previewAble(); if (updateVersionTimerTask == null) { updateVersionTimerTask = new UpdateVersionTimerTask(checkPreview); } if (fetch) { try { return updateVersionTimerTask.fetchLastVersion(checkPreview); } catch (Exception e) { LOGGER.error("",e); } } return updateVersionTimerTask.getVersion(); }
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
getLastVersion
web/src/main/java/com/zrlog/web/plugin/UpdateVersionPlugin.java
4a91c83af669e31a22297c14f089d8911d353fa1
1
Analyze the following code function for security vulnerabilities
@Deprecated public void setIntValue(String className, String fieldName, int value) { setIntValue(getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()), fieldName, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIntValue 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
setIntValue
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
@Override public boolean equals(Object obj) { return delegate.equals(obj); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: src/main/java/org/apache/ibatis/cache/decorators/SerializedCache.java Repository: mybatis/mybatis-3 The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-26945
MEDIUM
5.1
mybatis/mybatis-3
equals
src/main/java/org/apache/ibatis/cache/decorators/SerializedCache.java
9caf480e05c389548c9889362c2cb080d728b5d8
0
Analyze the following code function for security vulnerabilities
private ContentValues getContentValuesForRosterEntry(final RosterEntry entry, Presence presence) { final ContentValues values = new ContentValues(); values.put(RosterConstants.JID, entry.getUser()); values.put(RosterConstants.ALIAS, getName(entry)); // handle subscription requests and errors with higher priority Presence sub = subscriptionRequests.get(entry.getUser()); if (presence.getType() == Presence.Type.error) { String error = presence.getError().getMessage(); if (error == null || error.length() == 0) error = presence.getError().toString(); values.put(RosterConstants.STATUS_MESSAGE, error); } else if (sub != null) { presence = sub; values.put(RosterConstants.STATUS_MESSAGE, presence.getStatus()); } else switch (entry.getType()) { case to: case both: // override received presence from roster, using highest-prio entry presence = mRoster.getPresence(entry.getUser()); values.put(RosterConstants.STATUS_MESSAGE, presence.getStatus()); break; case from: values.put(RosterConstants.STATUS_MESSAGE, mService.getString(R.string.subscription_status_from)); presence = null; break; case none: values.put(RosterConstants.STATUS_MESSAGE, ""); presence = null; } values.put(RosterConstants.STATUS_MODE, getStatusInt(presence)); values.put(RosterConstants.GROUP, getGroup(entry.getGroups())); return values; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentValuesForRosterEntry File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
getContentValuesForRosterEntry
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public int getProcessLimit() throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProcessLimit File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getProcessLimit
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private String addHeadersToRequestAndGetContentType(WebClient.Builder webClientBuilder, List<Property> headers) { String contentType = ""; for (Property header : headers) { String key = header.getKey(); if (StringUtils.isNotEmpty(key)) { String value = (String) header.getValue(); webClientBuilder.defaultHeader(key, value); if (HttpHeaders.CONTENT_TYPE.equalsIgnoreCase(key)) { contentType = value; } } } return contentType; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addHeadersToRequestAndGetContentType File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-38298
HIGH
8.8
appsmithorg/appsmith
addHeadersToRequestAndGetContentType
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object o) { if (!(o instanceof Map.Entry)) { return false; } Entry<?, ?> other = (Entry<?, ?>) o; return (getKey() == null ? other.getKey() == null : getKey().equals(other.getKey())) && (getValue() == null ? other.getValue() == null : getValue().equals(other.getValue())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
equals
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public void addQsTile(ComponentName tile) { mQSPanel.getHost().addTile(tile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addQsTile File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
addQsTile
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static FileLock getFileLock(String path, boolean shared, boolean allowBlock) throws FileNotFoundException { RandomAccessFile rafFile = new RandomAccessFile(path, "rw"); FileChannel fc = rafFile.getChannel(); FileLock lock = null; try { if (!shared) { if (allowBlock) { lock = fc.lock(0, Long.MAX_VALUE, false); } else { lock = fc.tryLock(0, Long.MAX_VALUE, false); } } else { // We want shared lock. This will block regardless if allowBlock is true or not. // Test to see if we can get a shared lock. lock = fc.lock(0, 1, true); // Block if a non exclusive lock is being held. if (!lock.isShared()) { // This lock is an exclusive lock. Use alternate solution. FileLock tempLock = null; for (long pos = 1; tempLock == null && pos < Long.MAX_VALUE - 1; pos++) { tempLock = fc.tryLock(pos, 1, false); } lock.release(); lock = tempLock; // Get the unique exclusive lock. } } } catch (IOException e) { LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, e); } return lock; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileLock File: core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getFileLock
core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
protected RowState getRowState() { return rowState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRowState 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
getRowState
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public void flush(ChannelHandlerContext ctx) throws Exception { ctx.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: flush File: handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-34462
MEDIUM
6.5
netty
flush
handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java
535da17e45201ae4278c0479e6162bb4127d4c32
0
Analyze the following code function for security vulnerabilities
public OutputStream getOutputStream() { return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOutputStream File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
getOutputStream
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
@Nullable public String getSource() { return source; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSource File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getSource
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
void handleStopUser(int userId) { updateNetworkPreferenceForUser(userId, List.of(PreferentialNetworkServiceConfig.DEFAULT)); mDeviceAdminServiceController.stopServicesForUser(userId, /* actionForLog= */ "stop-user"); if (isPermissionCheckFlagEnabled() || isPolicyEngineForFinanceFlagEnabled()) { mDevicePolicyEngine.handleStopUser(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleStopUser 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
handleStopUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@GET @Path("test/{nodeId}/configuration") @Operation(summary = "Retrieve configuration", description = "Retrieves configuration of the test course node") @ApiResponse(responseCode = "200", description = "The course 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 node was not found") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response getTestConfiguration(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId) { TestConfigVO config = new TestConfigVO(); ICourse course = CoursesWebService.loadCourse(courseId); CourseNode courseNode = getParentNode(course, nodeId).getCourseNode(); //build configuration with fallback to default values ModuleConfiguration moduleConfig = courseNode.getModuleConfiguration(); RepositoryEntry testRe = courseNode.getReferencedRepositoryEntry(); if(testRe == null) { return Response.noContent().build(); } QTI21DeliveryOptions deliveryOptions = CoreSpringFactory.getImpl(QTI21Service.class) .getDeliveryOptions(testRe); Boolean allowCancel = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_ENABLECANCEL); config.setAllowCancel(allowCancel == null ? false : allowCancel); Boolean allowNavi = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_ENABLEMENU); config.setAllowNavigation(allowNavi == null ? false : allowNavi); Boolean allowSuspend = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_ENABLESUSPEND); config.setAllowSuspend(allowSuspend == null ? false : allowSuspend); config.setNumAttempts(moduleConfig.getIntegerSafe(IQEditController.CONFIG_KEY_ATTEMPTS, 0)); config.setSequencePresentation(moduleConfig.getStringValue(IQEditController.CONFIG_KEY_SEQUENCE, AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM)); Boolean showNavi = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_DISPLAYMENU); config.setShowNavigation(showNavi == null ? true : showNavi); boolean showQuestionTitle = moduleConfig.getBooleanSafe(IQEditController.CONFIG_KEY_QUESTIONTITLE, deliveryOptions.isShowTitles()); config.setShowQuestionTitle(showQuestionTitle); // report Boolean showResHomepage = moduleConfig.getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); config.setShowResultsOnHomepage(showResHomepage != null && showResHomepage.booleanValue());// default false boolean showScoreInfo = moduleConfig.getBooleanSafe(IQEditController.CONFIG_KEY_ENABLESCOREINFO); config.setShowScoreInfo(showScoreInfo); Boolean showResFinish = moduleConfig.getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_FINISH); config.setShowResultsAfterFinish(showResFinish == null || showResFinish.booleanValue());// default true String showResDate = (String)moduleConfig.get(IQEditController.CONFIG_KEY_DATE_DEPENDENT_RESULTS); config.setShowResultsDependendOnDate(showResDate == null ? IQEditController.CONFIG_VALUE_DATE_DEPENDENT_RESULT_ALWAYS : showResDate); config.setShowResultsStartDate((Date) moduleConfig.get(IQEditController.CONFIG_KEY_RESULTS_START_DATE)); config.setShowResultsEndDate((Date) moduleConfig.get(IQEditController.CONFIG_KEY_RESULTS_END_DATE)); config.setShowResultsPassedStartDate((Date) moduleConfig.get(IQEditController.CONFIG_KEY_RESULTS_PASSED_START_DATE)); config.setShowResultsPassedEndDate((Date) moduleConfig.get(IQEditController.CONFIG_KEY_RESULTS_PASSED_END_DATE)); config.setShowResultsFailedStartDate((Date) moduleConfig.get(IQEditController.CONFIG_KEY_RESULTS_FAILED_START_DATE)); config.setShowResultsFailedEndDate((Date) moduleConfig.get(IQEditController.CONFIG_KEY_RESULTS_FAILED_END_DATE)); config.setSummeryPresentation(moduleConfig.getStringValue(IQEditController.CONFIG_KEY_SUMMARY, AssessmentInstance.QMD_ENTRY_SUMMARY_COMPACT)); // boolean configRef = moduleConfig.getBooleanSafe(IQEditController.CONFIG_KEY_CONFIG_REF, false); boolean showQuestionProgress = configRef ? deliveryOptions.isDisplayQuestionProgress() : moduleConfig.getBooleanSafe(IQEditController.CONFIG_KEY_QUESTIONPROGRESS, deliveryOptions.isDisplayQuestionProgress()); config.setShowQuestionProgress(showQuestionProgress); boolean showScoreProgress = configRef ? deliveryOptions.isDisplayScoreProgress() : moduleConfig.getBooleanSafe(IQEditController.CONFIG_KEY_SCOREPROGRESS, deliveryOptions.isDisplayScoreProgress()); config.setShowScoreProgress(showScoreProgress); return Response.ok(config).build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTestConfiguration 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
getTestConfiguration
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public static String alterBodyHtmlAbsolutizePaths(String HTML, String serverName) { String message = HTML; //Replacing links "TD background" like tags message = message .replaceAll( "<\\s*td([^>]*)background\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<td$1background=\"http://" + serverName + "$2\"$3>"); // Replacing links "TR background" like tags message = message .replaceAll( "<\\s*tr([^>]*)background\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<tr$1background=\"http://" + serverName + "$2\"$3>"); // Replacing links "IMG SRC" like tags message = message.replaceAll( "<\\s*img([^>]*)src\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<img$1src=\"http://" + serverName + "$2\"$3>"); // Replacing links "A HREF" like tags message = message .replaceAll( "<\\s*link([^>]*)href\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<link$1href=\"http://" + serverName + "$2\"$3>"); // Replacing links "SCRIPT" like tags message = message .replaceAll( "<\\s*script([^>]*)src\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<script$1src=\"http://" + serverName + "$2\"$3>"); // Replacing links "APPLET" with codebase like tags message = message .replaceAll( "<\\s*applet([^>]*)codebase\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<applet$1codebase=\"http://" + serverName + "$2\"$3>"); // Replacing links "APPLET" without codebase like tags message = message .replaceAll( "<\\s*applet(([^>][^(codebase)])*)code\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?(([^>][^(codebase)])*)>", "<applet$1code=\"http://" + serverName + "$4\"$5>"); // Replacing links "IFRAME" src replacement message = message .replaceAll( "<\\s*iframe([^>]*)src\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<iframe$1src=\"http://" + serverName + "$2\"$3>"); // Replacing links "IFRAME" longdesc replacement message = message .replaceAll( "<\\s*iframe([^>]*)longdesc\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<iframe$1longdesc=\"http://" + serverName + "$2\"$3>"); // Replacing links "FRAME" src replacement message = message .replaceAll( "<\\s*frame([^>]*)src\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<frame$1src=\"http://" + serverName + "$2\"$3>"); // Replacing links "FRAME" longdesc replacement message = message .replaceAll( "<\\s*frame([^>]*)longdesc\\s*=\\s*[\"\']?([^\'\">]*)[\"\']?([^>]*)>", "<frame$1longdesc=\"http://" + serverName + "$2\"$3>"); // Replacing some style URLs message = message .replaceAll( "<([^>]*)style\\s*=\\s*[\"\']?([^\'\">]*)url\\s*\\(\\s*([^>]*)\\s*\\)([^\'\">]*)[\"\']?([^>]*)>", "<$1style=\"$2url(http://" + serverName + "$3)$4\"$5>"); // Fixing absolute paths message = message.replaceAll("http://" + serverName + "\\s*http://", "http://"); return message; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: alterBodyHtmlAbsolutizePaths 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
alterBodyHtmlAbsolutizePaths
src/com/dotmarketing/factories/EmailFactory.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
@JsonProperty("Type") public String getType() { return type; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getType File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getType
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public int createFakeFontSubsets() { int total = 0; for (int k = 1; k < xrefObj.size(); ++k) { PdfObject obj = getPdfObjectRelease(k); if (obj == null || !obj.isDictionary()) continue; PdfDictionary dic = (PdfDictionary)obj; if (!existsName(dic, PdfName.TYPE, PdfName.FONT)) continue; if (existsName(dic, PdfName.SUBTYPE, PdfName.TYPE1) || existsName(dic, PdfName.SUBTYPE, PdfName.MMTYPE1) || existsName(dic, PdfName.SUBTYPE, PdfName.TRUETYPE)) { String s = getSubsetPrefix(dic); if (s != null) continue; s = getFontName(dic); if (s == null) continue; String ns = BaseFont.createSubsetPrefix() + s; PdfDictionary fd = (PdfDictionary)getPdfObjectRelease(dic.get(PdfName.FONTDESCRIPTOR)); if (fd == null) continue; if (fd.get(PdfName.FONTFILE) == null && fd.get(PdfName.FONTFILE2) == null && fd.get(PdfName.FONTFILE3) == null) continue; fd = dic.getAsDict(PdfName.FONTDESCRIPTOR); PdfName newName = new PdfName(ns); dic.put(PdfName.BASEFONT, newName); fd.put(PdfName.FONTNAME, newName); setXrefPartialObject(k, dic); ++total; } } return total; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createFakeFontSubsets File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
createFakeFontSubsets
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
private InvalidClassException missingClassDescriptor() throws InvalidClassException { throw new InvalidClassException("Read null attempting to read class descriptor for object"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: missingClassDescriptor 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
missingClassDescriptor
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public void run() { synchronized (mLock) { ensureGroupStateLoadedLocked(mUserId); saveStateLocked(mUserId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
run
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection) throws DatabaseServiceException { try { // logger.info("connection::{}, forceNewConnection: {}", connection, forceNewConnection); if (connection != null && !forceNewConnection) { // logger.info("connection closed::{}", connection.isClosed()); if (!connection.isClosed()) { if (logger.isDebugEnabled()) { logger.debug("Returning existing connection::{}", connection); } return connection; } } Class.forName(type.getClassPath()); DriverManager.setLoginTimeout(10); String dbURL = getDatabaseUrl(databaseConfiguration); connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(), databaseConfiguration.getDatabasePassword()); logger.debug("*** Acquired New connection for ::{} **** ", dbURL); return connection; } catch (ClassNotFoundException e) { logger.error("Jdbc Driver not found", e); throw new DatabaseServiceException(e.getMessage()); } catch (SQLException e) { logger.error("SQLException::Couldn't get a Connection!", e); throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage()); } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2023-41887 - Severity: CRITICAL - CVSS Score: 9.8 Description: Properly escape JDBC URL components in database extension Function: getConnection File: extensions/database/src/com/google/refine/extension/database/pgsql/PgSQLConnectionManager.java Repository: OpenRefine Fixed Code: public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection) throws DatabaseServiceException { try { // logger.info("connection::{}, forceNewConnection: {}", connection, forceNewConnection); if (connection != null && !forceNewConnection) { // logger.info("connection closed::{}", connection.isClosed()); if (!connection.isClosed()) { if (logger.isDebugEnabled()) { logger.debug("Returning existing connection::{}", connection); } return connection; } } Class.forName(type.getClassPath()); DriverManager.setLoginTimeout(10); String dbURL = databaseConfiguration.toURI().toString(); connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(), databaseConfiguration.getDatabasePassword()); logger.debug("*** Acquired New connection for ::{} **** ", dbURL); return connection; } catch (ClassNotFoundException e) { logger.error("Jdbc Driver not found", e); throw new DatabaseServiceException(e.getMessage()); } catch (SQLException e) { logger.error("SQLException::Couldn't get a Connection!", e); throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage()); } }
[ "CWE-89" ]
CVE-2023-41887
CRITICAL
9.8
OpenRefine
getConnection
extensions/database/src/com/google/refine/extension/database/pgsql/PgSQLConnectionManager.java
693fde606d4b5b78b16391c29d110389eb605511
1
Analyze the following code function for security vulnerabilities
@JsonProperty("Version") public Integer getVersion() { return version; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVersion File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getVersion
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
protected void processFile(String fileName) throws Exception { processFile(fileName, getSystemIdForFileName(fileName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processFile File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java Repository: quartz-scheduler/quartz The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-13990
HIGH
7.5
quartz-scheduler/quartz
processFile
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
0
Analyze the following code function for security vulnerabilities
public void decodeResources(File outDir) throws AndrolibException { if (!mApkInfo.hasResources()) { return; } mResTable.loadMainPkg(mApkInfo.getApkFile()); ResStreamDecoderContainer decoders = new ResStreamDecoderContainer(); decoders.setDecoder("raw", new ResRawStreamDecoder()); decoders.setDecoder("9patch", new Res9patchStreamDecoder()); AXmlResourceParser axmlParser = new AXmlResourceParser(mResTable); decoders.setDecoder("xml", new XmlPullStreamDecoder(axmlParser, getResXmlSerializer())); ResFileDecoder fileDecoder = new ResFileDecoder(decoders); Directory in, out; try { out = new FileDirectory(outDir); in = mApkInfo.getApkFile().getDirectory(); out = out.createDir("res"); } catch (DirectoryException ex) { throw new AndrolibException(ex); } ExtMXSerializer xmlSerializer = getResXmlSerializer(); for (ResPackage pkg : mResTable.listMainPackages()) { LOGGER.info("Decoding file-resources..."); for (ResResource res : pkg.listFiles()) { fileDecoder.decode(res, in, out, mResFileMapping); } LOGGER.info("Decoding values */* XMLs..."); for (ResValuesFile valuesFile : pkg.listValuesFiles()) { generateValuesFile(valuesFile, out, xmlSerializer); } generatePublicXml(pkg, out, xmlSerializer); } AndrolibException decodeError = axmlParser.getFirstError(); if (decodeError != null) { throw decodeError; } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2024-21633 - Severity: HIGH - CVSS Score: 7.8 Description: Prevent arbitrary file writes with malicious resource names. (#3484) * refactor: rename sanitize function * fix: expose getDir * fix: safe handling of untrusted resource names - fixes: GHSA-2hqv-2xv4-5h5w * test: sample file for GHSA-2hqv-2xv4-5h5w * refactor: avoid detection of absolute files for resource check * chore: enable info mode on gradle * test: skip test on windows * chore: debug windows handling * fix: normalize entry with file separators * fix: normalize filepath after cleansing * chore: Android paths are not OS specific * refactor: use java.nio for path traversal checking * chore: align path separator on Windows for Zip files * chore: rework towards basic directory traversal * chore: remove '--info' on build.yml Function: decodeResources File: brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java Repository: iBotPeaches/Apktool Fixed Code: public void decodeResources(File outDir) throws AndrolibException { if (!mApkInfo.hasResources()) { return; } mResTable.loadMainPkg(mApkInfo.getApkFile()); ResStreamDecoderContainer decoders = new ResStreamDecoderContainer(); decoders.setDecoder("raw", new ResRawStreamDecoder()); decoders.setDecoder("9patch", new Res9patchStreamDecoder()); AXmlResourceParser axmlParser = new AXmlResourceParser(mResTable); decoders.setDecoder("xml", new XmlPullStreamDecoder(axmlParser, getResXmlSerializer())); ResFileDecoder fileDecoder = new ResFileDecoder(decoders); Directory in, out, outRes; try { out = new FileDirectory(outDir); in = mApkInfo.getApkFile().getDirectory(); outRes = out.createDir("res"); } catch (DirectoryException ex) { throw new AndrolibException(ex); } ExtMXSerializer xmlSerializer = getResXmlSerializer(); for (ResPackage pkg : mResTable.listMainPackages()) { LOGGER.info("Decoding file-resources..."); for (ResResource res : pkg.listFiles()) { fileDecoder.decode(res, in, outRes, mResFileMapping); } LOGGER.info("Decoding values */* XMLs..."); for (ResValuesFile valuesFile : pkg.listValuesFiles()) { generateValuesFile(valuesFile, outRes, xmlSerializer); } generatePublicXml(pkg, outRes, xmlSerializer); } AndrolibException decodeError = axmlParser.getFirstError(); if (decodeError != null) { throw decodeError; } }
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
decodeResources
brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
1
Analyze the following code function for security vulnerabilities
public void put(int userId, String packageName, ArrayList<String> components) { ArrayMap<String, ArrayList<String>> packages = getOrAllocate(userId); packages.put(packageName, components); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
put
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { return String.format("<DecimalQuantity %s:%d:%d:%s %s %s%s>", (lOptPos > 1000 ? "999" : String.valueOf(lOptPos)), lReqPos, rReqPos, (rOptPos < -1000 ? "-999" : String.valueOf(rOptPos)), (usingBytes ? "bytes" : "long"), (isNegative() ? "-" : ""), toNumberString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
toString
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
@Override public void startOneTimePermissionSession(String packageName, @UserIdInt int userId, long timeoutMillis, long revokeAfterKilledDelayMillis, int importanceToResetTimer, int importanceToKeepSessionAlive) { mContext.enforceCallingOrSelfPermission( Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS, "Must hold " + Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS + " to register permissions as one time."); Objects.requireNonNull(packageName); final long token = Binder.clearCallingIdentity(); try { getOneTimePermissionUserManager(userId).startPackageOneTimeSession(packageName, timeoutMillis, revokeAfterKilledDelayMillis, importanceToResetTimer, importanceToKeepSessionAlive); } finally { Binder.restoreCallingIdentity(token); } }
Vulnerability Classification: - CWE: CWE-281 - CVE: CVE-2023-21249 - Severity: MEDIUM - CVSS Score: 5.5 Description: Watch uid proc state instead of importance for 1-time permissions The system process may bind to an app with the flag BIND_FOREGROUND_SERVICE, this will put the client in the foreground service importance level without the normal requirement that foreground services must show a notification. Looking at proc states instead allows us to differentiate between these two levels of foreground service and revoke the client when not in use. This change makes the parameters `importanceToResetTimer` and `importanceToKeepSessionAlive` in PermissionManager#startOneTimePermissionSession obsolete. Test: atest CtsPermissionTestCases + manual testing with mic/cam/loc Bug: 217981062 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0be78fbbf7d92bf29858aa0c48b171045ab5057f) Merged-In: I7a725647c001062d1a76a82b680a02e3e2edcb03 Change-Id: I7a725647c001062d1a76a82b680a02e3e2edcb03 Function: startOneTimePermissionSession File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android Fixed Code: @Override public void startOneTimePermissionSession(String packageName, @UserIdInt int userId, long timeoutMillis, long revokeAfterKilledDelayMillis) { mContext.enforceCallingOrSelfPermission( Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS, "Must hold " + Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS + " to register permissions as one time."); Objects.requireNonNull(packageName); final long token = Binder.clearCallingIdentity(); try { getOneTimePermissionUserManager(userId).startPackageOneTimeSession(packageName, timeoutMillis, revokeAfterKilledDelayMillis); } finally { Binder.restoreCallingIdentity(token); } }
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
startOneTimePermissionSession
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
1
Analyze the following code function for security vulnerabilities
public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).usePasswordFlow(username, password); return this; } } throw new RuntimeException("No OAuth2 authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOauthPasswordFlow File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setOauthPasswordFlow
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private static String generateRandomFilename(boolean hidden) { String filename = String.format("%s", RandomStringUtils.randomAlphanumeric(8)); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmm"); String datePart = sdf.format(new Date()); filename = datePart+"_"+filename; return filename; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateRandomFilename File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
generateRandomFilename
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
public IdImpl marshal(Id id) throws Exception { if (id instanceof IdImpl) { return (IdImpl) id; } else { throw new IllegalStateException("an unknown ID is un use: " + id); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: marshal File: modules/common/src/main/java/org/opencastproject/mediapackage/identifier/Id.java Repository: opencast The code follows secure coding practices.
[ "CWE-74" ]
CVE-2020-5230
MEDIUM
5
opencast
marshal
modules/common/src/main/java/org/opencastproject/mediapackage/identifier/Id.java
bbb473f34ab95497d6c432c81285efb0c739f317
0
Analyze the following code function for security vulnerabilities
public boolean refContentProvider(IBinder connection, int stable, int unstable) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(connection); data.writeInt(stable); data.writeInt(unstable); mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); reply.readException(); boolean res = reply.readInt() != 0; data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: refContentProvider File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
refContentProvider
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Nullable static ComponentName parseComponentNameAttribute(TypedXmlPullParser parser, String attribute) { final String value = parseStringAttribute(parser, attribute); if (TextUtils.isEmpty(value)) { return null; } return ComponentName.unflattenFromString(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseComponentNameAttribute 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
parseComponentNameAttribute
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition post(final String path, final Route.Handler handler) { return appendDefinition(POST, path, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: post 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
post
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private void registerConverterDynamically(String className, int priority, Class[] constructorParamTypes, Object[] constructorParamValues) { try { Class type = Class.forName(className, false, classLoaderReference.getReference()); Constructor constructor = type.getConstructor(constructorParamTypes); Object instance = constructor.newInstance(constructorParamValues); if (instance instanceof Converter) { registerConverter((Converter)instance, priority); } else if (instance instanceof SingleValueConverter) { registerConverter((SingleValueConverter)instance, priority); } } catch (Exception e) { throw new com.thoughtworks.xstream.InitializationException("Could not instantiate converter : " + className, e); } catch (LinkageError e) { throw new com.thoughtworks.xstream.InitializationException("Could not instantiate converter : " + className, e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerConverterDynamically File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
registerConverterDynamically
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public int getFlags() { return mFlags; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFlags File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getFlags
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override protected int getMaxPanelHeight() { int min = mStatusBarMinHeight; if (mStatusBar.getBarState() != StatusBarState.KEYGUARD && mNotificationStackScroller.getNotGoneChildCount() == 0) { int minHeight = (int) (mQsMinExpansionHeight + getOverExpansionAmount()); min = Math.max(min, minHeight); } int maxHeight; if (mQsExpandImmediate || mQsExpanded || mIsExpanding && mQsExpandedWhenExpandingStarted) { maxHeight = calculatePanelHeightQsExpanded(); } else { maxHeight = calculatePanelHeightShade(); } maxHeight = Math.max(maxHeight, min); return maxHeight; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxPanelHeight File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
getMaxPanelHeight
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public OIDCProviderMetadata findProviderMetadata() { init(); return this.providerMetadata; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findProviderMetadata File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
findProviderMetadata
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
public void createAdminUser(boolean programming) { String username = ADMIN_CREDENTIALS.getUserName(); String password = ADMIN_CREDENTIALS.getPassword(); LocalDocumentReference userReference = new LocalDocumentReference("XWiki", username); Page userPage = rest().page(userReference); userPage.setObjects(new org.xwiki.rest.model.jaxb.Objects()); org.xwiki.rest.model.jaxb.Object userObject = RestTestUtils.object("XWiki.XWikiUsers"); // Set password userObject.getProperties().add(RestTestUtils.property("password", password)); userPage.getObjects().getObjectSummaries().add(userObject); // Save the user page try { rest().save(userPage); } catch (Exception e) { fail("Failed to save the user with name [" + username + "]", e); } // Add the user to XWikiAllGroup addObject("XWiki", "XWikiAllGroup", "XWiki.XWikiGroups", "member", serializeReference(userReference)); // Add the user to XWikiAdminGroup group (before we login as the user does not have admin right at first) addObject("XWiki", "XWikiAdminGroup", "XWiki.XWikiGroups", "member", serializeReference(userReference)); // Give ADMIN right (and maybe PROGRAMMING right) to XWikiAdminGroup setGlobalRights("XWiki.XWikiAdminGroup", "", programming ? "admin,programming" : "admin", true); loginAsAdmin(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAdminUser 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-79" ]
CVE-2023-35157
MEDIUM
4.8
xwiki/xwiki-platform
createAdminUser
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
35e9073ffec567861e0abeea072bd97921a3decf
0
Analyze the following code function for security vulnerabilities
void onClick(View v, Intent intent);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onClick File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
onClick
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
@Override public void startDocument() throws SAXException { this.attributes = new HashMap<String, Object>(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startDocument File: cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java Repository: apereo/java-cas-client The code follows secure coding practices.
[ "CWE-74" ]
CVE-2014-4172
HIGH
7.5
apereo/java-cas-client
startDocument
cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java
ae37092100c8eaec610dab6d83e5e05a8ee58814
0
Analyze the following code function for security vulnerabilities
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex, int connectTimeout, SecureRandom rnd, ProxyData proxyData) throws IOException { /* First, establish the TCP connection to the SSH-2 server */ establishConnection(proxyData, connectTimeout); /* Parse the server line and say hello - important: this information is later needed for the * key exchange (to stop man-in-the-middle attacks) - that is why we wrap it into an object * for later use. */ ClientServerHello csh = new ClientServerHello(sock.getInputStream(), sock.getOutputStream()); tc = new TransportConnection(sock.getInputStream(), sock.getOutputStream(), rnd); km = new KexManager(this, csh, cwl, hostname, port, verifier, rnd); km.initiateKEX(cwl, dhgex); receiveThread = new Thread(new Runnable() { public void run() { try { receiveLoop(); } catch (IOException e) { close(e, false); if (log.isEnabled()) log.log(10, "Receive thread: error in receiveLoop: " + e.getMessage()); } if (log.isEnabled()) log.log(50, "Receive thread: back from receiveLoop"); /* Tell all handlers that it is time to say goodbye */ if (km != null) { try { km.handleMessage(null, 0); } catch (IOException e) { } } for (int i = 0; i < messageHandlers.size(); i++) { HandlerEntry he = messageHandlers.elementAt(i); try { he.mh.handleMessage(null, 0); } catch (Exception ignore) { } } } }); receiveThread.setDaemon(true); receiveThread.start(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialize File: src/main/java/com/trilead/ssh2/transport/TransportManager.java Repository: connectbot/sshlib The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
connectbot/sshlib
initialize
src/main/java/com/trilead/ssh2/transport/TransportManager.java
5c8b534f6e97db7ac0e0e579331213aa25c173ab
0
Analyze the following code function for security vulnerabilities
private List<ApnSetting> getOverrideApnsUnchecked() { TelephonyManager tm = mContext.getSystemService(TelephonyManager.class); if (tm != null) { return mInjector.binderWithCleanCallingIdentity( () -> tm.getDevicePolicyOverrideApns(mContext)); } Slogf.w(LOG_TAG, "TelephonyManager is null when trying to get override apns"); return Collections.emptyList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOverrideApnsUnchecked 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
getOverrideApnsUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private Service createService(String serviceImplementationName) throws ServiceException { if(serviceImplementationName == null) { throw new IllegalArgumentException(Messages.getMessage("serviceFactoryInvalidServiceName")); } try { Class serviceImplementationClass; serviceImplementationClass = Thread.currentThread().getContextClassLoader().loadClass(serviceImplementationName); if (!(org.apache.axis.client.Service.class).isAssignableFrom(serviceImplementationClass)) { throw new ServiceException( Messages.getMessage("serviceFactoryServiceImplementationRequirement", serviceImplementationName)); } Service service = (Service) serviceImplementationClass.newInstance(); if (service.getServiceName() != null) { return service; } else { throw new ServiceException(Messages.getMessage("serviceFactoryInvalidServiceName")); } } catch (ServiceException e) { throw e; } catch (Exception e){ throw new ServiceException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createService File: axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java Repository: apache/axis-axis1-java The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-51441
HIGH
7.2
apache/axis-axis1-java
createService
axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java
685c309febc64aa393b2d64a05f90e7eb9f73e06
0
Analyze the following code function for security vulnerabilities
@Override public boolean isOpen() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOpen File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
isOpen
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
@Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.edit_fdn_contact_screen); setupView(); setTitle(mAddContact ? R.string.add_fdn_contact : R.string.edit_fdn_contact); PersistableBundle b; if (mSubscriptionInfoHelper.hasSubId()) { b = PhoneGlobals.getInstance().getCarrierConfigForSubId( mSubscriptionInfoHelper.getSubId()); } else { b = PhoneGlobals.getInstance().getCarrierConfig(); } if (b != null) { mFdnNumberLimitLength = b.getInt( CarrierConfigManager.KEY_FDN_NUMBER_LENGTH_LIMIT_INT); } displayProgress(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate File: src/com/android/phone/settings/fdn/EditFdnContactScreen.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
onCreate
src/com/android/phone/settings/fdn/EditFdnContactScreen.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
public void removeRosterItem(String user) throws YaximXMPPException { debugLog("removeRosterItem(" + user + ")"); subscriptionRequests.remove(user); tryToRemoveRosterEntry(user); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeRosterItem File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
removeRosterItem
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public BaseObject addXObjectFromRequest(DocumentReference classReference, String prefix, XWikiContext context) throws XWikiException { return addXObjectFromRequest(classReference, prefix, 0, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addXObjectFromRequest 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
addXObjectFromRequest
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
public VirtualHostBuilder defaultVirtualHost() { return defaultVirtualHostBuilder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultVirtualHost File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
defaultVirtualHost
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
private void updateHomepageBackground() { if (!mIsEmbeddingActivityEnabled) { return; } final Window window = getWindow(); final int color = mIsTwoPane ? getColor(R.color.settings_two_pane_background_color) : Utils.getColorAttrDefaultColor(this, android.R.attr.colorBackground); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); // Update status bar color window.setStatusBarColor(color); // Update content background. findViewById(android.R.id.content).setBackgroundColor(color); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateHomepageBackground File: src/com/android/settings/homepage/SettingsHomepageActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21256
HIGH
7.8
android
updateHomepageBackground
src/com/android/settings/homepage/SettingsHomepageActivity.java
62fc1d269f5e754fc8f00b6167d79c3933b4c1f4
0
Analyze the following code function for security vulnerabilities
@Override public VirtualChannel getChannel() { return localChannel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChannel File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getChannel
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private static JsonArray unwrapVarArgs(JsonArray argsFromClient, Method method) { int paramCount = method.getParameterCount(); if (argsFromClient.length() == paramCount) { if (argsFromClient.get(paramCount - 1).getType() .equals(JsonType.ARRAY)) { return argsFromClient; } } JsonArray result = Json.createArray(); JsonArray rest = Json.createArray(); int newIndex = 0; for (int i = 0; i < argsFromClient.length(); i++) { JsonValue value = argsFromClient.get(i); if (i < paramCount - 1) { result.set(i, value); } else { rest.set(newIndex, value); newIndex++; } } result.set(paramCount - 1, rest); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unwrapVarArgs File: flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25500
MEDIUM
4.3
vaadin/flow
unwrapVarArgs
flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
1fa4976902a117455bf2f98b191f8c80692b53c8
0
Analyze the following code function for security vulnerabilities
@Deprecated protected BeanSerializerBase withIgnorals(String[] toIgnore) { return withIgnorals(ArrayBuilders.arrayToSet(toIgnore)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withIgnorals File: src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
withIgnorals
src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@Override protected void onDestroy() { super.onDestroy(); if (mRefinementResultReceiver != null) { mRefinementResultReceiver.destroy(); mRefinementResultReceiver = null; } unbindRemainingServices(); mChooserHandler.removeMessages(CHOOSER_TARGET_SERVICE_RESULT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDestroy File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
onDestroy
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
private boolean isValidColumnType(String name, String className) { String[] validtypes = this.validTypesMap.get(className); if (validtypes == null) { return true; } else { return ArrayUtils.contains(validtypes, name); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidColumnType File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
isValidColumnType
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
private static RMQMessage instantiateRmqMessage(String messageClass, List<String> trustedPackages) throws RMQJMSException { if(isRmqObjectMessageClass(messageClass)) { return instantiateRmqObjectMessageWithTrustedPackages(trustedPackages); } else { try { // instantiate the message object with the thread context classloader return (RMQMessage) Class.forName(messageClass, true, Thread.currentThread().getContextClassLoader()).getDeclaredConstructor().newInstance(); } catch (InstantiationException e) { throw new RMQJMSException(e); } catch (IllegalAccessException e) { throw new RMQJMSException(e); } catch (ClassNotFoundException e) { throw new RMQJMSException(e); } catch (NoSuchMethodException e) { throw new RMQJMSException(e); } catch (InvocationTargetException e) { throw new RMQJMSException(e); } } }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2020-36282 - Severity: HIGH - CVSS Score: 7.5 Description: Use trusted packages in StreamMessage StreamMessage now uses the same "white list" mechanism as ObjectMessage to avoid some arbitrary code execution on deserialization. Even though StreamMessage is supposed to handle only primitive types, it is still to possible to send a message that contains an arbitrary serializable instance. The consuming application application may then execute code from this class on deserialization. The fix consists in using the list of trusted packages that can be set at the connection factory level. Fixes #135 Function: instantiateRmqMessage File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client Fixed Code: private static RMQMessage instantiateRmqMessage(String messageClass, List<String> trustedPackages) throws RMQJMSException { if(isRmqObjectMessageClass(messageClass)) { return instantiateRmqObjectMessageWithTrustedPackages(trustedPackages); } else if (isRmqStreamMessageClass(messageClass)) { return instantiateRmqStreamMessageWithTrustedPackages(trustedPackages); } else { try { // instantiate the message object with the thread context classloader return (RMQMessage) Class.forName(messageClass, true, Thread.currentThread().getContextClassLoader()).getDeclaredConstructor().newInstance(); } catch (InstantiationException e) { throw new RMQJMSException(e); } catch (IllegalAccessException e) { throw new RMQJMSException(e); } catch (ClassNotFoundException e) { throw new RMQJMSException(e); } catch (NoSuchMethodException e) { throw new RMQJMSException(e); } catch (InvocationTargetException e) { throw new RMQJMSException(e); } } }
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
instantiateRmqMessage
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
1
Analyze the following code function for security vulnerabilities
@Override public boolean startOnThisNode() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startOnThisNode File: graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
startOnThisNode
graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
0
Analyze the following code function for security vulnerabilities
@Override public void setRequiredPasswordComplexity(int passwordComplexity, boolean calledOnParent) { if (!mHasFeature) { return; } final Set<Integer> allowedModes = Set.of(PASSWORD_COMPLEXITY_NONE, PASSWORD_COMPLEXITY_LOW, PASSWORD_COMPLEXITY_MEDIUM, PASSWORD_COMPLEXITY_HIGH); Preconditions.checkArgument(allowedModes.contains(passwordComplexity), "Provided complexity is not one of the allowed values."); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); Preconditions.checkArgument(!calledOnParent || isProfileOwner(caller)); synchronized (getLockObject()) { final ActiveAdmin admin = getParentOfAdminIfRequired( getProfileOwnerOrDeviceOwnerLocked(caller), calledOnParent); if (admin.mPasswordComplexity != passwordComplexity) { // We require the caller to explicitly clear any password quality requirements set // on the parent DPM instance, to avoid the case where password requirements are // specified in the form of quality on the parent but complexity on the profile // itself. if (!calledOnParent) { final boolean hasQualityRequirementsOnParent = admin.hasParentActiveAdmin() && admin.getParentActiveAdmin().mPasswordPolicy.quality != PASSWORD_QUALITY_UNSPECIFIED; Preconditions.checkState(!hasQualityRequirementsOnParent, "Password quality is set on the parent when attempting to set password" + "complexity. Clear the quality by setting the password quality " + "on the parent to PASSWORD_QUALITY_UNSPECIFIED first"); } mInjector.binderWithCleanCallingIdentity(() -> { admin.mPasswordComplexity = passwordComplexity; // Reset the password policy. admin.mPasswordPolicy = new PasswordPolicy(); updatePasswordValidityCheckpointLocked(caller.getUserId(), calledOnParent); updatePasswordQualityCacheForUserGroup(caller.getUserId()); saveSettingsLocked(caller.getUserId()); }); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_PASSWORD_COMPLEXITY) .setAdmin(admin.info.getPackageName()) .setInt(passwordComplexity) .setBoolean(calledOnParent) .write(); } logPasswordComplexityRequiredIfSecurityLogEnabled(admin.info.getComponent(), caller.getUserId(), calledOnParent, passwordComplexity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRequiredPasswordComplexity 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
setRequiredPasswordComplexity
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void showWaitingForDebugger(IApplicationThread who, boolean waiting) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(who.asBinder()); data.writeInt(waiting ? 1 : 0); mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showWaitingForDebugger File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
showWaitingForDebugger
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public void runPendingAccessTasks(VaadinSession session) { assert session.hasLock(); if (session.getPendingAccessQueue().isEmpty()) { return; } FutureAccess pendingAccess; // Dump all current instances, not only the ones dumped by setCurrent Map<Class<?>, CurrentInstance> oldInstances = CurrentInstance .getInstances(); CurrentInstance.setCurrent(session); try { while ((pendingAccess = session.getPendingAccessQueue() .poll()) != null) { if (!pendingAccess.isCancelled()) { pendingAccess.run(); try { pendingAccess.get(); } catch (Exception exception) { if (exception instanceof ExecutionException) { Throwable cause = exception.getCause(); if (cause instanceof Exception) { exception = (Exception) cause; } } pendingAccess.handleError(exception); } } } } finally { CurrentInstance.clearAll(); CurrentInstance.restoreInstances(oldInstances); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runPendingAccessTasks File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
runPendingAccessTasks
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
void enqueueNotificationInternal(final String pkg, final String opPkg, final int callingUid, final int callingPid, final String tag, final int id, final Notification notification, int[] idOut, int incomingUserId) { if (DBG) { Slog.v(TAG, "enqueueNotificationInternal: pkg=" + pkg + " id=" + id + " notification=" + notification); } checkCallerIsSystemOrSameApp(pkg); final boolean isSystemNotification = isUidSystem(callingUid) || ("android".equals(pkg)); final boolean isNotificationFromListener = mListeners.isListenerPackage(pkg); final int userId = ActivityManager.handleIncomingUser(callingPid, callingUid, incomingUserId, true, false, "enqueueNotification", pkg); final UserHandle user = new UserHandle(userId); // Fix the notification as best we can. try { final ApplicationInfo ai = getContext().getPackageManager().getApplicationInfoAsUser( pkg, PackageManager.MATCH_DEBUG_TRIAGED_MISSING, (userId == UserHandle.USER_ALL) ? UserHandle.USER_SYSTEM : userId); Notification.addFieldsFromContext(ai, userId, notification); } catch (NameNotFoundException e) { Slog.e(TAG, "Cannot create a context for sending app", e); return; } mUsageStats.registerEnqueuedByApp(pkg); // Limit the number of notifications that any given package except the android // package or a registered listener can enqueue. Prevents DOS attacks and deals with leaks. if (!isSystemNotification && !isNotificationFromListener) { synchronized (mNotificationList) { final float appEnqueueRate = mUsageStats.getAppEnqueueRate(pkg); if (appEnqueueRate > mMaxPackageEnqueueRate) { mUsageStats.registerOverRateQuota(pkg); final long now = SystemClock.elapsedRealtime(); if ((now - mLastOverRateLogTime) > MIN_PACKAGE_OVERRATE_LOG_INTERVAL) { Slog.e(TAG, "Package enqueue rate is " + appEnqueueRate + ". Shedding events. package=" + pkg); mLastOverRateLogTime = now; } return; } int count = 0; final int N = mNotificationList.size(); for (int i=0; i<N; i++) { final NotificationRecord r = mNotificationList.get(i); if (r.sbn.getPackageName().equals(pkg) && r.sbn.getUserId() == userId) { if (r.sbn.getId() == id && TextUtils.equals(r.sbn.getTag(), tag)) { break; // Allow updating existing notification } count++; if (count >= MAX_PACKAGE_NOTIFICATIONS) { mUsageStats.registerOverCountQuota(pkg); Slog.e(TAG, "Package has already posted " + count + " notifications. Not showing more. package=" + pkg); return; } } } } } if (pkg == null || notification == null) { throw new IllegalArgumentException("null not allowed: pkg=" + pkg + " id=" + id + " notification=" + notification); } // Whitelist pending intents. if (notification.allPendingIntents != null) { final int intentCount = notification.allPendingIntents.size(); if (intentCount > 0) { final ActivityManagerInternal am = LocalServices .getService(ActivityManagerInternal.class); final long duration = LocalServices.getService( DeviceIdleController.LocalService.class).getNotificationWhitelistDuration(); for (int i = 0; i < intentCount; i++) { PendingIntent pendingIntent = notification.allPendingIntents.valueAt(i); if (pendingIntent != null) { am.setPendingIntentWhitelistDuration(pendingIntent.getTarget(), duration); } } } } // Sanitize inputs notification.priority = clamp(notification.priority, Notification.PRIORITY_MIN, Notification.PRIORITY_MAX); // setup local book-keeping final StatusBarNotification n = new StatusBarNotification( pkg, opPkg, id, tag, callingUid, callingPid, 0, notification, user); final NotificationRecord r = new NotificationRecord(getContext(), n); mHandler.post(new EnqueueNotificationRunnable(userId, r)); idOut[0] = id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enqueueNotificationInternal File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
enqueueNotificationInternal
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@Override public OnGoingLogicalCondition between(T from, T to) { Condition conditionLocal = new BetweenCondition<T>(selector, Arrays.asList(selector.generateParameter(from), selector.generateParameter(to))); return getOnGoingLogicalCondition(conditionLocal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: between File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java Repository: xjodoin/torpedoquery The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2019-11343
HIGH
7.5
xjodoin/torpedoquery
between
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
3c20b874fba9cc2a78b9ace10208de1602b56c3f
0
Analyze the following code function for security vulnerabilities
public void setBrowserProperty(PeerComponent browserPeer, String key, Object value) { ((AndroidImplementation.AndroidBrowserComponent) browserPeer).setProperty(key, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBrowserProperty 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
setBrowserProperty
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
protected Map<String, Object> getDetails(InstanceEvent event) { Map<String, Object> details = new HashMap<>(); if (event instanceof InstanceStatusChangedEvent) { details.put("from", this.getLastStatus(event.getInstance())); details.put("to", ((InstanceStatusChangedEvent) event).getStatusInfo()); } return details; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDetails File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getDetails
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
private static native void write(int fd, int c) throws IOException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: write File: classpath/java/io/FileOutputStream.java Repository: ReadyTalk/avian The code follows secure coding practices.
[ "CWE-190", "CWE-787" ]
CVE-2020-28371
HIGH
7.5
ReadyTalk/avian
write
classpath/java/io/FileOutputStream.java
0871979b298add320ca63f65060acb7532c8a0dd
0
Analyze the following code function for security vulnerabilities
private int readIntAttribute(XmlPullParser parser, String attr, int defaultValue) { String valueString = parser.getAttributeValue(null, attr); if (valueString == null) return defaultValue; try { return Integer.parseInt(valueString); } catch (NumberFormatException nfe) { return defaultValue; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readIntAttribute 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
readIntAttribute
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public BaseObject addObjectFromRequest(String className, XWikiContext context) throws XWikiException { return addObjectFromRequest(className, "", 0, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addObjectFromRequest 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
addObjectFromRequest
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
private int getStrictestPasswordRequirement(ComponentName who, int userHandle, boolean parent, Function<ActiveAdmin, Integer> getter, int minimumPasswordQuality) { if (!mHasFeature) { return 0; } Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); synchronized (getLockObject()) { if (who != null) { final ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle, parent); return admin != null ? getter.apply(admin) : 0; } int maxValue = 0; final List<ActiveAdmin> admins = getActiveAdminsForLockscreenPoliciesLocked( getProfileParentUserIfRequested(userHandle, parent)); final int N = admins.size(); for (int i = 0; i < N; i++) { final ActiveAdmin admin = admins.get(i); if (!isLimitPasswordAllowed(admin, minimumPasswordQuality)) { continue; } final Integer adminValue = getter.apply(admin); if (adminValue > maxValue) { maxValue = adminValue; } } return maxValue; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStrictestPasswordRequirement 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
getStrictestPasswordRequirement
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void unpackBlock( byte[] bytes, int off) { int index = off; C0 = (bytes[index++] & 0xff); C0 |= (bytes[index++] & 0xff) << 8; C0 |= (bytes[index++] & 0xff) << 16; C0 |= bytes[index++] << 24; C1 = (bytes[index++] & 0xff); C1 |= (bytes[index++] & 0xff) << 8; C1 |= (bytes[index++] & 0xff) << 16; C1 |= bytes[index++] << 24; C2 = (bytes[index++] & 0xff); C2 |= (bytes[index++] & 0xff) << 8; C2 |= (bytes[index++] & 0xff) << 16; C2 |= bytes[index++] << 24; C3 = (bytes[index++] & 0xff); C3 |= (bytes[index++] & 0xff) << 8; C3 |= (bytes[index++] & 0xff) << 16; C3 |= bytes[index++] << 24; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unpackBlock File: core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
unpackBlock
core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java
413b42f4d770456508585c830cfcde95f9b0e93b
0
Analyze the following code function for security vulnerabilities
protected boolean onKeyEvent(KeyEvent event) { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onKeyEvent File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
onKeyEvent
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
@Deprecated public String getDriverClass() { if (readerfac instanceof XMLReaderSAX2Factory) { return ((XMLReaderSAX2Factory) readerfac).getDriverClassName(); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDriverClass File: core/src/java/org/jdom2/input/SAXBuilder.java Repository: hunterhacker/jdom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33813
MEDIUM
5
hunterhacker/jdom
getDriverClass
core/src/java/org/jdom2/input/SAXBuilder.java
bd3ab78370098491911d7fe9d7a43b97144a234e
0
Analyze the following code function for security vulnerabilities
public String clearCacheAction() throws ClientProtocolException, IOException, IndexUnreachableException { logger.trace("clearCacheAction: {}", clearCacheMode); if (clearCacheMode == null || viewManager == null) { return ""; } String url = NetTools.buildClearCacheUrl(clearCacheMode, viewManager.getPi(), navigationHelper.getApplicationUrl(), DataManager.getInstance().getConfiguration().getWebApiToken()); try { try { NetTools.getWebContentDELETE(url, null, null, null, null); Messages.info("cache_clear__success"); } catch (ClientProtocolException e) { logger.error(e.getMessage()); Messages.error("cache_clear__failure"); } catch (IOException e) { logger.error(e.getMessage()); Messages.error("cache_clear__failure"); } } finally { clearCacheMode = null; } return ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearCacheAction File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
clearCacheAction
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
private void addBTEItems(Context c, Collection[] mycollections, String sourceDir, String mapFile, boolean template, String inputType, String workingDir) throws Exception { //Determine the folder where BTE will output the results String outputFolder = null; if (workingDir == null){ //This indicates a command line import, create a random path File importDir = new File(ConfigurationManager.getProperty("org.dspace.app.batchitemimport.work.dir")); if (!importDir.exists()){ boolean success = importDir.mkdir(); if (!success) { log.info("Cannot create batch import directory!"); throw new Exception("Cannot create batch import directory!"); } } //Get a random folder in case two admins batch import data at the same time outputFolder = importDir + File.separator + generateRandomFilename(true); } else { //This indicates a UI import, working dir is preconfigured outputFolder = workingDir; } BTEBatchImportService dls = new DSpace().getSingletonService(BTEBatchImportService.class); DataLoader dataLoader = dls.getDataLoaders().get(inputType); Map<String, String> outputMap = dls.getOutputMap(); TransformationEngine te = dls.getTransformationEngine(); if (dataLoader==null){ System.out.println("ERROR: The key used in -i parameter must match a valid DataLoader in the BTE Spring XML configuration file!"); return; } if (outputMap==null){ System.out.println("ERROR: The key used in -i parameter must match a valid outputMapping in the BTE Spring XML configuration file!"); return; } if (dataLoader instanceof FileDataLoader){ FileDataLoader fdl = (FileDataLoader) dataLoader; if (!StringUtils.isBlank(sourceDir)) { System.out.println("INFO: Dataloader will load data from the file specified in the command prompt (and not from the Spring XML configuration file)"); fdl.setFilename(sourceDir); } } else if (dataLoader instanceof OAIPMHDataLoader){ OAIPMHDataLoader fdl = (OAIPMHDataLoader) dataLoader; System.out.println(sourceDir); if (!StringUtils.isBlank(sourceDir)){ System.out.println("INFO: Dataloader will load data from the address specified in the command prompt (and not from the Spring XML configuration file)"); fdl.setServerAddress(sourceDir); } } if (dataLoader!=null){ System.out.println("INFO: Dataloader " + dataLoader.toString()+" will be used for the import!"); te.setDataLoader(dataLoader); DSpaceOutputGenerator outputGenerator = new DSpaceOutputGenerator(outputMap); outputGenerator.setOutputDirectory(outputFolder); te.setOutputGenerator(outputGenerator); try { TransformationResult res = te.transform(new TransformationSpec()); List<String> output = res.getOutput(); outputGenerator.writeOutput(output); } catch (Exception e) { System.err.println("Exception"); e.printStackTrace(); throw e; } ItemImport myloader = new ItemImport(); myloader.addItems(c, mycollections, outputFolder, mapFile, template); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBTEItems File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
addBTEItems
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
public void enforceModifyAppWidgetBindPermissions(String packageName) { mContext.enforceCallingPermission( android.Manifest.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS, "hasBindAppWidgetPermission packageName=" + packageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceModifyAppWidgetBindPermissions File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
enforceModifyAppWidgetBindPermissions
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder text(String value) { return this.text(value, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: text 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
text
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private org.neo4j.graphdb.Node connectWithParent(org.neo4j.graphdb.Node thisNode, ParentAndChildPair parentAndChildPair, org.neo4j.graphdb.Node last) { final org.neo4j.graphdb.Node parent = parentAndChildPair.getParent(); final org.neo4j.graphdb.Node previousChild = parentAndChildPair.getPreviousChild(); last.createRelationshipTo(thisNode, RelationshipType.withName("NEXT")); thisNode.createRelationshipTo(parent, RelationshipType.withName("IS_CHILD_OF")); if (previousChild ==null) { thisNode.createRelationshipTo(parent, RelationshipType.withName("FIRST_CHILD_OF")); } else { previousChild.createRelationshipTo(thisNode, RelationshipType.withName("NEXT_SIBLING")); } parentAndChildPair.setPreviousChild(thisNode); last = thisNode; return last; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connectWithParent File: src/main/java/apoc/load/Xml.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000820
HIGH
7.5
neo4j-contrib/neo4j-apoc-procedures
connectWithParent
src/main/java/apoc/load/Xml.java
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
0
Analyze the following code function for security vulnerabilities
public static String jsFunction_getHTTPURL(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws APIManagementException { return "http://" + System.getProperty(hostName) + ":" + System.getProperty(httpPort); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_getHTTPURL File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_getHTTPURL
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
private static AudioAttributes audioAttributesForNotification(Notification n) { if (n.audioAttributes != null && !Notification.AUDIO_ATTRIBUTES_DEFAULT.equals(n.audioAttributes)) { // the audio attributes are set and different from the default, use them return n.audioAttributes; } else if (n.audioStreamType >= 0 && n.audioStreamType < AudioSystem.getNumStreamTypes()) { // the stream type is valid, use it return new AudioAttributes.Builder() .setInternalLegacyStreamType(n.audioStreamType) .build(); } else if (n.audioStreamType == AudioSystem.STREAM_DEFAULT) { return Notification.AUDIO_ATTRIBUTES_DEFAULT; } else { Log.w(TAG, String.format("Invalid stream type: %d", n.audioStreamType)); return Notification.AUDIO_ATTRIBUTES_DEFAULT; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: audioAttributesForNotification File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
audioAttributesForNotification
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private void addUrlAndMethodRelation(String urlKey, String[] requestParam, Method method) { RequestMappingInfo requestMappingInfo = new RequestMappingInfo(); requestMappingInfo.setPathRequestCondition(new PathRequestCondition(urlKey)); requestMappingInfo.setParamRequestCondition(new ParamRequestCondition(requestParam)); List<RequestMappingInfo> requestMappingInfos = urlLookup.get(urlKey); if (requestMappingInfos == null) { urlLookup.putIfAbsent(urlKey, new ArrayList<>()); requestMappingInfos = urlLookup.get(urlKey); } requestMappingInfos.add(requestMappingInfo); methods.put(requestMappingInfo, method); }
Vulnerability Classification: - CWE: CWE-290 - CVE: CVE-2021-29441 - Severity: HIGH - CVSS Score: 7.5 Description: Fix #4701 Function: addUrlAndMethodRelation File: core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java Repository: alibaba/nacos Fixed Code: private void addUrlAndMethodRelation(String urlKey, String[] requestParam, Method method) { RequestMappingInfo requestMappingInfo = new RequestMappingInfo(); requestMappingInfo.setPathRequestCondition(new PathRequestCondition(urlKey)); requestMappingInfo.setParamRequestCondition(new ParamRequestCondition(requestParam)); List<RequestMappingInfo> requestMappingInfos = urlLookup.get(urlKey); if (requestMappingInfos == null) { urlLookup.putIfAbsent(urlKey, new ArrayList<>()); requestMappingInfos = urlLookup.get(urlKey); // For issue #4701. String urlKeyBackup = urlKey + "/"; urlLookup.putIfAbsent(urlKeyBackup, requestMappingInfos); } requestMappingInfos.add(requestMappingInfo); methods.put(requestMappingInfo, method); }
[ "CWE-290" ]
CVE-2021-29441
HIGH
7.5
alibaba/nacos
addUrlAndMethodRelation
core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java
91d16023d91ea21a5e58722c751485a0b9bbeeb3
1
Analyze the following code function for security vulnerabilities
private static boolean isCallerSystem() { return isUidSystem(Binder.getCallingUid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCallerSystem File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
isCallerSystem
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public static Document parseDocument(java.io.File file) throws XMLException { try (InputStream is = new FileInputStream(file)) { return parseDocument(new InputSource(is)); } catch (IOException e) { throw new XMLException("Error opening file '" + file + "'", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseDocument File: bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java Repository: dbeaver The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3836
MEDIUM
4.3
dbeaver
parseDocument
bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
4debf8f25184b7283681ed3fb5e9e887d9d4fe22
0
Analyze the following code function for security vulnerabilities
private void sendRemovedResult(long deviceId, int fingerId, int groupId) { if (mRemovalCallback != null) { int reqFingerId = mRemovalFingerprint.getFingerId(); int reqGroupId = mRemovalFingerprint.getGroupId(); if (reqFingerId != 0 && fingerId != 0 && fingerId != reqFingerId) { Log.w(TAG, "Finger id didn't match: " + fingerId + " != " + reqFingerId); return; } if (groupId != reqGroupId) { Log.w(TAG, "Group id didn't match: " + groupId + " != " + reqGroupId); return; } mRemovalCallback.onRemovalSucceeded(new Fingerprint(null, groupId, fingerId, deviceId)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendRemovedResult 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
sendRemovedResult
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private static void parseStatement(Lexer lexer) { // both possibilities start with COLUMN if (lexer.currentToken() != Lexer.TOKEN_COLUMN) { throw new IllegalArgumentException("syntax error, expected column name"); } lexer.advance(); // statement <- COLUMN COMPARE VALUE if (lexer.currentToken() == Lexer.TOKEN_COMPARE) { lexer.advance(); if (lexer.currentToken() != Lexer.TOKEN_VALUE) { throw new IllegalArgumentException("syntax error, expected quoted string"); } lexer.advance(); return; } // statement <- COLUMN IS NULL if (lexer.currentToken() == Lexer.TOKEN_IS) { lexer.advance(); if (lexer.currentToken() != Lexer.TOKEN_NULL) { throw new IllegalArgumentException("syntax error, expected NULL"); } lexer.advance(); return; } // didn't get anything good after COLUMN throw new IllegalArgumentException("syntax error after column name"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseStatement File: src/com/android/providers/downloads/Helpers.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
parseStatement
src/com/android/providers/downloads/Helpers.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
@NonNull public final SoftKeyboardController getSoftKeyboardController() { synchronized (mLock) { if (mSoftKeyboardController == null) { mSoftKeyboardController = new SoftKeyboardController(this, mLock); } return mSoftKeyboardController; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSoftKeyboardController File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
getSoftKeyboardController
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
@Override public void stopAppForUser(final String packageName, int userId) { if (checkCallingPermission(MANAGE_ACTIVITY_TASKS) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: stopAppForUser() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + MANAGE_ACTIVITY_TASKS; Slog.w(TAG, msg); throw new SecurityException(msg); } final int callingPid = Binder.getCallingPid(); userId = mUserController.handleIncomingUser(callingPid, Binder.getCallingUid(), userId, true, ALLOW_FULL_ONLY, "stopAppForUser", null); final long callingId = Binder.clearCallingIdentity(); try { stopAppForUserInternal(packageName, userId); } finally { Binder.restoreCallingIdentity(callingId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopAppForUser File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
stopAppForUser
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@NonNull public List<ScanResult> getMatchingScanResults( @NonNull PasspointConfiguration passpointConfiguration, @NonNull List<ScanResult> scanResults) { PasspointProvider provider = mObjectFactory.makePasspointProvider(passpointConfiguration, null, mWifiCarrierInfoManager, 0, 0, null, false, mClock); List<ScanResult> filteredScanResults = new ArrayList<>(); for (ScanResult scanResult : scanResults) { PasspointMatch matchInfo = provider.match(getANQPElements(scanResult), InformationElementUtil.getRoamingConsortiumIE(scanResult.informationElements), scanResult); if (matchInfo == PasspointMatch.HomeProvider || matchInfo == PasspointMatch.RoamingProvider) { filteredScanResults.add(scanResult); } } return filteredScanResults; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMatchingScanResults File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
getMatchingScanResults
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private boolean hasActionBar() { return android.os.Build.VERSION.SDK_INT >= 11; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasActionBar 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
hasActionBar
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@GuardedBy(anyOf = {"this", "mProcLock"}) ProcessRecord getRecordForAppLOSP(IApplicationThread thread) { if (thread == null) { return null; } ProcessRecord record = mProcessList.getLRURecordForAppLOSP(thread); if (record != null) return record; // Validation: if it isn't in the LRU list, it shouldn't exist, but let's // double-check that. final IBinder threadBinder = thread.asBinder(); final ArrayMap<String, SparseArray<ProcessRecord>> pmap = mProcessList.getProcessNamesLOSP().getMap(); for (int i = pmap.size()-1; i >= 0; i--) { final SparseArray<ProcessRecord> procs = pmap.valueAt(i); for (int j = procs.size()-1; j >= 0; j--) { final ProcessRecord proc = procs.valueAt(j); final IApplicationThread procThread = proc.getThread(); if (procThread != null && procThread.asBinder() == threadBinder) { Slog.wtf(TAG, "getRecordForApp: exists in name list but not in LRU list: " + proc); return proc; } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRecordForAppLOSP File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
getRecordForAppLOSP
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public ParcelableResource getString(String stringId) { return mInjector.binderWithCleanCallingIdentity(() -> mDeviceManagementResourcesProvider.getString(stringId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getString 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
getString
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static SQLiteDatabase openDatabase(@NonNull String path, @Nullable CursorFactory factory, @DatabaseOpenFlags int flags, @Nullable DatabaseErrorHandler errorHandler) { SQLiteDatabase db = new SQLiteDatabase(path, flags, factory, errorHandler, -1, -1, -1, null, null); db.open(); return db; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openDatabase File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
openDatabase
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public FolderDirectoryEntry addFolder(String folderName) { FolderDirectoryEntry folderDirectoryEntry = new FolderDirectoryEntry(folderName, "", new DirectoryEntries()); add(folderDirectoryEntry); return folderDirectoryEntry; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addFolder File: common/src/main/java/com/thoughtworks/go/domain/DirectoryEntries.java Repository: gocd The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-43288
LOW
3.5
gocd
addFolder
common/src/main/java/com/thoughtworks/go/domain/DirectoryEntries.java
f5c1d2aa9ab302a97898a6e4b16218e64fe8e9e4
0
Analyze the following code function for security vulnerabilities
@Deprecated public Builder setTicker(CharSequence tickerText, RemoteViews views) { setTicker(tickerText); // views is ignored return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTicker File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setTicker
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void maybeEscalateHeadsUp() { Collection<HeadsUpManager.HeadsUpEntry> entries = mHeadsUpManager.getAllEntries(); for (HeadsUpManager.HeadsUpEntry entry : entries) { final StatusBarNotification sbn = entry.entry.notification; final Notification notification = sbn.getNotification(); if (notification.fullScreenIntent != null) { if (DEBUG) { Log.d(TAG, "converting a heads up to fullScreen"); } try { EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION, sbn.getKey()); notification.fullScreenIntent.send(); entry.entry.notifyFullScreenIntentLaunched(); } catch (PendingIntent.CanceledException e) { } } } mHeadsUpManager.releaseAllImmediately(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeEscalateHeadsUp File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
maybeEscalateHeadsUp
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void validateHostName(String hostName) { if (!isHostName(hostName)) { throw new IllegalArgumentException( String.format(Locale.ENGLISH, "[%s] is an invalid hostname. Please supply a pure hostname (eg. api.graylog.com)", hostName)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateHostName File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
validateHostName
graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
protected Iterator<VaadinServiceInitListener> getServiceInitListeners() { ServiceLoader<VaadinServiceInitListener> loader = ServiceLoader .load(VaadinServiceInitListener.class, getClassLoader()); return loader.iterator(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServiceInitListeners File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
getServiceInitListeners
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { if (getMeasuredWidth() == 0) return; if (mSuggestion.getType() != OmniboxSuggestionType.SEARCH_SUGGEST_TAIL) { mContentsView.resetTextWidths(); } boolean refineVisible = mRefineView.getVisibility() == VISIBLE; boolean isRtl = ApiCompatibilityUtils.isLayoutRtl(this); int contentsViewOffsetX = isRtl && refineVisible ? mRefineWidth : 0; mContentsView.layout( contentsViewOffsetX, 0, contentsViewOffsetX + mContentsView.getMeasuredWidth(), mContentsView.getMeasuredHeight()); int refineViewOffsetX = isRtl ? 0 : getMeasuredWidth() - mRefineWidth; mRefineView.layout( refineViewOffsetX, 0, refineViewOffsetX + mRefineWidth, mContentsView.getMeasuredHeight()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLayout File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
onLayout
chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0