# GHSA-67r5-rqwv-9p9q: `array-init-cursor` in version 0.2.0 and below is unsound when used with types that implement `Drop`

> The array-init-cursor library causes double-free vulnerabilities when used with types implementing Drop, potentially leading to memory corruption 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:** 27 Mar 2025
- **Also known as:** RUSTSEC-2025-0019

## What is GHSA-67r5-rqwv-9p9q?

GHSA-67r5-rqwv-9p9q is an use after free vulnerability in array-init-cursor, published on 27 Mar 2025. 

### Official description

The `Drop` implementation will get run twice when using the cursor.

This issue does not affect you, if you are using only using the crate with
types that are `Copy` such as `u8`.

This issue also does not affect you, if you are only depending on it through
the crate `planus`.

## Which versions are affected by GHSA-67r5-rqwv-9p9q?

3 open source packages ship an affected version, including array-init-cursor.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `array-init-cursor` | crates.io | All versions | 0.2.1 |
| `array-init-cursor` | crates.io | All versions | 0.2.1 |
| `array-init-cursor` | crates.io | From 0.0.0-0 | 0.2.1 |

## How do I fix GHSA-67r5-rqwv-9p9q?

Upgrade array-init-cursor to 0.2.1 or later.

## Is GHSA-67r5-rqwv-9p9q being exploited?

There is no known exploitation of GHSA-67r5-rqwv-9p9q in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-67r5-rqwv-9p9q and fix it if it is affected.

What it is: GHSA-67r5-rqwv-9p9q is an use after free vulnerability in array-init-cursor, published on 27 Mar 2025. 
Exploitation: There is no known exploitation of GHSA-67r5-rqwv-9p9q in the wild and no public exploit code.

Affected packages and fixed versions:
- array-init-cursor (crates.io): affected all versions; fixed in 0.2.1
- array-init-cursor (crates.io): affected all versions; fixed in 0.2.1
- array-init-cursor (crates.io): affected from 0.0.0-0; fixed in 0.2.1

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-67r5-rqwv-9p9q/ (Markdown: https://insights.sbomify.com/GHSA-67r5-rqwv-9p9q/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-67r5-rqwv-9p9q

---
From sbomify Insights: https://insights.sbomify.com/GHSA-67r5-rqwv-9p9q/
Summaries are generated and may contain mistakes; the official description above is the record.
