# GHSA-g753-ghr7-q33w: cyfs-base vulnerable to misaligned pointer dereference in `ChunkId::new`

> A misaligned pointer dereference in cyfs-base can cause undefined behavior, potentially leading to crashes or arbitrary code execution.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 15 Jun 2023
- **Also known as:** RUSTSEC-2023-0046

## What is GHSA-g753-ghr7-q33w?

GHSA-g753-ghr7-q33w is a memory corruption vulnerability in cyfs-base, published on 15 Jun 2023. 

### Official description

The function `ChunkId::new` creates a misaligned pointer by casting mutable pointer of `u8` slice which has alignment 1 to the mutable pointer of `u32` which has alignment 4, and dereference the misaligned pointer leading UB, which should not be allowed in safe function.

## Which versions are affected by GHSA-g753-ghr7-q33w?

3 open source packages ship an affected version, including cyfs-base.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cyfs-base` | crates.io | All versions to 0.6.12 | None |
| `cyfs-base` | crates.io | All versions to 0.6.12 | None |
| `cyfs-base` | crates.io | From 0.0.0-0 | None |

## How do I fix GHSA-g753-ghr7-q33w?

No fix has been published for GHSA-g753-ghr7-q33w yet. Limit exposure of the affected software until one is available.

## Is GHSA-g753-ghr7-q33w being exploited?

There is no known exploitation of GHSA-g753-ghr7-q33w in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g753-ghr7-q33w and fix it if it is affected.

What it is: GHSA-g753-ghr7-q33w is a memory corruption vulnerability in cyfs-base, published on 15 Jun 2023. 
Exploitation: There is no known exploitation of GHSA-g753-ghr7-q33w in the wild and no public exploit code.

Affected packages and fixed versions:
- cyfs-base (crates.io): affected all versions up to 0.6.12; no fix listed
- cyfs-base (crates.io): affected all versions up to 0.6.12; no fix listed
- cyfs-base (crates.io): affected from 0.0.0-0; no fix listed

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-g753-ghr7-q33w/ (Markdown: https://insights.sbomify.com/GHSA-g753-ghr7-q33w/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g753-ghr7-q33w

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g753-ghr7-q33w/
Summaries are generated and may contain mistakes; the official description above is the record.
