CVE-2018-6345CWE-122

The function number_format is vulnerable to a heap overflow issue when its second argument ($dec_points) is excessively large

published January 15, 2019

CVSS
—
EPSS
2%
Percentile
77.5
In the wild
Unconfirmed
What it is

⚠️ A heap overflow lurking in the number_format function? That's right! An oversized argument could lead to some seriously chaotic behavior. 🔥 Think of it like trying to fit an elephant into a tiny car. The car (your function) simply can't handle the size of the elephant (the excessively large second argument), leading to a messy overflow everywhere! If an attacker is crafty enough to exploit this, they could create a scenario where the system misbehaves due to the invalid string length, potentially causing crashes or erratic behavior of your application. While no known exploit exists yet, the risk of unexpected consequences is definitely there!

Put simply

Think of it like trying to fit an elephant into a tiny car. The car (your function) simply can't handle the size of the elephant (the excessively large second argument), leading to a messy overflow everywhere! The vulnerability in the number_format function arises when an excessively large value is passed as the second argument ($dec_points). This causes the function to generate a string with an invalid length, which can clash with other functions and lead to instability.

What to do

If an attacker is crafty enough to exploit this, they could create a scenario where the system misbehaves due to the invalid string length, potentially causing crashes or erratic behavior of your application. While no known exploit exists yet, the risk of unexpected consequences is definitely there! To remediate this, ensure you validate and sanitize inputs to the number_format function, checking that $dec_points remains within a safe range. Consider updating to the latest version of HHVM to gain any relevant fixes, focusing on versions 3.30.1 and above. You've got this! With a little input validation, you'll keep your code safe and sound. 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.01748 · 77.5th percentile
Weakness
CWE-122 · Heap-based Buffer Overflow
Published
2019-01-15T22:00Z
EPSS history
Timeline
  • 15 JAN 22:00Z
    The function number_format is vulnerable to a heap overflow issue when its second argument ($dec_points) is excessively large
    cvelistv5