Unsoundness in perpetual
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1.2k
- Forks
- 544
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 45
Description
see https://github.com/perpetual-ml/perpetual/issues/34 for detail.
Description
Both from_parent_child and from_parent_two_children functions use unsafe { hist_tree.get_unchecked(...) } to access elements of the hist_tree slice without bounds checking. This is unsafe and can result in undefined behavior (UB) if the provided indices (root_num, child_num, update_num, first_num, second_num) are out of bounds. The lack of bounds checking makes these functions unsound.
declear histogram as a pub mod and from_parent_child , from_parent_two_children as pub function cause the result. According to the authors, these two functions should not be used externally, so it is possible to fix these problems by changing them to pub(crate).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked perpetual issue for the complete vulnerability details and affected functions. Then determine whether this advisory-db issue needs an advisory entry or only upstream remediation; done means the required security record or clearly scoped follow-up is present, with the proposed visibility change verified against the upstream project.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100