exam questions

Exam PT0-003 All Questions

View all questions & answers for the PT0-003 exam

Exam PT0-003 topic 1 question 13 discussion

Actual exam question from CompTIA's PT0-003
Question #: 13
Topic #: 1
[All PT0-003 Questions]

A penetration tester reviews a SAST vulnerability scan report. The following lines of code have been reported as vulnerable:

Which of the following is the best method to remediate this vulnerability?

  • A. Implementing a logging framework
  • B. Removing the five code lines reported with issues
  • C. Initiating a secure coding-awareness program with all the developers
  • D. Documenting the vulnerability as a false positive
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
mosdef137
1 week, 2 days ago
Selected Answer: A
Using printStackTrace() is discouraged in production code because it can leak sensitive information and does not provide control over how or where the error is logged. The recommended practice is to replace printStackTrace() with a secure logging framework (such as java.util.logging, Log4j, or SLF4J), which allows you to control log levels, destinations, and to sanitize output, reducing the risk of information exposure B. Removing the five code lines reported with issues Simply removing the code would suppress error reporting entirely, making it harder to debug and maintain the application. It does not address the underlying need for exception handling and logging. C. Initiating a secure coding-awareness program with all the developers While valuable for long-term security culture, this is not a direct remediation for the specific code vulnerability flagged in the SAST report. D. Documenting the vulnerability as a false positive This is not a false positive. The use of printStackTrace() is a well-known security risk
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...