Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crouton's debootstrap call does not verify the packages it installs #2362

Closed
eighthave opened this issue Jan 11, 2016 · 7 comments
Closed

crouton's debootstrap call does not verify the packages it installs #2362

eighthave opened this issue Jan 11, 2016 · 7 comments

Comments

@eighthave
Copy link

Since no keyring is provided and no gpgv binary present, crouton's invokation of debootstrap does not verify any of the packages that it downloads via plain text HTTP. That means that anyone with access to the network traffic can easily root the new crouton install. For example, if an attacker exploits a home router, which is easy to do these days, then that attacker can feed any file they want to when crouton's debootstrap's HTTP requests, and debootstrap will just install it. Additionally, debootstrap runs as root, so that attacker can also gain root by feeding bad packages to that HTTP connection.

Luckily, the fix is well documented and not too hard: download a gpgv binary and keyring from Debian over HTTPS, and point debootstrap to them. But as I said before #2067, I'm not going to sign this CLA, so I'm making a HOWTO for someone else to write the code, instead of a pull request.

get the keyring

building gpgv options

Then gpgv needs to be in the path, and debootstrap can be run like this, similar to how I did it in Lil' Debi:

PATH="$newpath" DEBOOTSTRAP_DIR="$tmp" $FAKEROOT \
    "$tmp/debootstrap" --foreign --arch="$ARCH" --keyring=$KEYRING \
    "$RELEASE" "$tmp/$subdir" "$MIRROR" 1>&2
@dnschneid
Copy link
Owner

Thanks for the tips. I'll merge #2103 into here.

@sunnyps
Copy link

sunnyps commented Nov 6, 2016

I thought I would work around this by specifying an https mirror with -m, e.g. mirrors.kernel.org/debian. However, that doesn't have any effect on where the debootstrap is downloaded from.

@eighthave
Copy link
Author

eighthave commented Nov 6, 2016 via email

@eighthave
Copy link
Author

gpgv-static is now built as part of Debian: https://packages.debian.org/gpgv-static making this quite easy to achieve now:

  1. download from HTTPS debian mirror like https://mirrors.kernel.org: debootstrap debian-archive-keyring gpgv-static
  2. unpack debian-archive-keyring and gpgv-static and put the files where debootstrap can find them
  3. set --keyring= when calling debootstrap.

@dnschneid
Copy link
Owner

Thanks for the walkthrough, and for doing the evangelizing on the Debian side of things.

@anakimluke
Copy link

Please, correct me if I'm wrong, but shouldn't this be marked as kind of a priority?

@dnschneid
Copy link
Owner

Looks like debootstrap now automatically falls back on HTTPS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants