Skip to content

[bug] policy bypass gaps in block-rm-rf, block-curl-pipe-sh, and protect-env-vars #59

Closed

Description

@yashexosphere

Three built-in policies have regex gaps that allow commands to slip through undetected.

1. block-rm-rf — GNU long flags bypass

The flag check only filters short flags (-r, -f). GNU long flags --recursive and --force are completely ignored.

Currently unblocked:

  • rm --recursive --force /
  • rm -r --force / (mixed)
  • rm --recursive -f / (mixed)

2. block-rm-rf — depth-1 absolute path without trailing slash

hasDestructivePath only triggers on trailing /, /*, or ~. A bare top-level path without a trailing slash bypasses the gate entirely.

Currently unblocked:

  • rm -rf /home
  • rm -rf /etc
  • rm --recursive --force /home

3. block-curl-pipe-sh — narrow shell list

Regex only covers sh|bash|zsh. Other common POSIX shells are not checked.

Currently unblocked:

  • curl ... | fish
  • curl ... | dash
  • curl ... | ksh
  • wget ... | ash

4. protect-env-vars — ${VAR} brace expansion bypass

ECHO_ENV_RE matches $[A-Za-z_] but not ${ — the brace falls outside the character class.

Currently unblocked:

  • echo ${SECRET_KEY}
  • echo ${HOME}/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions