block-dangerous.sh: several force-push and rm -rf spellings get through
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
Research direction
Start with .cursor/hooks/block-dangerous.sh and inspect its two grep -E patterns against the listed commands. Update the checks so the eight dangerous spellings are blocked while the listed safe commands remain allowed, then run uvx paveo test cursor to verify the Cursor hooks.
Written by the indexing model from the issue text.
Description
.cursor/hooks/block-dangerous.sh catches git push --force, git push -f, rm -rf and rm -fr. Checked against its two grep -E patterns, these pass:
- force push:
git push origin main -f,git push origin +main,git -C . push --force,git push -uf origin main - delete:
rm -Rf build,rm -r -f build,rm --recursive --force build,find build -delete
These two patterns stop all eight, and still allow git push origin main, git push --follow-tags, git push -u origin feature-fix, rm -f file.txt and find . -name x:
grep -qE '\bgit\b.*\bpush\b.*(\s--force|\s-[a-zA-Z]*f\b|\s\+[^ ])'
grep -qE '\brm\b.*\s(-[a-zA-Z]*[rR]|--recursive)|\bfind\b.*\s-delete\b'
The second also stops a plain rm -r, which seems in the spirit of the hook. failClosed: true is already set, so a missing jq blocks rather than lets things through.
I build Paveo, an open-source test for agent guards: uvx paveo test cursor runs these and 60 more spellings against a repo's Cursor hooks.
- Dominant language
- Python
- Stars
- 35
- Forks
- 66
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- Has a 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 project-codeflare/codeflare-sdk
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
project-codeflare/codeflare-sdk#1190 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
project-codeflare/codeflare-sdk#813 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
project-codeflare/codeflare-sdk#774 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
project-codeflare/codeflare-sdk#425 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
project-codeflare/codeflare-sdk#422 · 1 comment ·
Maintainers usually reply within 1 day
All issues in project-codeflare/codeflare-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
vllm-project/vllm#64845 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
dekobon/big-code-analysis#1729 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pydantic/pydantic-ai#12091 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100