-
-
Notifications
You must be signed in to change notification settings - Fork 745
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
Security Enhancement: Distance Check for 'esx:onPickup' Event #1161
Conversation
I see no reason to use a table for coords. Saves us pointless conversions like the one on client side and allows for arithmetic operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will require decrease in vector z, else player won't be able to pick anything from ground
TriggerEvent('esx:createPickup', pickupId, pickup.label, pickup.coords - vector3(0, 0, 0.5), pickup.type, pickup.name, pickup.components, pickup.tintIndex)
however, who don't use ox_inventory, after client restart missing pickups will appear floating in the air, needs an better fix, but for now at least it will work. currently in last version missing pickups wasn't working at all.
Haven't tested that tbh. The pickups spawned properly on the ground when I tested the vulnerability. I can push another commit tho if requested. |
i tested, that's why i wrote it. |
My changes have nothing to do with that. |
without your changes missing pickups won't spawn at all (after a client restart), resulting in an error in client console. |
@Kenshiin13 Hi! Could you write in to accept coordinates not just the current coordinate? |
I'm sorry, I'm not sure what you mean. Why would we test against anything other than the players current coordinates to determine whether a pickup request ist legitmate or not? |
I seem to remember that currently in ESX there is no option to spawn a pickup point to a given coordinate, you can only spawn a point to the player's coordinate. That's what I was thinking about, that I should be able to spawn a pickup point to a custom coordinate. |
You mean like this 92d6f49? |
@Kenshiin13 Yes, thank you. |
Thanks for the PR, we will test it soon and if it works we will merge it. |
@Kenshiin13 Hi! I tested this pr and i found bug.
Let's find a solution so that if I don't want to spawn a weapon, I don't have to specify "components" and "tintIdex", because I currently have to specify them because coordinates are included and the parameter number of pieces makes it mandatory to specify them. (!!We have to pay attention to backwards compatibility because it is not easy to do this.) |
In the future, please make sure that it is tested, because this is a basic bug that could have been fixed in the first test. Thanks. |
Well, I am not sure if there is a way to do this without breaking backwards-compatibility. |
If you have any ideas, feel free to write them down, I can't think of anything right now, if we don't have a solution, it will stay as it was. I mean that part will not be changed. |
Nope, not really. Does that work for you? 1b27475 |
I will check soon. |
Hi! Well done, I was tested and merged. |
Security Enhancement: Distance Check for 'esx:onPickup' Event
Description
This pull request introduces a critical security update for the "esx:onPickup" event to mitigate potential abuses. The update incorporates a distance check mechanism, preventing players from exploiting the event to collect pickups from excessive distances. This measure ensures fair gameplay and maintains the integrity of the event.
Changes Made
The modified code snippet is as follows:
Reasoning
This security update is vital to prevent potential abuses of the "esx:onPickup" event. The event could potentially be exploited by malicious players to trigger unauthorized pickups using a simple code snippet like this:
By implementing a distance check, the update ensures that players can only interact with pickups within a reasonable range, discouraging unauthorized collection of pickups from afar.
Counterargument Consideration:
It's worth addressing the potential counterargument that the distance check might be unnecessary due to a player's ability to teleport to pickups, thus eliminating the need for this change. However, it's essential to recognize that third-party anticheats are designed precisely to identify players employing teleportation tactics across the map. Additionally, the presence of one form of vulnerability should not overshadow addressing another potential attack vector.
Thank you for considering these enhancements. Your feedback and suggestions are appreciated.