Escape javascript breaking on backlash or special characters in finding title#12514
Conversation
|
@c-goosen Thank you for reporting and fixing! Could you look at the Ruff failures? It looks like you added some |
🔴 Risk threshold exceeded.This pull request involves sensitive edits to a template file with potential cross-site scripting (XSS) risks and input validation concerns, which may require careful review of escaping mechanisms and input handling to prevent potential security vulnerabilities.
|
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
💭 Unconfirmed Findings (2)
| Vulnerability | Potential Cross-Site Scripting (XSS) Risk Without Escaping |
|---|---|
| Description | Located in dojo/templates/dojo/filter_js_snippet.html, this vulnerability involves direct insertion of words into JavaScript arrays without escaping, which could potentially allow XSS attacks by executing malicious scripts if special characters are present. |
| Vulnerability | Potential Input Validation Bypass with Special Characters |
|---|---|
| Description | Found in tests/finding_test.py, this issue suggests possible insufficient input validation for special characters in finding titles, with the test indicating the application can handle backslash characters, which might reveal input validation weaknesses. |
We've notified @mtesauro.
All finding details can be found in the DryRun Security Dashboard.
Thanks fixed that. Local tested before with our data: Just to be careful I tested inputs like a XSS payload getting injected, but the escapejs jinja2 argument is escaping the content correctly. |
Maffooch
left a comment
There was a problem hiding this comment.
I was unable to reproduce the issue where findings could not be displayed, but there was a bunch of browser console errors that this fixes
@valentijnscholten && @manuel-sommer I only changed the generation of the javascript file, didn't touch the HTML templates. I can look at what we would need to fix the two issues as well. |
…ng title (DefectDojo#12514) * Escape javascript breaking on backlash or special characters in finding titel * Ruff formatting and W605 ignore * Fix escape character issue with \ * Remove ruff noqa comments. * Fix ruff failure on w291



Escape javascript breaking on backlash or special characters in finding title
Description
Fixes: #12512
A backslash in finding title breaks frontend render in list view.
Test results
Ideally you extend the test suite in
tests/anddojo/unitteststo cover the changed in this PR.Alternatively, describe what you have and haven't tested.