Vulnerabilities in pkg:pypi/nameko
PACKAGECVE-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.
pkg:pypi/nameko
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
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).
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.
pip install nameko>=2.14.0
pip install nameko>=3.0.0rc10
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
CVE-2021-41078 Affected Nameko Versions
2 component(s)| 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?
Which Nameko versions are affected?
What version fixes CVE-2021-41078?
Is nameko affected?
What is the CVSS score of CVE-2021-41078?
What CWE is associated with CVE-2021-41078?
How can I check PyPI dependencies for CVE-2021-41078?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}