You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Array.prototype.push on a fast array that was previously grown with a.length =
leaves the array's element accounting inconsistent, and a later GC over-decrements
a child reference. JS_REF_COUNT underflows — a use-after-free / over-free
reachable from plain, untrusted JavaScript.
Environment
quickjs-ng commit 3c8f3d6, x86_64 Linux, clang, -O2 -g. A build with
assertions enabled aborts at the assert below; a normal release build segfaults
in the same GC pass instead.
Reproducer
Aborts / segfaults on ~100% of runs (12/12 here):
varkeep=[];for(leti=0;i<30;i++){vara=[0];a.length=245;// grow the fast array with hole slotsa.push(2);// append after the growkeep.push(a);// keep it alive so GC has to scan it}
The same corruption also surfaces (with other inputs on the length-grow +
array-builtin path) as an out-of-bounds free in set_array_length
(quickjs.c:10324) and an OOB read in js_array_finalizer (quickjs.c:6877).
Root cause
Growing a small fast array via a.length = N extends u.array.count with hole
slots; the following a.push() on that grown array leaves u.array.count and the
references actually held in u.array.u.values[] out of sync. When the
cycle-collection GC later scans the array (js_array_mark -> JS_MarkValue -> gc_decref_child) it decrements a child whose reference count is already 0 — the
array accounted for one more reference than it really held. That is a reference
count underflow / over-free: the child object can be freed while still reachable,
i.e. a use-after-free triggerable entirely from script with no C-API or bytecode
involvement.
Hi! Thanks again for looking into the vulnerability report and make quick response.
I was wondering if you are planning to request a CVE for this issue. Since it has security impact, having a CVE would make it easier for downstream users and security tools to track affected versions.
Basically, since this was disclosed publicly there would be no CVE. In addition, I suppose this was found some automated tool, right? Then in many ways anyone could've gone and used said tools, no?
That said, I'd like to respectfully disagree with the implication that a vulnerability found with automated tooling is somehow less deserving of a CVE.
Modern vulnerability research heavily relies on fuzzing, static analysis, symbolic execution, and other automated techniques. Many CVEs across major open source projects—including browsers, kernels, libraries, and OSS-Fuzz findings—originate from automated tools.
Running a fuzzer is only a small part of the work. Producing a high-quality security report still requires substantial manual effort: developing or improving the harness, increasing code coverage, triaging crashes, determining whether a crash has security impact, performing root cause analysis, minimizing the testcase, and preparing a reliable and reproducible report.
If it were simply a matter of "anyone could run the tool," these projects would not continue to accumulate previously undiscovered vulnerabilities until researchers identify, analyze, and responsibly report them.
Whether a vulnerability is discovered manually or with the assistance of automation does not change the existence of the underlying security issue or its impact on downstream users. In my opinion, the discovery method should not be a criterion for whether a vulnerability deserves CVE assignment.
I understand and respect that this is the project's policy regarding public disclosure. However, I still believe this vulnerability itself meets the criteria for a CVE, and the fact that it was discovered with automated tooling should not be a reason to deny one.
By "tool" here I was mostly referring to LLMs. I understand that fuzzing an static analysis are still used and valuable.
We are at some weird intersection where what I said is true for LLM generated reports, but not so for the approach you have outlined.
So we are adapting to it as we go 😅
On a personal note, coordinating CVEs, embargo, and the pressure that comes with it do reduce the fun I have working on the project (I do this on my free time) so I lean more towards full disclosure.
Maybe some middle ground can be found here, but I'm not 100% sure how that looks like yet.
Just to clarify one point on my side: this wasn't an LLM-generated report. The vulnerability was discovered through a fuzzing setup that I specifically developed and optimized for QuickJS. I spent considerable time improving the fuzzing and mutation strategies, as well as the harness, before manually triaging crashes, performing root cause analysis, minimizing the testcase, and verifying the issue. While automation played a role, this was the result of dedicated security research rather than an automatically generated report.
I also completely understand your concerns about CVE coordination. Maintaining an open source project in your free time is already a significant commitment, and I can certainly see why you prefer full disclosure.
That said, I still hope this vulnerability can receive a CVE—not because I need a CVE number, but because it provides downstream users and security tools with a standardized way to identify and track the issue. In my view, whether a vulnerability merits a CVE should depend on the vulnerability itself, not on how it was discovered.
If the project doesn't intend to request a CVE, would you be comfortable with me pursuing one independently (for example, through another CNA or the CVE Program)? I'd be happy to handle as much of the coordination as possible so it doesn't create additional work for you.
If the project doesn't intend to request a CVE, would you be comfortable with me pursuing one independently (for example, through another CNA or the CVE Program)? I
Activity
saghul commentedon Jul 12, 2026
Thanks for the report!
Fix use-after-free from Array `.length` grow + `push`
saghul commentedon Jul 14, 2026
Fix in #1563
xmzyshypnc commentedon Jul 15, 2026
Hi! Thanks again for looking into the vulnerability report and make quick response.
I was wondering if you are planning to request a CVE for this issue. Since it has security impact, having a CVE would make it easier for downstream users and security tools to track affected versions.
saghul commentedon Jul 15, 2026
Our policy is outlined in https://github.com/quickjs-ng/quickjs/blob/master/SECURITY.md
Basically, since this was disclosed publicly there would be no CVE. In addition, I suppose this was found some automated tool, right? Then in many ways anyone could've gone and used said tools, no?
xmzyshypnc commentedon Jul 15, 2026
Thanks for explaining the project's policy.
That said, I'd like to respectfully disagree with the implication that a vulnerability found with automated tooling is somehow less deserving of a CVE.
Modern vulnerability research heavily relies on fuzzing, static analysis, symbolic execution, and other automated techniques. Many CVEs across major open source projects—including browsers, kernels, libraries, and OSS-Fuzz findings—originate from automated tools.
Running a fuzzer is only a small part of the work. Producing a high-quality security report still requires substantial manual effort: developing or improving the harness, increasing code coverage, triaging crashes, determining whether a crash has security impact, performing root cause analysis, minimizing the testcase, and preparing a reliable and reproducible report.
If it were simply a matter of "anyone could run the tool," these projects would not continue to accumulate previously undiscovered vulnerabilities until researchers identify, analyze, and responsibly report them.
Whether a vulnerability is discovered manually or with the assistance of automation does not change the existence of the underlying security issue or its impact on downstream users. In my opinion, the discovery method should not be a criterion for whether a vulnerability deserves CVE assignment.
I understand and respect that this is the project's policy regarding public disclosure. However, I still believe this vulnerability itself meets the criteria for a CVE, and the fact that it was discovered with automated tooling should not be a reason to deny one.
saghul commentedon Jul 15, 2026
I hear you.
By "tool" here I was mostly referring to LLMs. I understand that fuzzing an static analysis are still used and valuable.
We are at some weird intersection where what I said is true for LLM generated reports, but not so for the approach you have outlined.
So we are adapting to it as we go 😅
On a personal note, coordinating CVEs, embargo, and the pressure that comes with it do reduce the fun I have working on the project (I do this on my free time) so I lean more towards full disclosure.
Maybe some middle ground can be found here, but I'm not 100% sure how that looks like yet.
xmzyshypnc commentedon Jul 15, 2026
Thanks for clarifying—that makes much more sense.
Just to clarify one point on my side: this wasn't an LLM-generated report. The vulnerability was discovered through a fuzzing setup that I specifically developed and optimized for QuickJS. I spent considerable time improving the fuzzing and mutation strategies, as well as the harness, before manually triaging crashes, performing root cause analysis, minimizing the testcase, and verifying the issue. While automation played a role, this was the result of dedicated security research rather than an automatically generated report.
I also completely understand your concerns about CVE coordination. Maintaining an open source project in your free time is already a significant commitment, and I can certainly see why you prefer full disclosure.
That said, I still hope this vulnerability can receive a CVE—not because I need a CVE number, but because it provides downstream users and security tools with a standardized way to identify and track the issue. In my view, whether a vulnerability merits a CVE should depend on the vulnerability itself, not on how it was discovered.
If the project doesn't intend to request a CVE, would you be comfortable with me pursuing one independently (for example, through another CNA or the CVE Program)? I'd be happy to handle as much of the coordination as possible so it doesn't create additional work for you.
saghul commentedon Jul 15, 2026
Absolutely!
Fix use-after-free from Array `.length` grow + `push`