CVE-2025-62491: Use-after-free in js_std_promise_rejection_check in QuickJS
A Use-After-Free (UAF) vulnerability exists in the QuickJS engine's standard library when iterating over the global list of unhandled rejected promises (ts->rejectedpromiselist).
The function jsstdpromiserejectioncheck attempts to iterate over the rejectedpromiselist to report unhandled rejections using a standard list loop.
The reason for a promise rejection is processed inside the loop, including calling jsstddumperror1(ctx, rp->reason).
If the promise rejection reason is an Error object that defines a custom property getter (e.g., via Object.defineProperty), this getter is executed during the error dumping process.
The malicious custom getter can execute JavaScript code that calls catch() on the same rejected promise being processed.
Calling catch() internally triggers jsstdpromiserejectiontracker, which then removes and frees the current promise entry (JSRejectedPromiseEntry) from the rejectedpromiselist.
Since the list iteration continues using the now-freed memory pointer (el), the subsequent loop access results in a Use-After-Free condition.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-62491?
CVE-2025-62491 is classified as a high severity vulnerability due to its potential to cause crashes and execute arbitrary code within the QuickJS engine.
How do I fix CVE-2025-62491?
To fix CVE-2025-62491, update to the latest version of the QuickJS engine where this vulnerability has been addressed.
What causes CVE-2025-62491?
CVE-2025-62491 is caused by a Use-After-Free vulnerability that occurs during the iteration over the global list of unhandled rejected promises.
Which software versions are affected by CVE-2025-62491?
CVE-2025-62491 affects versions of the QuickJS engine prior to the patch that resolves the Use-After-Free issue.
What are the potential impacts of CVE-2025-62491?
The potential impacts of CVE-2025-62491 include crashes, denial of service, and the possibility of arbitrary code execution in applications using the QuickJS engine.