{"id":"CVE-2026-24905","published":"2026-01-29T21:29:24Z","modified":"2026-04-30T19:21:40Z","title":"Inspektor Gadget has a Command Injection vulnerability in Makefile.build","vendor":"inspektor-gadget","product":"inspektor-gadget","tier":"tail","description":{"text":"Inspektor Gadget is a set of tools and framework for data collection and system inspection on Kubernetes clusters and Linux hosts using eBPF. The `ig` binary provides a subcommand for image building, used to generate custom gadget OCI images. A part of this functionality is implemented in the file `inspektor-gadget/cmd/common/image/build.go`. The `Makefile.build` file is the Makefile template employed during the building process. This file includes user-controlled data in an unsafe fashion, specifically some parameters are embedded without an adequate escaping in the commands inside the Makefile. Prior to version 0.48.1, this implementation is vulnerable to command injection: an attacker able to control values in the `buildOptions` structure would be able to execute arbitrary commands during the building process. An attacker able to exploit this vulnerability would be able to execute arbitrary command on the Linux host where the `ig` command is launched, if images are built with the `--local` flag or on the build container invoked by `ig`, if the `--local` flag is not provided. The `buildOptions` structure is extracted from the YAML gadget manifest passed to the `ig image build` command. Therefore, the attacker would need a way to control either the full `build.yml` file passed to the `ig image build` command, or one of its options. Typically, this could happen in a CI/CD scenario that builds untrusted gadgets to verify correctness. Version 0.51.1 fixes the issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.6,"severity":"MEDIUM","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01392,"percentile":0.73042,"provenance":"source"},"cwes":[{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"},{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"references":[{"url":"https://github.com/inspektor-gadget/inspektor-gadget/security/advisories/GHSA-79qw-g77v-2vfh","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/inspektor-gadget/inspektor-gadget/commit/7c83ad84ff7a68565655253e2cf1c5d2da695c1a","tags":["x_refsource_MISC"]},{"url":"https://github.com/inspektor-gadget/inspektor-gadget/commit/d9bf2fe4a180dad33ce57ca793ff4799ee7b8320","tags":["x_refsource_MISC"]}],"priority":{"score":19.2,"factors":[{"name":"EPSS percentile","points":14.61},{"name":"CVSS severity","points":4.62}]},"vendorSlug":"inspektor-gadget","affectedVersions":[{"vendor":"inspektor-gadget","product":"inspektor-gadget","versions":["< 0.51.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-01-30T14:39:04.833042Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"github.com/inspektor-gadget/inspektor-gadget","vulnerableRanges":["<0.51.1"],"patched":["0.51.1"],"from":["GHSA-79qw-g77v-2vfh","GO-2026-5211"],"provenance":"source"}],"summary":{"text":"Inspektor Gadget's image build functionality, specifically the Makefile.build template used by the ig binary during custom gadget OCI image builds, embeds user-controlled parameters without adequate escaping in its commands. An attacker who can control values in the buildOptions structure, either by supplying the build manifest or one of its options (for example in a CI/CD pipeline building untrusted gadgets), can execute arbitrary commands on the Linux host running ig when --local is used, or inside the build container otherwise.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:33:25Z"},"euvd":{"id":"EUVD-2026-4954","exploited":false,"provenance":"source"}}