-
-
Notifications
You must be signed in to change notification settings - Fork 36
Security Notes
NeekoGta edited this page Jun 17, 2026
·
1 revision
CEF UI is client-side. Treat every browser event as untrusted input.
When JavaScript emits an event:
cef.emit("shop:buy", itemId, amount);The server must validate:
- player is logged in
- player can access the shop
- player is close enough to the shop NPC/object
- item exists
- amount is within allowed range
- player has enough money
- cooldown/rate limit is respected
The player can potentially tamper with their local UI.
Do not use CEF only to enforce:
- money
- inventory
- admin permissions
- anti-cheat checks
- item ownership
- location checks
The server remains authoritative.
Do not place secrets in:
- HTML
- JavaScript bundles
- frontend environment variables
- CEF resources
Packaged resources are not a safe place for secrets.
Use scoped event names and validate only registered events:
login:submit
inventory:move
shop:buy
vehicle:radio:set_urlWhen using frontend build tools:
- avoid shipping source maps in production if they expose sensitive internals
- avoid unused debug pages
- avoid hardcoded API tokens
- validate any URL submitted by players
If you load external websites, consider:
- performance
- autoplay/audio policies
- tracking/privacy
- mixed content
- broken external assets
- abuse through user-provided URLs
CEF Plugin — Client & Server for SA-MP / open.mp
Issues & PRs welcome.