You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
ifinfoName=="Contributors" andtonumber(v) thenv=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:
ifinfoName=="Contributors" andtypeof(v) =="number" thenv=main:GetModule("cf"):GetName(v)
end
The text was updated successfully, but these errors were encountered:
My mistake. I did not realize that Nanoblox and HD Admin aren't the same. Hopefully the issue can be addressed anyways.
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
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 ofServerStorage.HDAdminServer.Modules.CommandHandler
, values within a command'sContributors
field are checked to be numerical by callingtonumber
, 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: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:The text was updated successfully, but these errors were encountered: