CVE-2026-120642 in CGIinfo

Summary

by MITRE • 11/04/2026

CGI versions before 5.00 for Perl return request-derived values untainted under taint mode.

The upload filename, uploadInfo values, some path_info and script_name values, Accept results, and the name lists from url_param and cookie are returned without the taint flag, as is a cookie named expires from 4.67 on.

These values come from regex captures or hash keys, which Perl does not taint, so they pass -T checks unvalidated.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/04/2026

The Common Gateway Interface (CGI) module for the Perl programming language contains a critical security flaw in versions prior to 5.00 regarding the handling of tainted data under strict taint mode enforcement. In secure software development, particularly within web application contexts using Perl, taint mode is a fundamental defense mechanism designed to prevent injection attacks by marking all external input as untrusted. When enabled via the -T flag, any data originating from outside the program must be explicitly validated and sanitized before it can be used in sensitive operations such as system command execution or file access. The vulnerability arises because specific values derived directly from HTTP requests are returned without being marked as tainted, thereby bypassing these essential security checks.

The technical root cause of this flaw lies in how Perl handles regex captures and hash keys during the parsing of CGI parameters. By default behavior within the language runtime, data extracted via regular expression capture groups or retrieved as hash keys is not automatically considered tainted, even when taint mode is globally active for the script. The CGI module incorrectly relies on this underlying language characteristic rather than explicitly applying the taint flag to these specific input vectors. Consequently, values such as upload filenames, upload information metadata, certain path_info and script_name segments, Accept header results, and name lists derived from url_param and cookie parsing are treated as safe by subsequent validation logic that expects tainted data to be rejected or sanitized first.

This behavior creates a significant operational impact for developers who rely on taint mode to secure their web applications against injection vulnerabilities. Because these specific request-derived values pass through -T checks unvalidated, an attacker can inject malicious payloads into HTTP headers, URL parameters, cookies, or file upload metadata. If the application subsequently uses any of these unchecked variables in system calls, shell commands, or database queries without additional manual sanitization, it becomes susceptible to command injection and cross-site scripting attacks. The issue is particularly insidious because it affects a wide array of input vectors including cookie values like expires starting from version 4.67, making the scope of potential exploitation broad across many legacy Perl-based web systems that assume taint mode provides comprehensive protection against external input manipulation.

From an industry standards perspective, this vulnerability aligns with CWE-20 Improper Input Validation and CWE-138 Return of Untrusted Data Without Proper Neutralization. The failure to enforce the principle of least privilege by allowing unvalidated data to influence control flow or system commands is a classic precursor to remote code execution. In terms of attack patterns, this flaw facilitates techniques categorized under MITRE ATT&CK Tactic TA0001 Initial Access and specifically relates to command injection vectors where attackers leverage improperly sanitized input to execute arbitrary operating system commands on the host server. The lack of automatic tainting for regex captures represents a gap in defense-in-depth strategies that assume language-level security features are fully comprehensive without manual intervention.

To mitigate this vulnerability, organizations running Perl CGI applications must upgrade to version 5.00 or later where these specific inputs are correctly marked as tainted under -T mode. For systems unable to immediately upgrade due to legacy dependencies, developers should implement explicit sanitization routines for all data derived from regex captures and hash keys before use in sensitive operations. This includes manually applying taint checks using the defined() function combined with regular expression matching to ensure that only expected character sets are processed. Additionally, adopting modern web frameworks or migrating away from CGI scripts can provide more robust built-in protections against input validation failures. Regular security audits focusing on data flow analysis for external inputs are essential to identify other potential instances where taint mode might be bypassed due similar language quirks in older Perl modules.

Responsible

CPANSec

Reservation

11/02/2026

Disclosure

11/04/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!