Add regression tests for shell escaping with malicious Name/Upstream values #159
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracked from the medium-priority refactoring playbook in #154.
The git-gate shell rendering functions (
git_gate_render_entrypoint,git_gate_render_hook,git_gate_render_access_hook) embed manifest-controlled values (GitEntry.Name,upstream_url) into generated POSIX shell scripts. There are currently no tests that exercise pathological values, so regressions in escaping would go undetected.Work
GitEntryobjects with names/upstreams containing: single quotes, double quotes, spaces, semicolons, newlines, and backticks.bash -norsh -nin a subprocess) and that the embedded values are correctly quoted/escaped.shlex.quotehardening in the related issue.