haskell / haskell/cabal

`cabal update` doesn't validate new package db

Open
#2,691 1 comment 1 reaction 0 assignees View on GitHub
cabal-install: other type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I ran into a situation where my package db was replaced with a captive portal's HTML.
After unsuccessfully logging into my hotel's wifi, I ran `cabal update`. It replaced my old package db with the file it downloaded. Unfortunately the file was just the captive portal's HTML.
Apparently no validation is done when a new package db is downloaded, to make sure that it's actually a valid package db, and from the expected source.
I would expect that cabal should not replace the package db with anything else than a new valid package db.

```
kolmodin ~ $ cabal update
Downloading the latest package list from hackage.haskell.org
cabal: data is not in tar format
kolmodin ~ $ cabal list
cabal: data is not in tar format
kolmodin ~ $ cabal --version
cabal-install version 1.22.4.0
using version 1.22.2.0 of the Cabal library
kolmodin ~ $
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.