CVE-2026-58591
Executive Summary
CVE-2026-58591 is a stored Cross-Site Scripting (XSS) vulnerability in the Drupal Colorbox module, affecting versions 0.0.0 to 2.1.5 and 0.0.0 to 2.2.0. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an attacker to inject arbitrary JavaScript into the Colorbox overlay. This can lead to session hijacking, data theft, or defacement. The vulnerability is part of the Drupal ecosystem, specifically a contributed module, and does not affect the core Drupal CMS directly. No public proof-of-concept (PoC) or exploit code has been released, and the EPSS score is 0.0%, indicating low exploitation activity. However, the risk remains significant for sites using the affected module.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the Drupal Colorbox module, which is distributed via the Drupal.org project page and Composer. The module is not available on NPM, PyPI, Go, or Ruby registries. The supply chain risk is moderate, as the module is a third-party contribution and may not receive timely security updates. Administrators should verify the integrity of the module by checking checksums or using Composer's lock file to ensure no tampering.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R)
- Scope: Changed (S:C)
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability requires user interaction (e.g., clicking a link) and does not allow direct code execution on the server. However, it can be used to steal session cookies or perform actions on behalf of the victim.
Deep Dive & Mechanics
The Colorbox module provides a lightbox/popup functionality for images and other content. The vulnerability exists in the way the module handles user-supplied data when generating the Colorbox overlay. Specifically, the module fails to sanitize input that is used in the title attribute or other HTML attributes of the overlay. An attacker can craft a malicious link or embed code that, when clicked, injects JavaScript into the page context.
Root Cause: The module uses t() or similar functions to output user data without proper escaping. For example, if a user uploads an image with a malicious filename or description, the module may render it directly into the HTML without encoding special characters.
Attack Vector: An attacker with the ability to create or edit content (e.g., a low-privileged user) can inject XSS payloads into fields that are displayed via Colorbox. Alternatively, a crafted URL can be sent to a victim.
Impact: Successful exploitation allows the attacker to execute arbitrary JavaScript in the victim's browser, leading to:
- Session cookie theft
- Redirection to malicious sites
- Defacement of the page
- Keylogging or form data theft
Vulnerable vs. Patched Code
The vulnerable code likely resides in the Colorbox module's template or PHP files where user input is output without sanitization. A typical vulnerable pattern might be:
// Vulnerable code (Colorbox module)
$title = $node->title; // User-supplied title
print '<a href="' . $image_url . '" title="' . $title . '">...</a>';
The patched version would use Drupal's check_plain() or Html::escape() to sanitize the output:
// Patched code
$title = Html::escape($node->title);
print '<a href="' . $image_url . '" title="' . $title . '">...</a>';
Since no official patch is available, administrators should manually review the module's code and apply similar sanitization.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A Drupal site with Colorbox module version < 2.1.5 or < 2.2.0
- Ability to create or edit content (e.g., authenticated user with "create content" permission)
Exploitation Steps:
- Create a new node (e.g., Article) with a malicious title containing XSS payload:
"><script>alert('XSS')</script> - Ensure the node uses an image field that triggers Colorbox.
- Send the link to the victim (e.g., via email or social engineering).
- When the victim clicks the link, the XSS payload executes.
Example Payload:
<img src="x" onerror="alert(document.cookie)">
Note: No public exploit code is available. The above is a generic XSS technique.
Blue Team
Detection:
- Monitor for unusual content creation or editing activity.
- Look for suspicious strings in node titles, descriptions, or image alt text.
- Use WAF rules to block common XSS patterns (e.g.,
<script>,onerror=).
Hunting:
- Search database for nodes containing
<script>oronerrorin text fields. - Review Apache/Nginx access logs for requests with encoded XSS payloads.
Lab Setup:
- Use a local Drupal instance with Colorbox module installed.
- Create a test node with a malicious title.
- Verify the XSS by accessing the node and observing the popup.
Indicators of Compromise (IOCs)
- Network: HTTP requests containing
%3Cscript%3Eoronerrorin query parameters or POST data. - Host: Drupal database entries with
<script>tags innode.title,node.body, orfield_data_field_imagetables. - File: Modified Colorbox module files (e.g.,
colorbox.module,colorbox.theme) with suspicious code. - Logs: Drupal watchdog logs showing "XSS" or "malicious input" warnings.
Detection Engineering
YARA Rule
rule CVE_2026_58591_XSS_Colorbox {
meta:
description = "Detects XSS payloads in Drupal Colorbox module"
author = "Valters IT"
date = "2026-01-01"
reference = "CVE-2026-58591"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+/is
$xss3 = /onload\s*=\s*["']?[^"'\s>]+/is
condition:
any of them
}
Sigma Rule
title: Drupal Colorbox XSS Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects XSS attempts against Drupal Colorbox module
author: Valters IT
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '<script>'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in content
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2026-58591 Drupal Colorbox XSS Attempt"; flow:to_server,established; content:"<script>"; nocase; http_uri; pcre:"/<script[^>]*>.*?<\/script>/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the Colorbox module to a version > 2.2.0 if available. If not, manually patch the code by adding
Html::escape()to all user-supplied output. - Disable the Colorbox module temporarily if patching is not possible.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads.
Long-term Mitigation:
- Regularly update all Drupal contributed modules.
- Use Drupal's built-in input filtering and validation.
- Conduct security audits of custom or third-party modules.
- Educate content editors about the risks of malicious input.
Workaround:
- Edit the Colorbox module's template file (e.g.,
colorbox.tpl.php) and wrap all dynamic variables withcheck_plain()orHtml::escape().
Valters IT
DevSecOps & Cyber Threat Intelligence