vulnerability / NVI-00016440 / Revision 2
Decimal: Unbounded exponent in `Decimal.new` enables unauthenticated DoS
GitHub lists this reviewed advisory for decimal. Published version ranges and source prerequisites are shown below; this is not an inspection of a visitor’s application.
This report has not inspected your inventory, configuration, deployed build, reachability or evidence. A catalog listing and a severity score do not establish exposure or compromise.
01 / Meaning
Why it matters
Published affected context helps an owner decide what evidence to gather. This report has not examined your application.
6.9 MEDIUM (4.0)
6b3ad84c-e1a6-4bf7-a703-f496b71e49db severity; no combined Null risk score.
02 / Applicability
The affected context
Affected versions, configuration prerequisites and known exclusions are public. Confirm each one against the deployed service.
decimal
source listed>= 0.1.0, < 3.0.0
Summary `decimal` doesn't bound the exponent on parsed input, so something like `"1e10000000"` is parsed fine but then explodes the memory to more than 7GB if you run e.g. `Decimal.add(Decimal.parse("1e10000000"), 1)` because for positive `exp`, the function tail-recurses with `coef * 10` and `exp - 1` per iteration, growing the bignum coefficient by one digit each step. In the worst case, one request is enough to OOM the BEAM. ### Details `Decimal.new/parse/cast` happily store huge exponents. After that, a bunch of core paths allocate proportional to `exp`: - `add/sub/div` go through `add_align`, which calls `pow10(exp1 - exp2)` and builds a giant bignum (lib/decimal.ex:1734-1738, 1827). - `to_string/2` with `:normal` (also `:xsd` and the `String.Chars` impl) does `:lists.duplicate(exp, ?0)` (lib/decimal.ex:1506, 1513). - `to_integer/1` recurses `coef * 10`, `exp - 1` once per unit of `exp` (lib/decimal.ex:1603-1605). - `round/3` does the same `:lists.duplicate` trick on the exp difference (lib/decimal.ex:1850, 1874). - `compare/3` with a threshold argument loops back into `add`/`sub`, so it's vulnerable too (lib/decimal.ex:331-332). ### PoC Any of these will hang or OOM the BEA
03 / Response
What to do next
- investigate
Identify the exact component and deployed version, examine the linked publisher’s conditions, and retain evidence of any mitigation.
Confirm current vendor support, compatibility and deployment evidence. This report has not tested a fix in your system. NIST National Vulnerability Database
A fixed release is not deployment evidence.
Check current vendor support and compatibility. After making a change, verify the deployed build and relevant runtime conditions. Keep the evidence, owner and time. An updated lockfile alone does not prove what is running.
04 / Limits
What this report cannot establish
- Customer inventory, deployment, reachability and exploitation have not been inspected.
- NVD lastModified does not establish freshness of every associated CPE record.
05 / Provenance
Sources you can inspect
Each assertion retains its source. Mirrored records may repeat one underlying publisher; additional links are not independent corroboration.
- GHSA-rhv4-8758-jx7v ↗
GitHub Advisory Database · vendor advisory
Observed . GitHub Advisory Database; CC-BY-4.0. Each advisory links its original attribution. Null normalizes fields.
- CVE-2026-32686 ↗
NIST National Vulnerability Database · official catalog
Observed . This product uses data from the NVD API but is not endorsed or certified by the NVD.
Public revision history
Only published revisions appear here. Routine fetches do not create a material-change event.
- Revision 2 ·
Source facts changed; compare the preserved prior revision.
- Revision 1 ·
First indexed by Null; source disclosure date is shown separately.