Skip to content

harden(pytest): -p <bare-relative-path> bypass via looks_like_path #49

Closed

Description

@thehoff

Codex F7 / pre-release review. check_forbidden_pytest_args rejects -p <value> only when looks_like_path(value) returns true. The shared heuristic (with node) requires /, ./, ../, ~/, or Windows drive prefix. Bare attacker_subdir/plugin.py falls through. Pytest's plugin loader is Kernel.require-equivalent on FS paths. Fix: extend the pytest-specific check to also reject any value containing / or \\ even without an explicit leading dot.

Activity

  1. added
    enhancement
    on May 18, 2026
  2. added a commit that references this issue on May 18, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions