Description:
Using the NUI system, posting a jQuery JSON data on an inline “onchange” event of any input element causes the game to crash a few moments later. There is no need of any additional JS script, besides any JQuery version (including the one stock with the internal game NUI) nor does it require for the callback to be set-up on the game scripting environment. If the callback is set-up, the arguments sometimes still get passed but will still crash a few milliseconds after. Here is an example of script that can cause the issue (by moving the slider ingame):
https://pastebin.com/AGyScedn
Server artifact version:
1856 FiveM Windows Master, but is reproducible with all versions
Expected behavior:
The scripting environment (in this case it was tested on Lua) should pick up the message without crashing afterwards.
Current behavior:
Sometimes the message gets sent, but the client crashes a few milliseconds later with no minidump, no error message nor log entry (neither on CitizenFX logs nor CEF logs)
Note that the event handler does not need to be actually set up on the scripting environment, meaning this is reproducible by just using the HTML code provided in the pastebin without having to do any data manipulation on the CitizenFX client itself. There is appended a “script.js” file but that doesn’t really matter, it was just some leftover code I forgot to remove.
Error screenshot:
N/A
.dmp/crash files:
N/A
Extra information:
SetNuiFocus needs to be set to true in order to mess with the NUI.
Game Cache version: 1.0.1207.80
RedM client: 1139860 (1.1.0.0 ?)