{"id":"HSEC-2026-0006","aliases":["HSEC-2026-0006"],"related":[],"kind":"vulnerability","state":"published","title":"Cabal deletes project source files during configure","summary":"# Cabal deletes project source files during configure\n\nThe `checkDuplicateHeaders` function in `Distribution.Simple.Configure` removes\nheader files from the source directory when a header with the same name exists in\nboth the build directory and the source directory.\n\nThis behavior was introduced in commit `3a9830b` to resolve header precedence\nissues, as C compilers prefer relative includes over `-I` search paths. The\nworkaround uses `removeFile` on source directory files, which is destructive and\nshould not happen during a build process.\n\nWhile the current implementation does not follow symlinks explicitly, the\ndeletion of source files outside of the project  during a build operation is\npossible on Microsoft Windows.","summaryFormat":"markdown","summarySource":"hsec","descriptions":[{"lang":"en","text":"# Cabal deletes project source files during configure\n\nThe `checkDuplicateHeaders` function in `Distribution.Simple.Configure` removes\nheader files from the source directory when a header with the same name exists in\nboth the build directory and the source directory.\n\nThis behavior was introduced in commit `3a9830b` to resolve header precedence\nissues, as C compilers prefer relative includes over `-I` search paths. The\nworkaround uses `removeFile` on source directory files, which is destructive and\nshould not happen during a build process.\n\nWhile the current implementation does not follow symlinks explicitly, the\ndeletion of source files outside of the project  during a build operation is\npossible on Microsoft Windows.","format":"markdown","source":"hsec"}],"published":"2026-04-08T14:23:27.000Z","modified":"2026-11-28T12:15:02.760Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"ecosystem","introduced":"2.2","status":"affected","fixed":"3.18.1.0"}],"ecosystem":"Hackage","package":"Cabal","purl":"pkg:hackage/Cabal","source":"hsec"}],"references":[{"url":"https://github.com/haskell/cabal/issues/11176","tags":["report"],"sources":["hsec"]},{"url":"https://github.com/haskell/cabal/pull/11733","tags":["fix"],"sources":["hsec"]},{"url":"https://github.com/haskell/cabal/commit/3a9830bbdabef2f1009a69957966b778c7c1a9ee","tags":["introduced"],"sources":["hsec"]}],"credits":[],"sources":[{"source":"hsec","name":"Haskell Security Advisories","id":"HSEC-2026-0006","url":"https://osv.dev/vulnerability/HSEC-2026-0006","licence":"CC0-1.0","modified":"2026-11-28T12:15:02.760Z"}],"updatedAt":"2026-11-28T12:27:25.658Z"}