Am I affected?

type your ash version to check

Description

Uncontrolled Resource Consumption vulnerability in ash-project ash allows an attacker to force an expensive regular expression to run on input that a length constraint should have already rejected.

Ash.Type.String.apply_constraints/2 (lib/ash/type/string.ex) evaluated the :match regex regardless of the min_length and max_length constraints on the same attribute. Because the length check did not gate the regex, an over-length value that the length constraint rejects still had the pattern applied to it, so the length limit that would otherwise bound the work never constrained the regex input. Against a backtracking pattern this yields catastrophic regex evaluation on attacker-sized input, and even a linear pattern runs on arbitrarily large input, consuming CPU per request. The fix skips the :match regex whenever a length constraint is violated, making the two checks order-independent.

This issue affects ash: from 0.10.0 before 3.32.2.

Weaknesses & attack patterns

Weakness

CWE-400 · Uncontrolled Resource Consumption in catalog → MITRE ↗

Attack patterns

CAPEC-492 · Regular Expression Exponential Blowup MITRE ↗

Affected — Hex / ash Hex.pm ↗ Repository ↗

0.10.0 < 3.32.2 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Ash.Type.String'
source files lib/ash/type/string.ex
routines 'Elixir.Ash.Type.String':apply_constraints/2

Affected — GitHub / ash-project/ash Repository ↗

05848d5 < 1492841 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Ash.Type.String'
source files lib/ash/type/string.ex
routines 'Elixir.Ash.Type.String':apply_constraints/2

References

Credits

Jonatan Männchen / EEF Coordinator
Zach Daniel / Ash Project Remediation developer
Peter Ullrich Reporter Finder

CVSS breakdown

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