Security fixes for library/ (SACGF/variantgrid_private#3833)#1513
Open
Security fixes for library/ (SACGF/variantgrid_private#3833)#1513
Conversation
- Remove html_link() (unused, had unescaped URL XSS potential) - preview_request: use None instead of javascript: URL for NoReverseMatch - database_utils: int() cast on batch_size prevents non-integer SQL injection - diff_utils: escape operation_name in CSS class attribute - file_utils: downgrade path+stat error logging from ERROR to DEBUG
84a4e1b to
fba0040
Compare
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
Security hardening for the shared
library/utilities, addressing findings from SACGF/variantgrid_private#3833.html_link()which had an unescaped URL in its href attributepreview_request: replacejavascript:alert(...)fallback withNoneonNoReverseMatchdatabase_utils:int()cast onbatch_sizebefore SQL string interpolation insql_delete_qsdiff_utils:escape(diff.operation_name)in generated CSS class attributefile_utils: downgrade path+stat logging onchmodfailure fromERRORtoDEBUGNone of these are currently exploitable via user input — see the issue for the full exploitability assessment. These are defence-in-depth fixes.
Test plan
python3 manage.py test --keepdb)get_absolute_url()raisesNoReverseMatch(no link shown, no JS executed)