7.7high
RustFS sourceIp bypass via spoofed X-Forwarded-For/Real-IP headers
- Severity
- 7.7high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.25% (higher than 17% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-fc6g-2gcp-2qrq
Description
RustFS is a distributed object storage system built in Rust. Prior to version alpha.78, 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. This issue has been patched in version alpha.78.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rustfs rustfs | < alpha.78, 1.0.0 | CVE List, NVD |
| rustfs (crates.io) | before 1.0.0-alpha.78 | GitHub Advisory Database |
All scores
| GitHub_M | 7.7high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
RustFS is a distributed object storage system built in Rust. Prior to version alpha.78, 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. This issue has been patched in version alpha.78.
GitHub Advisory Database
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.
NVD (es)
RustFS es un sistema de almacenamiento de objetos distribuido construido en Rust. Antes de la versión alpha.78, el control de acceso basado en IP puede ser eludido: get_condition_values confía en X-Forwarded-For/X-Real-Ip suministrados por el cliente sin verificar un proxy de confianza, por lo que cualquier cliente accesible puede falsificar aws:SourceIp y satisfacer las políticas de lista de permitidos de IP. Este problema ha sido parcheado en la versión alpha.78.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-21862 changed 2026-02-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-fc6g-2gcp-2qrq changed 2026-02-03 | CC-BY-4.0 |
| NVD | CVE-2026-21862 changed 2026-06-17 | Public domain |