feat(upload-cdk-source): run on the node24 runtime, implemented in TypeScript - #270
Conversation
| export const zipPaths = ( | ||
| root: string, | ||
| names: readonly string[], | ||
| ): Result<Uint8Array> => archive(root, names.map((name) => join(root, name))) |
There was a problem hiding this comment.
Potential file inclusion attack via reading file - high severity
If an attacker can control the input leading into the ReadFile function, they might be able to read sensitive files and launch further attacks with that information.
Show fix
| ): Result<Uint8Array> => archive(root, names.map((name) => join(root, name))) | |
| ): Result<Uint8Array> => { | |
| const resolvedRoot = path.resolve(root); | |
| const validatedPaths = names.map((name) => { | |
| const target = path.resolve(resolvedRoot, name); | |
| const relative = path.relative(resolvedRoot, target); | |
| if (relative.startsWith('..') || path.isAbsolute(relative)) { | |
| throw new Error('Invalid path'); | |
| } | |
| return target; | |
| }); | |
| return archive(root, validatedPaths); | |
| } |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
There was a problem hiding this comment.
@AikidoSec ignore: reads a path the workflow author supplies, who already has code execution in the job;
There was a problem hiding this comment.
✅ Based on your feedback, we ignored this issue because of the following reason:
reads a path the workflow author supplies, who already has code execution in the job;
db64e35 to
6f0d767
Compare
9ed80ed to
5efc16c
Compare
6f0d767 to
b10e5e5
Compare
81a09af to
9ace52b
Compare
9ace52b to
6fbc724
Compare
5efc16c to
ea2b56b
Compare
6fbc724 to
e8fb430
Compare
ea2b56b to
115266d
Compare
e8fb430 to
9ec38cc
Compare
142601d to
178538b
Compare
…peScript Selects, archives and uploads the CDK source with fflate and the AWS SDK, replacing a find-grep-zip pipeline and the aws CLI. Which files are selected was a grep alternation and is now a tested function. test.sh carries the workflow test beside the action's unit tests. It asserts what the archive holds, not only that it uploaded: an archive carrying node_modules would upload and report success just the same. Inputs, outputs and the metadata file's fields are unchanged.
9ec38cc to
89a8d3d
Compare
|
🎉 This PR is included in version 1.16.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Moves the action to the
node24runtime. Selects the CDK application's files, archives them withfflateand uploads with the AWS SDK, replacing afind | grep | zippipeline and theawsCLI.Unit tests now cover which files are selected and the metadata the pipeline reads.
Stacked on #267, which adds the shared archive and S3 modules this uses.