Skip to content

Add unsound advisory for caja (as_mut_slice aliasing) - #3493

Closed
MJUCOM wants to merge 1 commit into
rustsec:mainfrom
MJUCOM:caja-as-mut-slice-aliasing
Closed

MJUCOM wants to merge 1 commit into
rustsec:mainfrom
MJUCOM:caja-as-mut-slice-aliasing

Conversation

@MJUCOM

@MJUCOM MJUCOM commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Affected crate(s)

caja (~5.5k total downloads on crates.io) — all versions before 0.3.2

Links to upstream issue(s) or PR(s)

Severity

Caja::as_mut_slice() takes &self but returns &mut [T] over the whole array.
Since any number of shared borrows of a Caja can exist, calling it twice gives two
live mutable slices of the same elements, which breaks Rust's aliasing rules. A write
through one slice is visible through the other, and Miri reports the access as
undefined behavior.

Filed as a soundness issue: no unsafe is required from the caller, and the effect
is aliasing &mut references (undefined behavior), not a demonstrated memory
corruption.

Checklist

  • Advisory filename(s) starts with RUSTSEC-0000-0000 as the ID
  • date field is set to the public disclosure date
  • Contains a concise and descriptive title after advisory metadata
  • Asked maintainer(s) if publishing an advisory is appropriate

@djc

djc commented Nov 3, 2026

Copy link
Copy Markdown
Member

At 42 recent downloads (the pull request template asked for recent downloads, not all-time downloads), this crate doesn't meet our notability criteria:

#wg-secure-code > Minimum notability criteria?

@djc djc closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants