rustsec / rustsec/advisory-db

Unsoundness in perpetual

Open
#2,149 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.