CVE-2025-62493: Heap out-of-bounds read in js_bigint_to_string1 in QuickJS

Published Oct 16, 2025
·
Updated

A vulnerability exists in the QuickJS engine's BigInt string conversion logic (jsbiginttostring1) due to an incorrect calculation of the required number of digits, which in turn leads to reading memory past the allocated BigInt structure.

The function determines the number of characters (ndigits) needed for the string representation by calculating:

$$ \\ \text{n\digits} = (\text{n\bits} + \text{log2\radix} - 1) / \text{log2\radix}$$

$$$$This formula is off-by-one in certain edge cases when calculating the necessary memory limbs. For instance, a 127-bit BigInt using radix 32 (where $\text{log2\radix}=5$) is calculated to need $\text{n\digits}=26$.

The maximum number of bits actually stored is $\text{n\bits}=127$, which requires only two 64-bit limbs ($\text{JS\LIMB\BITS}=64$).

The conversion loop iterates $\text{n\digits}=26$ times, attempting to read 5 bits in each iteration, totaling $26 \times 5 = 130$ bits.

In the final iterations of the loop, the code attempts to read data that spans two limbs:

C

c = (r->tab[pos] >> shift) | (r->tab[pos + 1] << (JSLIMBBITS - shift));

Since the BigInt was only allocated two limbs, the read operation for r->tab[pos + 1] becomes an Out-of-Bounds Read when pos points to the last valid limb (e.g., $pos=1$).

This vulnerability allows an attacker to cause the engine to read and process data from the memory immediately following the BigInt buffer. This can lead to Information Disclosure of sensitive data stored on the heap adjacent to the BigInt object.

Affected Software

2 affected components
QuickJS QuickJS engine
Quickjs Project Quickjs<2025-09-13

Event History

Oct 16, 2025
CVE Published
via MITRE·03:51 PM
Data Sourced
via MITRE·03:51 PM
DescriptionWeakness
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-62493?

CVE-2025-62493 is classified as a high severity vulnerability due to potential memory corruption risks.

2

How do I fix CVE-2025-62493?

To fix CVE-2025-62493, you should update to the latest version of the QuickJS engine where the vulnerability has been addressed.

3

What causes CVE-2025-62493?

CVE-2025-62493 is caused by an incorrect calculation of the required number of digits in the BigInt string conversion logic.

4

What are the effects of CVE-2025-62493?

The effects of CVE-2025-62493 include the potential for reading memory beyond the allocated BigInt structure, which can lead to application crashes or exploitation.

5

Which versions of QuickJS are affected by CVE-2025-62493?

CVE-2025-62493 affects all versions of the QuickJS engine that have the vulnerable BigInt string conversion logic.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203