CVE-2025-1861CWE-131

Stream HTTP wrapper truncates redirect location to 1024 bytes

Medium · published March 30, 2025

CVSS v4.0
6.3
EPSS
1%
Percentile
57.4
In the wild
Unconfirmed
What it is

⚠️ A cozy 1024-character buffer is all that stands between your PHP app and the wrong redirects! Think of it like a post office that can only accept packages up to a certain size — any parcel over that limit gets cut off, potentially sending it to the wrong address altogether. This means that if a header has a URL longer than 1024 characters, it gets truncated. An attacker could trick your application into redirecting users to a misleading or malicious site instead of the correct destination, which could lead to confusion or even compromise sensitive data.

Put simply

Think of it like a post office that can only accept packages up to a certain size — any parcel over that limit gets cut off, potentially sending it to the wrong address altogether. This vulnerability in PHP affects versions prior to 8.1.32, 8.2.28, 8.3.19, and 8.4.5 by limiting the HTTP location header size to 1024 characters instead of the recommended 8000. This truncation can cause improper redirects.

What to do

This means that if a header has a URL longer than 1024 characters, it gets truncated. An attacker could trick your application into redirecting users to a misleading or malicious site instead of the correct destination, which could lead to confusion or even compromise sensitive data. Upgrade your PHP to version 8.1.32, 8.2.28, 8.3.19, or 8.4.5 to resolve this issue. Additionally, consider reviewing your redirect implementations to ensure they handle larger URLs properly. Don't forget to test thoroughly after the updates! You've got this! With these updates and checks, your app will be safer and more reliable than ever. 🛡️

The record
Technical detail
CVSS v4.0
6.3 · MEDIUM
Vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
EPSS
0.00839 · 57.4th percentile
Weakness
CWE-131 · Incorrect Calculation of Buffer Size
Published
2025-03-30T05:57Z
EPSS history
Timeline
  • 30 MAR 05:57Z
    Stream HTTP wrapper truncates redirect location to 1024 bytes
    cvelistv5