# HSEC-2025-0001: Subword division operations may produce incorrect results

> The GHC compiler may generate incorrect subword division results with optimizations, potentially causing data integrity issues or buffer overflows.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Nov 2025

## What is HSEC-2025-0001?

HSEC-2025-0001 is a vulnerability in ghc, published on 14 Nov 2025. 

### Official description

# Subword division operations may produce incorrect results

Arithmetic operations may produce incorrect results when compiled with optimizations.
For the most part, this bug only causes availability and data integrity issues.
However, in some circumstances, it may result in other, more complicated security related flaws, such as buffer overflow conditions.

## Which versions are affected by HSEC-2025-0001?

1 open source package ship an affected version, including ghc.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ghc` | GHC | From 9.12.1 | 9.12.2, 9.12.4 |

## How do I fix HSEC-2025-0001?

Upgrade ghc to a fixed version for your release line: 9.12.2 or 9.12.4.

## Is HSEC-2025-0001 being exploited?

There is no known exploitation of HSEC-2025-0001 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for HSEC-2025-0001 and fix it if it is affected.

What it is: HSEC-2025-0001 is a vulnerability in ghc, published on 14 Nov 2025. 
Exploitation: There is no known exploitation of HSEC-2025-0001 in the wild and no public exploit code.

Affected packages and fixed versions:
- ghc (GHC): affected from 9.12.1; fixed in 9.12.2, 9.12.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/HSEC-2025-0001/ (Markdown: https://insights.sbomify.com/HSEC-2025-0001/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/HSEC-2025-0001

---
From sbomify Insights: https://insights.sbomify.com/HSEC-2025-0001/
Summaries are generated and may contain mistakes; the official description above is the record.
