CVE-2025-3047
📋 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
- AWS Serverless Application Model Command Line Interface (SAM CLI)
⚠️ 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.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- 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.
🎯 Exploit Status
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
allDo 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
linuxClean 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*"