Skip to content
NOUMENResearch
Network
Engineering
, home page

IntelligenceFindingsNMN-2026-0087

Unsound API in `secp256k1` allows use-after-free and invalid deallocation from safe code

CandidateMachine- or researcher-generated; not independently verified.

In short

What to know.

Package
secp256k1 crates.iosecp256k1: from 0.24.0 before 0.24.2
What to do
Upgrade secp256k1 to 0.22.2 or 0.23.5 or 0.24.2 or later.
Severity
UnknownRated by the source advisory.
Confidence
HighThe affected range comes from the advisory; no system that uses the component has been assessed.

Verification

Where it stands.

  1. Candidate
  2. In review
  3. Reproduced
  4. Confirmed
  5. Resolved
  6. Disputed
  7. Withdrawn
Candidate Machine- or researcher-generated; not independently verified.

What each state means, and how a record moves between them.

7 listed

Sources

  1. OSV record RUSTSEC-2022-0070osv.devRetrieved 3 December 2026
  2. package reference for RUSTSEC-2022-0070crates.ioRetrieved 3 December 2026
  3. advisory reference for RUSTSEC-2022-0070rustsec.orgRetrieved 3 December 2026
  4. report reference for RUSTSEC-2022-0070github.comRetrieved 3 December 2026
  5. web reference for RUSTSEC-2022-0070github.comRetrieved 3 December 2026
  6. OSV record GHSA-969w-q74q-9j8vosv.devRetrieved 3 December 2026
  7. package reference for GHSA-969w-q74q-9j8vgithub.comRetrieved 3 December 2026

Full record

Finding
NMN-2026-0087
Category
vulnerability
Component
secp256k1 (crates.io)secp256k1: from 0.24.0 before 0.24.2
Severity
Unknown. Rated by the source advisory.The source advisory RUSTSEC-2022-0070 gives no severity label. Noumen has not assessed it.
Confidence
High.The affected range comes from the advisory; no system that uses the component has been assessed.
State
Candidate. Machine- or researcher-generated; not independently verified.
Disclosure
Public
Mitigation
Upgrade secp256k1 to 0.22.2 or 0.23.5 or 0.24.2 or later.
Discovery method
imported from a public advisory by the Advisory Monitor (1.0.0)Machine-generated by the agent advisory-monitor@1.0.0.
Reproduction
No reproduction steps recorded.
Affected systems
None listed. A link to a system needs its own evidence.
Attribution
Researcher: advisory-monitor@1.0.0 (agent, machine-generated)Validators: None yet
Assigned reviewer
Nobody yet
Dates
Created 3 December 2026, 16:49 UTCUpdated 3 December 2026, 16:49 UTC
Summary, as published by the source advisory
As published by the source advisory
Because of incorrect bounds on method `Secp256k1::preallocated_gen_new` it was possible to cause use-after-free from safe consumer code. It was also possible to "free" memory not allocated by the appropriate allocator. The method takes a place for storing the context as a mutable reference and returns context containing that reference. Because the code internally uses `unsafe` and the bounds were incorrect it was possible to create a context that outlived the passed reference (e.g. `'static`). Because the context can alternatively carry heap-allocated pointer freed on drop it was possible to "deallocate" a pointer that wasn't returned from appropriate allocator. The code decides whether to free the memory based on type parameter but because of missing bound it was possible to construct the context with invalid parameter. You are unaffected if you either * don't call `Secp256k1::preallocated_gen_new` * manually checked that your usage of the method is sound * upgraded to the patched version of `secp256k1` (recommended) The patched version uses correct bounds which means it is API-breaking. This effectively means adopting the policy of Rust lang itself allowing API-breaking changes to fix soundness bugs. Note however that valid straightforward usage of the code will continue to compile. Only unsound code or code that propagates the bound in custom generics will fail to compile. If the code is sound fixing the bounds should be sufficient to make the code compile. See the [GitHub issue](https://github.com/rust-bitcoin/rust-secp256k1/issues/543) for example "exploit" code and further discussion.

2 events, oldest first

History

History verified: 2 eventsLatest hashc3cdca55a220c3cdca55a220c34b99003b194d5b54e8db8c3821b7c3a1c7fc1719ad9cccc944

  1. Record createdMachine-generated

    By advisory-monitor@1.0.0 (agent, machine-generated)

    Reason: Imported from public advisory GHSA-969w-q74q-9j8v.

    Entered the record in the state Candidate.

    Event 1 hash143ad1480b1b143ad1480b1b4ef713ac744a44f3013ccb6e39d316551f65e4c4c4d76fb96759
  2. CorrectionMachine-generated

    By advisory-monitor@1.0.0 (agent, machine-generated)

    Reason: The source advisory RUSTSEC-2022-0070 changed.

    Sources

    Before

    [ { "url": "https://osv.dev/vulnerability/GHSA-969w-q74q-9j8v", "title": "OSV record GHSA-969w-q74q-9j8v", "retrieved": "2026-12-03" }, { "url": "https://github.com/rust-bitcoin/rust-secp256k1/issues/543", "title": "web reference for GHSA-969w-q74q-9j8v", "retrieved": "2026-12-03" }, { "url": "https://github.com/rust-bitcoin/rust-secp256k1", "title": "package reference for GHSA-969w-q74q-9j8v", "retrieved": "2026-12-03" }, { "url": "https://rustsec.org/advisories/RUSTSEC-2022-0070.html", "title": "web reference for GHSA-969w-q74q-9j8v", "retrieved": "2026-12-03" } ]

    After

    [ { "url": "https://osv.dev/vulnerability/RUSTSEC-2022-0070", "title": "OSV record RUSTSEC-2022-0070", "retrieved": "2026-12-03" }, { "url": "https://crates.io/crates/secp256k1", "title": "package reference for RUSTSEC-2022-0070", "retrieved": "2026-12-03" }, { "url": "https://rustsec.org/advisories/RUSTSEC-2022-0070.html", "title": "advisory reference for RUSTSEC-2022-0070", "retrieved": "2026-12-03" }, { "url": "https://github.com/rust-bitcoin/rust-secp256k1/issues/543", "title": "report reference for RUSTSEC-2022-0070", "retrieved": "2026-12-03" }, { "url": "https://github.com/rust-bitcoin/rust-secp256k1/pull/548", "title": "web reference for RUSTSEC-2022-0070", "retrieved": "2026-12-03" }, { "url": "https://osv.dev/vulnerability/GHSA-969w-q74q-9j8v", "title": "OSV record GHSA-969w-q74q-9j8v", "retrieved": "2026-12-03" }, { "url": "ht... (135 more characters)

    Summary

    Before

    Because of incorrect bounds on method `Secp256k1::preallocated_gen_new` it was possible to cause use-after-free from safe consumer code. It was also possible to "free" memory not allocated by the appropriate allocator. The method takes a place for storing the context as a mutable reference and returns context containing that reference. Because the code internally uses `unsafe` and the bounds were incorrect it was possible to create a context that outlived the passed reference (e.g. `'static`). Because the context can alternatively carry heap-allocated pointer freed on drop it was possible to "deallocate" a pointer that wasn't returned from appropriate allocator. The code decides whether to free the memory based on type parameter but because of missing bound it was possible to construct the context with invalid parameter. You are unaffected if you either * don't call `Secp256k1::preall... (722 more characters)

    After

    Because of incorrect bounds on method `Secp256k1::preallocated_gen_new` it was possible to cause use-after-free from safe consumer code. It was also possible to "free" memory not allocated by the appropriate allocator. The method takes a place for storing the context as a mutable reference and returns context containing that reference. Because the code internally uses `unsafe` and the bounds were incorrect it was possible to create a context that outlived the passed reference (e.g. `'static`). Because the context can alternatively carry heap-allocated pointer freed on drop it was possible to "deallocate" a pointer that wasn't returned from appropriate allocator. The code decides whether to free the memory based on type parameter but because of missing bound it was possible to construct the context with invalid parameter. You are unaffected if you either * don't call `Secp256k1::preall... (722 more characters)

    Affected versions

    Before

    [ { "name": "secp256k1", "ranges": [ { "fixed": "0.22.2", "introduced": "0.14.0" } ], "ecosystem": "crates.io" }, { "name": "secp256k1", "ranges": [ { "fixed": "0.23.5", "introduced": "0.23.0" } ], "ecosystem": "crates.io" }, { "name": "secp256k1", "ranges": [ { "fixed": "0.24.2", "introduced": "0.24.0" } ], "ecosystem": "crates.io" } ]

    After

    [ { "name": "secp256k1", "ranges": [ { "fixed": "0.24.2", "introduced": "0.24.0" } ], "ecosystem": "crates.io" } ]

    Severity

    Before

    moderate

    After

    unknown

    Mitigation

    Before

    Upgrade secp256k1 to 0.22.2 or later. Upgrade secp256k1 to 0.23.5 or later. Upgrade secp256k1 to 0.24.2 or later.

    After

    Upgrade secp256k1 to 0.22.2 or 0.23.5 or 0.24.2 or later.

    severityRationale

    Before

    Severity as labelled by the source advisory GHSA-969w-q74q-9j8v. Noumen has not assessed it.

    After

    The source advisory RUSTSEC-2022-0070 gives no severity label. Noumen has not assessed it.

    Event 2 hashc3cdca55a220c3cdca55a220c34b99003b194d5b54e8db8c3821b7c3a1c7fc1719ad9cccc944
About this record

Severity and confidence are rated separately, each with its own reason.

History events are never edited or deleted. Each stores the hash of the one before, so a later change breaks the chain.

Corrections keep the value before and after.