CVE-2025-3047

6.5 MEDIUM

📋 TL;DR

This vulnerability in AWS SAM CLI allows attackers to access privileged host files when building with Docker if symlinks are present in build files. The elevated permissions granted to the tool enable copying restricted files to permissive container locations. Users running SAM CLI with Docker builds containing symlinks are affected.

💻 Affected Systems

Products:
  • AWS Serverless Application Model Command Line Interface (SAM CLI)
Versions: Versions before v1.133.0
Operating Systems: All operating systems where SAM CLI with Docker is used
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects builds using Docker with symlinks in build files. Non-Docker builds are not vulnerable.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could exfiltrate sensitive host files like SSH keys, AWS credentials, or system configuration files, leading to complete host compromise.

🟠

Likely Case

Unauthorized access to sensitive files on the host system, potentially exposing credentials or configuration data.

🟢

If Mitigated

Limited impact with proper access controls and monitoring, though file exposure risk remains.

🌐 Internet-Facing: MEDIUM - Requires user to run SAM CLI with Docker builds containing attacker-controlled symlinks.
🏢 Internal Only: MEDIUM - Internal developers or CI/CD systems using SAM CLI with Docker are at risk.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires user to run SAM CLI build with Docker and have symlinks in build context. Not remotely exploitable without user interaction.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v1.133.0 and newer

Vendor Advisory: https://github.com/aws/aws-sam-cli/security/advisories/GHSA-px37-jpqx-97q9

Restart Required: No

Instructions:

1. Update SAM CLI using pip: 'pip install --upgrade aws-sam-cli' 2. Verify version with 'sam --version' shows v1.133.0 or higher 3. Update any CI/CD pipelines using SAM CLI

🔧 Temporary Workarounds

Avoid Docker builds with symlinks

all

Do not use Docker builds with SAM CLI when symlinks are present in build files

Use 'sam build --use-container=false' to disable Docker builds

Remove symlinks from build context

linux

Clean build directories to remove any symlinks before building

find . -type l -delete # Remove symlinks in current directory

🧯 If You Can't Patch

  • Disable Docker builds in SAM CLI using --use-container=false flag
  • Implement strict access controls on build environments and monitor for suspicious file access

🔍 How to Verify

Check if Vulnerable:

Run 'sam --version' and check if version is below v1.133.0

Check Version:

sam --version

Verify Fix Applied:

Run 'sam --version' and confirm version is v1.133.0 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unusual file access patterns during SAM CLI Docker builds
  • Symlink traversal attempts in container logs

Network Indicators:

  • Unexpected outbound transfers of sensitive file data from build containers

SIEM Query:

source="sam-cli" AND (event="build" OR event="docker") AND file_access="*symlink*"

🔗 References

📤 Share & Export