Skip to content

Fix handleIndexError crash on throw null in query servers#5953

Open
vamsi2246 wants to merge 2 commits intoapache:mainfrom
vamsi2246:fix-nouveau-handleindexerror-crash
Open

Fix handleIndexError crash on throw null in query servers#5953
vamsi2246 wants to merge 2 commits intoapache:mainfrom
vamsi2246:fix-nouveau-handleindexerror-crash

Conversation

@vamsi2246
Copy link
Copy Markdown

If an untrusted map function executes 'throw null', the check 'err[0] == "fatal"' evaluates 'null[0]' which throws an uncaught TypeError, fatally crashing the JavaScript worker process. This adds a null guard 'err && err[0]' to nouveau.js, views.js, and dreyfus.js.

vamsi and others added 2 commits March 29, 2026 15:12
If an untrusted map function executes 'throw null', the check 'err[0] == "fatal"' evaluates 'null[0]' which throws an uncaught TypeError, fatally crashing the JavaScript worker process. This adds a null guard 'err && err[0]' to nouveau.js, views.js, and dreyfus.js.
@big-r81
Copy link
Copy Markdown
Contributor

big-r81 commented Mar 29, 2026

What is an "untrusted map function" and why would you do a "throw null"?

@rnewson
Copy link
Copy Markdown
Member

rnewson commented Mar 30, 2026

(and noting that our mandatory form has been deleted. It needs to be restored and completely honestly before we could consider merging)

@rnewson
Copy link
Copy Markdown
Member

rnewson commented Mar 30, 2026

noting that this just crashes things we expect to crash in such events, it's not a security finding or a DDOS finding. Still, it is nice to handle such things more politely.

@rnewson
Copy link
Copy Markdown
Member

rnewson commented Mar 30, 2026

@big-r81 we deliberately do not trust any javascript map or reduce functions, they're entered by users. it's why they are executed in a sandbox.

@big-r81
Copy link
Copy Markdown
Contributor

big-r81 commented Mar 30, 2026

@big-r81 we deliberately do not trust any javascript map or reduce functions, they're entered by users. it's why they are executed in a sandbox.

I'm well aware of that 😉, I was just talking about the term itself — we're simply executing JavaScript code, whether it's trusted, untrusted or whatever ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants