]> git.ipfire.org Git - thirdparty/squid.git/commit
Limit X-Forwarded-For growth.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 11 Jul 2009 05:39:44 +0000 (23:39 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Sat, 11 Jul 2009 05:39:44 +0000 (23:39 -0600)
commitc4f302236d91fea72e24c39e7a0ef529acca10f2
treeb9f48ed593a83e206aba36b07abc60a5cbdd1d01
parent618249f5755241605848b06c7c98ebbf10d1580d
Limit X-Forwarded-For growth.

X-Forwarded-For growth leads to String size limit assertions and probably
other problems.

We now replace huge XFF values with a string "error", warn the admin the
first 100 times, and hope that something will stop the loop (if it is a
loop). TODO: we should probably deny requests with huge XFF.

To make growth-associated problems visible during forwarding loops, the
loop breaking code must be disabled (no Via) or not applicable (direct
forwarding) and request_header_max_size has to be raised or disabled.
The X-Forwarded-For header value may also grow too large for reasons
unrelated to forwarding loops.

This change also prevents most cases of pointless computation of the
original X-Forwarded-For value list. That computation can be quite
expensive.
src/http.cc