Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS0zcjNnLWc3M3gtZzU5M80Wgg

coreos-installer improperly verifies GPG signature when decompressing gzipped artifact

Impact

coreos-installer fails to correctly verify GPG signatures when decompressing gzip-compressed artifacts. This allows bypass of signature verification in cases where coreos-installer decompresses a downloaded OS image, allowing an attacker who can modify the OS image to compromise a newly-installed system.

Default installations from ISO or PXE media in Fedora CoreOS, RHEL CoreOS, and RHEL for Edge are not affected, as coreos-installer installs from an OS image shipped as part of the install media.

These flows are affected:

  1. Installing with --image-file, --image-url, or coreos.inst.image_url. For example, if a user has a local mirror of installation images, an attacker could replace an image with a gzip-compressed alternative (even if the file extension is .xz). The result:

    $ coreos-installer install --image-url http://localhost:8080/image.xz /dev/loop0
    Downloading image from http://localhost:8080/image.xz
    Downloading signature from http://localhost:8080/image.xz.sig
    > Read disk 749.9 MiB/749.9 MiB (100%)
    gpg: Signature made Mon 20 Sep 2021 02:41:50 PM EDT
    gpg: using RSA key 8C5BA6990BDB26E19F2A1A801161AE6945719A39
    gpg: BAD signature from "Fedora (34) <[email protected]>" [ultimate]
    Install complete.
    

    Notice that GPG reports a bad signature, but coreos-installer continues anyway. Automation that relies on coreos-installer's exit status will not notice either.

  2. coreos-installer download --decompress --image-url:

    $ coreos-installer download --decompress --image-url http://localhost:8080/image.xz
    > Read disk 749.9 MiB/749.9 MiB (100%)
    gpg: Signature made Mon 20 Sep 2021 02:41:50 PM EDT
    gpg: using RSA key 8C5BA6990BDB26E19F2A1A801161AE6945719A39
    gpg: BAD signature from "Fedora (34) <[email protected]>" [ultimate]
    ./image
    

    Again, coreos-installer reports success.

  3. Installing with default parameters, when not installing from the image built into live ISO or PXE media, if the hosting service is compromised or if an active attacker gains control of the HTTPS response.

  4. coreos-installer download --decompress if the hosting service is compromised or if an active attacker gains control of the HTTPS response.

Patches

The vulnerability is fixed in coreos-installer 0.10.1.

Workarounds

For coreos-installer download, do not use the -d or --decompress options.

For coreos-installer install, manually inspect the stderr output. If BAD signature appears, do not boot from the target disk. Note, however, that some OS services may have already accessed data on the compromised disk.

References

For more information, see PR 655.

For more information

If you have any questions or comments about this advisory, open an issue in coreos-installer or email the CoreOS development mailing list.

Permalink: https://github.com/advisories/GHSA-3r3g-g73x-g593
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0zcjNnLWc3M3gtZzU5M80Wgg
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: over 2 years ago
Updated: over 1 year ago


CVSS Score: 7.8
CVSS vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Identifiers: GHSA-3r3g-g73x-g593, CVE-2021-20319
References: Repository: https://github.com/coreos/coreos-installer
Blast Radius: 0.0

Affected Packages

cargo:coreos-installer
Dependent packages: 0
Dependent repositories: 1
Downloads: 18,619 total
Affected Version Ranges: < 0.10.1
Fixed in: 0.10.1
All affected versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.9.0, 0.9.1, 0.10.0
All unaffected versions: 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.15.0, 0.16.0, 0.16.1, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0