CVE-2019-17109: Koji Koji Hub Allows Arbitrary Upload Vulnerability

HIGH
Advisory Identifier: GHSA-7498-c9fm-g64p
CVSS 6.5
CWE-22
Published
Advisory Summary

CVE-2019-17109 is a HIGH (CVSS 6.5) koji hub allows arbitrary upload vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Koji libraries in the PyPI ecosystem. The issue involves koji hub allows arbitrary upload destinations. Remediation is available by upgrading affected packages to version 1.14.3, 1.15.3, 1.16.3, 1.17.1, 1.18.1.

CVE-2019-17109 at a Glance

CVE Identifier CVE-2019-17109
GHSA Identifier GHSA-7498-c9fm-g64p
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Koji
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2019-17109

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

koji fixed: 1.14.3
pip install koji>=1.14.3
koji fixed: 1.15.3
pip install koji>=1.15.3
koji fixed: 1.16.3
pip install koji>=1.16.3
koji fixed: 1.17.1
pip install koji>=1.17.1
koji fixed: 1.18.1
pip install koji>=1.18.1
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 koji

How to Check if You Are Affected

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

pip show koji

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Koji, 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

The way that the hub code validates upload paths allows for an attacker to choose an arbitrary destination for the uploaded file. Uploading still requires login. However, an attacker with credentials could damage the integrity of the Koji system. ### Workaround There is no known workaround. All Koji admins are encouraged to update to a fixed version as soon as possible. ### Fix Koji versions 1.14.3, 1.15.3, 1.16.3, 1.17.1, and 1.18.1 all include patches to solve this vulnerability.

CVE-2019-17109 Affected Koji Versions

5 component(s)
Fixed Versions:
1.14.31.15.31.16.31.17.11.18.1
Product / Package Ecosystem Affected Versions Fixed Version
koji
PyPI
≥ 1.14.0
< 1.14.3
1.14.3
koji
PyPI
≥ 1.15.0
< 1.15.3
1.15.3
koji
PyPI
≥ 1.16.0
< 1.16.3
1.16.3
koji
PyPI
≥ 1.17.0
< 1.17.1
1.17.1
koji
PyPI
≥ 1.18.0
< 1.18.1
1.18.1

References

Frequently Asked Questions

What is CVE-2019-17109?
CVE-2019-17109 is a security vulnerability in Koji involving koji hub allows arbitrary upload destinations under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Koji versions are affected?
Affected versions include releases prior to 1.14.3, 1.15.3, 1.16.3, 1.17.1, 1.18.1 across affected packages: koji.
What version fixes CVE-2019-17109?
Upgrading to 1.14.3, 1.15.3, 1.16.3, 1.17.1, 1.18.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is koji affected?
Yes, koji is affected in releases prior to 1.14.3, 1.15.3, 1.16.3, 1.17.1, 1.18.1. Upgrade your dependency to 1.14.3, 1.15.3, 1.16.3, 1.17.1, 1.18.1 or later.
What is the CVSS score of CVE-2019-17109?
CVE-2019-17109 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2019-17109?
CVE-2019-17109 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2019-17109?
Run the dependency tree command: 'pip show koji'. 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-7498-c9fm-g64p",
  "modified" : "2024-09-27T18:30:23Z",
  "published" : "2022-05-24T16:58:31Z",
  "aliases" : [ "CVE-2019-17109" ],
  "summary" : "koji hub allows arbitrary upload destinations",
  "details" : "The way that the hub code validates upload paths allows for an attacker to choose an arbitrary destination for the uploaded file.\nUploading still requires login. However, an attacker with credentials could damage the integrity of the Koji system.\n\n### Workaround\nThere is no known workaround. All Koji admins are encouraged to update to a fixed version as soon as possible.\n\n### Fix\nKoji versions 1.14.3, 1.15.3, 1.16.3, 1.17.1, and 1.18.1 all include patches to solve this vulnerability.\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "koji"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.14.0"
      }, {
        "fixed" : "1.14.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "koji"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.15.0"
      }, {
        "fixed" : "1.15.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "koji"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.16.0"
      }, {
        "fixed" : "1.16.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "koji"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.17.0"
      }, {
        "fixed" : "1.17.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "koji"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.18.0"
      }, {
        "fixed" : "1.18.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-17109"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/koji-project/koji/commit/91d6f0b607c7f5af666dfb56931f1db4e38c28a5"
  }, {
    "type" : "WEB",
    "url" : "https://docs.pagure.org/koji/CVE-2019-17109"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/koji-project/koji"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/koji-project/koji/blob/d0507c4d2d2269daa984db642e3bd957dff18948/docs/source/CVEs/CVE-2019-17109.rst"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/koji/PYSEC-2019-183.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4BGUXMZIAQFFNNQ7PEFDAYQCXXKJR76U"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7PSCCFHLNVFLDPC7DB4UJGXD6ZWBSY57"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DEQYYGWLJBQQVTAC7E7XSDGVF27NPMPB"
  }, {
    "type" : "WEB",
    "url" : "https://pagure.io/koji/commits/master"
  }, {
    "type" : "WEB",
    "url" : "https://pagure.io/koji/issue/1634"
  }, {
    "type" : "WEB",
    "url" : "https://pagure.io/koji/pull-request/1686"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2019/10/09/5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-29T09:53:43Z",
    "nvd_published_at" : "2019-10-09T22:15:00Z"
  }
}