fix(server): Shell escape docker login args (backport #534)#536
Conversation
|
| Filename | Overview |
|---|---|
| agent/server.py | Adds shlex.quote to all docker command arguments (login credentials, image tags, container names, bench names) to prevent shell injection via the shell=True subprocess execution path. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[docker command with user-controlled arg] --> B{shlex.quote applied?}
B -- Before PR: No --> C[f-string interpolated directly into shell command]
C --> D[subprocess.Popen shell=True]
D --> E[Shell injection possible]
B -- After PR: Yes --> F[arg shell-escaped before interpolation]
F --> D
D --> G[Shell injection prevented]
Reviews (2): Last reviewed commit: "fix(server): add missing shlex import" | Re-trigger Greptile
|
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes. Issue 1 of 1agent/server.py:3-10 |
Fixed in the latest commit — |
This is an automatic backport of pull request #534 done by [Mergify](https://mergify.com).