rustsec / rustsec/advisory-db

Unsoundness in ninjabook

Open
#2,150 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/ninja-quant/ninjabook/issues/3 for detail.
Description
The get_mutand get function in the Orderbook implementation uses unsafe code to call Buffer::get_unchecked_mut, bypassing bounds checking. This function is unsound because it allows access to an arbitrary index without ensuring that the index is within bounds. If the caller provides an out-of-bounds index, the program will invoke undefined behavior (UB).

author didn't reply yet, so no patched version.

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 ninjabook issue for the missing details, then inspect the reported Orderbook get_mut and get functions and their use of Buffer::get_unchecked_mut. Confirm the out-of-bounds behavior and determine what advisory-database change, if any, the evidence supports; completion requires a clear, supported issue record.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.