fix(F1085): scope rm to /configs/<path> not /configs + <path>

rm received /configs and filePath as two separate arguments, deleting
the entire /configs dir on every call. Concatenate to target only the
intended file. validateRelPath already prevents traversal, so this is
a logic bug not a security vulnerability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
rabbitblood 2026-04-22 15:42:50 -07:00
parent 557394f853
commit f4207cd1dc

View File

@ -171,7 +171,7 @@ func (h *TemplatesHandler) deleteViaEphemeral(ctx context.Context, volumeName, f
resp, err := h.docker.ContainerCreate(ctx, &container.Config{
Image: "alpine:latest",
Cmd: []string{"rm", "-rf", "/configs", filePath},
Cmd: []string{"rm", "-rf", "/configs/" + filePath},
}, &container.HostConfig{
Binds: []string{volumeName + ":/configs"},
}, nil, nil, "")