Repository navigation
SECFOO-22: Fix filter dropdowns blocked by the portal CSP - #35
Merged
Merged
Conversation
The portal's Content-Security-Policy (default-src 'self', no 'unsafe-inline') blocks every inline event handler, not just onclick. Five filter dropdowns still used onchange="this.form.submit()", so on app.secfoo.com choosing a status/project silently did nothing (local `secfoo serve` sends no CSP, so it only looked fine there): - assessments/list.html (status) - sast_findings_list.html, sca_vulnerabilities_list.html, secret_scanning_findings_list.html (project) - activities/detail.html (diagram project) Replace them with a data-autosubmit attribute handled by a delegated "change" listener in static/js/interactive.js, the same pattern used for data-href/data-confirm. Widen the regression test from onclick to any inline on...= handler, which is why these were missed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What does this change, and why?
Part of SECFOO-22 (Initiative 3: Dashboard usability). Independent of the other SECFOO-22 PRs, with no conflicts with #34.
The enterprise portal serves this same dashboard with
Content-Security-Policy: default-src 'self'(no'unsafe-inline'), which blocks every inline event handler, not justonclick. Five filter dropdowns still usedonchange="this.form.submit()", so on app.secfoo.com choosing a value silently did nothing.secfoo servesends no CSP, so it only ever looked fine locally.Affected: Assessments list (status), SAST / SCA / Secret Scanning findings lists (project), Activity detail (diagram project).
data-autosubmitattribute, handled by a delegatedchangelistener instatic/js/interactive.js(same pattern asdata-href/data-confirm).test_no_inline_scripts.pynow flags any inlineon...=handler, not onlyonclick. That's why these were missed; the widened test fails on currentmain.Testing
pytest tests: 812 passed🤖 Generated with Claude Code