confine: RunAgent truncates the command when it contains its own literal --
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #231 by @tnalbant — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with cli/confine/run.go:37, where RunAgent separates confine’s flags from the agent command, and trace how the remaining arguments reach the agent invocation. Reproduce with confine run -- mytool arg1 -- arg2 arg3; done means the agent receives every token after the first separator, including its own -- and the trailing arguments.
Written by the indexing model from the issue text.
Description
Problem
In packages/cli/confine/run.go:37, RunAgent splits its own arguments on the first -- it finds to separate confine's own flags from the agent command to run, but if the agent command itself legitimately contains a -- token (e.g. as an argument to the wrapped program), everything after that embedded -- is dropped rather than passed through to the agent.
Impact
Any agent invocation whose own command line needs to include a literal -- argument (common for tools that use -- to separate their own flags from positional arguments) has that argument and everything after it silently truncated, changing the effective command run and potentially breaking the wrapped tool or silently dropping intended arguments.
Repro
- Invoke confine with an agent command that itself contains
--, e.g.confine run -- mytool arg1 -- arg2 arg3. - Observe that
arg2 arg3(everything after the agent's own--) is truncated from what actually gets executed, rather than being passed through as part of the agent's arguments.
Suggested fix
Split only on the first -- to separate confine's own flags from the start of the agent command (this part is correct), but then pass every remaining token, including any subsequent literal --, through to the agent invocation unmodified, rather than re-applying ---splitting logic to the already-separated agent command portion.
- Dominant language
- Go
- Stars
- 157
- Forks
- 19
- Avg merge
- 4h 21m
- Merged PRs (30d)
- 91
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from solongate/agent-security
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
solongate/agent-security#226 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
solongate/agent-security#225 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
solongate/agent-security#224 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
solongate/agent-security#223 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
solongate/agent-security#222 ·
Maintainers usually reply within 1 day
All issues in solongate/agent-security
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cloudflare/cloudflared#1783 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
orchestration.migration.data.tasks.retry values are ignored by the 8.8 data migration jobPossibly taken @irisfield claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
camunda/camunda-platform-helm#7773 ·
Maintainers usually reply within 1 day
-
Add missing unit tests for IsAdmissionPolicyName and IsCertManagerResourceNamePossibly taken @a1h8 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kubernetes-sigs/security-profiles-operator#3644 ·
Maintainers usually reply within 1 day