Описание
Qwik's unhandled exception vulnerabilty can cause server crashes from malicious requests
Summary
Possibility to craft a request that will crash the Qwik Server in the default configuration.
Details
When a Qwik Server Action QRL is executed it dynamically load the file containing the symbol. When an invalid qfunc is sent, the server does not handle the thrown error. The error then causes Node JS to exit.
PoC
- Setup a Qwik Project
pnpm create qwik@latest - Start the Qwik Server using
pnpm run preview - Execute the following curl command to crash the instance
Here the qfunc query parameter, X-Qrl header and payload need to have the same qrl.
The Qwik Server will then crash with the message
The same can also be repeated running Qwik in production using express.
- Setup a Qwik Project
pnpm create qwik@latest - Install the express middleware
pnpm run qwik add express - Build the qwik app using
pnpm run build - Start the server using
pnpm run serve - Execute the following curl command to crash the instance
Impact
Any Qwik Server instance running the default configuration can be crashed. Using a simple loop to send this HTTP request will cause permanent down time of the service as it takes a few seconds for an instance to restart.
There is also the issue that this can happen without a malicious attacker. When a Qwik Application is deployed through a CDN and an old instance is still loaded on some Client, like through an inactive Tab. Once that user returns to the old Version and performs an action that runs a removed qfunc the server will crash.
Пакеты
@builder.io/qwik-city
< 1.13.0
1.13.0
Связанные уязвимости
@builder.io/qwik-city is the meta-framework for Qwik. When a Qwik Server Action QRL is executed it dynamically load the file containing the symbol. When an invalid qfunc is sent, the server does not handle the thrown error. The error then causes Node JS to exit. This vulnerability is fixed in 1.13.0.
Уязвимость фреймворка для создания высокопроизводительных веб-приложений Qwik, связанная с ошибкой обработки исключениий, позволяющая нарушителю вызвать в отказ в обслуживании