Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-1861: CWE-131 Incorrect Calculation of Buffer Size in PHP Group PHP

0
Medium
VulnerabilityCVE-2025-1861cvecve-2025-1861cwe-131
Published: Sun Mar 30 2025 (03/30/2025, 05:57:57 UTC)
Source: CVE
Vendor/Project: PHP Group
Product: PHP

Description

In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when parsing HTTP redirect in the response to an HTTP request, there is currently limit on the location value size caused by limited size of the location buffer to 1024. However as per RFC9110, the limit is recommended to be 8000. This may lead to incorrect URL truncation and redirecting to a wrong location.

AI-Powered Analysis

AILast updated: 11/04/2025, 01:06:35 UTC

Technical Analysis

CVE-2025-1861 is a vulnerability identified in the PHP programming language, specifically affecting versions 8.1.* before 8.1.32, 8.2.* before 8.2.28, 8.3.* before 8.3.19, and 8.4.* before 8.4.5. The issue arises from an incorrect calculation of the buffer size allocated for the HTTP Location header when PHP parses HTTP redirect responses. PHP currently limits the Location header buffer size to 1024 bytes, which is significantly smaller than the 8000-byte limit recommended by RFC9110. This limitation can cause truncation of the redirect URL if the Location header exceeds 1024 bytes, leading to incorrect URL redirection. Such truncation might redirect users to unintended or malicious URLs, potentially facilitating phishing attacks, session hijacking, or other redirect-based exploits. The vulnerability is classified under CWE-131 (Incorrect Calculation of Buffer Size) and has a CVSS 4.0 base score of 6.3, indicating medium severity. The attack vector is network-based (AV:N), requires low attack complexity (AC:L), no privileges (PR:N), no user interaction (UI:N), and partial confidentiality impact (VC:L). No known exploits have been reported in the wild at the time of publication. The vulnerability affects web applications and services that rely on PHP for HTTP redirect handling, especially those that process user-supplied or third-party URLs in redirects. This flaw could be exploited by attackers to manipulate redirect destinations, potentially leading to security issues such as phishing or redirect loops.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to web applications and services that utilize affected PHP versions for handling HTTP redirects. Incorrect URL truncation could lead to users being redirected to malicious sites, increasing the risk of phishing attacks, credential theft, or malware distribution. Organizations in sectors with high web traffic, such as e-commerce, finance, government, and healthcare, may face reputational damage and regulatory scrutiny if exploited. The partial confidentiality impact suggests some information disclosure risk, though integrity and availability impacts are minimal. Since exploitation requires no authentication or user interaction, attackers can remotely trigger the vulnerability, increasing its threat potential. The medium severity rating indicates a moderate risk but warrants timely remediation to prevent exploitation. Additionally, the discrepancy with RFC9110 compliance could affect interoperability and user trust in web services. Overall, the vulnerability could undermine secure web navigation and user trust in affected European digital services.

Mitigation Recommendations

European organizations should promptly upgrade PHP to the fixed versions: 8.1.32 or later, 8.2.28 or later, 8.3.19 or later, and 8.4.5 or later once available. Until patches are applied, organizations can implement web application firewall (WAF) rules to monitor and block HTTP responses with excessively long Location headers exceeding 1024 bytes. Application-level input validation should be enhanced to restrict or sanitize redirect URLs to safe, expected domains and lengths. Security teams should audit existing redirect implementations to identify any reliance on long Location headers and refactor them to comply with RFC9110 recommendations. Logging and monitoring should be increased for unusual redirect patterns or user complaints about unexpected redirects. Additionally, educating developers about proper buffer size handling and adherence to RFC standards can prevent similar issues. Organizations should also review third-party PHP modules or frameworks for related vulnerabilities. Coordinated vulnerability management and incident response plans should be updated to address potential exploitation scenarios involving redirect manipulation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
php
Date Reserved
2025-03-03T04:47:51.192Z
Cisa Enriched
true
Cvss Version
4.0
State
PUBLISHED

Threat ID: 683076940acd01a2492725d1

Added to database: 5/23/2025, 1:22:28 PM

Last enriched: 11/4/2025, 1:06:35 AM

Last updated: 12/2/2025, 4:44:06 AM

Views: 67

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats