Conversation
Update the vendored go-sdk to reject function names that could delete directories outside the build root and handler folders that could write files outside the function's build context. Use path-aware containment for extra-copy paths to reject sibling directories whose names merely start with the project directory name. These fixes apply to both faas-cli build and faas-cli publish. Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
AI Pull Request OverviewDisclaimer: This review was generated by automated AI and may contain errors. Do not trust its outputs without human verification. Summary
Approval rating (1-10)4/10. The intended security fixes are valuable, but the committed local module replacement is a merge blocker for reproducible builds. Summary per fileSummary per file
Overall AssessmentThe PR appears aimed at closing important build-context containment gaps, but the final state is not ready to merge because it commits a local Detailed ReviewDetailed ReviewFindingsHigh: Local SDK replacement makes builds non-reproducible
replace github.com/openfaas/go-sdk => ../go-sdkThis makes the module graph depend on a sibling directory that is not part of this repository. Any workflow that resolves modules outside the committed vendor tree, or regenerates vendor metadata, now requires Replace this with a released AI agent details. |
Description
Vendor the SDK fixes for function names, handler folders and extra-copy paths
used by
faas-cli buildandfaas-cli publish.Motivation and Context
Fix three build context containment issues: function names could cause deletion
of directories outside the build root, template
handler_foldervalues couldwrite files outside the function's build context, and
configuration.copycouldread files from sibling directories whose names merely start with the project
directory name. These paths are now rejected.
How Has This Been Tested?
Tested multiple E2E cases across build/publish
--shrinkwrap: reproduced thefailures on master, verified rejection and outside-file preservation, and checked
valid handler folders and extra-copy paths.
Types of changes
Checklist:
git commit -s