Remove insecure printStackTrace calls.#87
Merged
wjonassen merged 8 commits intoopendcs:mainfrom Feb 14, 2024
Merged
Conversation
73216e4 to
6bc58b9
Compare
… branch/pull request.
…ing them to logging.
6bc58b9 to
7278f87
Compare
…s being logged, I don't think it's necessary to restate the message in the thrown exception.
…on.getMessage, as the string is not what we are looking for. Cleaning up some unused comments and imports.
adamkorynta
reviewed
Jan 24, 2024
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/lrgsclient/ApiLddsClient.java
Outdated
Show resolved
Hide resolved
adamkorynta
reviewed
Jan 24, 2024
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/res/AppResources.java
Outdated
Show resolved
Hide resolved
adamkorynta
reviewed
Feb 6, 2024
adamkorynta
reviewed
Feb 6, 2024
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/util/ApiBasicClient.java
Outdated
Show resolved
Hide resolved
adamkorynta
reviewed
Feb 6, 2024
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/util/ApiBasicClient.java
Outdated
Show resolved
Hide resolved
adamkorynta
approved these changes
Feb 14, 2024
|
MikeNeilson
approved these changes
Feb 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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:
(Formerly called regression tests.)
If you aren't sure leave unchecked and we will help guide you to want needs changing where.