security: systematic XSS remediation across all templates#97
Open
rhoerr wants to merge 4 commits intovpietri:mainfrom
Open
security: systematic XSS remediation across all templates#97rhoerr wants to merge 4 commits intovpietri:mainfrom
rhoerr wants to merge 4 commits intovpietri:mainfrom
Conversation
- Escape all variable output in templates with escapeHtml/escapeHtmlAttr/escapeUrl - Rewrite formatSql() to escape input before applying syntax highlighting - Escape IDE link helper HTML output with htmlspecialchars - Replace innerHTML with textContent in log viewer - Remove executeScriptElements() (re-activates scripts from AJAX HTML) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous commit removed executeScriptElements and its call as a CSP hardening measure. However, four tab templates (log, action, profiler, dumper) contain inline <script> blocks that are loaded via AJAX into innerHTML. Browsers do not execute scripts set via innerHTML, so executeScriptElements (which clones script elements to force execution) is required for those tabs to function. Removing executeScriptElements is a valid goal but requires refactoring all tab templates to use event-delegation or post-load initialization instead of inline scripts — out of scope for this XSS sweep. The stray this.log() debug call has been removed from the restored method. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
escapeHtml/escapeHtmlAttr/escapeUrlformatSql()to escape input before applying syntax highlightinghtmlspecialcharsinnerHTMLwithtextContentin log viewerexecuteScriptElements()which re-activated scripts from AJAX HTMLSecurity Findings Addressed
Files Modified
Block/Tab/Content/Sql.php— formatSql() escape-firstBlock/Tab/Content/Request.php— formatValue() escapingHelper/Data.php— getIDELinkForFile() htmlspecialcharstoolbar.phtml— executeScriptElements removedlog.phtml— innerHTML → textContentTest plan
🤖 Generated with Claude Code