Heap-based Buffer Overflow Affecting qpdf/qpdf package, versions [,11.9.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.07% (19th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-QPDFQPDF-6348796
  • published1 Mar 2024
  • disclosed29 Feb 2024
  • creditChen zhiyuan

Introduced: 29 Feb 2024

CVE-2024-24246  (opens in a new tab)
CWE-122  (opens in a new tab)

How to fix?

Upgrade qpdf/qpdf to version 11.9.0 or higher.

Overview

Affected versions of this package are vulnerable to Heap-based Buffer Overflow due to the improper handling of objects in memory by the std::__shared_count() function. An attacker can cause a denial of service by crafting a malicious input.

PoC

git clone https://github.com/qpdf/qpdf
cd qpdf
./build-scripts/build-linux
#Modified the instruction to add ASAN.
#cmake -S . -B build -DCI_MODE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
#      -DREQUIRE_CRYPTO_OPENSSL=1 -DREQUIRE_CRYPTO_GNUTLS=1   \
#      -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fsanitize=address" \
#      -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fsanitize=address" \

CVSS Base Scores

version 3.1