Verify XSS fix for reflected cacheTimeout parameter (issue #2779)#2909
Closed
Verify XSS fix for reflected cacheTimeout parameter (issue #2779)#2909
Conversation
Copilot
AI
changed the title
[WIP] [GH-2779] Fix the issue with graphite-web
Verify XSS fix for reflected cacheTimeout parameter (issue #2779)
Mar 17, 2026
Closed
deniszh
approved these changes
Mar 17, 2026
Member
|
Empty commit, no need to merge |
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.
Issue #2779 reported a reflected XSS vulnerability at
/render/?cacheTimeout=<payload>— whencacheTimeoutis non-integer, Python'sint()error message includes the raw user input, which was reflected unsanitized in the HTTP response.Status
The fix is already present in the codebase via the
handleInputParameterErrordecorator inwebapp/graphite/errors.py, which applieshtmlEscape()before returning anyHttpResponseBadRequest:Error flow
parseOptions()→int(queryParams.get('cacheTimeout', ...))raisesValueErrorrenderView()catches → re-raises asInputParameterError(str(e))@handleInputParameterError→ returnsHttpResponseBadRequest(htmlEscape(msgStr))Test coverage
RenderXSSTest.test_render_xssinwebapp/tests/test_xss.pydirectly exercises this path with a crafted XSS string acrosscacheTimeout,from, anduntilparameters, asserting a clean 400 response with no unescaped HTML. All 5 XSS tests pass.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.