Cloudanix VulnDB

CVE-2024-38517

High · 7.8

CVSS

7.8

EPSS

0.4%

Published

Jul 9, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A specially made file can trick programs that read JSON into giving an attacker higher access rights on a computer if the user opens that file.

Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Privilege Gain
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Integer underflow in GenericReader::ParseNumber() during JSON stream parsing leads to memory corruption that can be leveraged for local privilege escalation.

Why it matters to the business

Attackers who trick users into opening a malicious file can obtain elevated privileges on the affected system, risking data theft or further compromise of developer and build environments that embed this library.

How an attack unfolds

An attacker crafts a JSON document containing specially chosen numeric values that trigger the underflow in ParseNumber when the file is parsed by an application using the vulnerable RapidJSON code; the resulting memory corruption is used to escalate privileges on the local machine.

How to fix it

Upgrade fmalita/rapidjson to commit 8269bc2bc289e9d343bae51cdf6d23ef0950e001 or later; rebuild and redeploy all dependent applications and containers.

How to confirm the fix worked

Confirm the library commit hash or version string matches the fixed revision; recompile a test binary and attempt to parse a known-triggering JSON payload to verify absence of the underflow condition.

Typical attack path

  1. Create a JSON file containing numeric values that trigger the integer underflow in GenericReader::ParseNumber
  2. Deliver the crafted file to the target user via email, download link, or shared storage
  3. Victim opens the file with an application that links against the vulnerable RapidJSON library
  4. Library parses the malicious numeric field and the underflow occurs
  5. Memory corruption is exploited to elevate privileges

How to detect it

Review application logs for unexpected crashes or errors during JSON parsing of files received from external sources; monitor for processes that suddenly spawn with elevated privileges after handling JSON input.

What your security team should do

  • Immediately update all copies of RapidJSON to the fixed commit and rebuild dependent software
  • Scan source repositories and build pipelines for the vulnerable commit hash
  • Add automated dependency checks that flag RapidJSON versions prior to 8269bc2bc289e9d343bae51cdf6d23ef0950e001

The record

Tencent RapidJSON is vulnerable to privilege escalation due to an integer underflow in the `GenericReader::ParseNumber()` function of `include/rapidjson/reader.h` when parsing JSON text from a stream. An attacker needs to send the victim a crafted file which needs to be opened; this triggers the integer underflow vulnerability (when the file is parsed), leading to elevation of privilege.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 rapidjson 0 No fix
Debian:12 rapidjson 0 No fix
Debian:13 rapidjson 0 No fix
Mageia:9 rapidjson 0 1.1.0-6.1.mga9
Ubuntu:20.04:LTS rapidjson 0 No fix
Ubuntu:22.04:LTS rapidjson 0 No fix
Ubuntu:24.04:LTS rapidjson 0 No fix
Ubuntu:24.10 rapidjson 0 No fix
Ubuntu:24.10 rapidjson 0 1.1.0+dfsg2-7.3ubuntu0.1
Ubuntu:25.04 rapidjson 0 No fix
Ubuntu:25.10 rapidjson 0 No fix
Ubuntu:Pro:16.04:LTS rapidjson 0 No fix
Ubuntu:Pro:16.04:LTS rapidjson 0 0.12~git20141031-3ubuntu0.1~esm1
Ubuntu:Pro:18.04:LTS rapidjson 0 No fix
Ubuntu:Pro:18.04:LTS rapidjson 0 1.1.0+dfsg2-3ubuntu0.1~esm1
Ubuntu:Pro:20.04:LTS rapidjson 0 1.1.0+dfsg2-5ubuntu1+esm1
Ubuntu:Pro:22.04:LTS rapidjson 0 1.1.0+dfsg2-7ubuntu0.1~esm1
Ubuntu:Pro:24.04:LTS rapidjson 0 1.1.0+dfsg2-7.2ubuntu0.1~esm1

Related vulnerabilities