Repository navigation
Description
Target Language
rust
Query Name (Optional)
SsrfReflectionInjection
Query Type
Security
Query Description
AI Scan reported 2 high-severity CWE-918 (ssrf reflection injection) finding(s) in Rust public synthetic repositories that the baseline CodeQL default-setup scan did not report. Gap categories: missing-query. Existing queries considered: none.
Why CodeQL appears to have missed these (unverified until reproduced with a test database):
- The installed Rust security catalog has no query for this vulnerability class; useful coverage requires a new query and, for framework APIs, supporting models.
Linked findings (gap-key: rust/query-create/ssrf-reflection-injection)
| Repo | CWE | Severity | AI scan alert | Summary |
|---|---|---|---|---|
| rust-vulnerable-apps | CWE-918 | high | https://github.com/codeql-forks-felickz/rust-vulnerable-apps/security/code-scanning/16 | The inbound request URL, whose authority is derived from attacker-controlled HTTP request metadata, is passed directly to reqwest. An attacker can select internal or external destinations and have the server fetch and return their response. |
| rust-vulnerable-apps | CWE-918 | high | https://github.com/codeql-forks-felickz/rust-vulnerable-apps/security/code-scanning/17 | The URL path parameter is interpolated into the destination used by reqwest without an allowlist or address validation. An attacker can cause requests to attacker-selected HTTPS hosts; default redirect following can also reach otherwise disallowed schemes or internal destinations. |
Findings come from AI Scan on public synthetic apps. Hypotheses above are unverified until reproduced with a test database. Verify first whether CodeQL already covers a case (for example via a different query or threat model) before adding code.
Expected Severity
High
Code Examples
See the linked alerts above for the vulnerable pattern; reduce each to a minimal test case with a safe counterpart that should not alert.
CWE/CVE Reference (Optional)
CWE-918
References (Optional)
https://cwe.mitre.org/data/definitions/918.html
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
felickz commentedon Nov 3, 2026
Upstream triage
precision:mediumRelies on heuristics or accepted over-approximation. Community Packs, always tags:experimental.
tags:experimental
Goes to Community Packs: performance, false-positive or synthetic-only concerns.
Community Packs, experimental. Recommended for the Community Packs repository, not
github/codeql. The issue is labeledtags:experimentalfor this.Linked pull request: #144
Why. Stock rust/request-forgery already exists; this query copies its configuration and adds iron request-field sources, a regexp-based fixed-host format! barrier and a query-local async-capture flow step. The iron source targets a niche framework and the barrier is a text heuristic, so it is not a clean patch for the product query. Keep it as an experimental community query; the barrier and async gap are better raised as separate library changes.
highin the pull request). Sources and sinks come from the stock RequestForgery module. Additions: a regexp over format! template text (barrier only), whole-field iron sources (url, headers, body) and a query-local async capture step. Tiered medium conservatively; real FP risk is mostly stock-level.Concerns, overlap and next steps
False-positive concerns
Performance concerns
Heuristics used
What an upstream change would look like. Community Packs: rust/src/<category>/ExtendedRequestForgery.ql with tests under rust/test. If a piece goes to github/codeql later: a Barrier in RequestForgeryExtensions.qll (tests in rust/ql/test/query-tests/security/CWE-918, lib change note), an iron model, and a dataflow fix for async captures.
Before opening an upstream pull request
Split note. Three separable parts: iron sources (niche, better as a model), fixed-host format! barrier (possible patch to RequestForgeryExtensions.qll if made structural), async capture step (dataflow library). Whole-PR destination is Community Packs.
This is a recommendation only. A human reviews it before any pull request is opened against
github/codeqlor the Community Packs repository.