GHSA-fc6g-2gcp-2qrq CVE-2026-21862
RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers
- Severity
- 0.0 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 0.25%
- Chance of exploitation in the next 30 days. Higher than 16.56% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-290 Authentication Bypass by Spoofing
- Fix
1.0.0-alpha.78- Upgrade rustfs to this version or later
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 versions
crates.io
| Package | Vulnerable | Fixed in |
|---|---|---|
| rustfs | < 1.0.0-alpha.78 |
1.0.0-alpha.78 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
rustfs crates.io → 1.0.0-alpha.78
- cargo
cargo update -p rustfs --precise 1.0.0-alpha.78
Severity breakdown
CVSS 4.0 0.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
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- None
- Integrity (vulnerable system)
- High
- Availability (vulnerable system)
- None
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
- Exploit maturity
- Proof of concept
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Weakness
CWE-290: Authentication Bypass by Spoofing
This attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-mm2q-qcmx-gw4w RustFS: ListServiceAccount authorizes against wrong admin action, enabling cross-user enumeration and root service account takeover | High | Also affects rustfs |
| GHSA-pfcq-4gjr-6gjm RustFS: Missing admin authorization on notification target endpoints allows unauthenticated configuration of event webhooks | High | Also affects rustfs |
| GHSA-mx42-j6wv-px98 RustFS has an authorization bypass in multipart UploadPartCopy enables cross-bucket object exfiltration | Medium | Also affects rustfs |
| GHSA-v9fg-3cr2-277j Rust has Critical Stored XSS in Preview Modal, leading to Administrative Account Takeover | Medium | Also affects rustfs |
| GHSA-w5fh-f8xh-5x3p RustFS: Missing Post Policy Validation leads to Arbitrary Object Write | Critical | Also affects rustfs |
| GHSA-r54g-49rx-98cr RustFS Logs Sensitive Credentials in Plaintext | High | Also affects rustfs |
| GHSA-333v-68xh-8mmq RustFS's RPC signature verification logs shared secret | High | Also affects rustfs |
| GHSA-xgr5-qc6w-vcg9 RustFS has IAM deny_only Short-Circuit that Allows Privilege Escalation via Service Account Minting | Critical | Also affects rustfs |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor