CVE-2025-3048 Overview
CVE-2025-3048 is an information disclosure vulnerability in the AWS Serverless Application Model Command Line Interface (SAM CLI). When SAM CLI completes a build that includes symbolic links, the tool copies the contents of those symlinks into the local workspace cache as regular files or directories. This behavior allows a user without direct access to the symlink targets outside of the Docker container to obtain that data through the local workspace. The issue is tracked under CWE-61: UNIX Symbolic Link (Symlink) Following and is documented in AWS Security Bulletin 2025-008.
Critical Impact
Local users can access data referenced by symlinks inside a container by reading the dereferenced files copied into the host workspace cache after a sam build.
Affected Products
- AWS Serverless Application Model Command Line Interface (SAM CLI) prior to version 1.134.0
- Forked or derivative code bases that inherit the vulnerable build logic
- Container-based SAM builds invoked with sam build --use-container
Discovery Timeline
- 2025-03-31 - CVE-2025-3048 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-3048
Vulnerability Analysis
AWS SAM CLI orchestrates serverless application builds, often inside Docker containers when invoked with --use-container. During the build process, SAM CLI stages artifacts in a local workspace cache. The vulnerability occurs when the build artifacts include symbolic links. Instead of preserving the symlinks as links, SAM CLI dereferences them and writes the target content into the cache directory as regular files or directories.
This dereferencing crosses a trust boundary. Files reachable only from within the container context can be readable by any user on the host who can access the local workspace after the build completes. Additional detail is provided in the GitHub Security Advisory GHSA-pp64-wj43-xqcr.
Root Cause
The root cause is improper handling of symbolic links during artifact staging. The build routine follows links rather than preserving them, which violates the expected isolation between the container filesystem and the host workspace. The weakness maps to CWE-61 (Symlink Following).
Attack Vector
An attacker requires user interaction with a project that contains symlinks pointing to sensitive files reachable from the build context. After a victim runs sam build --use-container, the symlink targets are materialized into the workspace cache. A local user without prior access to those targets can then read them from the cache. The AWS Security Bulletin 2025-008 confirms confidentiality impact without integrity or availability effects.
Detection Methods for CVE-2025-3048
Indicators of Compromise
- Presence of files or directories inside the SAM build cache (for example, .aws-sam/build/) whose contents mirror data outside the intended project source tree.
- Regular files in the workspace cache whose contents match targets of symlinks defined in the project template or source directories.
- Unexpected sensitive files (credentials, keys, configuration) appearing in build output directories after running sam build --use-container.
Detection Strategies
- Audit SAM CLI project trees for symbolic links prior to building, using find . -type l to enumerate links and their targets.
- Compare build cache contents against the declared source tree to identify files that should not have been staged.
- Track installed SAM CLI versions across developer workstations and CI runners and flag any host running a version earlier than 1.134.0.
Monitoring Recommendations
- Log invocations of sam build and sam build --use-container in CI/CD pipelines, including the resulting artifact paths.
- Monitor developer workstations and build servers for reads of the .aws-sam directory by users other than the build initiator.
- Alert on secrets or credential material appearing inside SAM build output through repository or file integrity scanning.
How to Mitigate CVE-2025-3048
Immediate Actions Required
- Upgrade AWS SAM CLI to version 1.134.0 or later on every developer workstation, CI runner, and build image.
- Re-run sam build --use-container after upgrading to regenerate build artifacts and correctly handle symlinks.
- Review and remove any sensitive content previously copied into the .aws-sam workspace cache under the vulnerable version.
- Patch any forked or derivative codebases that reuse the SAM CLI build logic, per the guidance in the GitHub Release v1.134.0 notes.
Patch Information
AWS released the fix in AWS SAM CLI 1.134.0. Users must both upgrade the CLI and rebuild affected applications so the workspace cache reflects the corrected symlink handling. Details are published in AWS Security Bulletin 2025-008 and GitHub Security Advisory GHSA-pp64-wj43-xqcr.
Workarounds
- Avoid using symbolic links inside SAM project source trees until the CLI is upgraded.
- Restrict filesystem permissions on the .aws-sam build cache so only the build user can read its contents.
- Run SAM builds in isolated, single-tenant environments where no untrusted local users can read the workspace cache.
# Upgrade AWS SAM CLI and rebuild with the container option
pip install --upgrade "aws-sam-cli>=1.134.0"
sam --version
rm -rf .aws-sam
sam build --use-container
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

