]> git.kaiwu.me - njs.git/commit
HTTP: fail closed on js_access body completion errors
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 11 Aug 2026 01:14:38 +0000 (18:14 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 20 Aug 2026 18:32:21 +0000 (11:32 -0700)
commit6898f7c9f844ca30af2aed9e8b1fe10f393644a5
tree16173353ed8810c5527a9a3dfc91c6ec8868373f
parent3e02ae0fae030cd802075f42b7037fe3df96e2f6
HTTP: fail closed on js_access body completion errors

Previously, an exception in an asynchronous readRequest*()
continuation could leave the js_access decision unset, allowing nginx
to continue processing the request as though the access check had
succeeded.  An unhandled rejection could also be missed by the body-read
completion path or hidden by a pending internal redirect.

Now body-read completion errors set the access status to 500, and
access finalization checks execution errors before an uncommitted
access decision or internal redirect.  Responses already sent by the
handler remain terminal.

Reported by Ta Duc Thien.
nginx/ngx_http_js_module.c
nginx/t/js_access_body.t