Am I affected?

type your tesla version to check

Description

Improper Handling of Case Sensitivity vulnerability in elixir-tesla tesla allows credential leakage to a third-party origin on cross-origin redirects.

Tesla.Middleware.FollowRedirects strips security-sensitive headers on cross-origin redirects using a case-sensitive string comparison against a lowercase filter list (@filter_headers ["authorization", "host"]). HTTP header names are case-insensitive per RFC 7230, but Tesla preserves header keys verbatim as supplied by the caller without normalizing case. A header set as {"Authorization", "Bearer …"} (the RFC 7235 canonical casing used by virtually all HTTP libraries and documentation) does not match the lowercase filter entry and is forwarded to the redirect destination. An attacker who can control or influence a Location: response seen by the client (via their own endpoint, a redirect-open upstream, or a compromised origin) receives the bearer token or other Authorization material on the cross-origin request.

This issue affects tesla: from 1.4.0 before 1.18.3.

Weaknesses & attack patterns

Weakness

CWE-178 · Improper Handling of Case Sensitivity in catalog → MITRE ↗

Attack patterns

CAPEC-267 · Leverage Alternate Encoding MITRE ↗

Affected — Hex / tesla Hex.pm ↗ Repository ↗

1.4.0 < 1.18.3 affected
every other version: unaffected
cpe cpe:2.3:a:elixir-tesla:tesla:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Tesla.Middleware.FollowRedirects'
source files lib/tesla/middleware/follow_redirects.ex
routines 'Elixir.Tesla.Middleware.FollowRedirects':call/3

Affected — GitHub / elixir-tesla/tesla Repository ↗

2d937d5 < db963db affected
every other version: unaffected
cpe cpe:2.3:a:elixir-tesla:tesla:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Tesla.Middleware.FollowRedirects'
source files lib/tesla/middleware/follow_redirects.ex
routines 'Elixir.Tesla.Middleware.FollowRedirects':call/3

Workarounds

Normalize all header keys to lowercase before passing them to Tesla. Use "authorization" instead of "Authorization" when setting headers via Tesla.put_header/3 or Tesla.Middleware.Headers.

Configurations

The application must include Tesla.Middleware.FollowRedirects in its Tesla middleware pipeline.

References

Credits

Peter Ullrich Finder
Yordis Prieto Remediation developer
Jonatan Männchen Analyst

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
« All CVEs