Skip to main content

CVE-2026-21862 — Vulnerability in rustfs — CVE Details

HIGH

RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers

Published February 3, 2026Updated February 3, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.45%). Schedule for your next planned update.

Does your project use an affected rustfs version?

Paste your Cargo.lock to check it for CVE-2026-21862 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Cargo.lock

Summary

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-304 sets remote_addr from X-Forwarded-For/X-Real-Ip, then inserts SourceIp via get_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 meet aws:SourceIp conditions.
  • 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/):

  1. 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
  1. 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:SourceIp in 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.

Advisory Timeline

  • First published February 3, 2026 (296 days ago).
  • Last revised February 3, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update rustfs to 1.0.0-alpha.78 or later
cargo update -p rustfs --precise 1.0.0-alpha.78

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: crates.io (1).

PackageFixed In
rustfs crates.io · Affected: All versions1.0.0-alpha.78

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

Frequently Asked Questions

What is CVE-2026-21862?
RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2026-21862?
CVE-2026-21862 affects rustfs. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-21862 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.45%
EPSS percentile: 30.9

This is a below-median EPSS score — only 30.9% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-fc6g-2gcp-2qrq

Related CVEs

  • CVE-2025-68926
    CRITICAL

    RustFS has a gRPC Hardcoded Token Authentication Bypass

  • CVE-2026-27822
    CRITICAL

    Rust has Critical Stored XSS in Preview Modal, leading to Administrative Account Takeover

  • GHSA-mm2q-qcmx-gw4w
    HIGH

    RustFS: ListServiceAccount authorizes against wrong admin action, enabling cross-user enumeration and root service account takeover

  • CVE-2026-40937
    HIGH

    RustFS: Missing admin authorization on notification target endpoints allows unauthenticated configuration of event webhooks

  • CVE-2025-68705
    HIGH

    RustFS Path Traversal Vulnerability

  • CVE-2026-27607
    HIGH

    RustFS: Missing Post Policy Validation leads to Arbitrary Object Write

  • CVE-2026-22042
    MEDIUM

    RustFS has IAM Incorrect Authorization in ImportIam that Allows Privilege Escalation

  • CVE-2026-22043
    MEDIUM

    RustFS has IAM deny_only Short-Circuit that Allows Privilege Escalation via Service Account Minting

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock