AWS Serverless Application Model CLI Symlink Privilege Escalation Vulnerability

Vulnerability

A vulnerability in the AWS Serverless Application Model Command Line Interface (SAM CLI) build process with Docker allows access to privileged files on the host. This issue arises when symlinks are included in the build files, as the container environment permits users to leverage the elevated permissions of SAM CLI to access restricted files via symlinks. Affected versions include AWS SAM CLI through v1.132.0. The vulnerability has been resolved in v1.133.0. Users should upgrade to this version and patch any forked or derivative code to incorporate the new fixes.

Impact

Exploitation of this vulnerability could lead to unauthorized access to privileged files on the host machine, bypassing normal file access restrictions. This could allow sensitive information to be exposed or manipulated.

Reproduction

To reproduce this vulnerability, include symlinks in the build files while using AWS SAM CLI version 1.132.0 or earlier. Run the build process with the '--use-container' option, which will enable the Docker container environment. The symlinks will resolve within the container, allowing access to privileged files on the host. After the build, the contents of the symlinks will be copied to the local workspace cache as regular files or directories, potentially exposing restricted files to users who do not have access to them outside the Docker container.

Remediation

Upgrade to AWS SAM CLI version 1.133.0 or newer. To retain the previous behavior and allow symlinks to resolve on the host machine, use the explicit '--mount-symlinks' parameter.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
0.8
exploitability
5.0
remediation
7.7
relevance
0.0
threat
1.6
urgency
2.9
incentive
0.8

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.