Stalling a Qwik v1 server with one BigInt
I reported a denial of service in Qwik, the resumable web
framework with more than 22,000 stars on GitHub. It affects @builder.io/qwik 1.0.0 through
1.20.3 and is fixed in 1.20.4, advisory
GHSA-mvm8-x28h-fw3q.
Qwik rates it High, 7.5, and requested a CVE when publishing. It touches availability only, with
no data exposure, but it needs no account and works against a freshly scaffolded app.
Two release lines
Qwik currently ships two lines. v2 is in release candidates under a new package name,
@qwik.dev/core. v1 keeps the original name, @builder.io/qwik, still gets security releases,
and still carries most of the installs: about 72,000 weekly downloads against about 15,000 for
v2.
In October, GHSA-2v54-72rw-xh94
fixed a BigInt parsing denial of service in v2, in 2.0.0-rc.4. That advisory lists the v2
package, the one it was reported against. Advisory databases match by package name, so nothing
in it would reach a project on @builder.io/qwik. I wanted to know whether v1 had the same
code. It did.
The parser
Qwik serializes application state into JSON, and marks values JSON cannot express with a one character prefix. A string that starts with U+0018 holds a BigInt:
// packages/qwik/src/core/container/serializers.ts, 1.20.3
const BigIntSerializer = /*#__PURE__*/ serializer<bigint>({
$prefix$: '\u0018',
$test$: (v) => typeof v === 'bigint',
$serialize$: (v) => {
return v.toString();
},
$prepare$: (data) => {
return BigInt(data);
},
});
_deserializeData passes every string in the payload's _objs array to the serializer that
matches its prefix, so the digits go straight into BigInt() at any length.
Converting decimal digits to a BigInt costs more than linear time in V8. In my measurements a million digits took 136 ms and 9.5 million took 2.1 seconds, about ten times the input for fifteen times the time. The work runs synchronously, so the Node.js process does nothing else meanwhile.
Reaching it without an account
Qwik Router calls server functions through a POST to the page route itself, and it registers that handler on every page route:
// packages/qwik-city/src/middleware/request-handler/
// resolve-request-handlers.ts, 1.20.3, condensed
if (isPageRoute) {
if (method === 'POST' || method === 'GET') {
requestHandlers.push(runServerFunction);
}
}
async function runServerFunction(ev: RequestEvent) {
const fn = ev.query.get(QFN_KEY); // ?qfunc=
if (
fn &&
ev.request.headers.get('X-QRL') === fn &&
ev.request.headers.get('Content-Type') === 'application/qwik-json'
) {
// ...
const data = await ev.parseBody(); // line 335, body deserialized
if (Array.isArray(data)) {
const [qrl, ...args] = data;
if (isQrl(qrl) && qrl.getHash() === fn) { // line 338, hash checked
The caller picks the qfunc value and sends the same string in X-QRL. The body gets
deserialized before anything checks that qfunc names a real server function. So the app needs
no server$ function at all, and the request needs no session or token. The default body limit
of 10 MiB bounds the size of the payload, not the time spent parsing it.
The lab
I scaffolded the project's own empty starter with create-qwik 1.20.3, added the official Node
server adapter from the 1.20.3 tag, and served a production build on 127.0.0.1. I wrote no
application code. The request:
POST /?qfunc=x HTTP/1.1
X-QRL: x
Content-Type: application/qwik-json
{"_entry":"0","_objs":["\u0018<10 million decimal digits>"]}
A plain GET for the home page ran alongside each test, to see what ordinary visitors would get:
test response home page waited
before the test 200 3 ms
one BigInt body, 9.54 MiB 500 2514 ms 2416 ms
same size, no U+0018 prefix 500 40 ms 3 ms
four BigInt bodies at once 500 10015 ms 2436 ms
The control carries the same amount of data and takes 40 ms, so the cost sits in the conversion, not in the upload or the JSON parse. The 500 comes after the work already ran. An attacker who keeps sending keeps the process busy, for the price of the upload.
The fix
Varixo from the Qwik team opened the fix eight minutes after accepting the report, about seven and a half hours after I sent it. It brings the v2 guard to v1 unchanged, so both lines now behave the same:
$prepare$: (data) => {
// Decimal BigInt parsing is super-linear.
if (!/^-?\d{1,1000}$/.test(data)) {
throw new Error('Invalid BigInt');
}
return BigInt(data);
},
The patch came with a unit test that goes through _deserializeData, the same path a request
takes. I measured it before it merged:
digits 1.20.3 with the fix
1.0M 136 ms 0.2 ms
5.0M 1080 ms 1.8 ms
9.5M 2108 ms 2.6 ms
The regular expression runs in linear time itself. A full 10 MiB body packed with values under
the limit costs under 200 ms in total, because at 1000 digits the conversion stays cheap. The
serializer only ever writes decimal through toString(), so the stricter check breaks no round
trip.
1.20.4 went out on npm on 2026-11-09, two and a half days after the report. Upgrading is the whole fix. v2 users on 2.0.0-rc.4 or later already have the guard.
Sources: advisory GHSA-mvm8-x28h-fw3q · v2 advisory GHSA-2v54-72rw-xh94 · fix commit 20d6431.
Takeaway
When a project fixes a bug in one release line, check the other lines that share the code,
especially across a package rename. Advisory databases match by package name, and a fix for
@qwik.dev/core tells a @builder.io/qwik project nothing. Also, a request body limit caps the
bytes, not the work done per byte. A parser that grows faster than its input needs its own limit
close to the conversion.
Coordinated disclosure. Reported privately on 2026-11-07 at 02:09 UTC. The fix was ready the same morning and shipped in 1.20.4 on 2026-11-09. Qwik published the advisory on 2026-11-18, after users had over a week to upgrade, and requested a CVE. Thanks to Varixo and the Qwik team for a fast and careful fix. The lab only ran on 127.0.0.1.