CVE-2026-53941: Integer Overflow

Published Aug 19, 2026
·
Updated

Summary

An unprivileged container can block all other containers from starting on the same host by placing a crafted /etc/ld.so.cache file in its filesystem. When Inspektor Gadget attaches any uprobe-based gadget, it parses this file in the container startup path. A malicious cache causes ~53 seconds of CPU burn, during which Docker cannot start any other container. No special capabilities are required.

Severity

To be assessed — Availability impact, no confidentiality or integrity impact.

Affected Versions

All versions of Inspektor Gadget that support uprobe-based gadgets (tracemalloc, traceopen, tracessl, tracegrpc, etc.).

Description

When Inspektor Gadget attaches uprobe-based gadgets to containers, it resolves library paths by parsing the container's /etc/ld.so.cache file (pkg/uprobetracer/ldcacheparser.go). This file is fully controlled by the container.

The parser has three vulnerabilities:

1. Quadratic string building (pkg/uprobetracer/bytes.go:36-44): The readStringFromBytes function concatenates one byte at a time (res += string(data[i])), which is O(n²) in Go due to string immutability. With a 16MB cache file containing large regions without null terminators, this causes massive CPU and memory churn.

2. Insufficient entry count validation (pkg/uprobetracer/ldcacheparser.go:120): The EntryCount field is read directly from the untrusted file. While a per-entry bounds check prevents out-of-bounds access, the loop still iterates up to (fileSize - headerSize) / entrySize ≈ 700,000 times, calling readStringFromBytes on each iteration.

3. Integer overflow in format detection (pkg/uprobetracer/ldcacheparser.go:174): The cache1Len computation uses uint32 arithmetic (ldCache1Size + cache1.EntryCountldCache1EntrySize). With a crafted EntryCount, this overflows and produces a small value, causing the parser to misidentify the cache format.

Combined, these cause ~53 seconds of CPU burn per container attachment when a crafted 16MB /etc/ld.so.cache is present.

Impact

- Container runtime DoS: IG uses fanotify hooks (pkg/container-hook) to pause container startup until uprobe attachment completes. While IG is blocked processing the malicious cache, this pause is held, and Docker serializes container starts — meaning no other container can start on the host until IG finishes. This effectively causes a denial of service on the entire container runtime, not just on IG itself. - Container startup delay: When any uprobe-based gadget is running (tracemalloc, tracessl, etc.), starting a container with a crafted ld.so.cache delays startup by ~1 minute. - Monitoring degradation: The IG daemon is blocked processing the malicious cache, potentially missing events from other containers. - Amplification: Multiple containers with crafted caches can be started simultaneously to amplify the effect. - No special privileges required: Any container can include a crafted /etc/ld.so.cache in its image, mount one via a volume, or overwrite it at runtime before IG starts a uprobe gadget. In this last case, IG inspects all already-running containers when the gadget starts — this still burns CPU but does not block other containers from starting (since the fanotify pause only applies to new container starts).

Root Cause Analysis

In pkg/uprobetracer/ldcacheparser.go, the function readCacheFormat2 is called with the full file content:

go for i := uint32(0); i < ldCache.EntryCount; i++ { entryOffset := ldEntriesOffset + ildCache2EntrySize if uint32(len(data)) <= entryOffset+ldCache2EntrySize { return nil // bounds check stops iteration } // ... reads entry ... key := readStringFromBytes(data, keyOffset) // O(n²) per call value := readStringFromBytes(data, valueOffset) // O(n²) per call }

The per-entry bounds check correctly prevents out-of-bounds access, but: - The loop iterates ~700K times (limited by file size, not EntryCount) - Each readStringFromBytes call uses quadratic string concatenation

In pkg/uprobetracer/bytes.go:

go func readStringFromBytes(data []byte, startPos uint32) string { res := "" for i := startPos; i < uint32(len(data)); i++ { if data[i] == 0 { return res } res += string(data[i]) // O(n²) — allocates new string each iteration } return "" }

Note on Slice Bounds Checks

The code also performs slice accesses without proper bounds checks (e.g., data[:len(cache2Header)] when data may be shorter than 20 bytes, and ldCacheFile[:len(cache1Header)] when the file may be shorter than 11 bytes).

In practice, a malicious container cannot currently trigger a panic from these missing checks. This is because Go's io.ReadAll (used to read the file) always returns slices with cap >= 512 due to its initial buffer allocation (make([]byte, 0, 512) in Go's standard library). In Go, s[:n] only panics when n > cap(s), not when n > len(s). Since both header lengths (11 and 20) are well below 512, the slice expressions succeed — they simply read zero bytes beyond len, which don't match any valid header magic.

However, this relies on an undocumented implementation detail of io.ReadAll which could change in future Go versions. The bounds checks are still necessary for correctness and defense in depth.

Affected Software

1 affected componentFixes available
go/github.com/inspektor-gadget/inspektor-gadget>=0.27.0<0.53.1
0.53.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/inspektor-gadget/inspektor-gadget to a version that resolves this vulnerability.

    Fixed in 0.53.1

Event History

Aug 19, 2026
Advisory Published
via GitHub·07:16 PM
Data Sourced
via GitHub·07:16 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which environments are exposed to this denial of service?

Hosts running Inspektor Gadget versions that support uprobe-based gadgets are affected. Exposure occurs when Inspektor Gadget attaches a uprobe-based gadget, such as trace_malloc, trace_open, trace_ssl, or trace_grpc, to a container.

2

What does an attacker need to exploit this issue?

An attacker needs the ability to control the filesystem of an unprivileged container and place a crafted /etc/ld.so.cache file in it. No special container capabilities are required.

3

What operational symptoms indicate exploitation?

Attaching a uprobe-based gadget to the crafted container can cause roughly 53 seconds of CPU consumption in the container startup path. During that period, Docker cannot start other containers on the same host.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203