HSEC-2025-0005

See a problem?
Import Source
https://github.com/haskell/security-advisories/blob/generated/osv-export/2025/HSEC-2025-0005.json
JSON Data
https://api.osv.dev/v1/vulns/HSEC-2025-0005
Published
2025-07-13T13:03:59Z
Modified
2025-07-13T13:13:16.279715Z
Summary
cabal-install dependency confusion
Details

cabal-install dependency confusion

For cabal-install < 3.4.0.0 and where multiple repositories are configured, the resolver picks the highest available version across all repositories. Where a package is only defined in a private repository, this behaviour leads to a dependency confusion supply chain vulnerability. If the private package name becomes known, a malicious actor can claim the name in the public repository and publish a malicious version at a higher version number.

Default cabal-install configurations that only use the hackage.haskell.org repository are not affected. Configurations that use curated private repositories exclusively are also not affected.

Mitigations

cabal-install version 3.4.0.0 and higher provide an override option in the repository configuration. It marks the associated repository as canonical for all packages defined in that repository. No other repositories will be considered. For example:

-- For packages in repo.example.com,
-- only versions in repo.example.com are considered
active-repositories:
  , hackage.haskell.org
  , repo.example.com:override

Users and organisations using private repositories that contain private packages in addition to public repositories MUST use the override option to prevent dependency confusion attacks.

Alternatively, projects and organisations can run a private instance of hackage-server and carefully curate and review its contents. Using that instance exclusively defeats supply chain attacks including dependency confusion. For cabal-install < 3.4 and where using multiple repositories, this is the only effective mitigation against dependency confusion attacks.

References

Affected packages

Hackage / cabal-install

Package

Name
cabal-install
Purl
pkg:hackage/cabal-install

Severity

  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N CVSS Calculator

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.0.0.0
Fixed
3.4.0.0

Affected versions

1.*

1.16.0
1.16.0.1
1.16.0.2
1.16.1.0
1.18.0
1.18.0.1
1.18.0.2
1.18.0.3
1.18.0.4
1.18.0.5
1.18.0.6
1.18.0.7
1.18.0.8
1.18.1.0
1.18.2.0
1.20.0.0
1.20.0.1
1.20.0.2
1.20.0.3
1.20.0.4
1.20.0.5
1.20.0.6
1.20.1.0
1.20.2.0
1.22.0.0
1.22.0.1
1.22.2.0
1.22.3.0
1.22.4.0
1.22.5.0
1.22.6.0
1.22.7.0
1.22.8.0
1.22.9.0
1.24.0.0
1.24.0.1
1.24.0.2

2.*

2.0.0.0
2.0.0.1
2.2.0.0
2.4.0.0
2.4.1.0

3.*

3.0.0.0
3.2.0.0