{"id":"CVE-2026-113440","revision":"e4b717d597574aa4bbdebdbf1ebf9468","records":[{"revision":"e4b717d597574aa4bbdebdbf1ebf9468","observedAt":"2026-10-26T15:35:30.984+00:00","statement":{"source":"cve-program","id":"CVE-2026-113440","aliases":[],"title":"HTTP/1.1 and HTTP/2 redirects resend basic_auth and cookie to a different scheme or port in hackney","description":"Insufficiently Protected Credentials vulnerability in hackney in benoitc hackney allows a redirecting server to obtain the basic_auth and cookie credentials of a request via a same-host redirect to another scheme or port. With follow_redirect enabled, hackney:follow_redirect/10 in src/hackney.erl reissues the request to the Location target after hackney:maybe_strip_auth_on_redirect/3, which compared only the hostname of the current and the redirect URL. A redirect from https to http on the same host resent the Authorization and Cookie headers in cleartext, where an on-path attacker can read them, and a redirect to another port on the same host handed them to a different service. location_trusted forwards credentials to any target by design and is unchanged.\n\nThis issue affects hackney: from 2.0.0 before 4.9.0.","state":0,"publishedAt":"2026-10-26T13:49:17.377+00:00","modifiedAt":"2026-10-26T13:49:17.377+00:00","affected":[{"ecosystem":"https://repo.hex.pm","name":"hackney","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"collectionURL\": \"https://repo.hex.pm\",\n                    \"cpes\": [\n                        \"cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*\"\n                    ],\n                    \"defaultStatus\": \"unaffected\",\n                    \"modules\": [\n                        \"hackney\"\n                    ],\n                    \"packageName\": \"hackney\",\n                    \"packageURL\": \"pkg:hex/hackney\",\n                    \"product\": \"hackney\",\n                    \"programFiles\": [\n                        \"src/hackney.erl\"\n                    ],\n                    \"programRoutines\": [\n                        {\n                            \"name\": \"hackney:request/5\"\n                        },\n                        {\n                            \"name\": \"hackney:follow_redirect/10\"\n                        },\n                        {\n                            \"name\": \"hackney:maybe_strip_auth_on_redirect/3\"\n                        }\n                    ],\n                    \"repo\": \"https://github.com/benoitc/hackney\",\n                    \"vendor\": \"benoitc\",\n                    \"versions\": [\n                        {\n                            \"lessThan\": \"4.9.0\",\n                            \"status\": \"affected\",\n                            \"version\": \"2.0.0\",\n                            \"versionType\": \"semver\"\n                        }\n                    ]\n                }"},{"ecosystem":"https://github.com","name":"benoitc/hackney","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"collectionURL\": \"https://github.com\",\n                    \"cpes\": [\n                        \"cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*\"\n                    ],\n                    \"defaultStatus\": \"unaffected\",\n                    \"modules\": [\n                        \"hackney\"\n                    ],\n                    \"packageName\": \"benoitc/hackney\",\n                    \"packageURL\": \"pkg:github/benoitc/hackney\",\n                    \"product\": \"hackney\",\n                    \"programFiles\": [\n                        \"src/hackney.erl\"\n                    ],\n                    \"programRoutines\": [\n                        {\n                            \"name\": \"hackney:request/5\"\n                        },\n                        {\n                            \"name\": \"hackney:follow_redirect/10\"\n                        },\n                        {\n                            \"name\": \"hackney:maybe_strip_auth_on_redirect/3\"\n                        }\n                    ],\n                    \"repo\": \"https://github.com/benoitc/hackney\",\n                    \"vendor\": \"benoitc\",\n                    \"versions\": [\n                        {\n                            \"lessThan\": \"6548384b22ea196023a1963e2967d5715b6d9564\",\n                            \"status\": \"affected\",\n                            \"version\": \"8f944559bdb83da60b5c06f6cf6d842591278364\",\n                            \"versionType\": \"git\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6,"severity":"MEDIUM"}],"references":["https://github.com/benoitc/hackney/pull/979","https://cna.erlef.org/cves/CVE-2026-113440.html","https://osv.dev/vulnerability/EEF-CVE-2026-113440","https://github.com/benoitc/hackney/releases/tag/4.9.0","https://github.com/benoitc/hackney/commit/8f944559bdb83da60b5c06f6cf6d842591278364","https://github.com/benoitc/hackney/commit/6548384b22ea196023a1963e2967d5715b6d9564"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-113440","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-113440","identifiers":["CVE-2026-113440"]},"retained":false,"historicalAffected":[]}],"coverage":[]}