Skip to content

Latent shell injection in save commit message (git_workflow.save) #85

Description

@dev-dull

Summary

landing/app/git_workflow.py:139,147 interpolates a caller-supplied message into a single-quoted bash -c string:

commit_msg = message or "save: work in progress"
... f"git commit -m '{commit_msg}'"

run via exec_in_pod(pod_name, ["bash", "-c", ...]). A message containing a single quote breaks out of the quoting and injects arbitrary shell into the build pod.

Current reachability

Not reachable from the HTTP surface today: build_save (routes/build.py:135) calls wf.save(...) without passing message. But the parameter exists, the endpoint is docstringed "named save," and the moment a save-message field is wired to the UI this becomes RCE-in-pod.

Suggested fix

Don't interpolate untrusted text into a shell string. Pass the commit message as a separate argv element — e.g. build the commit with ["git", "commit", "-m", commit_msg] via a direct exec (no bash -c), or write the message to a file and git commit -F. Same care applies anywhere else a user string reaches bash -c.

Found during a repo audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions