Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add advisory for unsound problems in workflow-core #2001

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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.13.3"]
"workflow_core::utils::buffer_as_slice_mut" = ["<= 0.13.3"]

[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.