Skip to content

Allow Zap to Mediate Throughput to Stop Roblox Servers being Unable To Process All Events #219

@CoIorEvent8

Description

@CoIorEvent8

Describe the bug

Zap has a major vulnerability where exploiters can crash entire game servers (test in a team test or live game) with oversized buffers because of constant long loops without delays trying to handle buffers. This leads to an out of memory crash that is difficult to trace.

Our game received a spike in out of memory crashes while no updates were made. My team initially thought this was a DDOS, but after seeing a spike in errors from network requests, I looked deeper and found a security issue in ZAP which allows servers to crash instantly.

After deploying a fix to the output.rs, rebuilding the EXE, and running zap packets.zap, I've seen no more out of memory crashes even though attempts have been made.
Image

In addition, the logs indicate that this was in fact the method that exploits were using to crash servers.
Image

https://devforum.roblox.com/t/surge-in-out-of-memory-crashes-without-any-updates-added/4528808/3?u=coiorevent

Reproduction

  1. Create a Zap funct for anything (not sure if its only for calls)
  2. Run zap packets.zap to output the lua code
  3. Modify the client source in Zap's output files to get rid of the call error on large buffers e.g. error("Zap has more than 256 calls awaiting a response, and therefore this packet has been dropped")
Image
  1. Create a local script that requires the Zap module. In that localscript, call the modified function through Zap several times. I'm not sure if it has to have arguments or not.
game:GetService("RunService").RenderStepped:Connect(function()
    for i = 1, 256, 1 do
        task.spawn(function()
            Zap.castFishingPole.call(1 * 100)
        end)
    end
end)
  1. Notice that on a team test (or live server), the game immediately freezes for all clients. Players freeze, remotes no longer go through, etc. Server ping will go up, and eventually the server will crash due to an out of memory crash. Sometimes, this crash will be recorded by Roblox on the create page.

Expected behavior

I expect ZAP to handle large buffers without crashing OR DENY LARGE BUFFERS entirely, so that the server doesn't get put into an infinite, unending loop state that causes out of memory crashes.

Additional context

I've attached the updated server.rs file as a text file that my game is currently using to implement this fix into our game. This was generated with AI, but works. I'd recommend reviewing this and only using it as a glimpse of a final solution as there may be a better way.

With this solution however, my game went from having 30 minute sessions back to having servers as old as several days. I hope that a solution can be implemented into the official Zap codebase, so that I don't have to rely on a custom EXE to get an output with the solutions.

Image

server.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions