Vulnerabilities in pkg:pypi/nameko

PACKAGE
Advisory Identifier: GHSA-6p52-jr3q-c94g
Advisory Summary

CVE-2021-41078 is a CRITICAL (CVSS 8.6) nameko arbitrary code execution due vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Nameko libraries in the PyPI ecosystem. The issue involves nameko arbitrary code execution due to yaml deserialization. Remediation is available by upgrading affected packages to version 2.14.0, 3.0.0rc10.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/nameko

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-6p52-jr3q-c94g CVE-2021-41078 CRITICAL Nameko Arbitrary code execution due to YAML deserialization

CVE-2021-41078 at a Glance

CVE Identifier CVE-2021-41078
GHSA Identifier GHSA-6p52-jr3q-c94g
Severity CRITICAL
CVSS v3.1 Base Score 8.6
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Nameko
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.6

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

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

How to Fix CVE-2021-41078

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

nameko fixed: 2.14.0
pip install nameko>=2.14.0
nameko fixed: 3.0.0rc10
pip install nameko>=3.0.0rc10
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 nameko

How to Check if You Are Affected

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

pip show nameko

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Nameko, 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

### Impact Nameko can be tricked to perform arbitrary code execution when deserialising a YAML config file. Example: ``` yaml # malicious.yaml !!python/object/new:type args: ['z', !!python/tuple [], {'extend': !!python/name:exec }] listitems: "__import__('os').system('cat /etc/passwd')" ``` ``` shell $ nameko run --config malicious.yaml test root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin ... ``` ### Patches The problem was fixed in https://github.com/nameko/nameko/pull/722 and released in version 2.14.0, and in rc10 of the v3 pre-release. Versions prior to 2.14.0, and v3.0.0rc0 through v3.0.0rc9 are still vulnerable. ### Workarounds The vulnerability is exploited by config files with malicious content. It can be avoided by only using config files that you trust.

CVE-2021-41078 Affected Nameko Versions

2 component(s)
Fixed Versions:
2.14.03.0.0rc10
Product / Package Ecosystem Affected Versions Fixed Version
nameko
PyPI
< 2.14.0
2.14.0
nameko
PyPI
≥ 3.0.0rc0
< 3.0.0rc10
3.0.0rc10

References

Frequently Asked Questions

What is CVE-2021-41078?
CVE-2021-41078 is a security vulnerability in Nameko involving Nameko Arbitrary code execution due to YAML deserialization under CWE-502: Deserialization of Untrusted Data.
Which Nameko versions are affected?
Affected versions include releases prior to 2.14.0, 3.0.0rc10 across affected packages: nameko.
What version fixes CVE-2021-41078?
Upgrading to 2.14.0, 3.0.0rc10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nameko affected?
Yes, nameko is affected in releases prior to 2.14.0, 3.0.0rc10. Upgrade your dependency to 2.14.0, 3.0.0rc10 or later.
What is the CVSS score of CVE-2021-41078?
CVE-2021-41078 has a CVSS v3.1 base score of 8.6 (CRITICAL) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2021-41078?
CVE-2021-41078 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for CVE-2021-41078?
Run the dependency tree command: 'pip show nameko'. 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-6p52-jr3q-c94g",
  "modified" : "2024-10-07T14:45:04Z",
  "published" : "2021-10-19T15:28:57Z",
  "aliases" : [ "CVE-2021-41078" ],
  "summary" : "Nameko Arbitrary code execution due to YAML deserialization",
  "details" : "### Impact\n\nNameko can be tricked to perform arbitrary code execution when deserialising a YAML config file. Example:\n\n``` yaml\n# malicious.yaml\n!!python/object/new:type\nargs: ['z', !!python/tuple [], {'extend': !!python/name:exec }]\nlistitems: \"__import__('os').system('cat /etc/passwd')\"\n```\n\n``` shell\n$ nameko run --config malicious.yaml test\nroot:x:0:0:root:/root:/bin/bash\ndaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin\nbin:x:2:2:bin:/bin:/usr/sbin/nologin\nsys:x:3:3:sys:/dev:/usr/sbin/nologin\nsync:x:4:65534:sync:/bin:/bin/sync\ngames:x:5:60:games:/usr/games:/usr/sbin/nologin\n... \n```\n\n### Patches\n\nThe problem was fixed in https://github.com/nameko/nameko/pull/722 and released in version 2.14.0, and in rc10 of the v3 pre-release.\n\nVersions prior to 2.14.0, and v3.0.0rc0 through v3.0.0rc9 are still vulnerable.\n\n### Workarounds\n\nThe vulnerability is exploited by config files with malicious content. It can be avoided by only using config files that you trust.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nameko"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.14.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nameko"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0rc0"
      }, {
        "fixed" : "3.0.0rc10"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.0.0rc9"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nameko/nameko/security/advisories/GHSA-6p52-jr3q-c94g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41078"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nameko/nameko"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nameko/nameko/releases/tag/v2.14.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nameko/nameko/releases/tag/v3.0.0-rc10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nameko/PYSEC-2021-383.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-19T15:14:24Z",
    "nvd_published_at" : "2021-10-26T13:15:00Z"
  }
}