Skip to content
Heist/ feed
Back to feed
Medium

quickjs — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2025-62493

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 he

Products
quickjs
Affected versions
2021.03.27-1, 2021.03.27-1ubuntu0.1~esm1, 2024.01.13-5, 2025.04.26-1, 2025.04.26-1build1
Fixed versions
Not specified
CVEs
CVE-2025-62493
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 02:30 UTC · Revision 1

Source evidence

UBUNTU-CVE-2025-62493

core-osv · Original source

Published 16 Oct 2025, 16:15 UTC

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 he

osv:UBUNTU-CVE-2025-62493

quickjs

Fixed versions: Not specified

quickjs

Fixed versions: Not specified

quickjs

Fixed versions: Not specified

quickjs

Fixed versions: Not specified

Complete source record
{
  "id": "7f7d77e5b237da15213e754cf50e992cfab72b023daa415cf789febd8f35e61c",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2025-62493",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2025-62493",
    "summary": "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 he",
    "evidence": "osv:UBUNTU-CVE-2025-62493",
    "products": [
      {
        "name": {
          "value": "quickjs",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2021.03.27-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2021.03.27-1ubuntu0.1~esm1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "quickjs",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2024.01.13-5",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "2025.04.26-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "quickjs",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2025.04.26-1build1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "quickjs",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2025.04.26-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "2025.04.26-1build1",
            "evidence": "/affected/3/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2025-62493",
      "aliases": [
        "UBUNTU-CVE-2025-62493"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "quickjs",
            "purl": "pkg:deb/ubuntu/quickjs?arch=source&distro=esm-apps%2Fnoble",
            "ecosystem": "Ubuntu:Pro:24.04:LTS"
          },
          "versions": [
            "2021.03.27-1",
            "2021.03.27-1ubuntu0.1~esm1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-62493.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libquickjs",
                "binary_version": "2021.03.27-1ubuntu0.1~esm1"
              },
              {
                "binary_name": "quickjs",
                "binary_version": "2021.03.27-1ubuntu0.1~esm1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "quickjs",
            "purl": "pkg:deb/ubuntu/quickjs?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "2024.01.13-5",
            "2025.04.26-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-62493.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libquickjs",
                "binary_version": "2025.04.26-1"
              },
              {
                "binary_name": "quickjs",
                "binary_version": "2025.04.26-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "quickjs",
            "purl": "pkg:deb/ubuntu/quickjs?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "2025.04.26-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-62493.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libquickjs",
                "binary_version": "2025.04.26-1build1"
              },
              {
                "binary_name": "quickjs",
                "binary_version": "2025.04.26-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "quickjs",
            "purl": "pkg:deb/ubuntu/quickjs?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "2025.04.26-1",
            "2025.04.26-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-62493.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libquickjs",
                "binary_version": "2025.04.26-1build1"
              },
              {
                "binary_name": "quickjs",
                "binary_version": "2025.04.26-1build1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:58:38.026335553Z",
      "provider": "osv",
      "upstream": [
        "CVE-2025-62493"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2025-62493",
        "https://www.cve.org/CVERecord?id=CVE-2025-62493",
        "https://issuetracker.google.com/434193024",
        "https://bellard.org/quickjs/Changelog"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2025-62493",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 358903,
  "published_at": "2025-10-16T16:15:00+00:00"
}