Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Security Report: 1 high severity findings, 12 total findings #104

Open
1 task
mend-for-github-com bot opened this issue Aug 16, 2023 · 0 comments
Open
1 task
Labels
Mend: code security findings Code security findings detected by Mend

Comments

@mend-for-github-com
Copy link

mend-for-github-com bot commented Aug 16, 2023

Code Security Report

Scan Metadata

Latest Scan: 2023-09-04 02:11pm
Total Findings: 12 | New Findings: 0 | Resolved Findings: 0
Tested Project Files: 193
Detected Programming Languages: 1 (Java)

  • Check this box to manually trigger a scan

Most Relevant Findings

The below list presents the 10 most relevant findings that need your attention. To view information on the remaining findings, navigate to the Mend Application.

SeverityVulnerability TypeCWEFileData FlowsDate
HighCross-Site Scripting

CWE-79

OpenApiResource.java:32

12023-09-04 02:11pm
Vulnerable Code

@Operation(hidden = true)
public Response getOpenApi(@Context HttpHeaders headers,
@Context UriInfo uriInfo,
@PathParam("type") String type) throws Exception {
return super.getOpenApi(headers, config, app, uriInfo, type);

1 Data Flow/s detected
View Data Flow 1

 
MediumError Messages Information Exposure

CWE-209

ServletOpenApiConfigurationLoader.java:78

12023-09-04 02:11pm
Vulnerable Code

Class cls = getClass().getClassLoader().loadClass(builderClassName);
// TODO instantiate with configuration
OpenAPIConfigBuilder builder = (OpenAPIConfigBuilder) cls.newInstance();
return builder.build();
} catch (Exception e) {
LOGGER.error("error loading builder: " + e.getMessage(), e);

1 Data Flow/s detected
View Data Flow 1

 
MediumError Messages Information Exposure

CWE-209

Yaml.java:25

12023-09-04 02:11pm
Vulnerable Code

public static String pretty(Object o) {
try {
return pretty().writeValueAsString(o);
} catch (Exception e) {
e.printStackTrace();

1 Data Flow/s detected
View Data Flow 1

 
MediumError Messages Information Exposure

CWE-209

Json.java:35

12023-09-04 02:11pm
Vulnerable Code

public static void prettyPrint(Object o) {
try {
System.out.println(pretty().writeValueAsString(o).replace("\r", ""));
} catch (Exception e) {
e.printStackTrace();

1 Data Flow/s detected
View Data Flow 1

 
MediumError Messages Information Exposure

CWE-209

OpenApiServlet.java:38

12023-09-04 02:11pm
Vulnerable Code

new ServletOpenApiContextBuilder()
.servletConfig(config)
.ctxId(ctxId)
.buildContext(true);
} catch (OpenApiConfigurationException e) {
e.printStackTrace();

1 Data Flow/s detected
View Data Flow 1

 
MediumError Messages Information Exposure

CWE-209

StringOpenApiConfigurationLoader.java:24

12023-09-04 02:11pm
Vulnerable Code

} else { // assume yaml
return Yaml.mapper().readValue(configAsString, SwaggerConfiguration.class);
}
} catch (Exception e) {
LOGGER.error("exception reading config: " + e.getMessage(), e);

1 Data Flow/s detected
View Data Flow 1

 
MediumError Messages Information Exposure

CWE-209

GenericOpenApiContext.java:282

12023-09-04 02:11pm
Vulnerable Code

if (openApiScanner == null) {
openApiScanner = buildScanner(ContextUtils.deepCopy(openApiConfiguration));
}
} catch (Exception e) {
LOGGER.error("error initializing context: " + e.getMessage(), e);
throw new OpenApiConfigurationException("error initializing context: " + e.getMessage(), e);

1 Data Flow/s detected
View Data Flow 1

throw new OpenApiConfigurationException("error initializing context: " + e.getMessage(), e);

 
MediumError Messages Information Exposure

CWE-209

GenericOpenApiContext.java:255

12023-09-04 02:11pm
Vulnerable Code

}
}
}
return null;
} catch (Exception e) {
throw new OpenApiConfigurationException(e.getMessage(), e);

1 Data Flow/s detected
View Data Flow 1

 
MediumError Messages Information Exposure

CWE-209

ContextUtils.java:20

12023-09-04 02:11pm
Vulnerable Code

return null;
}
try {
return Json.mapper().readValue(Json.pretty(config), SwaggerConfiguration.class);
} catch (Exception e) {
LOGGER.error("Exception cloning config: " + e.getMessage(), e);

1 Data Flow/s detected
View Data Flow 1

LOGGER.error("Exception cloning config: " + e.getMessage(), e);

 
MediumError Messages Information Exposure

CWE-209

Yaml.java:34

12023-09-04 02:11pm
Vulnerable Code

public static void prettyPrint(Object o) {
try {
System.out.println(pretty().writeValueAsString(o));
} catch (Exception e) {
e.printStackTrace();

1 Data Flow/s detected
View Data Flow 1

Findings Overview

Severity Vulnerability Type CWE Language Count
High Cross-Site Scripting CWE-79 Java 1
Medium Error Messages Information Exposure CWE-209 Java 11
@mend-for-github-com mend-for-github-com bot added the Mend: code security findings Code security findings detected by Mend label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mend: code security findings Code security findings detected by Mend
Projects
None yet
Development

No branches or pull requests

0 participants