mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-24 12:18:06 +08:00
bake: fix potential context entitlements escape
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
@@ -1012,7 +1012,8 @@ func checkPath(p string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.HasPrefix(rel, ".."+string(os.PathSeparator)) {
|
||||
parts := strings.Split(rel, string(os.PathSeparator))
|
||||
if parts[0] == ".." {
|
||||
return errors.Errorf("path %s is outside of the working directory, please set BAKE_ALLOW_REMOTE_FS_ACCESS=1", p)
|
||||
}
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user