For example:
“NaN” as a number.
nil in general.
Also: What are some other lesser known exploits, other than junk inputs, that devs should be aware of?
For example:
“NaN” as a number.
nil in general.
Also: What are some other lesser known exploits, other than junk inputs, that devs should be aware of?
I big problem I’ve seen is that exploiters can just send negative numbers and infinity as a number.
This can break games that trust the information the client sends though remote events.
NaN vectors (can be checked the same as NaN numbers with v ~= v)
If you send instances from Client to Server then make sure to check typeof(X) == "Instance" on the Server as tables can be accessed like them
Also there’s a math.isfinite function coming to Luau soon which checks that the number is neither NaN nor an infinity
I hope it gets a fastcall or im gonna be mad ![]()
inf
It has fastcall but not NCG, might be added in a later PR
Any data type in a corrupted way
Color3,ColorSequence anything,
My solution to that is only accepting primitives (booleans, numbers…) or buffers.
Buffers are cheap, easy to sandbox, and easy to check length - good for performance, basically, so yeah, pack data into a buffer, check the type if it’s a buffer, and check the length of the buffer in the server, and that’s it.
CFrames have a method to fix them, but once again, they send a lot of waste and can be packed as 6 f32 numbers inside a buffer instead, so 24 bytes (4*6) (+ ~10 bytes internally) for buffer type being sent https://create.roblox.com/docs/reference/engine/datatypes/CFrame#Orthonormalize
About numbers, people already said your stuff, so I see no reason to repeat them.
Do check for insanely huge buffers and strings as well.
For buffers, size will always be deterministic anyway.
If you send CFrame as a buffer if the size is not 24 bytes, then you detected an exploiter etc.
Luckily, inf, negative, and 0 numbers are merciful, because everyone should be checking > or <. Checking for NaN or typeof() isn’t so commonly known…
My puny brain cannot comprehend. How can color3 be corrupted, for example? Just by inputting a value that’s too large (e.g. 2000,math.huge,-99999)? Or in another way?
I did some testing, and it basically prints Color3.R numbers far beyond its 0-1 range,
I don’t really understand how it is possible since I always assumed internally Color3 is in fact 3 bytes and .R metamethod interpolated 1 byte integer to 64-bit float, but it looks like Color3 is just 3 64-bit floats, as I see.
Very weird, but yeah, Color3 seems to be corrupted.
local a = Color3.new(2,0,0) print(a.R) → 2
USUALLY it fixes itself when assigned to an instance but breaks
Color3.new(5,0,0) will become 251,0,0 for example
JS ahh logic
Unrelated, but using this “bug” allows to make glowing decals, GUIS and such (Guis only in 3d world)
hm can you explain?
You seem to confuse Vector3 property inside SpecialMesh.
Nope. You can create decal, and abuse Color value to make it appear as neony. Like, Color3.fromRGB(2550, 2550, 2550)
Very interesting. Finally, something that mere mortals can comprehend.
Explanation please? eeeeeeeeeeeeeeeeeeeeeeee
CFrames are matrixes 4x4 (but think that they are 4x3). To easier understand their true behavior, treat them as 4 vectors. 1st being position, 3 others are for rotation.
position can be any vector
rotation can theoretically be any vector too, BUT to correctly represent object, they must be unit vectors, and all should be perpendicular to each other. Also there’s special rule for Z vector where it needs to cross plane from one side, and not other, cuz otherwise it will be inverted.
Now to the problem: to make “invalid” CFrame, you need make one or more of rotational vectors break rules listed above. They can be made zero vector, NAN vector, they can be made non-perpendicular, and such. This will result in stretched, collapsed, inverted shapes.
Note: Roblox AUTOMATICALLY fixes CFrame rotational vectors partially - they will be normalized if bigger than 1 (so (2, 0, 0) → (1, 0, 0), but (0.5, 0, 0) won’t be → (1, 0, 0))