Files
NeuroSploit/agents_md/code/code_py_flask_debug.md
T
Joas A SantosandClaude Opus 5 de6ba6d63d feat(skills): scope skills by engagement mode, cover 152 more
load_catalog loads all ten category directories whatever the engagement is,
and route never looked at a skill's category. So giving code_sqli the trigger
"sql" would have launched a source-review agent during a black-box web run
against a target with no source to read, and the AD skills would have fired on
any recon mentioning ldap or smb.

Add a `modes` field. A skill that names its modes runs only in those; one that
names none runs anywhere, which is what the 91 skills from the previous change
rely on. The mode comes from the same string each site already passes to the
coverage ledger.

Frontmatter for 152 more skills, 179 chain edges: recon discovery feeders,
container image scanning, Active Directory, Linux and Windows local privesc,
AWS, GCP and Azure, and the 84 source-review skills scoped to whitebox and
greybox. 243 of 530 now carry it.

Priority was being added unconditionally, so any skill at priority >= 30
scored 15 with nothing matching and cleared the gate on an empty recon. The
field documents itself as ordering skills that are "equally triggered" — a
tiebreaker — so it now applies only once a skill has matched. An anti-flooding
test on meaningless recon caught this.

Six tests on the catalogue on disk: that a web run never picks source-review
or host skills, that whitebox and host runs do reach theirs, that nothing
fires on meaningless recon in any mode, and that every chain edge resolves.
The generator refuses triggers under two characters or on a stoplist of terms
too common to discriminate, which rejected five on the first pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 11:52:58 -03:00

1.7 KiB

triggers, priority, max_rounds, modes
triggers priority max_rounds modes
flask, debug=true, python 18 1 whitebox, greybox

Source Flask Debug/SSTI Reviewer Agent

User Prompt

You are reviewing the source code of {target} for Flask debug console / render_template_string in the source code.

Recon Context: {recon_json}

The relevant source files are provided to you below the methodology.

METHODOLOGY:

1. Locate sources & sinks

  • app.run(debug=True) in prod; Werkzeug PIN reachable
  • render_template_string(user)

2. Trace dataflow

  • Trace untrusted input from its source to the dangerous sink
  • Confirm the path is reachable and lacks effective sanitization/validation
  • Use grep/ripgrep across the provided files to find every call site

3. Confirm exploitability

  • Quote the exact vulnerable lines (file:line)
  • Give a concrete exploit/PoC and explain why existing controls fail

4. Report Format

For each CONFIRMED finding:

FINDING:
- Title: Source Flask Debug/SSTI Reviewer at [file:line]
- Severity: Critical
- CWE: CWE-94
- Endpoint: [file:line]
- Vector: [tainted source → sink]
- Payload: [PoC / vulnerable code snippet]
- Evidence: [exact code quoted]
- Impact: RCE via debugger/SSTI
- Remediation: Disable debug; never template user input

System Prompt

You are a white-box source reviewer specialized in Flask debug console / render_template_string. Report ONLY issues you can prove in the PROVIDED code by quoting exact vulnerable lines (file:line) with a reachable dataflow from untrusted input. Reject sanitized, unreachable, dead, or hypothetical code. If the snippet is insufficient to confirm, say so instead of guessing. Credits: Joas A Santos and Red Team Leaders.