{"id":"HSEC-2024-0006","summary":"fromIntegral: conversion error","details":"# `fromIntegral`: conversion error\n\n`fromIntegral` may result in coercion errors when used with optimization flags `-O1` or `-O2`\nin the following situation:\n\n- Converting negative `Int` to `Natural` does not throw an arithmetic underflow error\n- Converting large `Integer` greater than 2^64 to `Natural` overflow.\n\nFor the most part, these errors in and of themselves result only in availability and data integrity issues.\nHowever, in some circumstances, they may result in other, more complicated security related flaws, such as buffer overflow conditions.\n","modified":"2025-11-14T18:15:08.348129Z","published":"2025-11-14T14:45:34Z","database_specific":{"repository":"https://github.com/haskell/security-advisories","home":"https://github.com/haskell/security-advisories","osvs":"https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export"},"references":[{"type":"REPORT","url":"https://gitlab.haskell.org/ghc/ghc/-/issues/19345"},{"type":"REPORT","url":"https://gitlab.haskell.org/ghc/ghc/-/issues/20066"},{"type":"FIX","url":"https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4980"},{"type":"FIX","url":"https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6109"}],"affected":[{"package":{"name":"base","ecosystem":"Hackage","purl":"pkg:hackage/base"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.15.0.0"},{"fixed":"4.15.1.0"}]}],"versions":["4.15.0.0"],"database_specific":{"osv":"https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export/2024/HSEC-2024-0006.json","source":"https://github.com/haskell/security-advisories/blob/generated/osv-export/2024/HSEC-2024-0006.json","human_link":"https://github.com/haskell/security-advisories/tree/main/advisories/published/2024/HSEC-2024-0006.md"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H"}]}],"schema_version":"1.7.5"}