Skip to content

oras manifest fetch-config uses too much memory for large config files #2221

Closed

Description

@TanvirTian

What happened in your environment?

oras manifest fetch-config can use too much memory when fetching a very large config file.

A malicious manifest can point to a very large config file, causing ORAS to download and store it in memory until the system runs out of memory

What did you expect to happen?

oras manifest fetch-config should reject config files that are too large before downloading them

How can we reproduce it?

  1. Start a local registry that returns a manifest with a config file size of more than 1 GiB.
  2. Configure the registry to return a large config blob when ORAS requests it.
  3. Run oras manifest fetch-config against the local registry:
./bin/linux/amd64/oras manifest fetch-config --plain-http 127.0.0.1:5001/test:latest &
set pid $last_pid
while kill -0 $pid 2>/dev/null
    awk '/VmRSS:/ {print "RSS:", $2, $3}' /proc/$pid/status
    sleep 0.2
end
wait $pid
  1. With the affected code, memory usage keeps growing as ORAS downloads the config blob. In our test, the process used around 2 GiB of memory before failing with a digest mismatch.
  2. The registry logs also show that ORAS requested the large blob after fetching the manifest.
Image

What is the version of your ORAS CLI?

1.3.4

What is your OS environment?

CachyOs(x86_64)

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Activity

  1. added
    bug
    triage
    on Oct 4, 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

    Labels

    bugtriage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions