-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GitHub Secrets Detection Report Parser #13286
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
GitHub Secrets Detection Report Parser #13286
Conversation
This pull request introduces a markdown/HTML injection risk in GithubSecretsDetectionReportParser: it builds Finding.description by concatenating unsanitized fields from the input JSON (e.g., html_url, secret_type_display_name, resolution_comment), which could allow stored XSS or content injection in DefectDojo when malicious markup or javascript is provided. The vuln is located in dojo/tools/github_secrets_detection_report/parser.py (lines 112–115) and should be mitigated by sanitizing or escaping user-supplied values before rendering.
Markdown/HTML Injection in Finding Description in
|
Vulnerability | Markdown/HTML Injection in Finding Description |
---|---|
Description | The GithubSecretsDetectionReportParser constructs the description for a Finding object by directly incorporating values from the input JSON report, such as html_url , secret_type_display_name , and resolution_comment . These values are not sanitized before being concatenated into the description string. If an attacker provides a crafted JSON report containing malicious Markdown or HTML within these fields, it could lead to Stored Cross-Site Scripting (XSS) or content injection when the Finding.description is rendered in the DefectDojo UI. For example, a malicious html_url could be javascript:alert(document.domain) . |
django-DefectDojo/dojo/tools/github_secrets_detection_report/parser.py
Lines 112 to 115 in 8d45cad
description = "\n\n".join(desc_lines) | |
# Determine severity based on state and other factors | |
if state == "resolved": |
All finding details can be found in the DryRun Security Dashboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR and the defensive coding techniques. I posted a question about the severity logic and hash_code config.
Can you also base your PR against bugfix
as requested in the PR template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Description
Hello again! This PR adds a new parser for GitHub secrets detection uploads.
Test results
Added unit tests for new parser. Results:
Ref links: