CVE-2025-62493
Heap out-of-bounds read in js_bigint_to_string1 in QuickJS
A vulnerability exists in the QuickJS engine's BigInt string conversion logic (js_bigint_to_string1) 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 (n_digits) 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] << (JS_LIMB_BITS - 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.
Attack profile
How easy it is to exploit
- Attack vector
- Adjacent network
- Complexity
- High
- Privileges needed
- Low
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.9
Heap out-of-bounds read in js_bigint_to_string1 in QuickJS
A vulnerability exists in the QuickJS engine's BigInt string conversion logic (js_bigint_to_string1) 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 (n_digits) 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] << (JS_LIMB_BITS - 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.
- Record
CVE-2025-62493- CVSS 4.0
- 5.9 Medium
CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L - Weakness
- CWE-125
- Updated
- 2026-11-02
EUVDEUVD-2025-34781
5.9
A vulnerability exists in the QuickJS engine's BigInt string conversion logic (js_bigint_to_string1) 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 (n_digits) 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] << (JS_LIMB_BITS - 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.
- Record
EUVD-2025-34781- CVSS 4.0
- 5.9 Medium
CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-pff3-r4r5-gmxp
5.9
A vulnerability exists in the QuickJS engine's BigInt string conversion logic ...
A vulnerability exists in the QuickJS engine's BigInt string conversion logic (js_bigint_to_string1) 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 (n_digits) 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] << (JS_LIMB_BITS - 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.
- Record
GHSA-pff3-r4r5-gmxp- CVSS 4.0
- 5.9 Medium
CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-125
- Updated
- 2026-11-02
NVD
5.9
A vulnerability exists in the QuickJS engine's BigInt string conversion logic (js_bigint_to_string1) 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 (n_digits) 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] << (JS_LIMB_BITS - 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.
- Record
CVE-2025-62493- CVSS 4.0
- 5.9 Medium
CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-125
- Updated
- 2026-11-02
OSV
6.5
A vulnerability exists in the QuickJS engine's BigInt string conversion logic (js_bigint_to_string1) 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 (n_digits) 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] << (JS_LIMB_BITS - 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.
- Record
CVE-2025-62493- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVDEBIAN-CVE-2025-62493
6.5
A vulnerability exists in the QuickJS engine's BigInt string conversion logic (js_bigint_to_string1) 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 (n_digits) 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] << (JS_LIMB_BITS - 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.
- Record
DEBIAN-CVE-2025-62493- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2025-62493
5.9
A vulnerability exists in the QuickJS engine's BigInt string conversion logic (js_bigint_to_string1) 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 (n_digits) 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] << (JS_LIMB_BITS - 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.
- Record
UBUNTU-CVE-2025-62493- CVSS 4.0
- 5.9 Medium
CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
quickjsDebian:13 |
All versions, plus listed versions 2025.04.26-1 |
None known |
quickjsDebian:14 |
All versions, plus listed versions 2025.04.26-1 |
None known |
quickjsUbuntu:Pro:24.04:LTS |
All versions, plus listed versions 2021.03.27-12021.03.27-1ubuntu0.1~esm1 |
None known |
quickjsUbuntu:25.10 |
All versions, plus listed versions 2024.01.13-52025.04.26-1 |
None known |
quickjsUbuntu:26.10 |
All versions, plus listed versions 2025.04.26-1build1 |
None known |
quickjsUbuntu:26.04:LTS |
All versions, plus listed versions 2025.04.26-12025.04.26-1build1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-62493 is a medium vulnerability (CVSS 5.9) in Quickjs, published October 16, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.39%, the 33rd percentile. No source names a fixed version.