eval spawn gate ignores a spawn's own cwd argument
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- bash, javascript, python, ruby, typescript
- Domain
- security
Research direction
Start at gateEval and compare its cwd handling with resolveToCwd. Trace the listed Python, JavaScript, and Ruby spawn forms, then verify that literal cwd values are resolved from ctx.cwd and used in both the dialog record and cache key, while non-literals remain opaque.
Written by the indexing model from the issue text.
Description
gateEval builds its permission dialog and its cache key from ctx.cwd, ignoring a cwd the spawn passes for itself.
exec("rm -rf .", { cwd: "/" })
extracts as rm -rf . and is shown to the human, and sent to the classifier, as running in the session's working directory. The plugin's own header states that the native-resolved cwd is part of the identity of a judgement, so the same spawn re-run against a different directory can also reuse a verdict earned somewhere else.
Both halves need the spawn's own cwd:
subprocess.run(cmd, cwd="/")andsubprocess.Popen(..., cwd=...)exec(cmd, { cwd: "/" }),spawn(file, args, { cwd })- Ruby
Dir.chdirblocks andsystem(..., chdir: "/")
Read it where it is a literal, resolve it against ctx.cwd the way resolveToCwd does for bash, and put it in both the dialog record and the cache key. Where it is not a literal, the spawn should read as opaque: a command judged against the wrong directory is a command judged on the wrong question.
Found during review of #12.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 1h 20m
- Merged PRs (30d)
- 32
Contributor guide
No contributing guide indexed for this repository
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 STRML/omp-classifier
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
STRML/omp-classifier#81 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
STRML/omp-classifier#80 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
STRML/omp-classifier#78 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
STRML/omp-classifier#82 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
STRML/omp-classifier#73 ·
All issues in STRML/omp-classifier
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
Difficulty 2/5 Half a day Newbie friendliness 78/100
vercel/vercel-plugin#199 ·