Nine-year-old bug in the Go standard library enables DoS
github.com
github.com
"Certain invalid inputs to ReadUvarint or ReadVarint could cause those functions to read an unlimited number of bytes from the ByteReader argument before returning an error. This could lead to processing more input than expected when the caller is reading directly from a network and depends on ReadUvarint and ReadVarint only consuming a small, bounded number of bytes, even from invalid inputs.
"With the update, ReadUvarint and ReadVarint now always return after consuming a bounded number of bytes (specifically, MaxVarintLen64, which is 10). The result being returned has not changed; the functions merely detect and return some errors without reading as much input."
What's a varint? This: https://developers.google.com/protocol-buffers/docs/encoding
You have to use varints to be affected, but of course you could be using them in a library without knowing it.
Exceptional cases, if you will.
I find it funny when people say Go doesn't have exceptions when Go is the only mainstream language that advocates for and prefers the use of exceptions.
I was just pointing out that this bug basically requires an explicit test checking for exactly the bug. Fuzzing would not have found the check for you.
From the article, "this attack was due to a 9 year old bug in the Go standard library. During the "post-mortem" @protolambda, @prestonvanloon, @raulk and I uncovered this bug," so at least they are quite clear that it is a recently discovered bug.
It is unambiguous. Neither interpretation says that the bug is newer than nine years vintage.
> Interesting that you and another commenter interpreted "9 year old bug" to mean "bug discovered 9 years ago".
In an unusual moment of reduced cynicism, I too interpreted it as that the bug was newly (or at least recently) discovered whcih does appear to be the case this time.
It could easily have been a bug discovered that long ago that was for some reason marked WONTFIX (the danger not appreciated, that bit of code was at that time due to be deprecated RealSoonNow, ...) or CANTREPRO.
> From the article
Yep. The fault lies with whoever named this submission. It isn't as if they've just used the title of the page linked to, as that differs completely, so a thought process happened and a wording decision was made.
There must still be confusion, as when I read the title it means exactly what is said in the GitHub issue.