CVE-2016-20021: Portage Gentoo Portage Missing PGP Validation Vulnerability

HIGH
Advisory Identifier: GHSA-pw5x-x5jw-ccmh
CVSS 9.8
CWE-347
Published
Advisory Summary

CVE-2016-20021 is a HIGH (CVSS 9.8) gentoo portage missing pgp validation vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Portage libraries in the PyPI ecosystem. The issue involves gentoo portage missing pgp validation of executed code. Remediation is available by upgrading affected packages to version 3.0.47.

CVE-2016-20021 at a Glance

CVE Identifier CVE-2016-20021
GHSA Identifier GHSA-pw5x-x5jw-ccmh
Severity HIGH
CVSS v3.1 Base Score 9.8
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product Portage
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2016-20021

To remediate this vulnerability, upgrade all affected Portage dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

portage fixed: 3.0.47
pip install portage>=3.0.47
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show portage

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2016-20021, inspect your installed packages using pip:

pip show portage

Analyze the terminal output to locate any version of Portage in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.47), your application is affected.

Note: The pip show portage command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Portage, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In Gentoo Portage before 3.0.47, there is missing PGP validation of executed code: the standalone emerge-webrsync downloads a .gpgsig file but does not perform signature verification.

CVE-2016-20021 Affected Portage Versions

1 component(s)
Fixed Versions:
3.0.47
Product / Package Ecosystem Affected Versions Fixed Version
portage
PyPI
< 3.0.47
3.0.47

References

Frequently Asked Questions

What is CVE-2016-20021?
CVE-2016-20021 is a security vulnerability in Portage involving Gentoo Portage missing PGP validation of executed code under CWE-347: Improper Verification of Cryptographic Signature.
Which Portage versions are affected?
Affected versions include releases prior to 3.0.47 across affected packages: portage.
What version fixes CVE-2016-20021?
Upgrading to 3.0.47 (or the latest patched release for your respective branch) resolves the vulnerability.
Is portage affected?
Yes, portage is affected in releases prior to 3.0.47. Upgrade your dependency to 3.0.47 or later.
What is the CVSS score of CVE-2016-20021?
CVE-2016-20021 has a CVSS v3.1 base score of 9.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2016-20021?
CVE-2016-20021 is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check PyPI dependencies for CVE-2016-20021?
Run the dependency tree command: 'pip show portage'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pw5x-x5jw-ccmh",
  "modified" : "2024-08-30T23:37:34Z",
  "published" : "2024-01-12T03:30:49Z",
  "aliases" : [ "CVE-2016-20021" ],
  "summary" : "Gentoo Portage missing PGP validation of executed code",
  "details" : "In Gentoo Portage before 3.0.47, there is missing PGP validation of executed code: the standalone emerge-webrsync downloads a .gpgsig file but does not perform signature verification.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "portage"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.47"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-20021"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gentoo/portage/commit/28cd240fb23d880b8641a058831c6762db71c3e2"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.gentoo.org/597800"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gentoo/portage"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/portage/PYSEC-2024-10.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://gitweb.gentoo.org/proj/portage.git/tree/NEWS"
  }, {
    "type" : "WEB",
    "url" : "https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b3c80502e96406b4b175e2ee79eb65f3f3cd9f6"
  }, {
    "type" : "WEB",
    "url" : "https://wiki.gentoo.org/wiki/Portage"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-30T23:37:34Z",
    "nvd_published_at" : "2024-01-12T03:15:08Z"
  }
}