Open Acecool opened 10 years ago
There's no attack - net.WriteTable on the client overflows and kills the frame before anything is sent to the server. Also, this is no worse than running
net.Start("Hi");
net.WriteString(string.rep("a", 64000))
net.SendToServer()
in a think loop to saturate the client's upstream channel in an attempt to make the server do a little more work than normal (would this even have any effect? The 64KBps clamp should prevent network flooding and the server will just drop messages with no reciever)
True; but while not all things can be fixed, at least some things could be resolved ( such as the table going through since it is so easy to tostring( table ) and use that identifier as a key to an array, check to see if it was sent during that net.Start; if not then parse, otherwise send as string reference )
While looking at: http://facepunch.com/showthread.php?t=1412399 I noticed there appeared to be a net.WriteTable stack-overflow bug whereby if you nest a parent table to a child, it'll continue trying to send. While it may be up to the developer to ensure stuff like this doesn't happen, what is going to stop someone on a CL scripts allowed server from spamming a server with WriteTables?
Code to produce issue:
where: _tab.tab = _tab; is the issue.
I started writing a fix in Lua, but the way the net-functions are called and re-called for each bit of data, and having no return statement to piggyback a list of processed tables, it may be better to have net.Start set up a table of processed data, and if it hits a table do the following logic:
As said, sent_data / processed_tables is better suited to be re/initialized in net.Start because of the way net.WriteTable is written. This is a minor fix in terms of the dev should know what data is being sent and shouldn't ever nest a parent table in a child.
In terms of security against a type of attack, this may be a good idea to implement...