VYPR
Unrated severityNVD Advisory· Published Feb 4, 2020· Updated Aug 4, 2024

CVE-2020-8450

CVE-2020-8450

Description

An issue was discovered in Squid before 4.10. Due to incorrect buffer management, a remote client can cause a buffer overflow in a Squid instance acting as a reverse proxy.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

23

Patches

Vulnerability mechanics

Root cause

"Buffer overflow in reverse proxy URL generation due to fixed-size stack buffer (256 bytes) for Host header without proper length validation."

Attack vector

A remote client sends a crafted HTTP request with an overly long Host header to a Squid instance configured as a reverse proxy (accelerator mode). The Host header value is copied into a fixed-size stack buffer (`char thost[256]`) without proper bounds checking, causing a buffer overflow. The attacker does not need authentication; they only need network access to the Squid proxy. [ref_id=1] [ref_id=2]

Affected code

The vulnerability resides in `src/client_side.cc` in the `prepareAcceleratedURL()` and `prepareTransparentURL()` functions. The initial patch introduced a `getHostHeader()` function to validate the Host header, but the character check logic was inverted (`if (hostChars[*c])` instead of `if (!hostChars[*c])`), causing all valid Host headers to be rejected. Additionally, a subsequent patch incorrectly used `>= SQUIDHOSTNAMELEN` instead of `<= SQUIDHOSTNAMELEN` when checking the host length, and the `thost` buffer was fixed at 256 bytes rather than using the proper `SQUIDHOSTNAMELEN` constant.

What the fix does

The fix corrects three issues. First, the character validation in `getHostHeader()` was inverted from `if (hostChars[*c])` to `if (!hostChars[*c])` so that invalid characters are properly rejected. Second, the length check was corrected from `>= SQUIDHOSTNAMELEN` to `<= SQUIDHOSTNAMELEN` so that only Host headers exceeding the maximum allowed length are rejected. Third, the `thost` buffer size was changed from the hardcoded `256` to `SQUIDHOSTNAMELEN + 6` to match the actual maximum hostname length plus port separator and port digits. [ref_id=1]

Preconditions

  • configSquid must be configured as a reverse proxy (accelerator mode) with vhost or switchedToHttps enabled
  • networkAttacker must have network access to send HTTP requests to the Squid instance
  • authNo authentication required
  • inputAttacker sends a crafted Host header exceeding 256 bytes

Generated on May 31, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

15

News mentions

0

No linked articles in our index yet.