[Low] setupImageVolumes builds host mount paths from vol.Name without a containment check
Maintainers usually reply within 1 day
@abhisheksharma2411 is already working on this.
Since Oct 20, 2026.
- #3024 by @abhisheksharma2411 — open
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
Research direction
Read internal/imagecache/bundle_linux.go at setupImageVolumes and internal/imagecache/spec.go for ImageVolumeMountPath and the createExtraDirs validation pattern. Check how volume names reach this function, then add a containment check before building mount paths. Done when non-local names are rejected and valid volume names still work; the payload names no test file.
Written by the indexing model from the issue text.
Description
Summary
In internal/imagecache/bundle_linux.go, setupImageVolumes constructs mount points using ImageVolumeMountPath(bundlePath, vol.Name) without verifying that vol.Name is a clean, local relative path. If a crafted rootfs-overlay.json containing path traversal sequences (such as ../) is processed, setupImageVolumes can create directories, unmount existing mounts, and mount image layers at arbitrary locations on the host within the privileged ateworker context.
Details
In internal/imagecache/bundle_linux.go#L114-L122:
mountpoint := ImageVolumeMountPath(bundlePath, vol.Name)
if err := os.MkdirAll(mountpoint, 0o700); err != nil {
return fmt.Errorf("while creating image volume mount point %q: %w", mountpoint, err)
}
_ = unix.Unmount(mountpoint, unix.MNT_DETACH)
if err := mountImageVolume(mountpoint, vol.Layers); err != nil {
return fmt.Errorf("while mounting image volume %q: %w", vol.Name, err)
}
And internal/imagecache/spec.go#L30-L32:
func ImageVolumeMountPath(bundlePath, volumeName string) string {
return filepath.Join(bundlePath, "volumes", volumeName)
}
In contrast to createExtraDirs (internal/imagecache/spec.go#L182-L184), which uses os.OpenRoot and enforces filepath.IsLocal, setupImageVolumes performs no checks on vol.Name.
Impact
Exploitability is constrained by upstream controls:
- Both
ateapi(cmd/ateapi/internal/apivalidation/zz_generated.validation.go#L9511) andatelet(cmd/atelet/internal/apivalidation/zz_generated.validation.go#L4448) enforcevalidate.ShortName(content.IsDNS1123Label), rejecting slashes and..traversal sequences in volume names at API ingress. rootfs-overlay.jsonis generated byateleton the host; untrusted sandboxed containers cannot modify it directly.
An attacker would require a pre-existing host-level compromise or a bypass of the API server validation to write a maliciousrootfs-overlay.json.
Suggested fix
Validate vol.Name in setupImageVolumes before joining paths, rejecting non-local paths or path separators:
if !filepath.IsLocal(vol.Name) || filepath.Base(vol.Name) != vol.Name {
return fmt.Errorf("invalid volume name %q: must be a local filename", vol.Name)
}
Related
- Related: #1436 (
SystemInfoVolumeSourcepath traversal validation) - Related: PR #923 (Added image volumes to ActorTemplate)
- Related: PR #2826 (Micro-VM image volumes refactor)
- Dominant language
- Go
- Stars
- 5.7k
- Forks
- 612
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 533
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from agent-substrate/substrate
-
area/security kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
agent-substrate/substrate#2935 ·
Maintainers usually reply within 1 day
-
area/security kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agent-substrate/substrate#2932 ·
Maintainers usually reply within 1 day
-
[Low] guestVolumeSource can map host paths containing ".." outside the microVM guest sharePossibly taken @jiayimeow claimed this 1 day ago. Openarea/security kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
agent-substrate/substrate#2920 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Low] ate-api-server accepts client certificates chained to system roots when --pod-identity-ca-certs is unsetPossibly taken @abhisheksharma2411 claimed this today. Openarea/security kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
agent-substrate/substrate#2918 ·
Maintainers usually reply within 1 day
-
Cloud SQL backend: document (and optionally provision) Private Service Connect for ATE_API_POSTGRES_CLOUDSQL_IP_TYPE=pscPossibly taken A pull request linked to this issue is open or already merged. Openarea/dev-infra kind/docs kind/feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
agent-substrate/substrate#2875 ·
Maintainers usually reply within 1 day
All issues in agent-substrate/substrate
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
-
✨ Propose the missing gate after three same-class findings instead of filing a fourthPossibly taken @hivecommons-hive claimed this today. Openenhancement help wanted hive/claimed-by-scanner stage/040-covered-by-pr
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hivecommons/hive#13428 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
🕷️ bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
sysadminsmedia/homebox#1805 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100