News for hackers. Stuff that matters.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by thirsteh on Tuesday March 18, 2014 @03:56PM (#7424572)
Before you panic: "The problem affects nginx 1.3.15 - 1.5.11, compiled with the ngx_http_spdy_module module (which is not compiled by default) and without --with-debug configure option, if the "spdy" option of the "listen" directive is used in a configuration file."
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by nevi-me on Tuesday March 18, 2014 @09:57PM (#7426377)
Well, SPDY is enabled by default on 1.5.11 from what I understand, so they better push out 1.5.12 out (at least not seeing it yet)
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by AaronFriel on Tuesday March 18, 2014 @02:38PM (#7423983)
Patch is pretty interesting. Why was buffer overflow protection behind a debug flag?

http://nginx.org/download/patch.2014.spdy2.txt

Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by nolok on Tuesday March 18, 2014 @02:54PM (#7424118)
Usual reason for mistakes like this is: someone was debugging something then (partially) forgot to clean up before committing.

Once that is done it's incredibly easy for these kind of bugs to go un-noticed for a long time.

Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by greglindahl on Tuesday March 18, 2014 @03:39PM (#7424456)
Assuming you don't have a test for it, sure. And don't fuzz everything on a regular basis.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by unwind on Wednesday March 19, 2014 @04:08AM (#7427301)
Without context (I'm not familiar with nginx' code) the blatant subtraction of pointers was scary, too.

As everyone is of course no doubt aware, subtraction of pointers is only valid in C if you can guarantee that the pointers point to the same "object" (or at most 1 character past the end of an object).

I would prefer an interface using a size_t count of available space, rather than passing an end-pointer around.

Again, this is based solely on reading the patch, so it might be perfectly fine. Considering nginx' reputation, I guess it's academic.

Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by ambrop7 on Wednesday March 19, 2014 @04:24AM (#7427335)
It's kind of implied by the parameters that they point to the same object; they're named "pos" and "end" after all. But I agree, a count variable is nicer.

The subtraction also has a (very theoretical) problem that its result must fit in ptrdiff_t (signed), and it would produce undefined behavior when you have a huge object whose size doesn't fit in ptrdiff_t (but does in size_t, by definition).

Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by atom7 on Wednesday March 19, 2014 @04:20AM (#7427324)
It's a common practice to use two pointers when parsing some stream data buffer. If you will use a pointer to the start of the buffer and the size of an available data to parse, then you would need to change two variables instead of one on every parsing stage. So you have more opportunity to make a mistake.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by willvarfar on Tuesday March 18, 2014 @03:34PM (#7424420)
And why leave in a #if when patching too?
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by atom7 on Tuesday March 18, 2014 @04:14PM (#7424680)
I assume the reason was to keep diff as minimal as possible. Note that it should apply to all mentioned versions without problems.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by untaken on Tuesday March 18, 2014 @04:06PM (#7424636)
Keeps the changes to a minimum, reducing the risk of effecting anything else. (quicker + safer)
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by IvyMike on Wednesday March 19, 2014 @03:29AM (#7427216)

  -        if (ngx_list_init(&r->headers_in.headers, r->pool, sc->entries + 3,
  +        if (ngx_list_init(&r->headers_in.headers, r->pool, 20,
Personally, both the old code and the new code use magic numbers, and both send up a red flag to me. What does 20 mean? (I don't personally need an answer here: my point is it's not obvious and therefore it's easier for bugs to get through.)
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by jmnicolas on Tuesday March 18, 2014 @02:00PM (#7423713)
I wonder if this discovery is a result of OpenBSD switching its focus from Apache to Nginx ?
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by jolan on Tuesday March 18, 2014 @02:52PM (#7424106)
It wasn't.

> Thanks to Lucas Molas, researcher at Programa STIC, Fundación Dr. Manuel Sadosky, Buenos Aires, Argentina.

Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by dperfect on Tuesday March 18, 2014 @03:18PM (#7424300)
I assume this only affects configurations with ngx_http_spdy_module enabled. Can anyone confirm whether or not that's the case?
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by fletchowns on Tuesday March 18, 2014 @03:22PM (#7424333)
Yup, it's in the announcement: http://mailman.nginx.org/pipermail/nginx-announce/2014/00013...

The problem affects nginx 1.3.15 - 1.5.11, compiled with the ngx_http_spdy_module module (which is not compiled by default) and without --with-debug configure option, if the "spdy" option of the "listen" directive is used in a configuration file.

Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by yeukhon on Tuesday March 18, 2014 @03:38PM (#7424452)
It said it affected 1.3.15 to 1.5.11 but the fix is available in nginx 1.5.12, 1.4.7.

So for those who are using legacy version are they going to rely on distro vendor to push the patch? Just curious, even though I guess the number of users who have activated this experimental SPDY is low and people who actually have it enabled probably know how to fix it themselves.

Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by aroch on Tuesday March 18, 2014 @03:47PM (#7424518)
1.5.12 is the latest devel branch and 1.4.7 is the latest release branch (released in response to this CVE and excepted from the vuln range). The patch works for any of the intervening versions.

As far as I'm aware, all the major distros backport nginx stable release

Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by jxf on Tuesday March 18, 2014 @08:20PM (#7426046)
Why was it replaced with "#if 1" instead of just deleting the entire "if/end" delimiters? Won't that always evaluate to true?
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by mherkender on Wednesday March 19, 2014 @12:51AM (#7426884)
Maybe they wanted a patch that could be easily applied to older versions. It might have an elif later too, although I'm guessing that's not too common after debug blocks.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by citrin_ru on Wednesday March 19, 2014 @10:45AM (#7428918)
To keep patch small. Now #if 1 is removed: http://hg.nginx.org/nginx/rev/b93db4e4ff77
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by ryanseys on Tuesday March 18, 2014 @07:48PM (#7425897)
It appears my Ubuntu server only updates nginx mainline to 1.5.11. I've disabled spdy support in my listen directive for now as an easier work around.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by atom7 on Tuesday March 18, 2014 @08:05PM (#7425980)
It's not affected on Debian/Ubuntu, check --with-debug flag.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by ryanseys on Tuesday March 18, 2014 @08:54PM (#7426164)
Thank you.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by atom7 on Tuesday March 18, 2014 @09:42PM (#7426337)
btw, I use packages from nginx.org, they're updated in time with every release: http://nginx.org/en/linux_packages.html
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by voltagex_ on Wednesday March 19, 2014 @01:25AM (#7426972)
Do the upstream packages still use a different configuration path from the Debian/Ubuntu packages?
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by kijin on Wednesday March 19, 2014 @03:31AM (#7427222)
Yes. There's no sites-available or sites-enabled, and some configuration is split off into different files in the conf.d directory.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by pjmlp on Tuesday March 18, 2014 @05:18PM (#7425061)
Got to love C.
Re:Nginx SPDY heap buffer overflow (affects 1.3.15 – 1.5.11) by Fasebook on Wednesday March 19, 2014 @09:43PM (#7433265)
Almost as much as I love Java