CVE-2026-121008 in Treeinfo

Summary

by MITRE • 11/04/2026

SQL::Abstract::Tree versions before 2.000001_04 for Perl allow cross-site scripting via unescaped SQL text and bind values in the html profile.

The html profile wraps keywords and placeholders in span elements and breaks lines with br elements, so its output is meant to go into a page as is. The format method does not HTML-escape the SQL text or the bind values it fills in around that markup.

An application that renders SQL formatted with the html profile, such as in a debug panel or query log, allows an attacker who controls a bind value or part of the SQL text to embed JavaScript in the page.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 11/04/2026

The vulnerability identified in versions of SQL::Abstract::Tree prior to 2.000001_04 represents a critical input validation failure within the Perl module's HTML rendering profile, leading directly to cross-site scripting attacks. This library is commonly utilized by developers to construct complex database queries programmatically, and it features an html profile designed specifically for visualizing SQL statements in web-based interfaces such as debug panels or query logs. The design intent of this profile is to wrap keywords and placeholders within span elements while using br tags for line breaks, thereby producing formatted output that can be safely embedded directly into a webpage's DOM without additional processing by the consuming application. However, the implementation fails to perform necessary HTML entity encoding on either the raw SQL text or the values bound to those queries before insertion into the markup structure.

The technical flaw stems from the format method within the module, which constructs the final string representation of the query but neglects to escape special characters that hold significance in an HTML context. When a bind value containing malicious script tags is passed through this function, or when user-controlled input influences the SQL text itself, those unescaped sequences are rendered verbatim by the browser. Because the output is intended for direct insertion into a page as-is, there is no secondary layer of sanitization to strip out dangerous payloads. This oversight creates a classic stored or reflected cross-site scripting vector depending on how the application handles and displays these query logs. An attacker who can control any part of the SQL text or supply specific bind values can inject executable JavaScript code that will run in the context of the victim's browser session whenever they view the affected page.

The operational impact of this vulnerability is severe, as it allows for a wide range of malicious activities beyond simple script execution. Attackers can steal sensitive cookies and authentication tokens associated with the web application, facilitating account takeover or unauthorized access to restricted areas. Furthermore, the ability to execute arbitrary JavaScript enables attackers to perform actions on behalf of authenticated users, such as modifying data, changing settings, or initiating requests that trust the current session's privileges. In environments where query logs are accessible to multiple administrators or developers, this vulnerability can be leveraged for persistent attacks if the malicious payload is stored within a bind value and displayed repeatedly across different sessions. The lack of output encoding violates fundamental web security principles regarding data separation from code, allowing client-side scripts to interfere with the intended functionality of the application interface.

To mitigate this risk, immediate updates to SQL::Abstract::Tree version 2.000001_04 or later are required, as these versions address the missing HTML escaping logic within the html profile implementation. For applications unable to upgrade immediately, developers should implement a defensive coding practice by manually applying an HTML entity encoding function such as CGI::escapeHTML or Template Toolkit's filter mechanism on any SQL strings and bind values before passing them to the formatting method. Additionally, implementing Content Security Policy headers can help mitigate the impact of successful exploitation by restricting the sources from which scripts are allowed to execute. It is also advisable to review all instances where query logs or debug information containing raw SQL data are rendered in web interfaces to ensure that proper output encoding is applied consistently across the application stack. This vulnerability aligns with CWE-79, known as Improper Neutralization of Input During Web Page Generation Cross-site Scripting, and maps to ATT&CK technique T1059 which covers Command and Scripting Interpreter execution via browser-based vectors.

Responsible

CPANSec

Reservation

11/03/2026

Disclosure

11/04/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!