# GHSA-mc9m-6fm9-pghc: Zoo Design Studio: Memory-corruption in memory handling of lib-kcl

> A race condition in kcl-lib causes use-after-free during concurrent environment access, potentially allowing code execution or crashes.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Aug 2026

## What is GHSA-mc9m-6fm9-pghc?

GHSA-mc9m-6fm9-pghc is an use after free vulnerability in zoo-kcl, published on 20 Aug 2026. 

### Official description

A race condition in kcl-lib can result in a use-after-free when accessing environments concurrently. During Vec reallocation, the previous buffer containing Box pointers is freed and replaced. A concurrent get_env operation that has already loaded a pointer to the old buffer may subsequently index into freed memory and retrieve a stale or corrupted Pin<Box<Environment>>.

## Which versions are affected by GHSA-mc9m-6fm9-pghc?

4 open source packages ship an affected version, including zoo-kcl and kcl-lib.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `zoo-kcl` | PyPI | All versions | 0.3.153 |
| `zoo-kcl` | PyPI | All versions | 0.3.153 |
| `kcl-lib` | crates.io | All versions | 0.2.153 |
| `kcl-lib` | crates.io | All versions | 0.2.153 |

## How do I fix GHSA-mc9m-6fm9-pghc?

Upgrade zoo-kcl to 0.3.153 or later.

## Is GHSA-mc9m-6fm9-pghc being exploited?

There is no known exploitation of GHSA-mc9m-6fm9-pghc in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-mc9m-6fm9-pghc and fix it if it is affected.

What it is: GHSA-mc9m-6fm9-pghc is an use after free vulnerability in zoo-kcl, published on 20 Aug 2026. 
Exploitation: There is no known exploitation of GHSA-mc9m-6fm9-pghc in the wild and no public exploit code.

Affected packages and fixed versions:
- zoo-kcl (PyPI): affected all versions; fixed in 0.3.153
- zoo-kcl (PyPI): affected all versions; fixed in 0.3.153
- kcl-lib (crates.io): affected all versions; fixed in 0.2.153
- kcl-lib (crates.io): affected all versions; fixed in 0.2.153

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-mc9m-6fm9-pghc/ (Markdown: https://insights.sbomify.com/GHSA-mc9m-6fm9-pghc/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-mc9m-6fm9-pghc

---
From sbomify Insights: https://insights.sbomify.com/GHSA-mc9m-6fm9-pghc/
Summaries are generated and may contain mistakes; the official description above is the record.
