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 substreams #2002

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/substreams/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 = "substreams"
date = "2024-07-07"
url = "https://github.com/streamingfast/substreams-rs/issues/24"
informational = "unsound"
categories = ["memory-exposure"]

[affected.functions]
"substreams::memory::get_output_data" = ["<= 0.5.20"]
"substreams::memory::read_u32_from_heap" = ["<= 0.5.20"]
"substreams::proto::decode_ptr" = ["<= 0.5.20"]

[versions]
patched = []
```

# Unsoundly mark unsafe functions as safe

The functions `read_u32_from_heap`, `get_output_data`, and `decode_ptr` in crate
`substreams` are unsafe since they directly operate on the pointer passed in and
have requirements for the caller.

These functions allow the caller to access memory illegally and generate undefined
`Vec` which could lead to more undefined behaviors.