Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] - esx_core- Setting Job #1322

Closed
HighLatencyy opened this issue Feb 22, 2024 · 5 comments
Closed

[Bug] - esx_core- Setting Job #1322

HighLatencyy opened this issue Feb 22, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@HighLatencyy
Copy link

HighLatencyy commented Feb 22, 2024

Describe the bug
Anyone can execute the following with a mod menu and get access to any specific job. Resulting in them able to access specific stuff in the server. This works for any version by the way.

To Reproduce

  1. Set your job to for an example unemployed.
  2. Run this code below on the clientside:
local function example()
    print("1") 
    Wait(100) 
    print("2") 
    Wait(8000) 
    TriggerEvent('esx:setJob', { name ="police", label = 'MEECH', grade = 13, grade_name = "boss", grade_label = "Chief of police" }) 
    Wait(10) 
    print("Executed")
end

RegisterCommand('test', function(playerId, args, rawCommand)
    example()
end)
  1. Type /job, it will say on server that their job is unemployed, but on client they can access every 'Police' feature. This works for any job. That relies on the player data on client. For example; house breaching, armory, etc. Does not work on server side though.

Expected behavior
A way for cheaters to not be able to set their job.

Screenshots
None

Debug Info (please complete the following information):

  • OS: Windows
  • Artifact: 7290
  • ESX Version: 1.10.5

Additional context
None

@HighLatencyy HighLatencyy added the bug Something isn't working label Feb 22, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in ESX Roadmap Feb 22, 2024
@Thekuca
Copy link
Contributor

Thekuca commented Feb 22, 2024

You can fix this vulnerability by using imports.lua in fxmanifest of the job and deleting esx:setJob handlers in client side.

@HighLatencyy
Copy link
Author

You can fix this vulnerability by using imports.lua in fxmanifest of the job and deleting esx:setJob handlers in client side.

Wouldn't this break compatibility with most scripts?

@Thekuca
Copy link
Contributor

Thekuca commented Feb 23, 2024

You can fix this vulnerability by using imports.lua in fxmanifest of the job and deleting esx:setJob handlers in client side.

Wouldn't this break compatibility with most scripts?

No. This was used when es_extended didn't have imports.lua file. Now the imports.lua handles player data object updating with a GetInvokingResource() check to prevent lua executors (cheaters) from updating the object.
I am not sure why this event handler wasn't removed from ESX resources such as esx_policejob but i will talk with the team and it will sure be implemented soon.

@HighLatencyy
Copy link
Author

You can fix this vulnerability by using imports.lua in fxmanifest of the job and deleting esx:setJob handlers in client side.

Wouldn't this break compatibility with most scripts?

No. This was used when es_extended didn't have imports.lua file. Now the imports.lua handles player data object updating with a GetInvokingResource() check to prevent lua executors (cheaters) from updating the object. I am not sure why this event handler wasn't removed from ESX resources such as esx_policejob but i will talk with the team and it will sure be implemented soon.

It works for any resource that has event I believe. Probably should be a priority as people can access anything a job because of this.

@Thekuca
Copy link
Contributor

Thekuca commented Feb 23, 2024

I agree, it will be implemented soon.

@Thekuca Thekuca closed this as completed Feb 23, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in ESX Roadmap Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants