Skip to content

Code Security Report: 2 high severity findings, 10 total findings [master] #18

@mend-developer-platform-dev

Description

@mend-developer-platform-dev

Code Security Report

Scan Metadata

Latest Scan: 2025-09-17 07:56AM
Total Findings: 10 | New Findings: 0 | Resolved Findings: 0
Tested Project Files: 820
Detected Programming Languages: 2 (Java*, JavaScript / TypeScript*)

Most Relevant Findings

The list below presents the 10 most relevant findings that need your attention.

Severity
Vulnerability Type
CWE
File
Data Flows
Detected
Violated Workflows
Violation Priority
Violation SLA
High
Server Side Request Forgery
1
2025-09-17 07:57AM
Code Test
HIGH
2025-10-17
Vulnerable Code

* @return true if a connection a established otherwise false
*/
protected static boolean testConnection(String urlString) {
try {
HttpURLConnection urlConnect = (HttpURLConnection) new URL(urlString).openConnection();
//wait for 15sec
urlConnect.setConnectTimeout(15000);
urlConnect.setUseCaches(false);
//trying to retrieve data from the source. If there
//is no connection, this line will fail

Data Flows (1 detected)

wizardModel.remoteUrl = httpRequest.getParameter("remoteUrl");

if (TestInstallUtil.testConnection(wizardModel.remoteUrl)) {

protected static boolean testConnection(String urlString) {

HttpURLConnection urlConnect = (HttpURLConnection) new URL(urlString).openConnection();

wizardModel.remoteUrl = httpRequest.getParameter("remoteUrl");

if (TestInstallUtil.testConnection(wizardModel.remoteUrl)) {

protected static boolean testConnection(String urlString) {

HttpURLConnection urlConnect = (HttpURLConnection) new URL(urlString).openConnection();

Secure Code Warrior Training Material
High
Server Side Request Forgery
1
2025-09-17 07:57AM
Code Test
HIGH
2025-10-17
Vulnerable Code

return connection.getInputStream();
}
private static HttpURLConnection createConnection(String url)
throws IOException, MalformedURLException {
final HttpURLConnection result = (HttpURLConnection) new URL(url).openConnection();
result.setRequestMethod("POST");
result.setConnectTimeout(15000);
result.setUseCaches(false);
result.setDoOutput(true);
return result;

Data Flows (1 detected)

wizardModel.remoteUrl = httpRequest.getParameter("remoteUrl");

wizardModel.remoteUrl + RELEASE_TESTING_MODULE_PATH + "verifycredentials.htm",


protected static InputStream getResourceInputStream(String url, String openmrsUsername, String openmrsPassword)

HttpURLConnection connection = createConnection(url);

private static HttpURLConnection createConnection(String url)

final HttpURLConnection result = (HttpURLConnection) new URL(url).openConnection();

wizardModel.remoteUrl = httpRequest.getParameter("remoteUrl");

wizardModel.remoteUrl + RELEASE_TESTING_MODULE_PATH + "verifycredentials.htm",


protected static InputStream getResourceInputStream(String url, String openmrsUsername, String openmrsPassword)

HttpURLConnection connection = createConnection(url);

private static HttpURLConnection createConnection(String url)

final HttpURLConnection result = (HttpURLConnection) new URL(url).openConnection();

Secure Code Warrior Training Material
Medium
Insufficient Transport Layer Protection
1
2025-09-17 07:57AM
Vulnerable Code

* @return true if a connection a established otherwise false
*/
protected static boolean testConnection(String urlString) {
try {
HttpURLConnection urlConnect = (HttpURLConnection) new URL(urlString).openConnection();
//wait for 15sec
urlConnect.setConnectTimeout(15000);
urlConnect.setUseCaches(false);
//trying to retrieve data from the source. If there
//is no connection, this line will fail

Data Flows (1 detected)

wizardModel.remoteUrl = httpRequest.getParameter("remoteUrl");

if (TestInstallUtil.testConnection(wizardModel.remoteUrl)) {

protected static boolean testConnection(String urlString) {

HttpURLConnection urlConnect = (HttpURLConnection) new URL(urlString).openConnection();

wizardModel.remoteUrl = httpRequest.getParameter("remoteUrl");

if (TestInstallUtil.testConnection(wizardModel.remoteUrl)) {

protected static boolean testConnection(String urlString) {

HttpURLConnection urlConnect = (HttpURLConnection) new URL(urlString).openConnection();

Secure Code Warrior Training Material
Medium
Insufficient Transport Layer Protection
1
2025-09-17 07:57AM
Vulnerable Code

return connection.getInputStream();
}
private static HttpURLConnection createConnection(String url)
throws IOException, MalformedURLException {
final HttpURLConnection result = (HttpURLConnection) new URL(url).openConnection();
result.setRequestMethod("POST");
result.setConnectTimeout(15000);
result.setUseCaches(false);
result.setDoOutput(true);
return result;

Data Flows (1 detected)

wizardModel.remoteUrl = httpRequest.getParameter("remoteUrl");

wizardModel.remoteUrl + RELEASE_TESTING_MODULE_PATH + "verifycredentials.htm",


protected static InputStream getResourceInputStream(String url, String openmrsUsername, String openmrsPassword)

HttpURLConnection connection = createConnection(url);

private static HttpURLConnection createConnection(String url)

final HttpURLConnection result = (HttpURLConnection) new URL(url).openConnection();

wizardModel.remoteUrl = httpRequest.getParameter("remoteUrl");

wizardModel.remoteUrl + RELEASE_TESTING_MODULE_PATH + "verifycredentials.htm",


protected static InputStream getResourceInputStream(String url, String openmrsUsername, String openmrsPassword)

HttpURLConnection connection = createConnection(url);

private static HttpURLConnection createConnection(String url)

final HttpURLConnection result = (HttpURLConnection) new URL(url).openConnection();

Secure Code Warrior Training Material
Medium
Unsafe Reflection
1
2025-09-17 07:57AM
Vulnerable Code

* @throws ClassNotFoundException
*/
public static String loadDatabaseDriver(String connectionUrl, String connectionDriver) throws ClassNotFoundException {
if (StringUtils.hasText(connectionDriver)) {
Class.forName(connectionDriver);
log.debug("set user defined Database driver class: " + connectionDriver);
} else {
if (connectionUrl.contains("mysql")) {
Class.forName("com.mysql.cj.jdbc.Driver");
connectionDriver = "com.mysql.cj.jdbc.Driver";

Data Flows (1 detected)

wizardModel.databaseDriver = httpRequest.getParameter("database_driver");

loadedDriverString = loadDriver(wizardModel.databaseConnection, wizardModel.databaseDriver);

public static String loadDriver(String connection, String databaseDriver) {

loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);

public static String loadDatabaseDriver(String connectionUrl, String connectionDriver) throws ClassNotFoundException {

wizardModel.databaseDriver = httpRequest.getParameter("database_driver");

loadedDriverString = loadDriver(wizardModel.databaseConnection, wizardModel.databaseDriver);

public static String loadDriver(String connection, String databaseDriver) {

loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);

public static String loadDatabaseDriver(String connectionUrl, String connectionDriver) throws ClassNotFoundException {

Medium
Trust Boundary Violation
1
2025-09-17 07:57AM
Vulnerable Code

// if user has changed locale parameter to new one
// or chooses it parameter at first page loading
if (storedLocale == null || !storedLocale.equals(localeParameter)) {
log.info("Stored locale parameter to session " + localeParameter);
httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);
}
if (rememberLocale) {
httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);
httpRequest.getSession().setAttribute(FilterUtil.REMEMBER_ATTRIBUTE, true);
wizardModel.localeToSave = localeParameter;

Data Flows (1 detected)

String localeParameter = httpRequest.getParameter(FilterUtil.LOCALE_ATTRIBUTE);

if (storedLocale == null || !storedLocale.equals(localeParameter)) {

httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);

String localeParameter = httpRequest.getParameter(FilterUtil.LOCALE_ATTRIBUTE);

if (storedLocale == null || !storedLocale.equals(localeParameter)) {

httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);

Medium
Trust Boundary Violation
1
2025-09-17 07:57AM
Vulnerable Code

log.info("Stored locale parameter to session " + localeParameter);
httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);
}
if (rememberLocale) {
httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);
httpRequest.getSession().setAttribute(FilterUtil.REMEMBER_ATTRIBUTE, true);
wizardModel.localeToSave = localeParameter;
} else {
// we need to reset it if it was set before
httpRequest.getSession().setAttribute(FilterUtil.REMEMBER_ATTRIBUTE, null);

Data Flows (1 detected)

String localeParameter = httpRequest.getParameter(FilterUtil.LOCALE_ATTRIBUTE);

if (storedLocale == null || !storedLocale.equals(localeParameter)) {

httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);

httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);

String localeParameter = httpRequest.getParameter(FilterUtil.LOCALE_ATTRIBUTE);

if (storedLocale == null || !storedLocale.equals(localeParameter)) {

httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);

httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);

Low
Log Forging
1
2025-09-17 07:57AM
Vulnerable Code

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
connectionDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
}
}
log.info("Set database driver class as " + connectionDriver);
return connectionDriver;
}
/**
* Executes the passed SQL query, enforcing select only if that parameter is set for given Session

Data Flows (1 detected)

wizardModel.databaseDriver = httpRequest.getParameter("database_driver");

loadedDriverString = loadDriver(wizardModel.databaseConnection, wizardModel.databaseDriver);

public static String loadDriver(String connection, String databaseDriver) {

loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);

public static String loadDatabaseDriver(String connectionUrl, String connectionDriver) throws ClassNotFoundException {

log.info("Set database driver class as " + connectionDriver);

wizardModel.databaseDriver = httpRequest.getParameter("database_driver");

loadedDriverString = loadDriver(wizardModel.databaseConnection, wizardModel.databaseDriver);

public static String loadDriver(String connection, String databaseDriver) {

loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);

public static String loadDatabaseDriver(String connectionUrl, String connectionDriver) throws ClassNotFoundException {

log.info("Set database driver class as " + connectionDriver);

Secure Code Warrior Training Material
Low
Log Forging
1
2025-09-17 07:57AM
Vulnerable Code

}
// if user has changed locale parameter to new one
// or chooses it parameter at first page loading
if (storedLocale == null || !storedLocale.equals(localeParameter)) {
log.info("Stored locale parameter to session " + localeParameter);
httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);
}
if (rememberLocale) {
httpRequest.getSession().setAttribute(FilterUtil.LOCALE_ATTRIBUTE, localeParameter);
httpRequest.getSession().setAttribute(FilterUtil.REMEMBER_ATTRIBUTE, true);

Data Flows (1 detected)

String localeParameter = httpRequest.getParameter(FilterUtil.LOCALE_ATTRIBUTE);

if (storedLocale == null || !storedLocale.equals(localeParameter)) {

log.info("Stored locale parameter to session " + localeParameter);

String localeParameter = httpRequest.getParameter(FilterUtil.LOCALE_ATTRIBUTE);

if (storedLocale == null || !storedLocale.equals(localeParameter)) {

log.info("Stored locale parameter to session " + localeParameter);

Secure Code Warrior Training Material
Low
Log Forging
1
2025-09-17 07:57AM
Vulnerable Code

public static String loadDriver(String connection, String databaseDriver) {
String loadedDriverString = null;
try {
loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);
log.info("using database driver :" + loadedDriverString);
}
catch (ClassNotFoundException e) {
log.error("The given database driver class was not found. "
+ "Please ensure that the database driver jar file is on the class path "
+ "(like in the webapp's lib folder)");

Data Flows (1 detected)

wizardModel.databaseDriver = httpRequest.getParameter("database_driver");

loadedDriverString = loadDriver(wizardModel.databaseConnection, wizardModel.databaseDriver);

public static String loadDriver(String connection, String databaseDriver) {

loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);

public static String loadDatabaseDriver(String connectionUrl, String connectionDriver) throws ClassNotFoundException {


loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);

log.info("using database driver :" + loadedDriverString);

wizardModel.databaseDriver = httpRequest.getParameter("database_driver");

loadedDriverString = loadDriver(wizardModel.databaseConnection, wizardModel.databaseDriver);

public static String loadDriver(String connection, String databaseDriver) {

loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);

public static String loadDatabaseDriver(String connectionUrl, String connectionDriver) throws ClassNotFoundException {


loadedDriverString = DatabaseUtil.loadDatabaseDriver(connection, databaseDriver);

log.info("using database driver :" + loadedDriverString);

Secure Code Warrior Training Material

Findings Overview

Severity Vulnerability Type CWE Language Count
High Server Side Request Forgery CWE-918 Java* 2
Medium Insufficient Transport Layer Protection CWE-319 Java* 2
Medium Trust Boundary Violation CWE-501 Java* 2
Medium Unsafe Reflection CWE-470 Java* 1
Low Log Forging CWE-117 Java* 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions