Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions crates/workflow-core/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "workflow-core"
date = "2024-07-07"
url = "https://github.com/workflow-rs/workflow-rs/issues/11"
informational = "unsound"
categories = ["memory-exposure", "memory-corruption"]

[affected.functions]
"workflow_core::utils::buffer_as_slice" = ["<= 0.18.0"]
"workflow_core::utils::buffer_as_slice_mut" = ["<= 0.18.0"]

[versions]
patched = []
```

# Create illegal slice by util function

The util functions `buffer_as_slice` and `buffer_as_slice_mut` in crate
`workflow-core` are very powerful and useful to get slice of other types
but are rather unsafe as well:

1. The pointer calculation with `byte_offset` could lead to alignment problem, which is an undefined behavior.

2. The `from_raw_parts` could create an out-of-bound slice that allows the user to access or even change the memory illegally.