cxg changelog
Version 1.5.0
Added
-
cxg pentest runcan be limited to a list of routes.--only-routes <FILE>(and the repeatable--only-route <ENTRY>) tests only the hypotheses whose route or enclosing function is in the list; every other hypothesis is excluded before ranking and the--max-templatesbudget, and reported with its reason in the run output and a newroute_allowlistblock inreport.json. Entries areMETHOD /path(ANY/*for any method; path templates and concrete paths match each other; a trailing*is a prefix),/path,file::Function, orfile:Function— one per line, or JSON, including a code graph’scodegraph_routes/codegraph_attack_surfaceanswer passed through unchanged, so a caller can hand cxg the routes a change reached without reformatting them. Path matching reuses the code graph’s template-aware matcher. An empty list means “nothing in scope” and exits0without contacting the target, distinct from omitting the flag (a full run); an unreadable file, or a use with--template-diror--template-lang py, refuses the run with exit4. This is the cxg half of testing only a pull request’s delta in CI. -
cxg pentest runreads a code graph when one is available. Ifcodegraph-mcporbravos graphis installed and a graph has been built for the codebase (bravos graph build <codebase>), cxg uses its route table as the preferred route source for--discover-routes. That covers gorilla/mux, net/http, httprouter, OpenAPI-table and Django routes the regex cannot see: on gophish discovery goes from 0 routes to 48, and on VAmPI from 0 to 14. The graph’s reachable-sink ranking (data layer, exec, outbound network, …) also becomes a ranking dimension for which hypotheses get the--max-templatesbudget. When the graph reports insufficient call resolution, it is not used for ranking and the run output says so. Without graph tooling, or with--no-code-graph, a run is unchanged.report.jsongains acode_graphblock, and each discovered hypothesis records which source its route came from. -
Route-declaring
@flowsreach route discovery, and the run reports flows it cannot use. A flow whose mechanism is a route (via GET./orders/<id>) now adds that route to the--discover-routessurface when no scanned route already serves it, matching parameters across router spellings (<id>,:id,{id}). The run prints a[1h] @flows:line counting flow edges, chainable flows and route-declaring flows, and names by file and line every flow that cannot chain and every@flowsline it could not read. -
cxg pentest runtests each declared trust boundary. A guardlink SARIF that carries its model graph (sarif_profile_version1, guardlink’s export since it added declared context) lists every@boundarywith its claim key, both sides and the flows that cross it. For each boundary whose outside side guardlink can infer (one side is not a declared asset), cxg builds oneauth_apihypothesis per route on the inside: a route@flowscrossing inward, or a code graph route handled where an inward crossing is declared. The probe calls the route with no credential and then as the lowest-privilege identity, told the boundary’s own words, the code graph’s measured access level for the route (public,authenticated,elevatedorunknown) and the data classes the inside asset handles. These hypotheses rank below every declared threat and never displace or merge with one; a boundary is a claim to test, never evidence that a route is safe. A boundary between two declared assets has no known direction and yields none.report.jsongainsdeclared_boundaries(one record per boundary, with what was built or why nothing was), and a finding from such a probe carriesboundary_claim_key.
Changed
-
cxg pentest runreads guardlink’s declared context instead of re-deriving it. With a SARIF that carries it, a hypothesis’s@flowschain comes from the result’scodeFlows, its@boundary/@assumes/@handles/@transfersintent notes from itsrelatedLocations(same@verb: descriptiontext), and its function name fromlogicalLocations, rather than from source comments within 30 lines of the annotation. A hypothesis no longer picks up flows and notes declared on a neighbouring handler or asset, and does pick up notes on its own asset declared in another file.@commentand@validates, which guardlink does not export, are still read from source. An older SARIF is read exactly as before. The run prints a[1h]line saying which path it took. -
Routes come from the code graph before the source is scraped. A guardlink hypothesis with no route takes the code graph’s route for its own handler when a graph is loaded, and the decorator scrape near the annotation no longer runs when a graph is loaded or when guardlink marked the result’s route ambiguous. Without either, the scrape remains the last resort.
-
cxg pentest runtolerates a richer guardlink SARIF.guardlink/parse-errorresults are skipped likeguardlink/dangling-refinstead of becoming a hypothesis read as mitigated. Aguardlink/boundary-claimresult is read as a trust boundary to verify, never as an exposure, and the run prints a[1h]line counting them. A hypothesis whose result carries a guardlink claim key is named by it, so its id is stable when guardlink reorders results; without one the positional id is unchanged in the first run and scoped by run (gl-r1-0-…) in later runs. -
--only-routesaccepts every graph answer verbatim. Multi-method routes (GET,POST /<int:id>/update) and anonymous handler ids (file.rb::<module>/<anon:get#0>) used to refuse the whole file; they now parse, and a multi-method route matches each of its methods. -
A vulnerability class guessed from a URL’s shape no longer earns ranking weight. With a goal, a discovered route whose class was inferred from its path alone ranks below every annotated threat and every hypothesis with code graph reach, takes no class-match bonus, and does not double its reach for the sink class its guessed class would land in.
-
cxg pentestreads@flowsto the verb’s definition. The reader now accepts exactly the forms guardlink’s grammar accepts and refuses the rest, so an annotation means the same thing to both tools. Newly read: a flow with novia(recorded as not chainable, with the reason, instead of dropped), a dotted or repository-qualified target (#billing.charge), bare and dotted endpoints such as guardlink’s own exampleapi.auth -> db.users via TLS 1.3, quoted endpoints, multi-word mechanisms, multi-hop chains (A -> B -> C, one flow per hop), and a-- "..."continuation line extending a flow’s description. A route mechanism keeps its method and full path:via GET./orders/<id>is GET/orders/<id>where cxg used to keep the channelGET.. No longer read, because guardlink rejects them: an unspaced arrow (#a->#b), a hyphen or leading digit in a bare endpoint (user-agent,3rdparty), and a flow whose description is followed by more text. A mechanism followed by a trailing comment now carries it, as guardlink records it (redis # noqa), so the artifact name a chain is keyed on can change for such a line.
Fixed
-
An unmodelled guardlink SARIF rule is no longer read as a mitigated exposure. A
guardlink/*result whose rule cxg does not model — aguardlink/agent-reachtarget from the pentest profile, or a rule a newer guardlink adds — used to fall through to a “be conservative, assume mitigated” branch and become a hypothesis asserted safe: a probe slot spent on a non-finding and a clean bill cxg never earned. On guardlink’s own support-desk pentest export that was 14 fabricated mitigated hypotheses beside the one real exposure. Such a result is now skipped and counted, andcxg pentest runprints what it declined to read (skipped N result(s) … none assumed mitigated).guardlink/mitigated-exposureis handled explicitly as a covered exposure that names its covering@mitigates/@acceptscontrol from the result’ssuppressions, instead of reaching the mitigated flag by accident. Results from non-guardlink tools, and guardlink’s hyphen-prefixed extended schema, are unchanged. -
Go templates that import third-party packages now compile. cxg built a Go template with
go build <file>and never resolved its imports, so a template importing anything outside the standard library failed with “no required module provides package …” —cxg scan --templates grpc-reflection-abuseamong them — unless the operator first wrote ago.modand rango getby hand. A template that imports a non-stdlib package and is not inside a Go module is now built in a private module at~/.cert-x-gen/cache/go-modules/<stem>-<sha256>/(honouringCERT_X_GEN_HOME): cxg copies the template there, generatesgo.mod, runsgo mod tidyand builds. The entry is keyed by the template’s content, so an unchanged template reuses its binary offline, and it is renamed into place only after a successful build. The operator’s Go environment (GOPATH,GOMODCACHE,GOCACHE,GOFLAGS,GOPROXY,GOTOOLCHAIN) is inherited; with downloads disabled or unreachable the run fails fast aserrored, naming the imports and how to make them available.The build no longer spends the probe’s
--timeout: templates gain an optionalTemplate::preparephase, which the executor runs first under its own budget (300s, or--timeoutif larger), and the Go engine compiles there. A cold first build ofgrpc-reflection-abusetakes ~30s on an empty Go cache and previously read astimed-outat the default 30s. Go build subprocesses are now killed when their budget expires instead of outliving it.Stdlib-only templates and templates inside a module build as before, except that the build now runs in the template’s own directory, so an enclosing module is the one Go uses rather than whatever module cxg was launched from.
Security
-
Dependency advisories addressed.
cryptographyis bumped49.0.0→50.0.0inpentest/requirements.txt(GHSA-g6cj-pr64-35w5), andrustls0.23.41→0.23.45(GHSA-2mjx-qc3c-rqvc), which carriesaws-lc-rs,aws-lc-sysandrustls-webpkiforward with it. cxg does not terminate TLS as a server, so the rustls advisory does not describe a code path cxg exercises; the bump keeps the tree current regardless. -
Known open advisories, carried deliberately. Two transitive advisories are left for a later release because resolving them is not a version bump:
idna(reachable through the DNS stack, which needs thetrust-dns→hickorymigration to move off the affected line) andrmcp(whose fix is the2.xmajor, an API break). Both are named here so a reader of this release knows they are unaddressed rather than unnoticed.
Documentation and infrastructure
- Security-contact and crate-homepage metadata, pull-request CI spend, and the vendored guardlink
@flowsconformance corpus were updated since 1.4.0; none change runtime behaviour.

