{"id":"CVE-2026-21862","aliases":["CVE-2026-21862","GHSA-fc6g-2gcp-2qrq"],"related":[],"kind":"vulnerability","state":"published","title":"RustFS sourceIp bypass via spoofed X-Forwarded-For/Real-IP headers","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-02-03T16:06:08.929Z","modified":"2026-06-17T10:19:02.963Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-290"],"affected":[{"ranges":[{"version":"< alpha.78","status":"affected"}],"vendor":"rustfs","product":"rustfs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.0.0-alpha.78"}],"ecosystem":"crates.io","package":"rustfs","purl":"pkg:cargo/rustfs","source":"ghsa"},{"ranges":[{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"}],"vendor":"rustfs","product":"rustfs","cpe":"cpe:2.3:a:rustfs:rustfs:1.0.0:alpha1:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/rustfs/rustfs/security/advisories/GHSA-fc6g-2gcp-2qrq","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-21862","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rustfs/rustfs/commit/b4ba62fa3300b5b258fdc0da141481e3be7ea960","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rustfs/rustfs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-02-03T17:10:14.991Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-21862","url":"https://www.cve.org/CVERecord?id=CVE-2026-21862","licence":"CVE Terms of Use","modified":"2026-02-03T17:10:32.495Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fc6g-2gcp-2qrq","url":"https://github.com/advisories/GHSA-fc6g-2gcp-2qrq","licence":"CC-BY-4.0","modified":"2026-02-03T19:03:44.212Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-21862","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-21862","licence":"Public domain","modified":"2026-06-17T10:19:02.963Z"}],"updatedAt":"2026-11-25T22:59:13.404Z","epss":{"score":0.00251,"percentile":0.17674,"date":"2026-12-01T12:00:22.000Z"}}