Skip to content
Heist/ feed
Back to feed
Medium

quickjs — security advisory

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

A vulnerability stemming from floating-point arithmetic precision errors exists in the QuickJS engine's implementation of TypedArray.prototype.indexOf() when a negative fromIndex argument is supplied. * The fromIndex argument (read as a double variable, $d$) is used to calculate the starting position for the search. * If d is negative, the index is calculated relative to the end of the array by adding the array's length (len) to d: $$d_{new} = d + \text{len}$$ * Due to the inherent limitations of floating-point arithmetic, if the negative value $d$ is extremely small (e.g., $-1 \times 10^{-20}$), the addition $d + \text{len}$ can result in a loss of precision, yielding an outcome that is exactly equal to $\text{len}$. * The result is then converted to an integer index $k$: $k = \text{len}$. * The search function proceeds to read array elements starting from index $k$. Since valid indices are $0$ to $\text{len}-1$, starting the read at index $\text{len}$ is one element past the end of the array. This allows an attacker to cause an Out-of-Bounds Read of one element immediately following the buffer. While the scope of this read is small (one element), it can potentially lead to Information Disclosure of adjacent memory contents, depending on the execution environment.

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-62492
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 02:32 UTC · Revision 1

Source evidence

UBUNTU-CVE-2025-62492

core-osv · Original source

Published 16 Oct 2025, 16:15 UTC

A vulnerability stemming from floating-point arithmetic precision errors exists in the QuickJS engine's implementation of TypedArray.prototype.indexOf() when a negative fromIndex argument is supplied. * The fromIndex argument (read as a double variable, $d$) is used to calculate the starting position for the search. * If d is negative, the index is calculated relative to the end of the array by adding the array's length (len) to d: $$d_{new} = d + \text{len}$$ * Due to the inherent limitations of floating-point arithmetic, if the negative value $d$ is extremely small (e.g., $-1 \times 10^{-20}$), the addition $d + \text{len}$ can result in a loss of precision, yielding an outcome that is exactly equal to $\text{len}$. * The result is then converted to an integer index $k$: $k = \text{len}$. * The search function proceeds to read array elements starting from index $k$. Since valid indices are $0$ to $\text{len}-1$, starting the read at index $\text{len}$ is one element past the end of the array. This allows an attacker to cause an Out-of-Bounds Read of one element immediately following the buffer. While the scope of this read is small (one element), it can potentially lead to Information Disclosure of adjacent memory contents, depending on the execution environment.

osv:UBUNTU-CVE-2025-62492

quickjs

Fixed versions: Not specified

quickjs

Fixed versions: Not specified

quickjs

Fixed versions: Not specified

quickjs

Fixed versions: Not specified

Complete source record
{
  "id": "b585fbde39742575edc91ce1b262c8620c1aa4b8d1e91c1bdd387ce8bdc5075c",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2025-62492",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2025-62492",
    "summary": "A vulnerability stemming from floating-point arithmetic precision errors exists in the QuickJS engine's implementation of TypedArray.prototype.indexOf() when a negative fromIndex argument is supplied. * The fromIndex argument (read as a double variable, $d$) is used to calculate the starting position for the search. * If d is negative, the index is calculated relative to the end of the array by adding the array's length (len) to d: $$d_{new} = d + \\text{len}$$ * Due to the inherent limitations of floating-point arithmetic, if the negative value $d$ is extremely small (e.g., $-1 \\times 10^{-20}$), the addition $d + \\text{len}$ can result in a loss of precision, yielding an outcome that is exactly equal to $\\text{len}$. * The result is then converted to an integer index $k$: $k = \\text{len}$. * The search function proceeds to read array elements starting from index $k$. Since valid indices are $0$ to $\\text{len}-1$, starting the read at index $\\text{len}$ is one element past the end of the array. This allows an attacker to cause an Out-of-Bounds Read of one element immediately following the buffer. While the scope of this read is small (one element), it can potentially lead to Information Disclosure of adjacent memory contents, depending on the execution environment.",
    "evidence": "osv:UBUNTU-CVE-2025-62492",
    "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-62492",
      "aliases": [
        "UBUNTU-CVE-2025-62492"
      ],
      "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-62492.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-62492.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-62492.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-62492.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.654424866Z",
      "provider": "osv",
      "upstream": [
        "CVE-2025-62492"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2025-62492",
        "https://www.cve.org/CVERecord?id=CVE-2025-62492",
        "https://issuetracker.google.com/434194797",
        "https://bellard.org/quickjs/Changelog"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2025-62492",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 358924,
  "published_at": "2025-10-16T16:15:00+00:00"
}