Description
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.
Published: 2026-01-29
Score: 6.6 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability resides in the Makefile.build template that the `ig image build` command uses to construct eBPF‑based gadget images. The template embeds build parameters directly into shell commands without proper escaping. An attacker who can influence the buildOptions structure (for example by supplying a malicious gadget manifest in a CI/CD pipeline) can inject shell commands that are executed during image creation. Depending on whether the `--local` flag is used, this execution may happen on the host where the `ig` command runs or inside the build container, giving the attacker command‑execution rights at the same privilege level as the `ig` process.

Affected Systems

Inspektor Gadget v0.48.1 and earlier. The product is distributed by Linux Foundation under the vendor product mapping inspektor‑gadget:inspektor‑gadget. All versions below 0.48.1 that employ the compromised Makefile.build template are vulnerable.

Risk and Exploitability

The CVSS score of 6.6 indicates a medium severity. The EPSS score of less than 1 % suggests a low probability of exploitation in the wild at the time of analysis, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalogue. The attack requires the attacker to control the buildOptions structure in the YAML gadget manifest or supply a malicious build.yml file, typically achievable in CI/CD pipelines building untrusted gadgets. If access is obtained, arbitrary commands can be executed with the same privileges as the ig process.

Generated by OpenCVE AI on May 2, 2026 at 00:50 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to Inspektor Gadget v0.51.1 or later where argument escaping has been corrected.
  • Restrict CI/CD pipelines to use trusted gadget manifests and prohibit untrusted input from remote sources.
  • Disable the image build functionality in environments where the gadget tool is not required or enforce the --local flag to confine execution to the build container.

Generated by OpenCVE AI on May 2, 2026 at 00:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-79qw-g77v-2vfh Inspektor Gadget: Command Injection via malicious buildOptions manipulation
History

Thu, 30 Apr 2026 20:00:00 +0000

Type Values Removed Values Added
Description 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.48.1 fixes the issue. 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.
References

Mon, 16 Mar 2026 18:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:linuxfoundation:inspektor_gadget:*:*:*:*:*:kubernetes:*:* cpe:2.3:a:linuxfoundation:inspektor_gadget:*:*:*:*:*:*:*:*

Tue, 03 Mar 2026 15:30:00 +0000

Type Values Removed Values Added
First Time appeared Linuxfoundation
Linuxfoundation inspektor Gadget
CPEs cpe:2.3:a:linuxfoundation:inspektor_gadget:*:*:*:*:*:kubernetes:*:*
Vendors & Products Linuxfoundation
Linuxfoundation inspektor Gadget
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}


Mon, 02 Feb 2026 17:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Fri, 30 Jan 2026 09:00:00 +0000

Type Values Removed Values Added
First Time appeared Inspektor-gadget
Inspektor-gadget inspektor-gadget
Vendors & Products Inspektor-gadget
Inspektor-gadget inspektor-gadget

Thu, 29 Jan 2026 22:00:00 +0000

Type Values Removed Values Added
Description 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.48.1 fixes the issue.
Title Inspektor Gadget has a Command Injection vulnerability in Makefile.build
Weaknesses CWE-77
CWE-78
References
Metrics cvssV4_0

{'score': 6.6, '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'}


Subscriptions

Inspektor-gadget Inspektor-gadget
Linuxfoundation Inspektor Gadget
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-04-30T19:21:40.531Z

Reserved: 2026-01-27T19:35:20.530Z

Link: CVE-2026-24905

cve-icon Vulnrichment

Updated: 2026-01-30T14:39:09.964Z

cve-icon NVD

Status : Modified

Published: 2026-01-29T22:15:55.200

Modified: 2026-04-30T20:16:23.340

Link: CVE-2026-24905

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-02T01:00:15Z

Weaknesses