Vulnerabilities in pkg:pypi/definitions

PACKAGE
Advisory Identifier: GHSA-v4x4-98cg-wr4g
Advisory Summary

CVE-2018-20325 is a HIGH (CVSS 9.8) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Definitions libraries in the PyPI ecosystem. The issue involves code injection in danijar definitions. Remediation is available in the latest vendor maintenance releases.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/definitions

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/definitions. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-v4x4-98cg-wr4g CVE-2018-20325 HIGH Code injection in Danijar Definitions

CVE-2018-20325 at a Glance

CVE Identifier CVE-2018-20325
GHSA Identifier GHSA-v4x4-98cg-wr4g
Severity HIGH
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Definitions
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.0/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-2018-20325

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

definitions fixed: Latest secure release
pip install definitions>=Latest secure release
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 definitions

How to Check if You Are Affected

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

pip show definitions

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Definitions, 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

There is a vulnerability in `load()` method in definitions/parser.py in the Danijar Hafner definitions package for Python. It can execute arbitrary python commands resulting in command execution.

CVE-2018-20325 Affected Definitions Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
definitions
PyPI
≤ 0.2.0

References

Frequently Asked Questions

What is CVE-2018-20325?
CVE-2018-20325 is a security vulnerability in Definitions involving Code injection in Danijar Definitions under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Definitions versions are affected?
Affected versions include releases prior to current release patches across affected packages: definitions.
What version fixes CVE-2018-20325?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is definitions affected?
Yes, definitions is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2018-20325?
CVE-2018-20325 has a CVSS v3.1 base score of 9.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-20325?
CVE-2018-20325 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check PyPI dependencies for CVE-2018-20325?
Run the dependency tree command: 'pip show definitions'. 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-v4x4-98cg-wr4g",
  "modified" : "2024-09-13T20:11:10Z",
  "published" : "2018-12-26T17:45:19Z",
  "aliases" : [ "CVE-2018-20325" ],
  "summary" : "Code injection in Danijar Definitions",
  "details" : "There is a vulnerability in `load()` method in definitions/parser.py in the Danijar Hafner definitions package for Python. It can execute arbitrary python commands resulting in command execution.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/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" : "definitions"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-20325"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/danijar/definitions/issues/14"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-v4x4-98cg-wr4g"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/danijar/definitions"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/definitions/PYSEC-2018-82.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:56:38Z",
    "nvd_published_at" : null
  }
}