CVE-2024-34073: Sagemaker Sagemaker-python-sdk Command Injection Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-7pc3-pr3q-58vg
CVSS 7.8
CWE-78
Published
Advisory Summary

CVE-2024-34073 is a HIGH (CVSS 7.8) sagemaker-python-sdk command injection vulnerability vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Sagemaker libraries in the PyPI ecosystem. The issue involves sagemaker-python-sdk command injection vulnerability. Remediation is available by upgrading affected packages to version 2.214.3.

CVE-2024-34073 at a Glance

CVE Identifier CVE-2024-34073
GHSA Identifier GHSA-7pc3-pr3q-58vg
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Sagemaker
Package Ecosystem PyPI
Published Date
Last Updated

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).

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

How to Fix CVE-2024-34073

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

sagemaker fixed: 2.214.3
pip install sagemaker>=2.214.3
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 sagemaker

How to Check if You Are Affected

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

pip show sagemaker

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Sagemaker, 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 The capture_dependencies function in `sagemaker.serve.save_retrive.version_1_0_0.save.utils` module before version 2.214.3 allows for potentially unsafe Operating System (OS) Command Injection if inappropriate command is passed as the “requirements_path” parameter. This consequently may allow an unprivileged third party to cause remote code execution, denial of service, affecting both confidentiality and integrity. Impacted versions: <2.214.3 ### Credit We would like to thank HiddenLayer for collaborating on this issue through the coordinated vulnerability disclosure process. ### Workarounds Do not override the “requirements_path” parameter of capture_dependencies function in `sagemaker.serve.save_retrive.version_1_0_0.save.utils`, instead use the default value. ### References If you have any questions or comments about this advisory we ask that you contact AWS/Amazon Security via our vulnerability reporting page [1] or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue. [1] Vulnerability reporting page: https://aws.amazon.com/security/vulnerability-reporting Fixed by: https://github.com/aws/sagemaker-python-sdk/pull/4556

CVE-2024-34073 Affected Sagemaker Versions

1 component(s)
Fixed Versions:
2.214.3
Product / Package Ecosystem Affected Versions Fixed Version
sagemaker
PyPI
< 2.214.3
2.214.3

References

Frequently Asked Questions

What is CVE-2024-34073?
CVE-2024-34073 is a security vulnerability in Sagemaker involving sagemaker-python-sdk Command Injection vulnerability under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Sagemaker versions are affected?
Affected versions include releases prior to 2.214.3 across affected packages: sagemaker.
What version fixes CVE-2024-34073?
Upgrading to 2.214.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sagemaker affected?
Yes, sagemaker is affected in releases prior to 2.214.3. Upgrade your dependency to 2.214.3 or later.
What is the CVSS score of CVE-2024-34073?
CVE-2024-34073 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-34073?
CVE-2024-34073 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2024-34073?
Run the dependency tree command: 'pip show sagemaker'. 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-7pc3-pr3q-58vg",
  "modified" : "2024-05-03T20:26:03Z",
  "published" : "2024-05-03T20:26:03Z",
  "aliases" : [ "CVE-2024-34073" ],
  "summary" : "sagemaker-python-sdk Command Injection vulnerability",
  "details" : "### Impact\n\nThe capture_dependencies function in `sagemaker.serve.save_retrive.version_1_0_0.save.utils` module before version 2.214.3 allows for potentially unsafe Operating System (OS) Command Injection if inappropriate command is passed as the “requirements_path” parameter. This consequently may allow an unprivileged third party to cause remote code execution, denial of service, affecting both confidentiality and integrity.\n\nImpacted versions: <2.214.3\n\n### Credit\n\nWe would like to thank HiddenLayer for collaborating on this issue through the coordinated vulnerability disclosure process.\n\n### Workarounds\n\nDo not override the “requirements_path” parameter of capture_dependencies function in `sagemaker.serve.save_retrive.version_1_0_0.save.utils`, instead use the default value.\n\n### References\n\nIf you have any questions or comments about this advisory we ask that you contact AWS/Amazon Security via our vulnerability reporting page [1] or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.\n[1] Vulnerability reporting page: https://aws.amazon.com/security/vulnerability-reporting\n\nFixed by: https://github.com/aws/sagemaker-python-sdk/pull/4556",
  "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" : "sagemaker"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.214.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/aws/sagemaker-python-sdk/security/advisories/GHSA-7pc3-pr3q-58vg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-34073"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/sagemaker-python-sdk/pull/4556"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/sagemaker-python-sdk/commit/2d873d53f708ea570fc2e2a6974f8c3097fe9df5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/aws/sagemaker-python-sdk"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-03T20:26:03Z",
    "nvd_published_at" : "2024-05-03T11:15:22Z"
  }
}