{"id":"CVE-2025-62496","aliases":["CVE-2025-62496"],"related":[],"kind":"vulnerability","state":"published","title":"Integer overflow in js_bigint_from_string in QuickJS","summary":"A vulnerability exists in the QuickJS engine's BigInt string parsing logic (js_bigint_from_string) when attempting to create a BigInt from a string with an excessively large number of digits.\n\nThe function calculates the necessary number of bits (n_bits) required to store the BigInt using the formula:\n\n$$\\text{n\\_bits} = (\\text{n\\_digits} \\times 27 + 7) / 8 \\quad (\\text{for radix 10})$$\n\n  *  For large input strings (e.g., $79,536,432$ digits or more for base 10), the intermediate calculation $(\\text{n\\_digits} \\times 27 + 7)$ exceeds the maximum value of a standard signed 32-bit integer, resulting in an Integer Overflow.\n\n\n  *  The resulting n_bits value becomes unexpectedly small or even negative due to this wrap-around.\n\n\n  *  This flawed n_bits is then used to compute n_limbs, the number of memory \"limbs\" needed for the BigInt object. Since n_bits is too small, the calculated n_limbs is also significantly underestimated.\n\n\n  *  The function proceeds to allocate a JSBigInt object using this underestimated n_limbs.\n\n\n  *  When the function later attempts to write the actual BigInt data into the allocated object, the small buffer size is quickly exceeded, leading to a Heap Out-of-Bounds Write as data is written past the end of the allocated r->tab array.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"A vulnerability exists in the QuickJS engine's BigInt string parsing logic (js_bigint_from_string) when attempting to create a BigInt from a string with an excessively large number of digits.\n\nThe function calculates the necessary number of bits (n_bits) required to store the BigInt using the formula:\n\n$$\\text{n\\_bits} = (\\text{n\\_digits} \\times 27 + 7) / 8 \\quad (\\text{for radix 10})$$\n\n  *  For large input strings (e.g., $79,536,432$ digits or more for base 10), the intermediate calculation $(\\text{n\\_digits} \\times 27 + 7)$ exceeds the maximum value of a standard signed 32-bit integer, resulting in an Integer Overflow.\n\n\n  *  The resulting n_bits value becomes unexpectedly small or even negative due to this wrap-around.\n\n\n  *  This flawed n_bits is then used to compute n_limbs, the number of memory \"limbs\" needed for the BigInt object. Since n_bits is too small, the calculated n_limbs is also significantly underestimated.\n\n\n  *  The function proceeds to allocate a JSBigInt object using this underestimated n_limbs.\n\n\n  *  When the function later attempts to write the actual BigInt data into the allocated object, the small buffer size is quickly exceeded, leading to a Heap Out-of-Bounds Write as data is written past the end of the allocated r->tab array.","source":"cvelist"},{"lang":"es","text":"Una vulnerabilidad existe en la lógica de análisis de cadenas BigInt del motor QuickJS (js_bigint_from_string) al intentar crear un BigInt a partir de una cadena con un número excesivamente grande de dígitos.\n\nLa función calcula el número necesario de bits (n_bits) requerido para almacenar el BigInt utilizando la fórmula:\n\n$$\\text{n\\_bits} = (\\text{n\\_digits} \\times 27 + 7) / 8 \\quad (\\text{para base 10})$$\n\n  *  Para cadenas de entrada grandes (por ejemplo, $79,536,432$ dígitos o más para base 10), el cálculo intermedio $(\\text{n\\_digits} \\times 27 + 7)$ excede el valor máximo de un entero con signo estándar de 32 bits, lo que resulta en un desbordamiento de entero.\n\n\n  *  El valor resultante de n_bits se vuelve inesperadamente pequeño o incluso negativo debido a este ajuste cíclico.\n\n\n  *  Este n_bits defectuoso se utiliza entonces para calcular n_limbs, el número de 'limbs' de memoria necesarios para el objeto BigInt. Dado que n_bits es demasiado pequeño, el n_limbs calculado también se subestima significativamente.\n\n\n  *  La función procede a asignar un objeto JSBigInt utilizando este n_limbs subestimado.\n\n\n  *  Cuando la función intenta posteriormente escribir los datos reales del BigInt en el objeto asignado, el pequeño tamaño del búfer se excede rápidamente, lo que lleva a una escritura fuera de límites en el heap a medida que los datos se escriben más allá del final del array r -> tab asignado.","source":"nvd"}],"published":"2025-10-16T15:52:05.654Z","modified":"2026-10-19T17:10:00.173Z","severity":{"scorer":"Google","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:H/VA:L/SC:H/SI:H/SA:L","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"Google","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:H/VA:L/SC:H/SI:H/SA:L","score":7.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-190"],"affected":[{"ranges":[{"type":"date","introduced":"2025-04-26","fixed":"2025-09-13","status":"affected"}],"vendor":"QuickJS","product":"QuickJS","package":"js_bigint_from_string","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"2025-09-13"}],"vendor":"quickjs_project","product":"quickjs","cpe":"cpe:2.3:a:quickjs_project:quickjs:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://bellard.org/quickjs/Changelog","tags":["release-notes"],"sources":["cvelist","nvd"]},{"url":"https://issuetracker.google.com/434193016","tags":["exploit","issue-tracking"],"sources":["cvelist","nvd"]}],"credits":["Google Big Sleep"],"assigner":"Google","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-10-16T17:26:14.998Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-62496","url":"https://www.cve.org/CVERecord?id=CVE-2025-62496","licence":"CVE Terms of Use","modified":"2025-10-16T17:26:25.654Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-62496","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-62496","licence":"Public domain","modified":"2026-10-19T17:10:00.173Z"}],"updatedAt":"2026-11-25T22:59:06.498Z","epss":{"score":0.00491,"percentile":0.43783,"date":"2026-12-01T12:00:22.000Z"}}