CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-58657

CVE-2026-58657: Stored CSS Injection in Grav CMS Media Resize Parser

Alon Barad
Alon Barad
Software Engineer

Sep 17, 2026·4 min read·2 visits

Executive Summary (TL;DR)

Low-privileged editors can inject arbitrary CSS via image resize query parameters due to missing type validation in Grav's media processing trait.

CVE-2026-58657 is a critical stored CSS injection vulnerability in Grav CMS's media processing pipeline. By exploiting improper sanitization of image dimensions in the resize helper, low-privileged users with page editing permissions can inject arbitrary CSS styles. This can lead to visual defacement, UI redressing, and indirect data exfiltration.

Vulnerability Overview

Grav CMS is a flat-file content management system that processes content written in Markdown. Within its media pipeline, users can append query parameters to image references to perform dynamic manipulations, such as resizing, cropping, or scaling.

The vulnerability, designated as CVE-2026-58657, resides within the media manipulation handler. Specifically, when parsing the resize parameter, the system fails to sanitize or validate the dimensions supplied in the URL query string.

This lack of sanitization allows an attacker with page creation or editing privileges to insert raw CSS syntax. Because the generated dimensions are directly written to inline style attributes, this results in stored CSS injection when the page is rendered for other users.

Root Cause Analysis

The root cause of this vulnerability lies in the lack of type verification within the resize() method. This method is implemented inside the StaticResizeTrait trait, located at system/src/Grav/Common/Media/Traits/StaticResizeTrait.php.

During Markdown processing, Grav extracts query parameters from image URLs and forwards them to Excerpts::processMediaActions(). When the resize action is processed, the raw width and height strings are assigned directly to the internal $styleAttributes array.

Because the input values are concatenated directly with the 'px' string without casting to integers, any character sequence containing semicolons is preserved. Semicolons act as delimiters in CSS, enabling an attacker to terminate the width property and append arbitrary CSS properties to the inline style block.

Code Analysis

A comparison of the vulnerable and patched code reveals how the input validation check was missing. In the vulnerable version, the parameters are handled as raw variables:

public function resize($width = null, $height = null)
{
    if ($width) {
        $this->styleAttributes['width'] = $width . 'px';
    }
    // ...
}

The fix introduces strict validation by verifying if the values are numeric and casting them to integers. This neutralizes any non-numeric characters before they are added to the inline style array:

$width = is_numeric($width) ? (int) $width : 0;
$height = is_numeric($height) ? (int) $height : 0;
 
if ($width > 0) {
    $this->styleAttributes['width'] = $width . 'px';
} else {
    unset($this->styleAttributes['width']);
}

This validation ensures that only positive integer values are rendered inside the final style attribute. Non-numeric inputs evaluate to 0 and are completely discarded, preventing the inject path.

Exploitation Methodology

To exploit this vulnerability, an attacker must have permissions to create or modify pages within the Grav CMS instance. This restriction makes the threat vector post-authentication, though achievable by users with low-privilege roles such as content editors or contributors.

The attacker crafts an image tag within the Markdown editor containing a malformed resize parameter. An example payload structures the query parameter to include a semicolon followed by positioning directives:

![Target](image.png?resize=100;position:fixed;top:0;left:0;width:100%;height:100%;z-index:9999;background:red;,200)

When processed by the server, the template parser renders an image tag with a corrupted inline style attribute. The browser parses the semicolon as a delimiter, overriding the layout with a full-screen block on top of the original interface. This visual overlay can be customized to display deceptive content.

Impact Assessment

The impact of this vulnerability is centered around UI redressing and potential credential theft. While CSS injection does not execute arbitrary JavaScript directly, modern CSS features allow sophisticated manipulation of the user interface.

Attackers can utilize absolute positioning and high z-index elements to craft phishing forms over the legitimate administration interface. When an administrator views the page, they may interact with the fake form, unknowingly submitting sensitive inputs to an external server.

Additionally, CSS attribute selectors can be used to exfiltrate sensitive tokens. By utilizing background image URLs that trigger conditionally based on input attributes, an attacker could leak CSRF tokens or user-typed data to an out-of-band logger.

Remediation & Mitigation

The primary remediation path is to update the Grav CMS installation to version 2.0.0 or higher. This release integrates the type-casting logic in the StaticResizeTrait class to completely block the injection path.

If upgrading is not immediately possible, administrators should manually apply the code-level patch to the StaticResizeTrait.php file. This involves casting the input parameters to integers before they are evaluated or appended to style arrays.

In addition, implementing a strict Content Security Policy can restrict the impact of CSS injection. Configuring the style-src directive without 'unsafe-inline' prevents the execution of arbitrary inline style rules, though it may affect normal operation if inline styles are required by the theme.

Fix Analysis (2)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
EPSS Probability
0.37%
Top 69% most exploited

Affected Systems

Grav CMS

Affected Versions Detail

Product
Affected Versions
Fixed Version
Grav CMS
Trilby Media
< 2.0.02.0.0
AttributeDetail
CWE IDCWE-79
Attack VectorNetwork
CVSS Score6.5
EPSS Score0.00371
ImpactStored CSS Injection
Exploit Statusnone
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1189Drive-by Compromise
Initial Access
T1185Browser Session Hijacking
Collection
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

References & Sources

  • [1]GitHub Security Advisory GHSA-ffmg-hfvg-jhg9
  • [2]NVD - CVE-2026-58657

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•14 minutes ago•CVE-2026-63128
7.5

CVE-2026-63128: Uncontrolled Resource Consumption in Model Context Protocol Rust SDK (rmcp)

CVE-2026-63128 is a high-severity uncontrolled resource consumption vulnerability in the Model Context Protocol (MCP) official Rust SDK (the rmcp crate) prior to version 2.0.0. An unauthenticated attacker can exploit this vulnerability by sending malformed or mismatching handshake requests to the stateful Streamable HTTP server, causing persistent memory allocation without cleanup. This results in an unbounded memory leak and lock contention that ultimately leads to complete denial of service.

Amit Schendel
Amit Schendel
1 views•6 min read
•about 1 hour ago•CVE-2026-63671
8.1

CVE-2026-63671: Cross-Site Scripting (XSS) Sanitizer Bypass in @nuxtjs/mdc

A cross-site scripting (XSS) vulnerability was identified in @nuxtjs/mdc prior to version 0.22.1. Gaps in the HTML/SVG attribute verification and URL protocol parsing allow unauthenticated remote attackers to bypass the application's sanitization routines. By embedding malicious SVG links or data-encoded iframe elements within Markdown, attackers can execute arbitrary JavaScript in the victim's browser context.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 3 hours ago•CVE-2026-61709
5.3

CVE-2026-61709: Improper Policy Enforcement and Exclusion Bypass in OpenFGA ListUsers API

An authorization-decision over-inclusion vulnerability exists in the OpenFGA authorization engine. The flaw manifests within the `ListUsers` API evaluation path when evaluating complex relationship intersections containing exclusions. Under certain configurations involving wildcards, the exclusion is bypassed, leading to incorrect permission lists.

Alon Barad
Alon Barad
8 views•7 min read
•about 4 hours ago•CVE-2026-61594
9.1

CVE-2026-61594: Authorization Bypass on WebSocket and SSE Mount Paths in djust

An authorization bypass vulnerability exists in the djust framework (djust-org/djust) prior to version 1.0.7. The framework fails to enforce standard Django view-level authorization mechanisms, such as AccessMixins or dispatch decorators, when mounting reactive views over stateful transport layers (WebSockets and Server-Sent Events). Unauthenticated or low-privileged attackers can establish persistent connections to mount arbitrary protected views and execute state-changing event handlers.

Amit Schendel
Amit Schendel
8 views•7 min read
•about 5 hours ago•CVE-2026-61560
9.8

CVE-2026-61560: Unauthenticated Remote Path Traversal and Access Token Exfiltration in @zereight/mcp-gitlab

CVE-2026-61560 is a critical security vulnerability in the @zereight/mcp-gitlab Server-Sent Events (SSE) server. By utilizing default, unauthenticated route setups and exposing vulnerable administrative tools, remote attackers can execute path traversal attacks to read internal process variables and hijack GitLab operations.

Amit Schendel
Amit Schendel
4 views•8 min read
•about 6 hours ago•CVE-2026-61590
7.4

CVE-2026-61590: Network-Exposed Observability Endpoints and Remote Method-Invocation in djust

A critical access control vulnerability in djust prior to 1.0.7 exposes diagnostic endpoints and remote method-invocation capabilities to unauthorized network actors. The vulnerability arises due to decoupling IP boundary validation into an opt-in middleware that was omitted from official configuration documentation, leaving views to rely solely on the status of Django's DEBUG flag.

Alon Barad
Alon Barad
5 views•7 min read