umoci icon indicating copy to clipboard operation
umoci copied to clipboard

CVE-2026-61801: unbounded memory growth parsing /etc/group via github.com/moby/sys/user v0.4.0

Open iYashMaurya opened this issue 1 month ago • 1 comments

Summary

umoci v0.6.0 vendors github.com/moby/sys/[email protected], which is affected by CVE-2026-61801 (GHSA-mjcv-p78q-w5fw): unbounded parsing of /etc/passwd//etc/group-style files can cause excessive memory consumption and an OOM kill. The fix is in v0.4.1.

This is reachable and exploitable in umoci.

Call path

cmd/umoci unpack → oci/layer.UnpackManifest (unpack.go:374) → convert.ToRuntimeSpec → convert.MutateRuntimeSpec (oci/config/convert/runtime.go:197) → user.GetExecUserPath(ig.ConfigUser(), nil, passwdPath, groupPath) → user.ParseGroupFilter

Group-file parsing runs whenever a rootfs is supplied, independent of config.User's value, so this triggers on ordinary umoci unpack calls against any image.

Trigger

An OCI image whose rootfs contains an /etc/group file with a single very large line (no trailing newline required). ParseGroupFilter in v0.4.0 has no bound on line length and grows an in-memory buffer unboundedly while reading it.

Impact

Denial of service: the umoci unpack process can be OOM-killed while processing an untrusted image. No code execution or data exposure.

Reproduction

Built a container image with a ~512 MiB single-line /etc/group, exported to an OCI layout, and ran umoci unpack under a 256 MiB memory cgroup.

  • v0.4.0 (current vendored version): process OOM-killed, exit 137.
  • v0.4.1: rejected cleanly, exit 1: cannot parse user spec: "": unable to find groups for spec root: bufio.Scanner: token too long

Fix

go get github.com/moby/sys/[email protected] go mod tidy go mod vendor

Verified the OOM no longer reproduces after the bump, using the same PoC. Happy to open a PR with this change.

References

  • https://github.com/moby/sys/security/advisories/GHSA-mjcv-p78q-w5fw
  • https://github.com/moby/sys/commit/85a71bbe1faa36c552a960e6a5f3d0cfb632fbbe
  • https://github.com/moby/sys/pull/221
  • http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2026-61801

iYashMaurya avatar Oct 19 '26 10:10 iYashMaurya

/assign

iYashMaurya avatar Oct 19 '26 10:10 iYashMaurya