CVE-2026-21862: RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers
Summary IP-based access control can be bypassed: getconditionvalues 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.
Published Feb 3, 2026
Affected packages
rustfs
- Ecosystem
- Rust (crates.io)
- Affected
- < 1.0.0-alpha.78
- Fixed in
- 1.0.0-alpha.78
- Check
cargo tree -i rustfs
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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 runThe script:
- Creates bucket
rustfs-trusted-ip-poc. - Applies a bucket policy allowing
s3:ListBucketonly from10.0.0.5/32(Principal: {"AWS":["*"]},Resource array). - Sends three unauthenticated
ListBucketcalls: - 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.
Credited to max-r-b, enitmar.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesGHSA-mm2q-qcmx-gw4w
RustFS: ListServiceAccount authorizes against wrong admin action, enabling cross-user enumeration and root service account takeover
high7.4May 5, 2026CVE-2026-40937
RustFS: Missing admin authorization on notification target endpoints allows unauthenticated configuration of event webhooks
high8.3No fixApr 22, 2026CVE-2026-39360
RustFS has an authorization bypass in multipart UploadPartCopy enables cross-bucket object exfiltration
medium4.3No fixApr 8, 2026CVE-2026-27607
RustFS: Missing Post Policy Validation leads to Arbitrary Object Write
high8.1Feb 25, 2026CVE-2026-27822
Rust has Critical Stored XSS in Preview Modal, leading to Administrative Account Takeover
critical9.0Feb 25, 2026CVE-2026-24762
RustFS Logs Sensitive Credentials in Plaintext
medium6.9Feb 3, 2026
