CVE-2025-3047: Aws sam cli Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-px37-jpqx-97q9
CVSS 6.5
CWE-61 CWE-22
Published
Advisory Summary

CVE-2025-3047 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-61: UNIX Symbolic Link (Symlink) Following) affecting Aws sam cli libraries in the PyPI ecosystem. The issue involves aws sam cli path traversal allows file copy to build container. Remediation is available by upgrading affected packages to version 1.133.0.

CVE-2025-3047 at a Glance

CVE Identifier CVE-2025-3047
GHSA Identifier GHSA-px37-jpqx-97q9
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-61: UNIX Symbolic Link (Symlink) Following
Affected Product Aws sam cli
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2025-3047

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

aws-sam-cli fixed: 1.133.0
pip install aws-sam-cli>=1.133.0
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 aws-sam-cli

How to Check if You Are Affected

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

pip show aws-sam-cli

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

Note: The pip show aws-sam-cli command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-61: UNIX Symbolic Link (Symlink) Following, where the product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. In Aws sam cli, 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

### Summary The [AWS Serverless Application Model Command Line Interface (AWS SAM CLI)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli.html) is an open-source CLI tool that helps Lambda developers to build and develop Lambda applications locally on their computers using Docker. When running the AWS SAM CLI build process with Docker and symlinks are included in the build files, the container environment allows a user to access privileged files on the host by leveraging the elevated permissions granted to the tool. A user could leverage the elevated permissions to access restricted files via symlinks and copy them to a more permissive location on the container. Users should [upgrade to v1.133.0](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/manage-sam-cli-versions.html#manage-sam-cli-versions-upgrade) or newer and ensure any forked or derivative code is patched to incorporate the new fixes. ### Impact This issue is limited to the local workspace and does not affect AWS services, production environments or cross-account resources. The issue only affects local workspaces using AWS SAM CLI with container builds (--use-container), potentially allowing access to local files outside the build directory through the usage of symlinks. **Impacted versions:** <= AWS SAM CLI v1.132.0 ### Patches The issue has been addressed in version 1.133.0. Users should upgrade and ensure any forked or derivative code is patched to incorporate the new fixes. To retain the previous behavior and allow symlinks to resolve on the host machine, please use the explicit '-[-mount-symlinks](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html#ref-sam-cli-build-options-mount-symlinks)' parameter. ### Workarounds There is no recommended work around. Customers are advised to upgrade to version v1.133.0 or the latest version. ### References CVE-2025-3047 --- If you have any questions or comments about this advisory we ask that you contact AWS/Amazon Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting) or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue. ### Credit We would like to thank [Kevin Backhouse](https://github.com/kevinbackhouse) with the GitHub Security Lab for collaborating on this issue through the coordinated vulnerability disclosure process.

CVE-2025-3047 Affected Aws sam cli Versions

1 component(s)
Fixed Versions:
1.133.0
Product / Package Ecosystem Affected Versions Fixed Version
aws-sam-cli
PyPI
< 1.133.0
1.133.0

References

Frequently Asked Questions

What is CVE-2025-3047?
CVE-2025-3047 is a security vulnerability in Aws sam cli involving AWS SAM CLI Path Traversal allows file copy to build container under CWE-61: UNIX Symbolic Link (Symlink) Following.
Which Aws sam cli versions are affected?
Affected versions include releases prior to 1.133.0 across affected packages: aws-sam-cli.
What version fixes CVE-2025-3047?
Upgrading to 1.133.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is aws-sam-cli affected?
Yes, aws-sam-cli is affected in releases prior to 1.133.0. Upgrade your dependency to 1.133.0 or later.
What is the CVSS score of CVE-2025-3047?
CVE-2025-3047 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2025-3047?
CVE-2025-3047 is classified under CWE-61: UNIX Symbolic Link (Symlink) Following (The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.).
How can I check PyPI dependencies for CVE-2025-3047?
Run the dependency tree command: 'pip show aws-sam-cli'. 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-px37-jpqx-97q9",
  "modified" : "2025-10-14T21:59:07Z",
  "published" : "2025-03-31T22:36:49Z",
  "aliases" : [ "CVE-2025-3047" ],
  "summary" : "AWS SAM CLI Path Traversal allows file copy to build container",
  "details" : "### Summary\n\nThe [AWS Serverless Application Model Command Line Interface (AWS SAM CLI)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli.html) is an open-source CLI tool that helps Lambda developers to build and develop Lambda applications locally on their computers using Docker.\n\nWhen running the AWS SAM CLI build process with Docker and symlinks are included in the build files, the container environment allows a user to access privileged files on the host by leveraging the elevated permissions granted to the tool. A user could leverage the elevated permissions to access restricted files via symlinks and copy them to a more permissive location on the container.\n\nUsers should [upgrade to v1.133.0](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/manage-sam-cli-versions.html#manage-sam-cli-versions-upgrade) or newer and ensure any forked or derivative code is patched to incorporate the new fixes. \n\n\n### Impact\n\nThis issue is limited to the local workspace and does not affect AWS services, production environments or cross-account resources. The issue only affects local workspaces using AWS SAM CLI with container builds (--use-container), potentially allowing access to local files outside the build directory through the usage of symlinks. \n\n\n\n**Impacted versions:** <= AWS SAM CLI v1.132.0\n\n\n\n### Patches\n\nThe issue has been addressed in version 1.133.0. Users should upgrade and ensure any forked or derivative code is patched to incorporate the new fixes. To retain the previous behavior and allow symlinks to resolve on the host machine, please use the explicit '-[-mount-symlinks](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html#ref-sam-cli-build-options-mount-symlinks)' parameter.\n\n\n\n### Workarounds\n\nThere is no recommended work around. Customers are advised to upgrade to version v1.133.0 or the latest version.\n\n\n\n### References\n\nCVE-2025-3047\n\n---\n\nIf you have any questions or comments about this advisory we ask that you contact AWS/Amazon Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting) or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue.\n\n\n\n### Credit\n\nWe would like to thank [Kevin Backhouse](https://github.com/kevinbackhouse) with the GitHub Security Lab for collaborating on this issue through the coordinated vulnerability disclosure process.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "aws-sam-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.133.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-sam-cli/security/advisories/GHSA-px37-jpqx-97q9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-3047"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-sam-cli/pull/7865"
  }, {
    "type" : "WEB",
    "url" : "https://aws.amazon.com/security/security-bulletins/AWS-2025-008"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/aws/aws-sam-cli"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-sam-cli/releases/tag/v1.134.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-61" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-31T22:36:49Z",
    "nvd_published_at" : "2025-03-31T16:15:27Z"
  }
}