shannon icon indicating copy to clipboard operation
shannon copied to clipboard

feat: Bug Bounty Mode

Open JonathanVD43 opened this issue 5 months ago • 4 comments

Problem Statement

Security researchers running Shannon against bug bounty programs face three concrete problems. First, there is no way to feed a program's scope into the tool — in-scope domains, out-of-scope exclusions, and active campaign focus classes all have to be manually translated into Shannon YAML config, which is error-prone and slow. Second, Shannon generates a single executive report aimed at internal security teams; bug bounty platforms expect one structured report per finding with a specific set of fields (title, severity, CVSS, steps to reproduce, PoC, impact). Third, the default pipeline is tuned for thoroughness, not for being a polite guest on a production system — aggressive scanning can get a researcher banned from a program before they find anything useful.

Solution

A ./shannon bounty subcommand that accepts a bug bounty program page (as a URL or pasted text file), parses it with an LLM into a structured program config, enforces scope automatically, and produces per-finding reports formatted for direct HackerOne submission alongside the existing executive summary.

The pipeline is also extended with three new lightweight vulnerability agents (CORS misconfiguration, information disclosure, open redirects) and the existing auth agent is extended to cover auth-surface hardening and rate-limiting bypass checks. Recon is enhanced to produce an agent_hints map that routes specific endpoints to the most relevant specialist agents.

User Stories

  1. As a bug bounty researcher, I want to pass a HackerOne program URL to Shannon so that scope, out-of-scope exclusions, and campaign focus classes are parsed automatically without manual YAML authoring.
  2. As a researcher, I want to pass a copy-pasted program page as a text file so that I can use Shannon even when the platform requires login to view the program page.
  3. As a researcher, I want parsed program configs to be saved to ~/.shannon/programs/<name>.json so that I can reference a program by name on subsequent scans without re-parsing.
  4. As a researcher, I want a --refresh-program flag so that I can pull updated scope when a program changes its rules or adds a new campaign.
  5. As a researcher, I want Shannon to automatically inject in-scope domains as URL focus rules so that agents stay within the program's allowed surface.
  6. As a researcher, I want out-of-scope patterns from the program page to be injected as avoid rules so that agents do not touch excluded assets.
  7. As a researcher, I want a post-scan scope validator to check every URL visited against the program's in-scope domains so that I know before submitting whether any out-of-scope activity occurred.
  8. As a researcher, I want findings that touched out-of-scope assets to be excluded from HackerOne submission files automatically, while still appearing in the executive summary for my own review.
  9. As a researcher, I want one HackerOne-formatted markdown file per finding, ready to paste into a submission, so that I do not have to reformat results manually.
  10. As a researcher, I want each HackerOne report to include a title, severity, suggested CVSS vector, the mapped asset from the program's asset list, a summary, exact steps to reproduce, the precise payload or HTTP request used, the expected vs actual response, impact statement, and a suggested fix.
  11. As a researcher, I want the CVSS score to be clearly marked as a suggestion requiring manual review before submission so that I do not accidentally submit an inaccurate severity.
  12. As a researcher, I want the steps-to-reproduce section to be a complete reproduction recipe — exact HTTP request, payload, auth state — so that I can manually verify the finding before submitting.
  13. As a researcher, I want the executive summary to still be generated alongside HackerOne files so that I have an overview for my own analysis before deciding what to submit.
  14. As a researcher, I want HackerOne reports to be written to workspaces/<workspace>/hackerone/ so that submission files are easy to find and separate from the executive report.
  15. As a researcher, I want Shannon to instruct agents to behave as a careful human researcher — spacing out requests, avoiding brute-force patterns, not hammering endpoints — so that I am not flagged for automated scanning and banned from a program.
  16. As a researcher, I want Shannon to detect CORS misconfigurations as a new dedicated agent so that a common P3 finding class is covered reliably.
  17. As a researcher, I want Shannon to detect information disclosure (exposed API keys, stack traces, debug endpoints, .env paths) as a new dedicated agent.
  18. As a researcher, I want Shannon to detect open redirects as a new dedicated agent, since these are often chainable to OAuth and session bugs.
  19. As a researcher, I want the existing auth agent extended to test auth-surface hardening and rate-limiting bypass so that auth-focused campaigns like Shopify's Authentication & ATO program are better covered.
  20. As a researcher, I want the recon agent to produce an agent_hints map — a structured output that routes specific endpoints to the most relevant specialist agents — so that each agent starts with targeted context rather than re-discovering the attack surface from scratch.
  21. As a researcher, I want bounty mode to work in black box mode (no repo path required, or with an empty git-initialised directory) so that I can scan targets where I do not have access to source code.
  22. As a researcher, I want the program's active campaign focus (e.g. Authentication & ATO with bounty multipliers) to be surfaced in the workspace output so that I know which finding classes are currently paying a premium.
  23. As a researcher, I want the ./shannon bounty command to support the same --workspace, --output, --debug, and --pipeline-testing flags as ./shannon start so that my existing workflow is not disrupted.

Implementation Decisions

New subcommand: ./shannon bounty

  • bounty is registered as a top-level command in the CLI dispatcher alongside start, stop, logs, etc.
  • bounty start is the primary subcommand. Future subcommands (programs list, submit) are reserved but not built.
  • Internally, bounty start calls the same spawnWorker / ensureInfra machinery as start. It is a thin wrapper, not a parallel implementation.
  • bounty start accepts --url, --repo, --program, --refresh-program, --workspace, --output, --debug, --pipeline-testing. The --config flag is omitted — scope and config are derived from the program config, not a user-authored YAML.
  • --repo remains required at the CLI layer for now (the git-init workaround is the short-term fix for black box scans; making it optional is a separate issue).

Program config system (apps/cli/src/programs/)

  • types.ts defines ProgramConfig: name, platform ('hackerone' | 'bugcrowd'), in_scope_domains (string[], supports wildcards like *.shopify.com), out_of_scope_patterns (string[]), focus_classes (maps to Shannon agent names), active_campaign (optional: asset name, multipliers by severity), rules (free-text array of participation rules).
  • fetcher.ts accepts a URL or file path. For URLs, performs a plain HTTP GET (no auth). For file paths, reads the file as UTF-8 text. Returns raw string.
  • parser.ts takes raw text and calls Claude (haiku tier — cheap, fast) with a structured output schema matching ProgramConfig. Validates the response with Zod before returning.
  • store.ts reads and writes ~/.shannon/programs/<name>.json. On write, derives the name slug from ProgramConfig.name (lowercased, hyphenated). --refresh-program deletes the existing file before the fetch+parse cycle.

Scope enforcement

  • bounty start converts ProgramConfig.in_scope_domains to rules.focus URL patterns and ProgramConfig.out_of_scope_patterns to rules.avoid patterns, then passes these as configData overrides into PipelineInput.
  • Bounty mode is signalled to the worker via a new bountyConfig field on PipelineInput (serialised ProgramConfig). This field drives agent prompt injection and report generation.
  • The _bounty-mode.txt shared partial is injected into all agent prompts when bountyConfig is present. It instructs the agent to behave as a careful human researcher: space out requests, avoid brute-force patterns, vary timing, do not hammer authentication endpoints.

Recon agent_hints

  • The recon-collector MCP server gains a set_agent_hints tool. The schema is Record<AgentName, string[]> — a map from agent name to a list of prioritised endpoint URLs or patterns.
  • ReconData gains an agent_hints optional field.
  • recon-renderer.ts gains a new section renderer for agent hints (a simple table: agent to endpoints).
  • Each vuln agent prompt gains an {{AGENT_HINTS}} substitution variable. The prompt-manager resolves it from the recon deliverable at agent startup. If no hints exist for an agent, the variable resolves to empty string (no-op).
  • The agent_hints feature is implemented unconditionally — it benefits all Shannon scans, not only bounty mode. Only the {{AGENT_HINTS}} substitution in agent prompts is conditional on hints being present.

New vulnerability agents

  • Three new agents added to AGENTS in session-manager.ts: cors-vuln, info-disclosure-vuln, open-redirects-vuln.
  • All three have recon as their only prerequisite and run in the existing parallel vuln phase alongside the five current agents (8 total parallel agents in vuln phase).
  • ALL_AGENTS and AgentName in types/agents.ts updated accordingly.
  • The existing auth-vuln agent prompt is extended (not replaced) to include auth-surface hardening checks and rate-limiting bypass testing. No new agent is created for these.
  • No exploit agents are created for the three new vuln types in this iteration — findings go directly to HackerOne reports via the reporting phase.

Scope validator (apps/worker/src/services/scope-validator.ts)

  • Reads the workspace audit log after the vuln phase completes.
  • Extracts every URL the agents visited (from tool call logs).
  • Matches each URL against bountyConfig.in_scope_domains using wildcard hostname matching (e.g. *.shopify.com matches accounts.shopify.com).
  • Returns ScopeViolation[]: { url, agent, timestamp }.
  • Called from activities.ts before the report activity. Result is passed into both the executive report and the HackerOne reporter.
  • Normalises URLs to hostname-only before matching (strips path, query, fragment).

HackerOne report generator (apps/worker/src/services/hackerone-reporter.ts)

  • Takes the assembled findings (from deliverable files), bountyConfig, and ScopeViolation[].
  • For each finding, determines whether it touched an out-of-scope URL. If yes, the finding is excluded from HackerOne output but retained in the executive summary.
  • For each in-scope finding, renders a HackerOne-formatted markdown file using a report-hackerone.txt prompt template (LLM call per finding).
  • Each file is written to workspaces/<workspace>/hackerone/finding-NNN-<slug>.md.
  • Files include a [SUGGESTED CVSS — review before submitting] marker on the CVSS line.

Storage layout

workspaces/<workspace>/
  report-executive.md
  hackerone/
    finding-001-cors-wildcard.md
    finding-002-open-redirect.md

~/.shannon/programs/
  shopify.json

PipelineInput changes

  • New optional field: bountyConfig?: BountyConfig (serialised form of ProgramConfig — platform, in_scope_domains, out_of_scope_patterns, focus_classes, active_campaign).
  • Workflow passes bountyConfig through to all activity inputs that need it (agent execution, scope validator, HackerOne reporter).

Testing Decisions

  • Good tests test observable external behaviour, not implementation details. They call the module's public interface with realistic inputs and assert on outputs. They do not mock internal collaborators unless those collaborators cross a system boundary (network, filesystem, LLM).
  • scope-validator.ts gets a unit test suite. Test cases: exact domain match, wildcard subdomain match (*.shopify.com matches accounts.shopify.com), wildcard does not match unrelated domain, multiple violations returned, empty violations when all URLs in scope, path component ignored in host matching. No filesystem or network needed — inputs are arrays of strings.
  • No other modules get automated tests in this iteration.
  • Test runner: Vitest. Add vitest as a dev dependency and a test script in the root package.json.

Out of Scope

  • IDOR/BOLA agent — deferred until basic bounty mode is validated end-to-end.
  • Direct HackerOne API submission (./shannon bounty submit) — deferred.
  • Duplicate detection (checking whether a finding is already reported on the platform) — deferred.
  • Bugcrowd platform support — architecture supports it (platform field in ProgramConfig) but only HackerOne parsing and report format are implemented.
  • Hard rate-limit enforcement at the network/Playwright layer — prompt-level instructions only.
  • Making --repo optional for black box scans — tracked separately; current workaround is git init on an empty directory.
  • Business logic vulnerability detection.
  • ./shannon bounty programs list and related program management commands.

Further Notes

  • The Shopify bug bounty program page was used as the primary design reference. The active Authentication & ATO campaign (multipliers: Medium 1.25x, High 1.5x, Critical 2x) demonstrates why active_campaign needs to surface in output — researchers need to know which finding classes are currently paying a premium.
  • Shopify's program rules ("only test stores you created") are extracted into ProgramConfig.rules and injected into the bounty-mode prompt partial so agents are aware of participation constraints, not just technical scope.
  • The scope validator's wildcard matching must handle both *.shopify.com style patterns and exact domain entries.
  • The agent_hints feature benefits all Shannon scans, not just bounty mode. The recon-collector MCP change and renderer update should be implemented unconditionally.

JonathanVD43 avatar Jun 19 '26 14:06 JonathanVD43

/claim

syu-toutousai avatar Jun 28 '26 23:06 syu-toutousai

Hi! I'm a TypeScript developer. I'd love to build out this Bug Bounty Mode logic today. Let me know if I can take this on!

niktoimiyazap avatar Jul 01 '26 10:07 niktoimiyazap

@niktoimiyazap idk if you're asking me but if you are go for it lol, the guy above you already built out https://github.com/KeygraphHQ/shannon/issues/364 and https://github.com/KeygraphHQ/shannon/issues/365 I believe, you can look at that in https://github.com/KeygraphHQ/shannon/pull/372

This isn't my repo so I don't have permission to assign you.

JonathanVD43 avatar Jul 01 '26 10:07 JonathanVD43

Thanks for putting so much thought into this and for breaking the proposal down in such detail.

After reviewing it, we think the broader bug bounty / black-box workflow is outside Shannon's focus for now. We're currently focused on code-informed pentesting integrated into the software development lifecycle, rather than optimizing Shannon for public bug bounty programs and HackerOne-style workflows.

There are definitely some useful ideas here that could apply more broadly to Shannon, and we may revisit those independently. For now, though, we're going to close these out so we can stay focused on our current direction.

Really appreciate the feedback and the work that went into this. We can absolutely revisit bug bounty support if it becomes a priority for Shannon in the future.

keygraphVarun avatar Sep 02 '26 23:09 keygraphVarun