Skip to content

Worker OOM via malicious image /etc/group (unbounded group file parsing) #9641

Closed

Description

@IvanChalukov

Summary

While investigating CVE-2026-47262 (containerd image-triggered DoS via unbounded group parsing), I found that Concourse has the same class of vulnerability in its own worker code, independently of the containerd version.

What happens

When a task runs with a non-root, non-numeric user: (either set in the task config or baked into the image via USER), the Concourse worker reads /etc/group from the image rootfs with no size limit before the container starts. A malicious image with a crafted /etc/group can cause the worker process to exhaust available memory and be OOM-killed, taking all in-flight builds on that worker with it.

There are two independent code paths that both hit this:

Both delegate to moby/sys/user.ParseGroupFilter, which reads the entire file into memory.

Steps to Reproduce

Build this image and use it as a task image in any pipeline with user: victim:

FROM alpine AS build
RUN printf 'root:x:0:\nvictim:x:1000:victim\nbig:x:9999:' > /tmp/group \
 && awk 'BEGIN{for(i=0;i<100000000;i++) printf "%su%07d",sep,i,"",sep=","; print ""}' >> /tmp/group \
 && printf 'root:x:0:0::/root:/bin/sh\nvictim:x:1000:1000::/:/bin/sh\n' > /tmp/passwd

FROM alpine
COPY --from=build /tmp/passwd /etc/passwd
COPY --from=build /tmp/group  /etc/group
USER victim

Trigger 50-60 parallel builds with following pipeline:

- task: run
  config:
    platform: linux
    image_resource:
      type: registry-image
      source: { repository: <above image> }
    run:
        path: /bin/sh
        args:
          - -c
          - echo "worker survived group parsing"; sleep 30
        user: victim

Observed

Worker memory spikes to 100% GB, as well as swap, worker is OOM-killed, all in-flight builds on that worker are lost. Then need to be recreated

Who can trigger this

Anyone who can supply a task image - i.e. any pipeline author with access to the Concourse instance. The attack does not require privileged access; a regular team member can trigger it accidentally or intentionally.

Fix

The root cause is that moby/sys/user v0.4.0 (used by Concourse at the time) has no size cap on file reads. The library authors fixed this in v0.4.1 (GHSA-mjcv-p78q-w5fw, released 2026-06-25) - full change log - https://github.com/moby/sys/releases/tag/user/v0.4.1. The fix for Concourse is a one-line dependency bump: github.com/moby/sys/user v0.4.0 → v0.4.1
No code changes are needed - GetExecUserPath in v0.4.1 applies the cap internally. After the upgrade, the same malicious image produces a clean task failure (bufio.Scanner: token too long) instead of killing the worker:

Image

Expected Results

A Concourse worker should be able to safely process any task image regardless of the content of /etc/passwd or /etc/group inside it. If those files are malformed or oversized, the task should fail with a clear error message. The worker process itself should remain unaffected and continue serving other builds.

Actual Results

When a task image contains a crafted /etc/passwd or /etc/group file (e.g. a single line with hundreds of millions of entries, or millions of lines), the Concourse worker process reads the entire file into memory before the container starts. This causes worker RSS to spike to ~10x the file size. On a worker node with insufficient free memory the worker process is OOM-killed, terminating all in-flight builds running on that worker.

Web Node(s) configuration

No response

Worker(s) configuration

No response

Concourse Version

8.2.4

Browser (if applicable)

N/A

Did this use to work?

N/A

Activity

  1. changed the title [-]Security: worker OOM via malicious image `/etc/group` (unbounded group file parsing)[/-] [+]Worker OOM via malicious image `/etc/group` (unbounded group file parsing)[/+] on Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions