# GHSA-pv22-fqcj-7xwh: Inspektor Gadget Security Policies Can be Bypassed

> A malicious client can bypass Inspektor Gadget security policies, allowing unauthorized gadget execution or image pulling if the client has access to the server or cluster.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 May 2025
- **Also known as:** GO-2025-3665

## What is GHSA-pv22-fqcj-7xwh?

GHSA-pv22-fqcj-7xwh is a vulnerability in github.com/inspektor-gadget/inspektor-gadget, published on 6 May 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Security policies like [`allowed-gadgets`](https://inspektor-gadget.io/docs/latest/reference/restricting-gadgets),  [`disallow-pulling`](https://inspektor-gadget.io/docs/latest/reference/disallow-pulling), [`verify-image`](https://inspektor-gadget.io/docs/latest/reference/verify-assets#verify-image-based-gadgets) can be bypassed by a malicious client.

### Impact

Users running `ig` in daemon mode or IG on Kubernetes that rely on any of the features mentioned above are vulnerable to this issue. In order to exploit this, the client needs access to the server, like the correct TLS certificates on the `ig daemon` case or access to the cluster in the Kubernetes case. 

### Patches

The issue has been fixed in v0.40.0

### Workarounds

There is not known workaround to fix it.

## Which versions are affected by GHSA-pv22-fqcj-7xwh?

3 open source packages ship an affected version, including github.com/inspektor-gadget/inspektor-gadget.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/inspektor-gadget/inspektor-gadget` | Go | From 0.31.0 | 0.40.0 |
| `github.com/inspektor-gadget/inspektor-gadget` | Go | From 0.31.0 | 0.40.0 |
| `github.com/inspektor-gadget/inspektor-gadget` | Go | From 0.31.0 | 0.40.0 |

## How do I fix GHSA-pv22-fqcj-7xwh?

Upgrade github.com/inspektor-gadget/inspektor-gadget to 0.40.0 or later.

## Is GHSA-pv22-fqcj-7xwh being exploited?

There is no known exploitation of GHSA-pv22-fqcj-7xwh in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-pv22-fqcj-7xwh and fix it if it is affected.

What it is: GHSA-pv22-fqcj-7xwh is a vulnerability in github.com/inspektor-gadget/inspektor-gadget, published on 6 May 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-pv22-fqcj-7xwh in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/inspektor-gadget/inspektor-gadget (Go): affected from 0.31.0; fixed in 0.40.0
- github.com/inspektor-gadget/inspektor-gadget (Go): affected from 0.31.0; fixed in 0.40.0
- github.com/inspektor-gadget/inspektor-gadget (Go): affected from 0.31.0; fixed in 0.40.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-pv22-fqcj-7xwh/ (Markdown: https://insights.sbomify.com/GHSA-pv22-fqcj-7xwh/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-pv22-fqcj-7xwh

---
From sbomify Insights: https://insights.sbomify.com/GHSA-pv22-fqcj-7xwh/
Summaries are generated and may contain mistakes; the official description above is the record.
