Repository navigation
Fixed
-
A one-byte heap overflow on every unauthenticated request.
ngx_http_auth_digest_send_challengesizes theWWW-Authenticate
value, allocates exactly that much, and then filled it with two
ngx_cpymemcalls that usedsizeof(...)instead of
sizeof(...) - 1: the terminator came along, andchallenge.lendoes
not account for one. Measured at run time with a realm of fifteen
characters: eighty-five bytes allocated, eighty-six written, in both
the stale and the ordinary branch.Any request to a protected location reaches it, so anyone can, and it
needs no credentials. What it corrupts is whatever the request pool
handed out next.It had been invisible to the sanitizer workflow, because the allocation
comes from the request pool:ngx_pnallochands out a slice of a block
that the allocator sees as one piece, and a write just past the slice
lands inside memory ASan had handed over whole. Building with
-DNGX_DEBUG_PALLOC=1, which sends every allocation straight to
malloc, is what brought it out -- ASan then reports
heap-buffer-overflow ... 0 bytes after 85-byte regionand takes the
worker down with it, on the first request.