Vulnerabilities in pkg:pypi/sockeye
PACKAGECVE-2021-43811 is a HIGH (CVSS 7.8) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Sockeye libraries in the PyPI ecosystem. The issue involves code injection via unsafe yaml loading. Remediation is available by upgrading affected packages to version 2.3.24.
pkg:pypi/sockeye
Vulnerability advisories affecting package pkg:pypi/sockeye. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-ggmr-44cv-24pm | CVE-2021-43811 | HIGH | Code injection via unsafe YAML loading |
CVE-2021-43811 at a Glance
Security Impact
CVSS: 7.8
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:U/C:H/I:H/A:H).
How to Fix CVE-2021-43811
To remediate this vulnerability, upgrade all affected Sockeye 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 sockeye>=2.3.24
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show sockeye
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-43811, inspect your installed packages using pip:
pip show sockeye
Analyze the terminal output to locate any version of Sockeye in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.24), your application is affected.
Note: The pip show sockeye 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 Sockeye, 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-43811 Affected Sockeye Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sockeye
|
PyPI |
< 2.3.24
|
2.3.24
|
References
Frequently Asked Questions
What is CVE-2021-43811?
Which Sockeye versions are affected?
What version fixes CVE-2021-43811?
Is sockeye affected?
What is the CVSS score of CVE-2021-43811?
What CWE is associated with CVE-2021-43811?
How can I check PyPI dependencies for CVE-2021-43811?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ggmr-44cv-24pm",
"modified" : "2024-10-25T14:50:22Z",
"published" : "2021-12-09T18:35:22Z",
"aliases" : [ "CVE-2021-43811" ],
"summary" : "Code injection via unsafe YAML loading",
"details" : "### Impact\nSockeye uses YAML to store model and data configurations on disk. Versions below 2.3.24 use unsafe YAML loading, which can be made to execute arbitrary code embedded in config files.\n\nAn attacker can add malicious code to the config file of a trained model and attempt to convince users to download and run it. If users run the model, the embedded code will run locally.\n\n### Patches\nThe issue is fixed in version 2.3.24 and above by #964.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [awslabs/sockeye](https://github.com/awslabs/sockeye)\n* Email us at [sockeye-dev](mailto:sockeye-dev@amazon.com)\n\n### Attribution\nThis vulnerability was reported by Masatoshi Yoshizawa of yamory Security Team.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "sockeye"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.3.24"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/awslabs/sockeye/security/advisories/GHSA-ggmr-44cv-24pm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43811"
}, {
"type" : "WEB",
"url" : "https://github.com/awslabs/sockeye/pull/964"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/awslabs/sockeye"
}, {
"type" : "WEB",
"url" : "https://github.com/awslabs/sockeye/releases/tag/2.3.24"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/sockeye/PYSEC-2021-848.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-12-08T23:14:41Z",
"nvd_published_at" : "2021-12-08T23:15:00Z"
}
}