{"id":"CVE-2026-47076","aliases":["CVE-2026-47076","GHSA-pj7v-xfvx-wmjq","EEF-CVE-2026-47076"],"related":[],"kind":"vulnerability","state":"published","title":"SSRF allowlist bypass via percent-encoded host in hackney","summary":"Interpretation Conflict vulnerability in benoitc hackney allows Server Side Request Forgery.\n\nhackney_url:normalize/2 URL-decodes the host component after the URL has been parsed into a #hackney_url{} record. OTP's uri_string:parse/1 and inet:parse_address/1 do not decode percent-escapes in the host, so a URL such as http://%31%32%37%2E%30%2E%30%2E%31/ is seen by a caller's allowlist validator with host %31%32%37%2E%30%2E%30%2E%31 (not an IP address), which passes the allowlist check. hackney's normalizer then decodes the host to 127.0.0.1 and opens a TCP connection to loopback. Because hackney:request/5 always calls hackney_url:normalize/2 with no opt-out, every request that takes a binary or list URL is affected. The same technique reaches cloud instance metadata services (169.254.169.254), RFC1918 networks, and any admin interface listening on localhost.\n\nThis issue affects hackney: from 0.13.0 before 4.0.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Interpretation Conflict vulnerability in benoitc hackney allows Server Side Request Forgery.\n\nhackney_url:normalize/2 URL-decodes the host component after the URL has been parsed into a #hackney_url{} record. OTP's uri_string:parse/1 and inet:parse_address/1 do not decode percent-escapes in the host, so a URL such as http://%31%32%37%2E%30%2E%30%2E%31/ is seen by a caller's allowlist validator with host %31%32%37%2E%30%2E%30%2E%31 (not an IP address), which passes the allowlist check. hackney's normalizer then decodes the host to 127.0.0.1 and opens a TCP connection to loopback. Because hackney:request/5 always calls hackney_url:normalize/2 with no opt-out, every request that takes a binary or list URL is affected. The same technique reaches cloud instance metadata services (169.254.169.254), RFC1918 networks, and any admin interface listening on localhost.\n\nThis issue affects hackney: from 0.13.0 before 4.0.1.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`hackney_url:normalize/2` URL-decodes the host component of a parsed URL, but the caller's SSRF allowlist runs before normalization using OTP's `uri_string:parse/1` and `inet:parse_address/1`, neither of which decodes percent-escapes in hostnames. A URL like `http://%31%32%37%2E%30%2E%30%2E%31/` presents an encoded, non-IP-looking host to the validator, which passes the allowlist check; hackney's normalizer then decodes it to `127.0.0.1` and connects to loopback. Because `hackney:request/5` always calls `normalize/2` with no opt-out, every request path that accepts a binary or list URL is affected. This is a parser-differential SSRF in the same class as CVE-2025-1211, but in a different function.\n\n### Details\n\nIn `src/hackney_url.erl` (lines 161–186), `normalize/2` checks whether the parsed host is already a dotted-quad or IPv6 literal via `inet_parse:address/1`. Percent-encoded forms like `%31%32%37%2E%30%2E%30%2E%31` fail that check and fall into the catch-all branch, where `urldecode/1` decodes the host before passing it to IDNA conversion:\n\n```erlang\nHost1 = binary_to_list(\n           urldecode(unicode:characters_to_binary(Host0))\n         ),\n```\n\nThe decoded host (`\"127.0.0.1\"`) replaces the original in the returned `#hackney_url{}` record. `hackney:request/5` at `src/hackney.erl:463` always calls `normalize/2`, so the decoded host is what `do_dispatch/1` and `add_host_header/2` ultimately use. The on-wire `Host:` header and the TCP connect target both reflect the decoded value.\n\nThe same payload pattern reaches the AWS/GCP/Azure IMDS (`169.254.169.254`), RFC1918 ranges, and any `localhost` admin endpoint. The 1.21.0 patch for CVE-2025-1211 fixed a separate differential in `parse_url/1` and did not touch `normalize/2`.\n\n### PoC\n\n1. Validate the URL with the canonical Erlang SSRF allowlist: `uri_string:parse/1` returns host `<<\"%31%32%37%2E%30%2E%30%2E%31\">>`, `inet:parse_address/1` returns `{error, einval}`, so the allowlist accepts it.\n2. Pass the same URL to `hackney:get/1`.\n3. hackney's `normalize/2` decodes the host to `\"127.0.0.1\"` and connects to `127.0.0.1:80`. The internal service receives the request with `Host: 127.0.0.1`.\n\n### Impact\n\nUnauthenticated SSRF bypassing the canonical Erlang allowlist pattern. Affects hackney 0.13.0 through 4.0.0 for any application that accepts attacker-supplied URLs. Targets include cloud IMDS endpoints, `localhost` admin interfaces, and RFC1918 backends. CVSS v4.0: **6.9 (MEDIUM)**.\n\n## Resources\n\n* Introduction commit: https://github.com/benoitc/hackney/commit/4d725507588942fd00efca15b86da3273656510a\n* Patch commit: https://github.com/benoitc/hackney/commit/452620a92ec1da2e6b4862a049a2a4f04b42068f","format":"markdown","source":"ghsa"},{"lang":"en","text":"## Summary\n\nInterpretation Conflict vulnerability in benoitc hackney allows Server Side Request Forgery.\n\n`hackney_url:normalize/2` URL-decodes the host component after the URL has been parsed into a `#hackney_url{}` record. OTP's `uri_string:parse/1` and `inet:parse_address/1` do not decode percent-escapes in the host, so a URL such as `http://%31%32%37%2E%30%2E%30%2E%31/` is seen by a caller's allowlist validator with host `%31%32%37%2E%30%2E%30%2E%31` (not an IP address), which passes the allowlist check. hackney's normalizer then decodes the host to `127.0.0.1` and opens a TCP connection to loopback. Because `hackney:request/5` always calls `hackney_url:normalize/2` with no opt-out, every request that takes a binary or list URL is affected. The same technique reaches cloud instance metadata services (169.254.169.254), RFC1918 networks, and any admin interface listening on localhost.\n\nThis issue affects hackney: from 0.13.0 before 4.0.1.","format":"markdown","source":"eef"},{"lang":"es","text":"Vulnerabilidad de conflicto de interpretación en benoitc hackney permite la falsificación de solicitudes del lado del servidor. hackney_url:normalize/2 decodifica URL el componente de host después de que la URL ha sido analizada en un registro #hackney_url{}. uri_string:parse/1 e inet:parse_address/1 de OTP no decodifican los escapes de porcentaje en el host, por lo que una URL como http://%31%32%37%2E%30%2E%30%2E%31/ es vista por el validador de lista de permitidos de un llamador con el host %31%32%37%2E%30%2E%30%2E%31 (no una dirección IP), lo que pasa la verificación de la lista de permitidos. El normalizador de hackney luego decodifica el host a 127.0.0.1 y abre una conexión TCP a loopback. Debido a que hackney:request/5 siempre llama a hackney_url:normalize/2 sin opción de exclusión, cada solicitud que toma una URL binaria o de lista se ve afectada. La misma técnica alcanza los servicios de metadatos de instancias en la nube (169.254.169.254), redes RFC1918 y cualquier interfaz de administración escuchando en localhost.\n\nEste problema afecta a hackney: desde 0.13.0 antes de 4.0.1.","source":"nvd"}],"published":"2026-05-25T14:00:46.707Z","modified":"2026-11-25T17:23:12.784Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-436","CWE-918"],"affected":[{"ranges":[{"type":"semver","introduced":"0.13.0","fixed":"4.0.1","status":"affected"}],"vendor":"benoitc","product":"hackney","package":"hackney","cpe":"cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*","repo":"https://github.com/benoitc/hackney","source":"cvelist"},{"ranges":[{"type":"git","introduced":"4d725507588942fd00efca15b86da3273656510a","fixed":"452620a92ec1da2e6b4862a049a2a4f04b42068f","status":"affected"}],"vendor":"benoitc","product":"hackney","package":"benoitc/hackney","cpe":"cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*","repo":"https://github.com/benoitc/hackney","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.13.0","status":"affected","fixed":"4.0.1"}],"ecosystem":"Hex","package":"hackney","purl":"pkg:hex/hackney","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.13.0","status":"affected","fixed":"4.0.1"}],"ecosystem":"Hex","package":"hackney","purl":"pkg:hex/hackney","source":"eef"},{"ranges":[{"type":"git","introduced":"4d725507588942fd00efca15b86da3273656510a","status":"affected","fixed":"452620a92ec1da2e6b4862a049a2a4f04b42068f"}],"repo":"https://github.com/benoitc/hackney","source":"eef"},{"ranges":[{"status":"affected","introduced":"0.13.0","fixed":"4.0.1"}],"vendor":"benoitc","product":"hackney","cpe":"cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/benoitc/hackney/security/advisories/GHSA-pj7v-xfvx-wmjq","tags":["advisory","exploit","patch","related","vendor-advisory","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-47076.html","tags":["patch","related","third-party-advisory","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-47076","tags":["patch","related","third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/benoitc/hackney/commit/4d725507588942fd00efca15b86da3273656510a","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/benoitc/hackney/commit/452620a92ec1da2e6b4862a049a2a4f04b42068f","tags":["fix","patch","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47076","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/benoitc/hackney","tags":["package"],"sources":["ghsa"]},{"url":"https://hex.pm/packages/hackney","tags":["package"],"sources":["eef"]}],"credits":["Ganbagana","Jonatan Männchen / EEF","Benoit Chesneau"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-26T15:46:49.956Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47076","url":"https://www.cve.org/CVERecord?id=CVE-2026-47076","licence":"CVE Terms of Use","modified":"2026-11-20T08:20:46.841Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pj7v-xfvx-wmjq","url":"https://github.com/advisories/GHSA-pj7v-xfvx-wmjq","licence":"CC-BY-4.0","modified":"2026-06-26T22:00:10.982Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-47076","url":"https://osv.dev/vulnerability/EEF-CVE-2026-47076","licence":"CC-BY-4.0","modified":"2026-11-25T17:23:12.784Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47076","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47076","licence":"Public domain","modified":"2026-11-20T09:20:10.793Z"}],"updatedAt":"2026-11-25T22:59:22.277Z","epss":{"score":0.00207,"percentile":0.11357,"date":"2026-12-01T12:00:22.000Z"}}