RunParallelLuaOnMainThread Detection

Hello, many Anti-cheats in Lua use Actors to hide their actions from the main Lua VM (where by default exploiters execute their code).

However, the FFlag I’m talking about is DebugRunParallelLuaOnMainThread, and as the name suggests, it causes all actors to run on the main Lua VM, where exploiters again execute code and can see your actions.

Many executors that do not have run_on_actor function, which would properly execute code on your actor Lua VM or have poor implementation (causing issues/crashes) resort to using this specific FFlag to practically defeat the purpose of using Actors for anti cheat purposes.

Because of this (and out of boredom), I have made a simple detection that would tell you if this FFlag was enabled or not, allowing you to protect yourself against these kind of attacks.

How does this detection work?

Simply said, this detection abuses the fact functions from one Lua VM cannot be loaded into another Lua VM instead they throw a error saying “Attempt to load a function from a different Lua VM”

By just knowing this fact, we use Roblox Actor :BindToMessage and :SendMessage API to send a function from the Main Lua VM to the Actor one, if the FFLag is enabled, the function will be allowed to execute and run, if not it will throw an error.

Implementation

This could be done in many different ways but the easiest is to use Roblox API with BindToMessage and SendMessage.

Actor Script
script.Parent:BindToMessage("detection", function(s)
	local isSuccess = pcall(s)
	if isSuccess then
		warn("DebugRunParallelLuaOnMainThread detected")
	else
		print("Actors work as supposed!")
	end
end)
Script outside of the Actor
script.Parent.Actor:SendMessage("detection", function() end)

Or you can test this yourself in this place:
DebugRunParallelLuaOnMainThread_Detection.rbxl (56.0 KB)

And use Studio Mod Manager to toggle this FFlag.

If any Roblox staff member is watching, I would also suggest removing this FFlag from the client completely as it’s only used to bypass Lua anticheats.

10 Likes