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·13 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

•35 minutes ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
1 views•11 min read
•about 2 hours ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 3 hours ago•GHSA-GPWC-27CW-RH9R
5.3

CVE-2026-126301: Quadratic CPU Exhaustion in NLTK LegalitySyllableTokenizer

The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.

Amit Schendel
Amit Schendel
4 views•10 min read
•about 4 hours ago•CVE-2026-126304
8.7

CVE-2026-126304: Symlink Path Traversal in NLTK YCOECorpusReader

CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.

Amit Schendel
Amit Schendel
6 views•9 min read
•about 5 hours ago•CVE-2026-128077
6.5

CVE-2026-128077: Authorization Bypass via Request Path Desynchronization in Nuxt and @nuxt/nitro-server

CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.

Amit Schendel
Amit Schendel
5 views•10 min read
•about 6 hours ago•CVE-2026-128084
4.8

CVE-2026-128084: Integer Truncation and SQL Query Truncation in sqlite3-ruby

Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.

Alon Barad
Alon Barad
5 views•11 min read