Repository navigation
fix: audit bug hunt — uninstall env leak, cursor strip, publish injection, band typos - #1196
Open
adiraj66132 wants to merge 4 commits into
Open
adiraj66132 wants to merge 4 commits into
adiraj66132 wants to merge 4 commits into
Conversation
…tion, band typos Twelve confirmed bugs from a full-repo audit: Must fix: - tests/uninstall.test.js: scrub XDG/Qoder/CodeBuddy config dirs so npm test cannot delete a developer's real ponytail state - scripts/cursor-hooks.js: stripPonytail no longer deletes event keys that never held a ponytail hook (empty arrays survive; false 'removed' gone) - scripts/publish-openclaw-skills.js: refuse skill dirs that are not plain [a-z0-9-] slugs before they reach a shell:true command line Should fix: - benchmarks/correctness.js: write the debounce harness as .cjs when the submission uses module.exports (was always .mjs, so CJS scored 0) - hooks/ponytail-mode-tracker.js: /ponytail band <typo> ignores like /ponytail ulta instead of toggling the band off - hooks/ponytail-band-import.js: temp-dir skip matches on a real path separator (/tmpfoo is a project, not /tmp) Nice to have: - hooks/ponytail-config.js: collapse internal whitespace so 'stop ponytail' deactivates - hooks/ponytail-band-import.js: guard the transcript cwd JSON.parse so one corrupt line cannot abort the whole import - scripts/check-versions.js: release-tag guard fails closed on non-X.Y.Z tags - benchmarks/agentic/run.py: catch BaseException from workers; check claude on PATH before warm-up so a missing CLI exits cleanly - scripts/uninstall.js: remove .ponytail-band; atomic settings.json writes - scripts/cursor-hooks.js: atomic hooks.json writes - benchmarks/agentic/judge.py: exclude seeded fixture files from the judge text; print every arm, not a hardcoded five Regression tests added for the env scrub, empty-array strip, band typo, temp-prefix project, corrupt cwd, module.exports debounce, and band flag.
…nscript fd, simpler TEMP - publish-openclaw-skills.js: check every skill dir name before the first publish so a bad name never leaves a half-done run - ponytail-band-import.js: close the transcript fd in finally so a read error cannot leak a handle; drop the TEMP .map (only tmpdir needs the trim)
Contributor
Author
|
Added a follow-up commit with the remaining hardcoded values and cleanups:
Verified: |
The benchmark now shows every arm it finds, and checks for claude before warming the cache. Version checks include plugin.yaml, the OpenClaw build reads homepage and license from package.json, and the band test works on macOS.
adiraj66132
force-pushed
the
fix/audit-bug-hunts
branch
from
October 20, 2026 20:16
2a6f9f2 to
fcff3f7
Compare
This was referenced Oct 22, 2026
This was referenced Oct 24, 2026
Closes DietrichGebert#1263: a wrong-shaped ~/.cursor/hooks.json now warns and lets the rest of uninstall run. Closes DietrichGebert#1268: the OpenClaw build prunes stale generated dirs, tests catch them, and publish uses the source skill list. Closes DietrichGebert#1274: check-rule-copies pins the whole never-cut fragment and checks the hook fallback copy. Closes DietrichGebert#1275: docs name the OpenCode V2 hook actually registered. Closes DietrichGebert#1279: uninstall removes Qoder per-project mode flags.
caioniehues
pushed a commit
to caioniehues/ponytail
that referenced
this pull request
Nov 18, 2026
) With Qoder detection on (QODER_SESSION_ID set), the mode tracker writes per-project flags under $QODER_CONFIG_DIR/ponytail-modes (hooks/ponytail-runtime.js:40). scripts/uninstall.js:30 removed ponytail-modes under the Claude, Cursor and CodeBuddy directories only, so the Qoder directory survived every uninstall. A leftover flag starts a reinstall with the project's previous mode instead of the configured default, the same effect DietrichGebert#676 fixed for the shared Qoder flag. Repro (scratch dirs, detection emulated with QODER_SESSION_ID): before uninstall: qoder/.ponytail-active and qoder/ponytail-modes/5be02fc2...b6fd28 after uninstall: qoder/ponytail-modes/5be02fc2...b6fd28 remained The fix adds getQoderDir() to the directory list, so the Qoder ponytail-modes directory is removed like the other three. After the fix the same repro leaves 0 files. Not covered: Windows untested; Qoder itself is not installed, detection was emulated. Open PR DietrichGebert#1202 makes this Qoder path the default via QODER_PROJECT_DIR, so the leak becomes the default case once it merges; this change is independent of it and of DietrichGebert#1196, which edits other parts of uninstall.js. (cherry picked from commit 1b43cab)
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An audit of the repo found 12 real bugs. This PR fixes all of them, 3 small cleanups from a follow-up review, and 5 issues filed after the first review (#1263, #1268, #1274, #1275, #1279).
The bad ones
Running
npm testcould delete your real ponytail settings. The uninstall test passed through yourXDG_CONFIG_HOME/ Qoder / CodeBuddy env vars into a script that deletes files. Now the test scrubs those vars first.Uninstalling Cursor hooks could wipe hooks that aren't ours. A hooks.json with an empty event list got deleted and the script said "Removed ponytail hooks" even though there were none. Now it only touches events that actually contain a ponytail hook.
A malicious skill folder name could run shell commands. The publish script builds a shell command from directory names. A folder named
x$(evil)would execute when a maintainer published. Now only plain names (a-z,0-9,-) are allowed — and every name is checked before the first upload, so one bad folder can't leave a half-finished publish.The annoying ones
Correct answers written as
module.exports = …always scored 0 in the debounce benchmark (wrong file extension). Fixed./ponytail band banana(typo) hid the band. Now it does nothing, same as a typo'd mode switch.Projects in paths like
/tmpfoowere skipped by band import (treated as temp dirs). Fixed with a proper path check.The small ones
stop ponytail(double space) didn't turn ponytail off. Now it does.One corrupt line in a transcript could crash the whole band import. Now it skips that line. The file handle is also always closed, even when the read fails.
A weird release tag (like
v5.4-beta) bypassed the version check. Now it fails.A missing
claudeCLI made the benchmark spend money then crash without a summary. Now it exits cleanly up front.Uninstall left the band flag behind and wrote
settings.jsonnon-atomically (could truncate it). Both fixed. Cursor'shooks.jsonwrites are atomic the same way.The over-engineering judge looked at the whole seeded repo instead of just the agent's changes, and only printed 5 of 8 arms. Both fixed.
Follow-up review cleanups
Issues filed after the first review
~/.cursor/hooks.jsonno longer aborts uninstall before thestatusLinecleanup; it warns and leaves the file untouched.check-rule-copiespins the whole never-cut fragment (so droppingsecurityfails) and now checks the hook fallback copy too.session.hook('context')).$QODER_CONFIG_DIR/ponytail-modes.Tests
csv: correct pandas) also fails on cleanmainhere — pandas isn't installed. Unrelated.Risk
~/.claude/.ponytail-bandand Qoder'sponytail-modes(intended — ponytail state)..openclaw/skills/(generated output; a hand-edited dir there is not preserved).vX.Y.Zrelease tags now fail the version check on purpose (normal releases unchanged).