# HSEC-2024-0006: fromIntegral: conversion error

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2025-11-14T14:45:34.000Z
- Modified: 2025-11-14T18:15:08.348Z

## 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.

(As written by Haskell Security Advisories.)

## Affected

- base (Hackage): from 4.15.0.0 before 4.15.1.0

## References

- <https://gitlab.haskell.org/ghc/ghc/-/issues/19345> (report)
- <https://gitlab.haskell.org/ghc/ghc/-/issues/20066> (report)
- <https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4980> (fix)
- <https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6109> (fix)

## Sources

- Haskell Security Advisories: [HSEC-2024-0006](https://osv.dev/vulnerability/HSEC-2024-0006), CC0-1.0, modified 2025-11-14

---

Page: https://cve.day/HSEC-2024-0006 · Whole record: https://cve.day/HSEC-2024-0006.json · Rebuilt by cve.day 2026-11-25T22:56:25.648Z
