CVE-2026-21862 — rustfs
Fix: rustfs/rustfs@b4ba62fCVE-2026-21862 is a CWE-290 vulnerability in rustfs. A fix is available for rustfs — see the affected versions and patch details below.
RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-21862.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
rustfsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Summary
IP-based access control can be bypassed: get_condition_values trusts client-supplied X-Forwarded-For/X-Real-Ip without verifying a trusted proxy, so any reachable client can spoof aws:SourceIp and satisfy IP-allowlist policies.
Details
- Vulnerable code:
rustfs/src/auth.rs:289-304setsremote_addrfromX-Forwarded-For/X-Real-Ip, then insertsSourceIpviaget_source_ip_raw, with no trust boundary or proxy validation:let remote_addr = header.get("x-forwarded-for").and_then(...).or_else(|| header.get("x-real-ip")...).unwrap_or("127.0.0.1");args.insert("SourceIp", vec![get_source_ip_raw(header, remote_addr)]);
- This value feeds IAM/bucket policy evaluation in
rustfs/src/storage/access.rs(authorization path), so any request that forges the header can meetaws:SourceIpconditions. - No authentication is required beyond the request itself; the header is taken at face value even on direct connections.
PoC
rustfs-auth-trusted-ip-header-spoofing-poc.tar.gz
Steps (already included in rustfs-auth-trusted-ip-header-spoofing-poc/):
- Start RustFS with two local volumes, e.g.:
mkdir -p /tmp/rustfs-data1 /tmp/rustfs-data2
RUSTFS_ACCESS_KEY=devadmin RUSTFS_SECRET_KEY=devadmin \
cargo run --bin rustfs -- --address 0.0.0.0:9000 \
/tmp/rustfs-data1 /tmp/rustfs-data2
- From
rustfs-auth-trusted-ip-header-spoofing-poc/, run:
ENDPOINT=http://127.0.0.1:9000 make run
The script:
- Creates bucket `rustfs-trusted-ip-poc`.
- Applies a bucket policy allowing `s3:ListBucket` only from `10.0.0.5/32` (`Principal: {"AWS":["*"]},` Resource array).
- Sends three unauthenticated `ListBucket` calls:
- Baseline (no spoof) → HTTP 403.
- Spoofed `X-Forwarded-For: 10.0.0.5` → HTTP 200 (policy bypass).
- Spoofed `X-Forwarded-For: 1.2.3.4` → HTTP 403.
- Responses saved to `poc-baseline.xml`, `poc-spoofed.xml`, `poc-deny.xml`.
Impact
- Vulnerability type: Authorization bypass of IP-allowlist (
aws:SourceIp) via header spoofing. - Who is impacted: Any deployment relying on
aws:SourceIpin IAM/bucket policies for S3 operations. Attackers with network reach to RustFS can forge forwarded-IP headers to gain list/read/write where IP restrictions were meant to block them.
Credits
Identified by SecMate (https://secmate.dev) automated analysis and validated during manual triage.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | rustfs | all versions | 1.0.0-alpha.78cargo update -p rustfs --precise 1.0.0-alpha.78 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for rustfs, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update rustfs to 1.0.0-alpha.78 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-21862 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-21862 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-21862. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-21862 in your dependencies?
O3 Security finds CVE-2026-21862 across crates.io dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.