T09 · Insecure Skill Coding Practices
- Location
source/reporter.py:318- Finding
Stored HTML and JavaScript Injection in Generated Security Reports
- Content
View full analysis
{icon} {issue['type'].replace('_', ' ').title()}{severity}📁 {issue['file']}:{issue['line']}{issue['message']}''' ``` ### Technical Analysis The HTML report generator interpolates finding data directly into HTML without context-appropriate escaping. In particular, `issue['snippet']` contains source text taken from the untrusted project being scanned. The file name and other finding properties are also inserted without escaping. An attacker can place HTML markup in a source line that triggers a scanner finding. For example, a syntactically valid Python line containing an insecure URL can include an HTML payload in its comment: ```python url = "http://example.invalid" # ``` The HTTP rule records this complete line as the finding snippet. When HTML output is generated, the injected `` closes the intended code element and the following `script` element becomes active markup. The report includes executable inline JavaScript and does not define a restrictive Content Security Policy, so the injected script can execute when a user opens the generated report. The same underlying issue ...[truncated 1536 chars]text {issue['snippet']}- Remediation
View remediation
