# GHSA-xcpm-76hf-c9cc: Borrowck Scarifices exposes uninitialized memory in any_as_u8_slice

> A Rust library function exposes uninitialized memory via unsafe slice creation, potentially leading to undefined behavior and information disclosure.

- **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:** 21 Oct 2025
- **Also known as:** RUSTSEC-2025-0107

## What is GHSA-xcpm-76hf-c9cc?

GHSA-xcpm-76hf-c9cc is a memory corruption vulnerability in borrowck_sacrifices, published on 21 Oct 2025. 

### Official description

The safe function `any_as_u8_slice` can create byte slices that reference uninitialized memory when used with types containing padding bytes.

The function uses `slice::from_raw_parts` to create a `&[u8]` covering the entire size of a type, including padding bytes. According to Rust's documentation, `from_raw_parts` requires all bytes to be properly initialized, but padding bytes in structs are not guaranteed to be initialized. This violates the safety contract and causes undefined behavior.

## Which versions are affected by GHSA-xcpm-76hf-c9cc?

3 open source packages ship an affected version, including borrowck_sacrifices.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `borrowck_sacrifices` | crates.io | All versions | 0.2.0 |
| `borrowck_sacrifices` | crates.io | All versions | 0.2.0 |
| `borrowck_sacrifices` | crates.io | From 0.0.0-0 | 0.2.0 |

## How do I fix GHSA-xcpm-76hf-c9cc?

Upgrade borrowck_sacrifices to 0.2.0 or later.

## Is GHSA-xcpm-76hf-c9cc being exploited?

There is no known exploitation of GHSA-xcpm-76hf-c9cc in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-xcpm-76hf-c9cc and fix it if it is affected.

What it is: GHSA-xcpm-76hf-c9cc is a memory corruption vulnerability in borrowck_sacrifices, published on 21 Oct 2025. 
Exploitation: There is no known exploitation of GHSA-xcpm-76hf-c9cc in the wild and no public exploit code.

Affected packages and fixed versions:
- borrowck_sacrifices (crates.io): affected all versions; fixed in 0.2.0
- borrowck_sacrifices (crates.io): affected all versions; fixed in 0.2.0
- borrowck_sacrifices (crates.io): affected from 0.0.0-0; fixed in 0.2.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-xcpm-76hf-c9cc/ (Markdown: https://insights.sbomify.com/GHSA-xcpm-76hf-c9cc/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-xcpm-76hf-c9cc

---
From sbomify Insights: https://insights.sbomify.com/GHSA-xcpm-76hf-c9cc/
Summaries are generated and may contain mistakes; the official description above is the record.
