Open
Conversation
- Replace exec(f"import {i}") with importlib.import_module(i) in import_task_factory.py
- Pass VCF split paths via environment variables (VG_HEADER_FILE/VG_SPLIT_VCF_DIR) instead
of f-string interpolation into the shell --filter argument, so metacharacters in paths
cannot be misinterpreted by the shell
- Return a generic error message to the client on upload failure instead of str(e)
- Replace bare except: with except Exception: in upload/views/views.py
cf9145b to
c0c8cd2
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
exec(f"import {i}")withimportlib.import_module(i)inimport_task_factory.pyVG_HEADER_FILE/VG_SPLIT_VCF_DIR) instead of f-string interpolation into thesplit --filtershell string, eliminating any risk of shell metacharacters in paths being misinterpretedstr(e), which could leak internal paths/tracebacks)except:withexcept Exception:inupload/views/views.pyAddresses findings from the upload app security audit: SACGF/variantgrid_private#3825
Test plan
split --filterenv-var path)get_import_task_factories()still returns the expected factories🤖 Generated with Claude Code