CVE-2026-21862: Rustfs Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-fc6g-2gcp-2qrq
CWE-290
Published
Advisory Summary

CVE-2026-21862 is a HIGH remote code execution vulnerability (CWE-290: Authentication Bypass by Spoofing) affecting Rustfs libraries in the crates.io ecosystem. The issue involves rustfs has sourceip bypass via spoofed x-forwarded-for/real-ip headers. Remediation is available by upgrading affected packages to version 1.0.0-alpha.78.

CVE-2026-21862 at a Glance

CVE Identifier CVE-2026-21862
GHSA Identifier GHSA-fc6g-2gcp-2qrq
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-290: Authentication Bypass by Spoofing
Affected Product Rustfs
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix CVE-2026-21862

To remediate this vulnerability, upgrade all affected Rustfs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rustfs fixed: 1.0.0-alpha.78
Upgrade rustfs to 1.0.0-alpha.78
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rustfs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-21862, inspect your project dependencies for Rustfs:

inspect dependencies for rustfs

Analyze the terminal output to locate any version of Rustfs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0-alpha.78), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-290: Authentication Bypass by Spoofing, where this attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks. In Rustfs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/user-attachments/files/24038162/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 ``` 2. 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.

CVE-2026-21862 Affected Rustfs Versions

1 component(s)
Fixed Versions:
1.0.0-alpha.78
Product / Package Ecosystem Affected Versions Fixed Version
rustfs
crates.io
< 1.0.0-alpha.78
1.0.0-alpha.78

References

Frequently Asked Questions

What is CVE-2026-21862?
CVE-2026-21862 is a security vulnerability in Rustfs involving RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers under CWE-290: Authentication Bypass by Spoofing.
Which Rustfs versions are affected?
Affected versions include releases prior to 1.0.0-alpha.78 across affected packages: rustfs.
What version fixes CVE-2026-21862?
Upgrading to 1.0.0-alpha.78 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rustfs affected?
Yes, rustfs is affected in releases prior to 1.0.0-alpha.78. Upgrade your dependency to 1.0.0-alpha.78 or later.
What CWE is associated with CVE-2026-21862?
CVE-2026-21862 is classified under CWE-290: Authentication Bypass by Spoofing (This attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks.).
How can I check crates.io dependencies for CVE-2026-21862?
Run the dependency tree command: 'inspect dependencies for rustfs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fc6g-2gcp-2qrq",
  "modified" : "2026-02-03T18:55:45Z",
  "published" : "2026-02-03T17:31:41Z",
  "aliases" : [ "CVE-2026-21862" ],
  "summary" : "RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers",
  "details" : "### Summary\nIP-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.\n\n### Details\n\n  - Vulnerable code: `rustfs/src/auth.rs:289-304` sets `remote_addr` from `X-Forwarded-For`/`X-Real-Ip`, then inserts `SourceIp` via\n    `get_source_ip_raw`, with no trust boundary or proxy validation:\n      - `let remote_addr = header.get(\"x-forwarded-for\").and_then(...).or_else(|| header.get(\"x-real-ip\")...).unwrap_or(\"127.0.0.1\");`\n      - `args.insert(\"SourceIp\", vec![get_source_ip_raw(header, remote_addr)]);`\n  - 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.\n  - No authentication is required beyond the request itself; the header is taken at face value even on direct connections.\n\n\n### PoC\n\n[rustfs-auth-trusted-ip-header-spoofing-poc.tar.gz](https://github.com/user-attachments/files/24038162/rustfs-auth-trusted-ip-header-spoofing-poc.tar.gz)\n\n\nSteps (already included in `rustfs-auth-trusted-ip-header-spoofing-poc/`):\n\n  1. Start RustFS with two local volumes, e.g.:\n\n```\n     mkdir -p /tmp/rustfs-data1 /tmp/rustfs-data2\n     RUSTFS_ACCESS_KEY=devadmin RUSTFS_SECRET_KEY=devadmin \\\n       cargo run --bin rustfs -- --address 0.0.0.0:9000 \\\n       /tmp/rustfs-data1 /tmp/rustfs-data2\n```\n\n  2. From `rustfs-auth-trusted-ip-header-spoofing-poc`/, run:\n\n```\n     ENDPOINT=http://127.0.0.1:9000 make run\n```\n\n     The script:\n      - Creates bucket `rustfs-trusted-ip-poc`.\n      - Applies a bucket policy allowing `s3:ListBucket` only from `10.0.0.5/32` (`Principal: {\"AWS\":[\"*\"]},` Resource array).\n      - Sends three unauthenticated `ListBucket` calls:\n          - Baseline (no spoof) → HTTP 403.\n          - Spoofed `X-Forwarded-For: 10.0.0.5` → HTTP 200 (policy bypass).\n          - Spoofed `X-Forwarded-For: 1.2.3.4` → HTTP 403.\n      - Responses saved to `poc-baseline.xml`, `poc-spoofed.xml`, `poc-deny.xml`.\n\n\n### Impact\n\n  - Vulnerability type: Authorization bypass of IP-allowlist (`aws:SourceIp`) via header spoofing.\n  - 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.\n\n### Credits\nIdentified by SecMate (https://secmate.dev) automated analysis and validated during manual triage.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "rustfs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.0-alpha.78"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rustfs/rustfs/security/advisories/GHSA-fc6g-2gcp-2qrq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-21862"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rustfs/rustfs/commit/b4ba62fa3300b5b258fdc0da141481e3be7ea960"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rustfs/rustfs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-290" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-03T17:31:41Z",
    "nvd_published_at" : "2026-02-03T16:16:12Z"
  }
}