Am I affected?

type your safeurl version to check

Description

Time-of-check Time-of-use (TOCTOU) Race Condition in Slab safeurl allows an attacker who controls a hostname's DNS responses to reach internal network destinations that validation rejected.

Validation returns a verdict and not the address it approved, so the HTTP clients the library ships receive the original hostname and resolve it a second time when the request is made. An attacker who controls the authoritative DNS for a name can answer the first lookup with a permitted address and the second with a blocked one, and the request then reaches a destination validation never approved. The same window opens without an attacker whenever a name legitimately resolves to different addresses across lookups, such as short record lifetimes or rotation between several addresses.

This issue affects safeurl: from 0.1.0 onward.

Weaknesses & attack patterns

Weakness

CWE-367 · Time-of-check Time-of-use (TOCTOU) Race Condition in catalog → MITRE ↗

Attack patterns

CAPEC-664 · Server Side Request Forgery MITRE ↗

Affected — Hex / safeurl Hex.pm ↗ Repository ↗

0.1.0 and up affected
every other version: unaffected
cpe cpe:2.3:a:slab:safeurl:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.SafeURL' · 'Elixir.SafeURL.HTTPoison' · 'Elixir.SafeURL.TeslaMiddleware'
source files lib/safeurl/safeurl.ex · lib/safeurl/httpoison.ex · lib/safeurl/tesla_middleware.ex
routines 'Elixir.SafeURL':validate/2 · 'Elixir.SafeURL.HTTPoison':get/3 · 'Elixir.SafeURL.TeslaMiddleware':call/3

Affected — GitHub / slab/safeurl-elixir Repository ↗

feabbd0 and up affected
every other version: unaffected
cpe cpe:2.3:a:slab:safeurl:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.SafeURL' · 'Elixir.SafeURL.HTTPoison' · 'Elixir.SafeURL.TeslaMiddleware'
source files lib/safeurl/safeurl.ex · lib/safeurl/httpoison.ex · lib/safeurl/tesla_middleware.ex
routines 'Elixir.SafeURL':validate/2 · 'Elixir.SafeURL.HTTPoison':get/3 · 'Elixir.SafeURL.TeslaMiddleware':call/3

References

Credits

Jonatan Männchen / EEF Reporter Coordinator

CVSS breakdown

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