GHSA-hw4g-2v3f-74x5 / CVE-2026-116678: Icon endpoint SSRF fix bypass via second-stage favicon IP literal URLs
- Published:
- Fetched:
- Updated:
- Affects:
- dani-garcia vaultwarden
https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-hw4g-2v3f-74x5 ↗
Icon endpoint SSRF fix bypass via second-stage favicon IP literal URLs # Vaultwarden icon endpoint SSRF fix bypass via second-stage icon URL IP literals ## Summary The Vaultwarden icon downloader in 1.36.0 and earlier validates the user-supplied icon host before fetching the target page and revalidates DNS answers through a custom `reqwest` DNS resolver. However, after parsing a controlled HTML page, it fetches discovered favicon URLs with `get_page_with_referer(&icon.href, ...)` without first applying `should_block_host()` to the favicon URL host. For IP-literal favicon URLs such as `http://127.0.0.1:PORT/favicon.ico`, `reqwest` does not call the configured DNS resolver, so the resolver-level `post_resolve()` IP allowlist is bypassed and Vaultwarden connects directly to loopback. This is a bypass of the fix for CVE-2026-47160 / GHSA-72vh-x5jq-m82g (patched in 1.36.0). The original decimal, hex, octal, and IPv4-mapped IPv6 host normalizations are covered, but the second-stage favicon fetch could still reach non-global IP literals. ## Root cause Line numbers refer to the code as tested, shortly after 1.36.0. Initial icon route validation: - `src/api/icons.rs:115-131` parses the route host with `get_valid_host()` and applies `should_block_host(&host)`. - `src/http_client.rs:137-160` blocks IP literal hosts that are not global. - `src/http_client.rs:241-282` uses the custom DNS resolver to run `post_resolve()` against DNS answers for domain names. Second-stage favicon fetch: - `src/api/icons.rs:249-295` parses attacker-controlled `` and joins it against the page URL. - `src/api/icons.rs:492-532` iterates discovered icon URLs and passes each `icon.href` to `get_page_with_referer()`. - `src/api/icons.rs:407-414` builds `CLIENT.get(url)` and sends it without parsing the URL host or calling `should_block_host()`. The custom DNS resolver only sees names that require DNS. A direct IP literal URL can be connected by `reqwest` without resolver invocation, so the resolver's `post_resolve()` check does not run. ## Reproduction evidence The reporter confirmed with a regression test that a loopback canary was reached through `get_page_with_referer()`. A separate reqwest probe with a custom DNS resolver that denies every lookup showed that IP-literal URLs bypass the resolver entirely: ```text url=http://127.0.0.1:40417/favicon.ico body=SSRFHIT! resolver_calls=0 canary_hits=1 ``` ## Attack flow 1. An attacker hosts an ordinary public web page on a globally routable domain that passes the initial icon host validation. 2. The HTML contains a favicon link such as: ```html ``` 3. A request to Vaultwarden's internal icon endpoint for the attacker domain causes Vaultwarden to fetch and parse that page. 4. Vaultwarden attempts to fetch the discovered favicon URL directly. 5. Because the favicon URL host is an IP literal and `get_page_with_referer()` does not prevalidate the URL, the DNS Affected packages: rust:vaultwarden Patched: vaultwarden 1.37.0