Skip to content

fix: patch authentication bypass and input validation in server callbacks#554

Open
peleg-development wants to merge 6 commits into
Project-Sloth:mainfrom
peleg-development:security-audit-findings
Open

fix: patch authentication bypass and input validation in server callbacks#554
peleg-development wants to merge 6 commits into
Project-Sloth:mainfrom
peleg-development:security-audit-findings

Conversation

@peleg-development

@peleg-development peleg-development commented Jun 9, 2026

Copy link
Copy Markdown
Severity Exploit File:Line What an executor can do Fixed
CRIT selfRegisterWeapon weapons.lua:427 Register weapons under ANY citizen's name, flood DB with fake weapons. No auth at all.
CRIT processFine / giveCitation charges.lua:42 / sentencing.lua:72 Send NaN as fine amount — bypasses <= 0 check, duplicates money via removeMoney(NaN)
HIGH updatePermissionRole management.lua:221 Grade-0 officer grants themselves all permissions, full admin escalation
HIGH uploadSuspectPhoto fivemanage.lua:143 Any civilian changes any citizen's profile picture. No auth at all.
HIGH openEvidenceStash evidence.lua:503 Open ANY stash by ID — steal evidence, contraband, items from any locker
MED issueWarrant warrants.lua:85 Issue warrants without permission
MED closeWarrant warrants.lua:123 Close warrants without permission
MED giveCitation sentencing.lua:55 Deduct money from players without permission
MED sendToJail sentencing.lua:6 Jail any player, unlimited sentence, no permission
MED impoundVehicle / releaseImpound impound.lua:4,53 Impound/release any vehicle without permission
MED createStaticCamera / deleteCamera cameras.lua:618,832 Spam cameras or delete any camera without permission
LOW processFine cooldown charges.lua:35 Global boolean blocks ALL officers when one processes a fine

… callbacks

Identified via defensive source code review:
- [HIGH] updatePermissionRole: no permission check (privilege escalation)
- [HIGH] uploadSuspectPhoto: no auth check at all
- [MED] issueWarrant/closeWarrant: missing warrants_issue/close perms
- [MED] giveCitation: missing charges_edit permission
- [MED] saveAward: missing management permission
- [MED] impoundVehicle/releaseImpound: no granular permission check
- [MED] sendToJail: no permission check or sentence cap
- [LOW] processFine: global anti-spam blocks all officers

Full report in SECURITY_AUDIT.md
Fixes all findings from SECURITY_AUDIT.md:

HIGH:
- updatePermissionRole: add CheckPermission('management_permissions')
- uploadSuspectPhoto: add CheckAuth + CheckPermission('evidence_upload')

MEDIUM:
- issueWarrant: add CheckPermission('warrants_issue')
- closeWarrant: add CheckPermission('warrants_close')
- giveCitation: add CheckPermission('charges_edit')
- saveAward: add CheckPermission('management_permissions')
- impoundVehicle: add CheckPermission('vehicles_edit_dmv')
- releaseImpound: add CheckPermission('vehicles_edit_dmv')
- sendToJail: add CheckPermission('charges_edit') + sentence cap

LOW:
- processFine: per-player cooldown instead of global boolean
…giveCitation

- NaN check: 'fine ~= fine' catches tonumber('NaN') bypassing <= 0 check
- math.floor: prevents fractional cent exploits (e.g. 0.001)
HIGH:
- selfRegisterWeapon: added CheckAuth, removed client-supplied owner param
  (any player could register weapons under any citizen's name)
- viewWarrant/viewBolo/viewReport: added CheckAuth (any player could trigger)

MEDIUM:
- openEvidenceStash: added CheckPermission('evidence_view')
- createStaticCamera: added CheckPermission('cameras_view')
- deleteCamera: added CheckPermission('cameras_view')
@peleg-development peleg-development changed the title security: audit — missing auth/permission checks on 8 server callbacks Fix missing auth checks and money duplication exploits Jun 9, 2026
@peleg-development peleg-development changed the title Fix missing auth checks and money duplication exploits Patch authentication bypass and input validation vulnerabilities in server callbacks Jun 9, 2026
@peleg-development peleg-development changed the title Patch authentication bypass and input validation vulnerabilities in server callbacks fix: patch authentication bypass and input validation in server callbacks Jun 9, 2026
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.

1 participant