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

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-04-08T14:23:27.000Z
- Modified: 2026-11-28T12:15:02.760Z

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

(As written by Haskell Security Advisories.)

## Affected

- Cabal (Hackage): from 2.2 before 3.18.1.0

## References

- <https://github.com/haskell/cabal/issues/11176> (report)
- <https://github.com/haskell/cabal/pull/11733> (fix)
- <https://github.com/haskell/cabal/commit/3a9830bbdabef2f1009a69957966b778c7c1a9ee> (introduced)

## Sources

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

---

Page: https://cve.day/HSEC-2026-0006 · Whole record: https://cve.day/HSEC-2026-0006.json · Rebuilt by cve.day 2026-11-28T12:27:25.658Z
