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

[HD Admin] Type confusion + numerical values in Contributors command field results in error #152

Open
mayak-dev opened this issue Jun 21, 2023 · 1 comment

Comments

@mayak-dev
Copy link

mayak-dev commented Jun 21, 2023

Perhaps this repository is outdated, as I'm unable to find the relevant script within it, but I am submitting this issue nonetheless so that it may be seen.

LuaU's base library function tonumber is capable of taking decimal and hexadecimal numbers stored as strings and converting them to the number type. On lines 91 - 93 of ServerStorage.HDAdminServer.Modules.CommandHandler, values within a command's Contributors field are checked to be numerical by calling tonumber, presumably to check if a user ID was provided (rather than a username) before attempting to fetch the corresponding username. The relevant code snippet is shown below:

if infoName == "Contributors" and tonumber(v) then
    v = main.main:GetModule("cf"):GetName(v)
end

This will result in type confusion for usernames containing hexadecimal integers (e.g., "0xDEADBEEF"), as well as those containing purely numerical characters, where the username would be treated as a user ID. Additionally, a typo on line 92 results in the error attempt to index nil with 'GetModule' being thrown. I suggest changing this behavior so that any user ID that is provided must explicitly be a number, alongside fixing the mentioned typo, as demonstrated below:

if infoName == "Contributors" and typeof(v) == "number" then
    v = main:GetModule("cf"):GetName(v)
end
@mayak-dev
Copy link
Author

My mistake. I did not realize that Nanoblox and HD Admin aren't the same. Hopefully the issue can be addressed anyways.

@mayak-dev mayak-dev changed the title Type confusion + numerical values in Contributors command field results in error [HD Admin] Type confusion + numerical values in Contributors command field results in error Jun 21, 2023
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

No branches or pull requests

1 participant