Skip to content

Relative PATH entries search the working directory #202

Closed

Description

@gaborbernat

get_paths() accepts relative search directories. With a caller-supplied ~/.local/bin entry, discovery searches below the working directory. On Windows, a supplied environment without PATH falls back to os.defpath, whose first entry is ., so discovery can probe an executable from the working directory without an explicit search path.

Affected code

get_paths() in release 1.9.1 accepts nonempty relative entries before candidate interrogation.

Impact

The caller-supplied relative PATH case is a bug: ordinary OS command lookup also searches that directory. The Windows fallback can add the working directory without the caller putting it in PATH; maintainers can see the reproduction and scope in draft advisory GHSA-4g3x-jm5r-x4qp. Reproducibility is moderate. The Windows exposure is unlikely because the caller must omit PATH from env and run discovery from a directory writable by another account.

Credits

Reported by Anthropic's OSS Scanner: ANT-2026-YKKUJR8L.

Activity

  1. added
    bugSomething isn't working
    securitySecurity fixes and advisories
    on Nov 2, 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

    bugSomething isn't workingsecuritySecurity fixes and advisories

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions