aws-cdk-lib is vulnerable to Improper Link Resolution Before File Access ('Link Following')
55
CVE Score
Medium
Improper Link Resolution Before File Access ('Link Following')
AWS CDK's AssetStaging construct, reached through stageByBundling, calls determineBundledAsset to stage Docker or local bundling output as the deployed asset. Before the fix, a single file was accepted even when it was a symlink, so the publisher could stream a readable build-host file as the file-asset upload. A non-archived output directory was staged without checking whether symlinks inside it pointed outside the bundle directory. The Docker container or local bundling command supplies that output, including any symlinks. AssetStagingProps.follow defaults to SymlinkFollowMode.EXTERNAL. Single-file symlinks were not checked in any follow mode, and external links in a directory were not checked even when follow was SymlinkFollowMode.BLOCK_EXTERNAL. The fix in aws-cdk-lib 2.267.0 rejects a single-file bundling output when lstatSync reports a symlink. It also adds a validateInternalSymlinks guard, called from determineBundledAsset when followMode is BLOCK_EXTERNAL, that throws if an external symlink is found in the non-archived output.
Upgrade the aws-cdk-lib package to a patched version.
You are affected if you are using a version that falls within the vulnerable range and are using Docker or local asset bundling in an AWS CDK application.
0.0.1 - 2.266.0
Fixed in 2.267.0aws-cdk-lib is vulnerable to Improper Link Resolution Before File Access ('Link Following') in versions 0.0.1 - 2.266.0.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.