# GHSA-g35x-j6jj-8g7j: @mittwald/kubernetes's secret contents leaked via debug logging

> Enabling debug logging in the Kubernetes client library leaks sensitive Secret data to logs, exposing it to unauthorized users with log access.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 May 2023

## What is GHSA-g35x-j6jj-8g7j?

GHSA-g35x-j6jj-8g7j is a vulnerability in @mittwald/kubernetes, published on 2 May 2023. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

### Impact

When debug logging is enabled (via `DEBUG` environment variable), the Kubernetes client may log all response bodies into the debug log -- including sensitive data from `Secret` resources.

When running in a Kubernetes cluster, this might expose sensitive information to users who are _not_ authorised to access secrets, but have access to Pod logs (either directly using kubectl, or by Pod logs being shipped elsewhere).

### Patches
Upgrade to 3.5.0 or newer.

### Workarounds
Disable debug logging entirely, or exclude the `kubernetes:client` debug item (for example, using `DEBUG=*,-kubernetes:client`).

### References

- https://cwe.mitre.org/data/definitions/532.html

## Which versions are affected by GHSA-g35x-j6jj-8g7j?

2 open source packages ship an affected version, including @mittwald/kubernetes.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@mittwald/kubernetes` | npm | All versions | 3.5.0 |
| `@mittwald/kubernetes` | npm | All versions | 3.5.0 |

## How do I fix GHSA-g35x-j6jj-8g7j?

Upgrade @mittwald/kubernetes to 3.5.0 or later.

## Is GHSA-g35x-j6jj-8g7j being exploited?

There is no known exploitation of GHSA-g35x-j6jj-8g7j in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g35x-j6jj-8g7j and fix it if it is affected.

What it is: GHSA-g35x-j6jj-8g7j is a vulnerability in @mittwald/kubernetes, published on 2 May 2023. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-g35x-j6jj-8g7j in the wild and no public exploit code.

Affected packages and fixed versions:
- @mittwald/kubernetes (npm): affected all versions; fixed in 3.5.0
- @mittwald/kubernetes (npm): affected all versions; fixed in 3.5.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-g35x-j6jj-8g7j/ (Markdown: https://insights.sbomify.com/GHSA-g35x-j6jj-8g7j/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g35x-j6jj-8g7j

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g35x-j6jj-8g7j/
Summaries are generated and may contain mistakes; the official description above is the record.
