Skip to content

fix(security): add re.DOTALL to prevent multiline bypass of dangerous command detection#233

Merged
teknium1 merged 1 commit intoNousResearch:mainfrom
Farukest:fix/dangerous-pattern-multiline-bypass
Mar 2, 2026
Merged

fix(security): add re.DOTALL to prevent multiline bypass of dangerous command detection#233
teknium1 merged 1 commit intoNousResearch:mainfrom
Farukest:fix/dangerous-pattern-multiline-bypass

Conversation

@Farukest
Copy link
Copy Markdown
Contributor

@Farukest Farukest commented Mar 1, 2026

Added TestMultilineBypass to tests/tools/test_approval.py with 4 tests:

  • curl ... \\\n| sh detected
  • wget ... \\\n| bash detected
  • dd \\\nif=... detected
  • chmod --recursive \\\n777 detected

All 4 fail without the fix, all 33 tests pass with it.

Closes #232

@ibhagwan
Copy link
Copy Markdown
Contributor

ibhagwan commented Mar 1, 2026

Mind me asking what formatter does this project use? opencode is messing up the format making it much harder to track the actual changes.

@teknium1 teknium1 merged commit 4faf2a6 into NousResearch:main Mar 2, 2026
@teknium1
Copy link
Copy Markdown
Contributor

teknium1 commented Mar 2, 2026

Merged — thanks for the security fix! Added 2 extra find-pattern newline tests as a follow-up.

@ibhagwan
Copy link
Copy Markdown
Contributor

ibhagwan commented Mar 2, 2026

Merged — thanks for the security fix! Added 2 extra find-pattern newline tests as a follow-up.

@teknium1, this project needs a formatter standard / guidelines urgently, submitting #268 was extra hard due to this.

@Farukest
Copy link
Copy Markdown
Contributor Author

Farukest commented Mar 3, 2026

Merged — thanks for the security fix! Added 2 extra find-pattern newline tests as a follow-up.

Thanks :)
Good call on the extra find pattern tests 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants