Source: Local AI for Cybersecurity (Project Black). Adapted here for bug bounty work on HackerOne, not just local-model research.
The article compares four approaches to finding vulnerabilities in a real codebase (benchmark: an LFI in PHPIPAM). Ranked worst to best:
- Semgrep (
semgrep scan --config auto) — rule-based SAST. Missed the bug entirely. Limitation: "you can only write rules for dangerous patterns that you already know exist." - Cloud agentic workflow (Strix + GLM 5.1) — autonomous repo exploration or full agentic run. ~$30–300 in tokens (GLM vs GPT-5.4/Sonnet 4.6), 60M tokens burned, still missed the bug. Unconstrained autonomy on a large codebase wastes budget without guaranteeing coverage.
- Cloud models + Markdown "skills" (Claude Code / Cursor / Copilot) — sub-agents per vulnerability category, more guidance. Inconsistent: found it sometimes, missed it other times, depending on which files the agent happened to pick.
- Local model + disciplined file-by-file harness (Qwen 3.6 27B, ~170K
context) — won, every run. Architecture:
~120M tokens for an ~800-file codebase, but 100% hit rate on the benchmark, plus a real find in the wild: myVesta authenticated RCE (username param passed straight into
for each source file: model reviews ONE file + relevant context writes a structured report collect all reportsexec()).
Takeaway: an unconstrained agent given a whole codebase and told "find bugs" burns huge budget and is unreliable — coverage depends on what it happens to look at. A disciplined pass that guarantees every file gets reviewed, one at a time, with a fixed report format, is what actually produces repeatable hits. This maps directly onto loop-until-dry / full coverage patterns, not "smart autonomous agent, hope it looks in the right place."
Straight source-code review only works when source is actually available:
- Self-hosted/open-source software in scope — some programs include
forked CMS, admin panels, or internal tools built on open-source bases
(like PHPIPAM, myVesta in the article). If a program's scope includes
something you can
git cloneor download, this is directly applicable. - Client-side JS bundles of closed-source SPAs — this is the
adaptation that matters for most bug bounty targets: a Next.js/React/Vue
bundle IS source you can read (minified, but still parseable). Treat each
JS chunk as a "source file" in the harness and look for the same
dangerous-pattern classes:
eval/new Function, hardcoded API keys/secrets (seeauth_secretfindings — this is exactly the kind of thing a per-file pass over JS bundles would have surfaced faster),postMessagehandlers without origin checks, prototype pollution patterns, debug/test code left in production bundles, client-trusted flags (withVip-style booleans).
No local model (Qwen/Ollama/llama.cpp) is installed in this environment —
that's not the point. The harness pattern is what to reuse, and this
session's own tooling (the Agent/Workflow mechanism) already implements
it structurally:
- Pull the target material: JS bundle files (
curleach_next/static/chunks/*.js), or a cloned repo if source is in scope. - Split into per-file (or per-chunk) units small enough for one review pass.
- For each unit: one review pass, fixed output structure (finding / file /
line / why-it-matters / confidence) — same shape as this project's own
ReportFindingsschema. - Collect every report, don't stop at the first hit — full coverage is the entire point, matching the article's "every run found it" result versus the agentic approach's "sometimes found it."
- Use
Workflowwithpipeline()over the file list for this: oneagent()call per file/chunk, schema-constrained output, then merge — this is a direct match for the winning harness, just using cloud models instead of a local Qwen rig. (Only invokeWorkflowif the user asks for multi-agent orchestration explicitly — see this repo's own tool rules.)
- High token consumption — file-by-file coverage on a large bundle set is expensive. Scale the file count to what the engagement budget allows.
- False positives — every finding from this pass is a candidate,
not a confirmed bug. Still needs the same manual verification discipline
used elsewhere in this lab (see
docs/hackerone-workflow.md— no reporting without a working PoC). - Weak on Broken Access Control / multi-step logic bugs — a single file in isolation can't see cross-request state (auth flows, IDOR across endpoints, race conditions). Those still need the manual, cross-referencing review this lab already does by hand — this harness is a complement for code-visible bug classes (injection, hardcoded secrets, dangerous sinks), not a replacement for business-logic testing.
| CVE | Software | Bug |
|---|---|---|
| CVE-2026-12194 | PHPIPAM | Authenticated LFI — unsanitized controller param concatenated into require_once() |
| CVE-2026-12195 | myVesta | Authenticated RCE — FTP username-deletion function passes username param straight to exec() |