# HSEC-2026-0006: Cabal deletes project source files during configure

> Cabal build tool deletes source header files during configuration, causing data loss and build failures for developers.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 8 Apr 2026

## What is HSEC-2026-0006?

HSEC-2026-0006 is a denial of service vulnerability in Cabal, published on 8 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

# Cabal deletes project source files during configure

The `checkDuplicateHeaders` function in `Distribution.Simple.Configure` removes
header files from the source directory when a header with the same name exists in
both the build directory and the source directory.

This behavior was introduced in commit `3a9830b` to resolve header precedence
issues, as C compilers prefer relative includes over `-I` search paths. The
workaround uses `removeFile` on source directory files, which is destructive and
should not happen during a build process.

While the current implementation does not follow symlinks explicitly, the
deletion of source files outside of the project  during a build operation is
possible on Microsoft Windows.

## Which versions are affected by HSEC-2026-0006?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `Cabal` | Hackage | From 2.2 | None |

## How do I fix HSEC-2026-0006?

No fix has been published for HSEC-2026-0006 yet. Limit exposure of the affected software until one is available.

## Is HSEC-2026-0006 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for HSEC-2026-0006 and fix it if it is affected.

What it is: HSEC-2026-0006 is a denial of service vulnerability in Cabal, published on 8 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of HSEC-2026-0006 in the wild and no public exploit code.

Affected packages and fixed versions:
- Cabal (Hackage): affected from 2.2; no fix listed

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-2026-0006/ (Markdown: https://insights.sbomify.com/HSEC-2026-0006/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/HSEC-2026-0006

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