Skip to content

[BUG]Heap-use-after-free in benchmark `RunSpecifiedBenchmarks #2240

Description

@eglonnnn

A clear and concise description of what the bug is.

A heap-use-after-free vulnerability in google/benchmark 1.9.4. When RunSpecifiedBenchmarks() is called with a filter that matches no registered benchmark, the static reporter pointer is freed but the cached pointer returned by CreateDefaultDisplayReporter() is not invalidated, causing a use-after-free on the next call.

Impact

  • Denial-of-service or potential memory corruption
  • Any application using the benchmark library with dynamic filtering is affected

Reproduction

All materials are available in my research repository:
https://github.com/eglonnnn/opensource-fuzz-vulnerability-research/tree/main/Heap-use-after-free%20in%20benchmark%20RunSpecifiedBenchmarks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions