Add yaml checker for exposed stacktrace#55
Closed
utkarsh181 wants to merge 2 commits intoDeepSourceCorp:masterfrom
Closed
Add yaml checker for exposed stacktrace#55utkarsh181 wants to merge 2 commits intoDeepSourceCorp:masterfrom
utkarsh181 wants to merge 2 commits intoDeepSourceCorp:masterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
Author
|
Can you please help me debug it? |
sanket-deepsource
requested changes
Feb 22, 2025
Author
|
Hi! I have fixed the checker and added a test case. However, as @srijan-paul mentioned:
For example, we cannot match cases like: Or handle exceptions such as: I will look into the Go API once it stable and as I become more familiar with Go. |
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.
Summary: Stack Trace Exposure Checker
This checker detects instances where raw stack traces generated by
traceback.format_stack(),traceback.format_exc(), ortraceback.format_tb()are directly returned in HTTP responses viaJsonResponseorHttpResponse. Exposing stack traces can reveal sensitive information, such as file paths, internal logic, and application structure, increasing the risk of exploitation.Security Impact (OWASP A04:2021 – Insecure Design)
Improper error handling is a key aspect of Insecure Design, as highlighted in OWASP A04:2021. Returning raw stack traces compromises security by leaking implementation details, which attackers can analyze to identify vulnerabilities and craft targeted exploits. Instead of exposing stack traces, applications should log errors securely using the
loggingmodule and return generic error messages to users.Remediation
logging.exception(),logging.error()) instead of returning stack traces in responses.