SecureLuaVirtualMachine - Controlled Execution Environment

Can you please stop trolling? If you are not feel free to enable debug mode in the SLVM module (SLVM_DEBUG_ENABLED) and set it to true and send me the code that triggers the issue and the logs.

1 Like

This reply made you like you were trolling - I am not insulting you in any way?

in the test place I got kicked thank you very much

Then it is not related to SLVM. You have to specify that it was in the test place, else I cannot guess.

Kicks from the Test Place are not “glitches”, but rather are intentional.

why is hindering testing intentional? You say push to its limits yet we can’t even run an empty script without being forcefully evicted from the experience. Its the hypocrisy for me

I added this when someone tried to crash the server by spamming console logs prompting that a user executed a script. The test place is supposed to simulate a real case scenario, where you indeed have to “push the limits” of SLVM by circumventing the Hooks, Blocks and etc, not by running empty scripts. The kick messages indicates that the script will not be executed due to the reason the message gave you, in this case, the script being “too short”.

There also is other kick messages, such as “Stop spamming”, as it will keep redirecting output which takes up server network bandwidth.

SLVM Update

Update is optional but recommended: https://create.roblox.com/marketplace/asset/15839058628/Secure-Lua-Virtual-Machine

SLVM Update

  • Fixed thread-related server crash vulnerability reported by @elomwot on Discord
  • Fixed buffer error message & increased buffer size limit

Update now: https://create.roblox.com/marketplace/asset/15839058628/Secure-Lua-Virtual-Machine

Preventing crashes may change the outcome of code that wasn’t actually going to crash. And, it is impossible to tell whether code will halt forever.

1 Like

So you want me to let them crash the server freely?

2 Likes

Well, yes. I’m assuming that if this runs on the server, it would be used by an admin or the owner of the game.

1 Like

It’s functionality and features such as Closure Hooking, Thread Closing, Instance Logging, etc… makes it suited to be the core of code executions for games like Studio Lite or Lua Learning as I’ve said here, although it can be used as an alternative to vLua:

2 Likes

thanks. you did a great job of making a module that functions like loadstring()

image

2 Likes

I’m happy that you like my resource! Don’t hesitate to reach out to me if you need any help with SLVM.

2 Likes

SLVM Update

  • Fixed bug where it would not allow calling a table or a userdata/proxy that has the __call metamethod

Update now: https://create.roblox.com/marketplace/asset/15839058628/Secure-Lua-Virtual-Machine

I have stack overflow error? How can i fix that? I use a lot of functions that are returned and called many times

ServerScriptService.SLVM.LuaVM.FiOne:54: stack overflow 

Sorry for the delay. Could you send the script that causes the error (Input) and the Logs? (They can be turned on from inside the SLVM module by setting SLVM_DEBUG_ENABLED to true)

image

__index is the problem
Yes i have analyzed and he blocked in this script: (OOP)

local Signal = {}
Signal.__index = Signal
Signal.ClassName = "Signal"
function Signal.new()
	local self = setmetatable({}, Signal)

	self._pdending = nil
	self._gvdata = nil
	self._bindableEvent = Instance.new("BindableEvent")
	self:Initialize()

	return self
end

function Signal.newWith(be)
	local self = setmetatable({}, Signal)

	self._pdending = nil
	self._gvdata = nil
	self._bindableEvent = be
	self:Initialize()

	return self
end

function Signal:GetPending()
	return self._pdending
end

function Signal:Initialize()
	self._bindableEvent.Event:Connect(function(...)
		self._pdending = ...
	end)
end

function Signal:Fire(...)
	self._bindableEvent:Fire(...)
end

function Signal:Connect(handler)
	if type(handler) == "function" then
		return self._bindableEvent.Event:Connect(function(...)
			handler(...)
		end)
	end
	return "function?"
end
function Signal:ConnectParallel(handler)
	if type(handler) == "function" then
		return self._bindableEvent.Event:ConnectParallel(function(...)
			handler(...)
		end)
	end
	return "function?"
end
function Signal:Wait()
	return self._bindableEvent.Event:Wait()
end
function Signal:Destroy()
	if self._bindableEvent then
		self._bindableEvent:Destroy()
		self._bindableEvent = nil
	end
end
return Signal
--[[local Connection = {}
Connection.__index = Connection

function Connection.new(callback)
	return setmetatable({
		_Callback = callback
	}, Connection)
end

function Connection:Disconnect()
	self._Callback = nil
	setmetatable(self,nil)
end


local Signal = {}
Signal.__index = Signal

function Signal.new()
	return setmetatable({
		_Threads = {},
		Firing = false,
		_gvdata = {}
	}, Signal)
end

function Signal:Fire(...)
	for threadOrConnection,_Type in pairs(self._Threads) do
		if _Type == "Connection" then
			if threadOrConnection._Callback == nil then self._Threads[threadOrConnection] = nil else
				task.spawn(threadOrConnection._Callback,...)
			end
		elseif _Type == "ConnectOnce" then
			if threadOrConnection._Callback ~= nil then
				task.spawn(threadOrConnection._Callback,...)
				threadOrConnection:Disconnect()
			end
		elseif _Type == "Wait" then
			self._Threads[threadOrConnection] = nil
			task.spawn(threadOrConnection, ...)
		end
	end
end

function Signal:Wait(duration : number?)
	local Running = coroutine.running()
	self._Threads[Running] = "Wait"
	if duration then
		task.delay(duration, function(thread)
			local stillYielding = self._Threads[thread]
			if stillYielding then
				self._Threads[thread] = nil
				task.spawn(thread)
			end
		end, Running)
	end
	return coroutine.yield()
end

function Signal:Connect(callback: () -> ())
	local connection = Connection.new(callback)
	self._Threads[connection] = "Connection"
	return connection
end

function Signal:ConnectOnce(callback: () -> ())
	local connection = Connection.new(callback)
	self._Threads[connection] = "ConnectOnce"
	return connection
end

function Signal:Destroy()

	self._Connections = nil
	self._Yielding = nil
	self.Firing = nil
	setmetatable(self,{__index = function() return nil end})

end


return Signal--]]

I am not getting any errors when running the script

image

And neither when running this below the script you sent:

Signal.new():Fire()

image

You right, i guess it’s me i wrongly type something. I don’t have stack overflow anymore.
Thanks anyways!

1 Like