CVE-2026-120634 in CGI::Carpinfo

Summary

by MITRE • 11/04/2026

CGI::Carp versions before 5.00 for Perl leak warnings across requests in persistent environments via the warningsToBrowser buffer.

Warnings are held in a package-level buffer until warningsToBrowser writes them into the page as HTML comments, and the buffer is never cleared between requests. Under mod_perl, FastCGI or PSGI, warnings from one request are written into a later one.

Warnings that contain one user's request data can appear in the HTML sent to another user.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/04/2026

The vulnerability identified in CGI::Carp versions prior to 5.00 represents a critical information disclosure flaw rooted in improper state management within persistent execution environments. This module, commonly used for logging Perl warnings and errors to web browsers or log files, maintains internal package-level buffers to accumulate warning messages before outputting them as HTML comments into the response stream. In standard CGI deployments where each request spawns a new process, this buffer is naturally reset upon termination of the script. However, in persistent environments such as mod_perl, FastCGI, and PSGI applications, the Perl interpreter remains loaded across multiple HTTP requests to optimize performance by avoiding repeated initialization overheads. The flaw arises because the warningsToBrowser function writes accumulated warnings from its internal buffer into the HTML output but fails to clear that buffer after transmission. Consequently, warning messages generated during one request persist in memory and are subsequently appended to the responses of subsequent, unrelated requests handled by the same interpreter instance or worker process.

This architectural oversight leads directly to a severe cross-user data leakage scenario. When an application processes user input that triggers warnings containing sensitive information such as session identifiers, personal details, database query parameters, or internal file paths, these strings are captured in the persistent buffer. Because the buffer is not flushed between requests, this cached warning text remains available for inclusion in future responses. If a different user subsequently accesses the same application endpoint handled by the same worker process, they will receive an HTML response that includes the leaked warnings from previous interactions. This effectively allows one user to view data belonging to another user or internal system details that were not intended for public consumption, violating fundamental principles of isolation and confidentiality in web applications.

From a technical classification perspective, this vulnerability aligns with CWE-209: Generation of Error Message Containing Sensitive Information, as it involves the exposure of sensitive data through error handling mechanisms. It also maps to CWE-613: Insufficient Session Expiration, although more accurately described under CWE-784: Reliance on Cookies without Validation or Integrity Checking in broader context, but specifically falls under CWE-200 and CWE-524 regarding the exposure of sensitive information through cache or buffer persistence. In terms of adversary tactics, this behavior facilitates reconnaissance and data exfiltration phases within the MITRE ATT&CK framework, particularly relating to Collection via Screen Capture or Data from Information Repositories if the leaked warnings reveal internal structures that aid further exploitation. The lack of state isolation between requests in long-lived processes is a common pitfall in persistent web frameworks, making this a significant risk for any production environment utilizing these technologies without proper mitigation.

The operational impact of this vulnerability extends beyond simple data leakage. It can lead to unauthorized access if session tokens or authentication cookies are exposed through warning messages generated during login failures or permission checks. Attackers can exploit this by crafting requests that trigger specific warnings, then monitoring subsequent responses from other users or even their own future requests to harvest sensitive context. This undermines the integrity of the application's security model and compromises user privacy. Furthermore, it may expose internal file paths, database schemas, or stack traces that provide attackers with valuable intelligence for developing more targeted attacks such as SQL injection or path traversal exploits. The persistence of these warnings means that even low-frequency errors can accumulate significant amounts of sensitive data over time if left unaddressed.

Mitigation strategies must focus on ensuring proper state cleanup between requests in persistent environments. For CGI::Carp users, upgrading to version 5.00 or later is the primary remediation step, as this release addresses the buffer clearing issue by resetting the warningsToBrowser buffer after each write operation. In cases where an upgrade is not immediately feasible, developers should implement manual cleanup routines within their application's request lifecycle hooks. This involves explicitly calling functions to clear the internal warning buffers at the end of every request processing cycle. Additionally, applications running in mod_perl or FastCGI environments should review their error handling configurations to ensure that sensitive data does not enter the logging pipeline unless strictly necessary and properly sanitized. Implementing strict input validation and output encoding can also reduce the likelihood of generating warnings that contain user-controlled data, thereby reducing the attack surface for this specific leakage vector. Regular security audits focusing on state management in persistent web applications are recommended to prevent similar issues across other modules or custom code.

Responsible

CPANSec

Reservation

11/02/2026

Disclosure

11/04/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!