Repository navigation
Fixes for a set of XSS security issues found using Psalm taint analysis - #1718
Merged
Merged
Conversation
…= and url= Note that URL needs to be something that can be fetched via HTTP, but there's nothing stopping a malicious user setting up a web server where '><script>...<script> is valid at the end of a URL
…p_limit_value= param
… param Only applies for action=edit, action=delete. Other actions fail with null argument TypeError exception when the language code can't be looked up by name. Add an explicit guard for this rather than accidentally blocking further progress. Add some extra input validation and URL escaping. The guard & validation makes some of these html_safe/attr_safe redundant, but it's better to be belt and braces in case this code is ever refactored.
…direction= params Add more input validation, and HTML escaping of dumped SQL output while we're here.
…x XSS from cutoff= and lang_match= params While here, validate most of the input strictly, escape the SQL WHERE clause and HTML escape some more output
…aim pages Very unlikely to be exploitable, but it quells a warning from Psalm
It's not technically necessary, but Psalm doesn't understand the flow control and can't see that none of the messages contain HTML characters.
* The anchor for a row to scroll to the correct location on form reload can be a simple counter like row_N. * The bare HTML should use html_safe * The hidden form field should use attr_safe
All these params are checked by validate_projectID/validate_page_image and so can't be used for XSS.
All these page IDs are validated, so can't be used for XSS.
…r report card It's a plain-text <pre>-block with a few bits of server-provided styling. HTML escape all the comments provided by the user to avoid XSS.
cpeel
approved these changes
Nov 22, 2026
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.
No description provided.