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

Server freeze exploits #5

Closed
6 tasks done
raymoo opened this issue Nov 25, 2016 · 3 comments
Closed
6 tasks done

Server freeze exploits #5

raymoo opened this issue Nov 25, 2016 · 3 comments

Comments

@raymoo
Copy link

raymoo commented Nov 25, 2016

Checkboxes provided to measure fix progress

  • The following program will freeze the server:
while(true)do end
  • This will too:
while{}do end
  • So will the following:
while (function(f) return f(f) end)(function(f) return f(f) end) do print("a") end
  • Here is another:
meme = "function"
while true do end
meme = ")"
  • Another:
while true do
  pcall(function() while true do end end)
end
  • More:
_G["increase_c" .. "counter"] = listen_msg
while true do end

Suggested fixes:

  • Stop trying to limit execution by inserting your own function calls, instead use an instruction count debug hook.
  • Remove pcall from the bot environment, or replace it with a "safe" version that will not allow the user to catch the "too much execution" errors.

These would fix all of the listed exploits/bugs

@raymoo raymoo changed the title Server freeze exploit Server freeze exploits Nov 25, 2016
@ac-minetest
Copy link
Owner

fixed most of problems.
im aware of hooks, i just dont want to use them cause:

  1. i like to use luajit
  2. is fun solving challenges you provide. Keep them coming :)

@raymoo
Copy link
Author

raymoo commented Nov 27, 2016

You did not fix the third freeze. Please reopen this issue since you have not actually resolved it.

@raymoo
Copy link
Author

raymoo commented Nov 27, 2016

Also, you would only need to disable luaJIT for the user-provided function, not the whole game. Since you are only allowing 32 loops/recursions, luaJIT will not make an appreciable performance difference.

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

2 participants