Skip to content
OpenAdvisories
Unscored HSEC-2024-0006

fromIntegral: conversion error

Published Nov 14, 2025 · Updated Nov 14, 2025 · Assigned by HSEC

Description

# `fromIntegral`: conversion error

`fromIntegral` may result in coercion errors when used with optimization flags `-O1` or `-O2`
in the following situation:

- Converting negative `Int` to `Natural` does not throw an arithmetic underflow error
- Converting large `Integer` greater than 2^64 to `Natural` overflow.

For the most part, these errors in and of themselves result only in availability and data integrity issues.
However, in some circumstances, they may result in other, more complicated security related flaws, such as buffer overflow conditions.

Affected packages

EcosystemPackageAffectedFixedRecord
Hackage base >= 4.15.0.0, < 4.15.1.0 4.15.1.0 HSEC-2024-0006

References