fix(server): Escape update args#532
Conversation
|
| Filename | Overview |
|---|---|
| agent/server.py | Adds shlex.quote() around url and branch args in update_agent_web; also adds branch = branch or "master" guard to prevent None reaching shlex.quote. |
Sequence Diagram
sequenceDiagram
participant Caller
participant update_agent_web
participant shlex
participant subprocess
participant git
Caller->>update_agent_web: url, branch (untrusted)
update_agent_web->>update_agent_web: "branch = branch or "master""
update_agent_web->>shlex: quote(url)
shlex-->>update_agent_web: 'escaped_url'
update_agent_web->>subprocess: "git remote set-url upstream 'escaped_url' (shell=True)"
subprocess->>git: safe literal arg
update_agent_web->>shlex: quote(branch)
shlex-->>update_agent_web: 'escaped_branch'
update_agent_web->>subprocess: "git checkout 'escaped_branch' (shell=True)"
subprocess->>git: safe literal arg
update_agent_web->>subprocess: "git merge --ff-only upstream/'escaped_branch' (shell=True)"
subprocess->>git: upstream/escaped_branch via shell concatenation
Reviews (2): Last reviewed commit: "fix(server): Escape update args" | Re-trigger Greptile
8398a74 to
4c3a033
Compare
fix(server): Escape update args (backport #532)
No description provided.