Am I affected?

type your hackney version to check

Description

Interpretation Conflict vulnerability in benoitc hackney allows Server Side Request Forgery.

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.

This issue affects hackney: from 0.13.0 before 4.0.1.

Weaknesses & attack patterns

Weakness

CWE-436 · Interpretation Conflict in catalog → MITRE ↗
CWE-918 · Server-Side Request Forgery in catalog → MITRE ↗

Attack patterns

CAPEC-664 · Server Side Request Forgery MITRE ↗

Affected — Hex / hackney Hex.pm ↗ Repository ↗

≥ 0.13.0 < 4.0.1 affected
every other version: unaffected
cpe cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*
version type semver
modules · source files · routines
modules hackney_url
source files src/hackney_url.erl · src/http/hackney_url.erl · src/hackney_lib/hackney_url.erl
routines hackney_url:normalize/2 · hackney_url:normalize/1

Affected — GitHub / benoitc/hackney Repository ↗

≥ 4d72550 < 452620a affected
every other version: unaffected
cpe cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules hackney_url
source files src/hackney_url.erl · src/http/hackney_url.erl · src/hackney_lib/hackney_url.erl
routines hackney_url:normalize/2 · hackney_url:normalize/1

References

Credits

Ganbagana Finder
Jonatan Männchen / EEF Analyst
Benoit Chesneau Remediation developer

CVSS breakdown

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

Exploitability

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None

Vulnerable System

Confidentiality
High
Integrity
None
Availability
None

Subsequent Systems

Confidentiality
High
Integrity
None
Availability
None
« All CVEs