Impact
The httpc client in Erlang/OTP inets forwards the Authorization and proxy-authorization request headers to redirect targets without checking whether the redirect crosses an origin boundary. The redirect handler in httpc_response.erl constructs the new request by updating only the host field of the header record. All other fields (including authorization and proxy_authorization) are copied verbatim from the original request. The redirect target host is never compared against the original host to decide whether credentials should be stripped.
autoredirect defaults to true, so this affects all httpc callers that do not explicitly disable automatic redirects.
An attacker who controls a server that the victim contacts via httpc can issue a cross-origin redirect (301, 302, 303, 307, or 308) to a server they also control. The Authorization header sent by the victim (including Basic credentials derived from URL userinfo via httpc_request:handle_user_info/2) is forwarded to the redirect target, allowing credential theft.
The same applies to the proxy-authorization header.
Workarounds
- Set
{autoredirect, false} in the httpc:request/4 options and handle redirects manually, stripping the Authorization header when the redirect crosses an origin boundary.
- Ensure that
httpc is only used to contact trusted servers that will not issue cross-origin redirects.
Affected/Unaffected Versions
A version larger than or equal to one of the listed patched versions is unaffected; otherwise, a version that satisfies an expression listed under affected versions is affected, and if it does not, it is unaffected.
The documentation of the OTP version scheme describes how versions should be compared. Note that versions used prior to OTP 17.0, when the new OTP version scheme was introduced, are never listed since it is not well defined how to compare those versions.
In the case of this vulnerability, versions prior to OTP 17.0 are also affected.
Credits
Thanks to Jonatan Männchen for finding and responsibly disclosing this vulnerability to the Erlang/OTP project.
Impact
The
httpcclient in Erlang/OTPinetsforwards theAuthorizationandproxy-authorizationrequest headers to redirect targets without checking whether the redirect crosses an origin boundary. The redirect handler inhttpc_response.erlconstructs the new request by updating only thehostfield of the header record. All other fields (includingauthorizationandproxy_authorization) are copied verbatim from the original request. The redirect target host is never compared against the original host to decide whether credentials should be stripped.autoredirectdefaults totrue, so this affects allhttpccallers that do not explicitly disable automatic redirects.An attacker who controls a server that the victim contacts via
httpccan issue a cross-origin redirect (301, 302, 303, 307, or 308) to a server they also control. TheAuthorizationheader sent by the victim (including Basic credentials derived from URL userinfo viahttpc_request:handle_user_info/2) is forwarded to the redirect target, allowing credential theft.The same applies to the
proxy-authorizationheader.Workarounds
{autoredirect, false}in thehttpc:request/4options and handle redirects manually, stripping theAuthorizationheader when the redirect crosses an origin boundary.httpcis only used to contact trusted servers that will not issue cross-origin redirects.Affected/Unaffected Versions
A version larger than or equal to one of the listed patched versions is unaffected; otherwise, a version that satisfies an expression listed under affected versions is affected, and if it does not, it is unaffected.
The documentation of the OTP version scheme describes how versions should be compared. Note that versions used prior to OTP 17.0, when the new OTP version scheme was introduced, are never listed since it is not well defined how to compare those versions.
In the case of this vulnerability, versions prior to OTP 17.0 are also affected.
Credits
Thanks to Jonatan Männchen for finding and responsibly disclosing this vulnerability to the Erlang/OTP project.