Per-CVE Rule Packs
For a real Next.js application reproduction with managed Nuclei and Vulhub containers, use managed CVE labs. The tools below remain signature-only checks.
A per-CVE rule pack tests a load-balancer or WAF rule using a profile you author from an advisory. It sends the specified request signature and benign controls, then checks the expected responses.
new CVE-2026-109618 writes an unfinished template with that ID. It does not
look up the CVE, generate an exploit, or build a vulnerable PHP server. server
turns a completed profile into an OpenAPI mock with canned responses. Neither
command reproduces PHP2Shell or Log4Shell. The template is rejected by server,
run, and probe until you replace its placeholders.
For a completed example, use
examples/cve-packs/CVE-2025-29927/profile.json. To reproduce vulnerable
application behavior, you need a separate application lab with the affected
version and observations specific to the advisory. See the
CVE reference and application requirements.
Install the tools from crates.io
Install MockForge 0.3.238 or later, then export the bundled scripts into a new directory:
cargo install mockforge-cli --version 0.3.238 --locked
mockforge tools export --output-dir mockforge-tools
cd mockforge-tools
python3 scripts/cve_pack.py --help
The export includes the discussion exporter, CVE scripts, their Python modules,
the Next.js profile, and this guide. It needs Python 3.11 or later and no pip
packages. VERSION records the CLI version that supplied the files. Export
into a new directory after upgrading; existing directories are never overwritten.
What it is and is not
This is a defensive rule-regression harness, not an exploit tool.
- Server leg is a MockForge mock of the guarded route (
cve_pack.py server). MockForge serves a fixed canned response; none of the vulnerable code runs, so a load balancer in front of it sees a realistic origin that is inherently inert. - Client leg sends the rule’s signature — the header and query-parameter
names the rule matches on — with inert marker values. The profile schema
only accepts marker values matching
[A-Za-z0-9_.:-], so a profile cannot carry a command, a template expression, markup, a traversal or any payload, and there is no request-body field at all. - The harness sends only
GET, one correlation token per request, no retries and no redirects, to a loopback target by default.
It never provisions a vulnerable application, executes a payload, or sends a
callback. Reports always mark runtime_patch_evidence as unverified.
The profile
A profile (examples/cve-packs/<cve-id>/profile.json) names the route, the
signature tokens, benign controls, and the expected rule outcome:
{
"schema_version": 1,
"cve": "CVE-2025-29927",
"title": "Next.js middleware authorization bypass via x-middleware-subrequest",
"references": ["https://nextjs.org/blog/cve-2025-29927"],
"route": "/dashboard",
"signature": {
"method": "GET",
"query": {},
"headers": { "x-middleware-subrequest": "middleware:middleware:middleware:middleware:middleware" }
},
"expect": { "blocked_status": 403, "origin": "absent" },
"controls": [
{ "id": "benign", "query": {}, "headers": {}, "expect": { "status": 200, "origin": "seen" } }
]
}
signature.headers/signature.queryare name → marker. Use the exact name the rule keys on; keep the value an inert marker. The repeatedmiddleware:token above is inert (letters and colons only) yet still matches a rule that looks for the chained value.expect.blocked_statusis the 4xx/5xx the rule returns;origin: "absent"asserts the request must not reach the origin.- Each control is benign traffic that should pass through (
200,seen).
Workflow
-
Scaffold a profile from the advisory:
python3 scripts/cve_pack.py new CVE-2025-29927 --output CVE-2025-29927.profile.jsonReplace the placeholder title, reference URL, route, and signature using the vendor advisory. Set
expect.blocked_statusto your rule’s response. Keep values as markers. A CVE ID alone does not supply any of these fields. -
(Optional) run the realistic origin for manual exploration:
python3 scripts/cve_pack.py server CVE-2025-29927.profile.json > mock.json mockforge serve --spec mock.json --http-port 18080 -
Test your load balancer or WAF with
run. Configure the LB’s upstream to127.0.0.1:18082on the machine running this command.runstarts its own recorder there for the duration of the test. The recorder listens on loopback, so run the LB on the same host or provide a tunnel from your remote LB to that recorder. Preserve the correlation query parameter and header.Point
--targetat the LB’s listener. The optional MockForge server on port 18080 is for manual exploration; it is not the recorder used byrun:run client -> LB listener :8080 -> run's recorder 127.0.0.1:18082python3 scripts/cve_pack.py run CVE-2025-29927.profile.json \ --target http://127.0.0.1:8080 --report report.jsonThe harness sends each benign control and the signature request (flanked by a control beacon to corroborate origin reachability), then prints a verdict per case and writes
report.json. It exits non-zero unless every case passes: the signature blocked and not forwarded, and every control allowed and observed at the origin.A non-loopback
--targetrequires--allow-external-target, which affirms you are authorized to send this traffic to that exact host.
Reading the result
For each case the report gives rule_behavior (pass, fail, inconclusive),
the observed status, origin_seen, and the bounded origin_observations. The
run exits 0 only if all cases pass.
passon the signature means the rule returned the expected block status and the request did not reach the origin.failmeans the status did not match, or a “blocked” response still forwarded the request to the origin.inconclusivemeans the evidence could not establish blocking — a network error, missing correlation, or controls that could not corroborate origin reachability (for example an LB that denies everything).
What the harness proves is scenario delivery and rule behavior at the transport layer. It is not a load-balancer byte capture, and it is not proof of CVE protection or remediation.
Remediation tips
For any CVE, cve_pack.py tips <CVE> aggregates actionable guidance from every
feed, deduplicated: the version to upgrade to (OSV per-package fixes, with
NVD CPE as a fallback), whether it is actively exploited (CISA KEV) and
ransomware-linked, its EPSS exploitation probability, the CWE classes,
and the authoritative references.
python3 scripts/cve_pack.py tips CVE-2025-29927
# "advice": "EPSS 99%; upgrade to next 13.5.9, next 14.2.25, next 15.2.3"
Each feed is queried independently. A connection reset or timeout produces
complete: false and a feed_errors entry identifying the URL and error type.
Results from other feeds remain in the JSON; the command exits 1 for partial
results and 0 when all reads succeed. Retry later or check network access to
the listed URLs. --timeout 30 changes the per-request timeout.
Unavailable KEV data yields actively_exploited: null, not false. No version
in the returned data means no version was found; it does not mean no fix exists.
Check the vendor advisory for the version appropriate to your application.
Feed lookups do not inspect your installed software or prove a WAF mitigates it.
Monitoring new CVEs
cve_pack_monitor.py keeps the pack set current. It is CISA KEV-driven (the
actively-exploited catalog), triages each entry to the CWE classes a
request-facing rule can act on, enriches the most urgent ones with tips, and
writes a candidate pack per CVE. Every CVE is keyed once across all feeds, and
CVEs you already have a profile for are skipped.
python3 scripts/cve_pack_monitor.py \
--out-dir candidate-packs \
--report monitor-report.json \
--known-dir examples/cve-packs \
--since 2026-10-01 --limit 25
Each candidate lands in candidate-packs/<CVE>/ as a profile.json (signature
TODO) plus a tips.json. It reads feeds only — it sends no traffic and opens
no pull request. Review a candidate, fill the signature from the advisory, and
run it.
Automatic signature drafts
Pass --drafter-cmd to have a command propose each signature. The command
reads a JSON context (CVE, title, references, CWEs, bounded advisory text) on
stdin and prints a JSON proposal (route, signature, expect, controls).
It is provider-agnostic — wire any LLM CLI behind it — so there is no built-in
model or cost.
python3 scripts/cve_pack_monitor.py --out-dir candidate-packs \
--drafter-cmd 'my-llm-drafter' --since 2026-10-01
The schema is the trust boundary, not the drafter. Advisory text is
untrusted input and a drafter may be an LLM, so every proposal is rebuilt with
the feed-authoritative CVE id, title and references and then validated. Because
a profile admits only inert marker values and has no request body, a
prompt-injected or careless draft cannot produce a runnable payload: it is
written as profile.needs-review.json with the reason and flagged, never run.
Always review a drafted signature before trusting it.
Choose run or probe
Use run when you can route your LB to the recorder, and want evidence about
which requests reached the origin. Use probe for a target you are authorized
to test when you cannot replace or instrument its origin. probe requires no
recorder and compares the signature response with benign controls. It works
with your own site too; origin access is the distinction, not site ownership.
python3 scripts/cve_pack.py probe CVE-2025-29927.profile.json \
--target https://example.com --report probe.json --allow-external-target
- blocked — the signature got an access-denied status (401/403/406/429/451/501) while a benign control was allowed.
- not-blocked — the signature passed (a 2xx/3xx).
- inconclusive — no benign control was allowed (no baseline), or the signature got an ambiguous status such as 404/400/5xx. A missing route is never reported as a block.
probe observes only the front end’s response; it does not correlate origin
reachability, so it is weaker evidence than run. Judge applicability with
tips — a WAF that doesn’t block a signature only matters if the CVE applies to
what’s behind it.
Limitations
- Name/presence signatures, not payload content. A profile’s values are
inert markers, so the harness tests rules that key on a header/parameter
name or presence (e.g. the Next.js
x-middleware-subrequestheader). It does not carry the literal payload of content-matching CVEs (Log4Shell${jndi:…}, reflected XSS, SQLi), so it cannot exercise a WAF rule that matches on that payload string — by design, the schema forbids payloads. probeis status-only. It cannot tell a rule block from an origin that happens to deny; it is a quick front-end check, not proof. Userunwith an owned origin for correlated evidence.- Neither mode proves a target is vulnerable or patched; that stays
unverified. Usetipsfor the upgrade path.