]> gitweb.ps.run Git - ps-cgit/commitdiff
filter: avoid integer overflow in authenticate_post
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 24 Nov 2015 10:28:00 +0000 (11:28 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 24 Nov 2015 10:31:43 +0000 (11:31 +0100)
ctx.env.content_length is an unsigned int, coming from the
CONTENT_LENGTH environment variable, which is parsed by strtoul. The
HTTP/1.1 spec says that "any Content-Length greater than or equal to
zero is a valid value." By storing this into an int, we potentially
overflow it, resulting in the following bounding check failing, leading
to a buffer overflow.

Reported-by: Erik Cabetas <Erik@cabetas.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

No differences found