opendcs / rest_api

Rest API that serves OpenDCS database objects as JSON
Apache License 2.0
1 stars 2 forks source link

Remove insecure printStackTrace calls. #87

Closed wjonassen closed 7 months ago

wjonassen commented 8 months ago

Problem Description

There are several calls to throwable.printStackTrace throughout the rest-api project. These have been flagged as insecure and need to be removed. Fixes #96. Throwable.printStackTrace(...) prints a Throwable and its stack trace to System.Err (by default) which is not easily parseable and can expose sensitive information.

Solution

Use a logger to get the same message to the user.

how you tested the change

Forced one of these conditions and verified the logger logged the message.

Where the following done:

If you aren't sure leave unchecked and we will help guide you to want needs changing where.

sonarcloud[bot] commented 7 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
2.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud