Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Canaries

Build Canaries

PyPI License Stars

Detect unsafe code execution in any system that processes untrusted repositories.
For bug bounty hunters, red teams, and security researchers.

InstallationQuick StartLibraryPayloadsContributing


Any tool that clones, scans, builds, or processes a repository is a potential target. Build Canaries generates beacon payloads that exploit implicit build hooks, package scripts, and config files that trigger code execution or network requests. These are behaviors organizations integrate without fully understanding.

Ships with a comprehensive payload library, bundled with runtime E2E tests that verify payloads actually trigger. Point it at a target's documentation and it will crawl the docs, identify coverage gaps, then generate candidate payload generators for review and testing.

How It Works

flowchart LR
    subgraph discover ["Discovery + Generation"]
        A1[/"Vendor Docs"/] --> A2["Identify supported ecosystems"]
        A2 --> A3["Find missing payloads"]
        A3 --> A4["AI generates candidate payload"]
        A4 --> A5["Review + test"]
    end

    subgraph library ["Payload Library"]
        B1[("Verified payloads")]
    end

    subgraph deploy ["Deployment"]
        C1[/"package.json, Makefile, ..."/] --> C2["Target processes repo"]
        C2 --> C3(("Beacon"))
    end

    A5 --> B1
    B1 --> C1
Loading

Origin

Build Canaries was created at ZeroPath after we caught an attempted attack against our SAST platform. We built this tool to systematically test our own infrastructure and discovered that many common dev tools (including other security scanners) would execute code or make network requests when processing untrusted repositories. We expanded the tool well beyond our internal needs to cover the full range of repository processing risks.

Black Hat USA 2026

Build Canaries was released as part of Scanning the Scanners: Turning Security Vendors into Supply-Chain Weapons, presented at Black Hat USA 2026 by Raphael Karger. The talk uses this tool to test 20 self-service hosted scanner platforms and walks through the confirmed cases where a submitted repository reached the vendor's own credentials.

For more information, including the full slide deck, see the blog post. DVASP is a deliberately vulnerable scanner you can point Build Canaries at to try this out locally.

Installation

Requires Python 3.10+

pip install build-canaries

Or from source:

git clone https://github.com/rek7/build-canaries
cd build-canaries
pip install -e .

Quick Start

1. Get a Beacon Subdomain

Use Interactsh to receive callbacks:

# Install
go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-client@latest

# Run (note your subdomain)
interactsh-client

# Output:
# [INF] Listing 1 payload for OOB Testing
# [INF] abc123xyz.oast.fun    <-- This is your subdomain

Or use the web interface: https://app.interactsh.com

2. Generate Payloads

# Generate all payloads
canary generate --beacon abc123xyz.oast.fun

# Generate specific categories
canary generate --beacon abc123xyz.oast.fun --category npm --category pip

# Use a preset
canary generate --beacon abc123xyz.oast.fun --preset minimal

# Output as zip
canary generate --beacon abc123xyz.oast.fun --format zip --output payloads.zip

3. Deploy and Watch

Deploy the generated files to your target system and watch for beacons:

[npm-preinstall-a1b2c3d4] Received HTTP request from 203.0.113.42
[symlink-environ-a1b2c3d4] Received DNS lookup from 198.51.100.7

The beacon prefix tells you exactly what triggered.

CLI Reference

⚠️ Warning: The --output option will delete and replace existing contents. Always specify a dedicated directory.

canary generate --beacon abc123.oast.fun                  # Generate all payloads
canary generate --beacon abc123.oast.fun --category npm   # Specific category
canary generate --beacon abc123.oast.fun --preset minimal # Use a preset
canary generate --beacon abc123.oast.fun --format zip     # Output as zip

canary list                                               # List payloads
canary presets                                            # List presets
canary preview npm-preinstall --beacon example.oast.fun   # Preview a payload

canary discover --url https://docs.example.com --dry-run  # Discover tools from vendor docs

Run canary generate --help for all options including custom URL schemes, commands, and symlink extensions.

Testing a New Tool

Before testing any code processing tool, run discover against its documentation to ensure payload coverage for all ecosystems it analyzes.

Setup: Requires OPENAI_API_KEY and the Codex CLI. Run ./scripts/install-discover.sh or poetry install && poetry run playwright install chromium.

# 1. Check what the tool scans and what payloads you're missing
canary discover --url https://docs.example.com/ --depth 2 --dry-run

# 2. Generate candidate payload generators for missing coverage
canary discover --url https://docs.example.com/ --depth 2

# 3. After review/tests, generate your payload set with the new coverage
canary generate --beacon abc123.oast.fun

This is the recommended workflow because tools often support ecosystems you wouldn't expect. A "Python linter" might also parse package.json, Makefile, or Docker configs.

Discover Options

canary discover --url <docs-url> --dry-run              # Show gaps without generating
canary discover --url <docs-url> --depth 0              # Single page only
canary discover --url <docs-url> --depth 2              # Limit crawl depth
canary discover --url <docs-url> --weak-model gpt-5.5   # Override extraction model
canary discover --url <docs-url> --strong-model gpt-5.5 # Override dedup/coverage model

Library Usage

Build Canaries can also be used as a Python library for programmatic payload generation. See the library documentation for API reference, custom generators, and examples.

Payloads

Payloads target CI/CD, package managers, build tools, security scanners, IDEs, AI assistants, and more. Categories include RCE, SSRF, blind exfil, symlink attacks, prompt injection, and honeytokens.

See docs/payloads.md for the full list with counts and descriptions.

Self-Hosting

For sensitive engagements, self-host Interactsh. Custom domains are recommended for AI testing since default *.oast.fun domains may be recognized as security infrastructure.

Contributing

See docs/contributing.md for guidelines on adding payloads, generators, and running tests.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages