Conversation
- oauth.py: validate URL scheme and use urljoin instead of string concat - models_classification_sync.py: validate remote_pk, use urljoin for URL construction - variant_grid_download.py: validate exclude_labs/orgs values and lab_group_name format before creating Lab/Org records - alissa_upload.py: safe int conversion for response counts, narrow except clause, store only sanitized response summaries in SyncRun.meta - query_json_filter.py: validate filter keys against safe identifier pattern - sync_runner.py: remove config dump (including credentials) from error message
f0fd22f to
53648bd
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
Addresses issues raised in SACGF/variantgrid_private#3831 (security audit of the
sync/app).library/oauth.py— Validate URL scheme ishttp(s)and useurljoininstead of string concatenation inServerAuth.url()sync/models/models_classification_sync.py— Validateremote_pkis a safe identifier; useurljoininstead ofos.path.joinfor URL constructionsync/shariant/variant_grid_download.py— Validateexclude_labs/exclude_orgsconfig values are safe identifiers; validatelab_group_nameformat andlab_namelength before auto-creating Lab/Org recordssync/alissa/alissa_upload.py— Safeint()conversion for API response counts; narrowexcept Exceptionto(ValueError, AttributeError); store only sanitized count summaries inSyncRun.metarather than full raw API responsessync/shariant/query_json_filter.py— Validate filter keys against safe identifier pattern to prevent ORM field traversalsync/sync_runner.py— RemoveSyncDestination.configdump (which may contain credentials) from error messageTest plan
python3 manage.py test --keepdb syncSyncDestinationwith an unsupported config type raises aValueErrorwith just the destination name (no config dump)