Note
Review of the downloaded gumApi package. The fixed copy is in _jrs/gumApi_hardened/gumApi. Nothing was changed in the original download.
What was fixed#
| Area | Problem | Fix |
|---|---|---|
| NUI (HTML) | Titles, texts, button labels, notification text and the multi-input form were written with innerHTML. A name or message from another resource containing HTML could run script inside the game UI and post answers to the resource |
All text goes through a small allow-list. Only b, i, u, strong, em, small, br survive, without attributes. The multi-input form is built with DOM calls |
| NUI icons | The item name went straight into a CSS url('...') |
Only plain file names are accepted and the path is encoded |
getApi event |
Registered as a server net event, so any client could fire it and flood the console with errors | Now a local event only, on the server and on the client. A non-function argument is ignored |
| Discord logs | Any URL could be used as the webhook, so a script could post player data to any server. @everyone in a character name pinged staff. Missing values crashed the call |
Only discord.com webhooks are accepted, mentions are disabled, fields are cut to Discord limits and nil values are handled. One shared helper replaces four copies |
| Input callbacks | button_2, multipleinputs accepted any type and some callbacks never answered, leaving the NUI waiting |
Types and length are checked (text max 2000), every callback answers |
| Notifications | A missing duration crashed the notification thread for the whole session. Entries were removed while looping, and the queue had no limit | One entry at a time, default 5 seconds (500 - 60000), queue capped at 50 |
createVehicle |
Waited for a variable that is always nil, so the script hung forever |
Waits for the vehicle that was created and gives up after about 2 seconds |
| Exports | createPrompt dropped its event argument, getPromptButtonData passed undefined variables, notify named its parameters in the wrong order |
Fixed. notify is now documented as (title, text, img, time), which is what it always did |
| Package | configLanguage.lua is listed in the manifest but was not in the zip, so the resource could not start |
Recreated with English defaults |
Not changed, but you should know#
Warning
newPrompts.js, newPrompts.lua and newPromptControls.lua are obfuscated (hex and decimal escaped strings, renamed variables). They were decoded and scanned: no HTTP calls, no load or eval, no server events, no file access, and the only network call is the NUI callback to the resource itself. A scan is not a full audit. Ask the author for the readable source before trusting them on a public server.
- Developer commands.
/cc,/cchand/polyPointwork for every player. They only copy coordinates, but remove them on a live server. createPeddoes nothing. The spawn loop is missing from this package, see the Client API.CUSTOMframework.serverCompCustom.luais mentioned in a comment but does not exist.- GUM and RSG bridges have race conditions in
getAllItems(the result is read before the database answers) and some functions return nothing. They were left as they are. - Trust model. Every server script that can call
getApican add money, items and jobs. That is by design. Only run server scripts you trust and never let a client script reach these functions through your own net events.
Rules for scripts that use gumApi#
- Never pass player controlled text to an HTML field without knowing it is shown as text. gumApi now shows it as text, but your own NUI may not.
- Validate every argument of your own net events on the server, then call gumApi.
- Keep webhooks in server config only.
- After an update of gumApi compare these files against the fixed copy before you overwrite them:
html/index.js,clientData/client.lua,serverData/*.lua.