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-54614

CVE-2026-54614: Unsafe Reflection and Arbitrary Class Instantiation in cakephp/debug_kit MailPreview

Alon Barad
Alon Barad
Software Engineer

Aug 26, 2026·7 min read·21 visits

Executive Summary (TL;DR)

An unsafe reflection flaw in CakePHP's DebugKit toolbar allows remote attackers to instantiate arbitrary PHP classes, potentially triggering remote code execution, database interactions, or denial of service through destructor/constructor side-effects.

CVE-2026-54614 is an unsafe reflection vulnerability in the MailPreview component of cakephp/debug_kit prior to versions 4.10.3 and 5.2.4. Unauthenticated or low-privileged remote attackers can exploit this vulnerability to dynamically resolve and instantiate arbitrary PHP classes within the Composer autoloader environment, leading to constructor and destructor execution.

Vulnerability Overview

The cakephp/debug_kit package provides a debugging toolbar containing various panels designed to simplify development. Among these is the MailPreview panel, which allows developers to test and view simulated email templates sent by the application. This feature exposes routes that dynamically process class and method names via user input in order to find, load, and render email previews.

The dynamic resolution relies on resolving class strings dynamically from URL routing parameters. Under normal operations, the toolbar expects to receive a simple name corresponding to a defined MailPreview subclass. It then resolves this name to a class inside the Mailer/Preview directory structure. However, because the routing logic does not enforce a rigorous strict-type or namespace boundary check, an attacker can specify arbitrary PHP namespaces in the URL path.

This behavior exposes the application to unsafe reflection (CWE-470). An attacker capable of sending network requests to the DebugKit routes can bypass local namespace assumptions. By doing so, they can force the application to instantiate any autoloadable PHP class available in the environment, utilizing constructor side-effects to achieve execution.

Root Cause Analysis

The root cause of the vulnerability lies within the class resolution method inside src/Controller/MailPreviewController.php. The controller relies on the App::className() utility method provided by the core CakePHP framework to convert shorthand class names into fully qualified namespaces.

The App::className() utility expects class names to match structured conventions. However, if the input parameter contains backslashes (e.g., Cake\Utility\Inflector), App::className() assumes that the input represents an absolute fully qualified class name. It bypasses conventional namespace prefixing logic and returns the class path as-is, provided the class is resolvable within the Composer autoloader.

Following class resolution, the application performs direct instantiation via new $realClass(). Crucially, before the patch, the application failed to verify whether the resolved class implements the expected base class or interface. It assumed any resolved class was an authorized mailer preview class.

Furthermore, the controller attempts to invoke the user-controlled $emailName method on the newly instantiated object. Even if the method call fails or throws an exception (due to incompatible signatures or non-existent methods), the object remains instantiated in memory. When the PHP engine initiates garbage collection at the end of the request-response lifecycle, the target class's destructor (__destruct()) is triggered. This behavior allows attackers to execute arbitrary destructors, enabling standard PHP destructor-based gadget chain exploitation.

Code Analysis and Comparison

To understand the vulnerability's mechanics, we can inspect the difference between the vulnerable implementation and the patched version in src/Controller/MailPreviewController.php.

Below is the vulnerable implementation:

protected function findPreview($previewName, $emailName, $plugin = '')
{
    if ($plugin) {
        $plugin = "$plugin.";
    }
 
    // Resolves input directly. If $previewName has backslashes, it bypasses Mailer/Preview structure.
    $realClass = App::className($plugin . $previewName, 'Mailer/Preview');
    if (!$realClass) {
        throw new NotFoundException("Mailer preview ${previewName} not found");
    }
 
    // Vulnerable: Instantiation happens without validation.
    $mailPreview = new $realClass();
    ...
}

The official patch restricts resolved names to block namespace navigation and validates inheritance prior to instantiation:

protected function findPreview($previewName, $emailName, $plugin = null)
{
    if ($plugin) {
        $plugin = "$plugin.";
    }
    
    // 1. Explicitly block backslashes to prevent namespace bypassing
    if (str_contains($previewName, '\\')) {
        throw new NotFoundException("Mailer preview $previewName not found");
    }
 
    $realClass = App::className($plugin . $previewName, 'Mailer/Preview');
    
    // 2. Validate that the class is a subclass of MailPreview before instantiation
    if (!$realClass || !is_subclass_of($realClass, MailPreview::class, true)) {
        throw new NotFoundException("Mailer preview ${previewName} not found");
    }
 
    // Safe: The object is guaranteed to be a valid MailPreview instance
    $mailPreview = new $realClass();
    ...
}

The check using is_subclass_of with the third parameter set to true is critical. It evaluates the string name of the class without instantiating it first, preventing the constructor from executing prematurely. By combining this with the backslash restriction, the vulnerability is fully mitigated.

Exploitation Methodology

Exploitation of CVE-2026-54614 requires access to the DebugKit interface, which is typically enabled only in development environments. However, production environments with misconfigured environments can also be targeted. No authentication is typically needed to interact with the DebugKit routing namespace if the host header checks are bypassed or the server is public-facing.

An attacker can trigger the vulnerability by sending a standard HTTP GET request. The input is passed directly in the URL structure. For example, testing for structural vulnerability can be achieved by supplying a known core CakePHP utility class like Cake\Utility\Inflector:

GET /debug-kit/mail-preview/preview/Cake%5CUtility%5CInflector/slug HTTP/1.1
Host: target-app.local
Accept: text/html

If the application is vulnerable, the server will attempt to locate Cake\Utility\Inflector via the autoloader, instantiate it, and execute its constructor. If the application has been patched, the request immediately terminates with a 404 Not Found response because of the backslash validation rule.

To escalate this vulnerability beyond simple resource loading, an attacker must identify classes with sensitive behavior inside their constructors or destructors. In modern PHP frameworks, such gadget chains are common in third-party vendor libraries (e.g., Monolog, Guzzle, or Doctrine). For example, if a loaded class contains a destructor that writes or deletes a temporary file based on instance variables, triggering its instantiation can lead to arbitrary file modification or destruction on the host system.

Impact Assessment

The baseline CVSS score for this vulnerability is 4.3 (Medium), with a vector of CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N. This calculation assumes a scenario where the impact is limited to low confidentiality disclosure through execution of basic methods. However, in practice, the operational impact can be significantly higher.

If a compatible gadget chain is present inside the application's dependencies (such as classes in the /vendor directory), the threat shifts from local information disclosure to complete system compromise. This allows an attacker to achieve Remote Code Execution (RCE) or arbitrary file delete actions.

Because DebugKit is a standard dependency in the CakePHP ecosystem, many web applications retain it in their composer files. If a developer accidentally deploys a container with the development configuration enabled (e.g., debug mode set to true), the attack vector becomes immediately reachable over the internet.

Remediation and Defense-in-Depth

The definitive solution is to upgrade cakephp/debug_kit to version 4.10.3 (for CakePHP 4.x applications) or 5.2.4 (for CakePHP 5.x applications) using Composer. These updates contain the namespace containment logic and subclass validation routines.

In addition to upgrading, organizations must apply robust defense-in-depth measures. Development dependencies such as DebugKit must never be loaded in production environments. Developers should ensure that their composer.json file separates development tools into the require-dev block, and deployments must be executed using the --no-dev parameter:

composer install --no-dev --optimize-autoloader

Furthermore, ensure that the core CakePHP configuration has debugging disabled in all production and staging environments:

// config/app.php or config/app_local.php
'debug' => false,

To detect potential exploitation attempts at the network layer, Web Application Firewalls (WAFs) should be configured to block requests to the MailPreview controller containing backslashes. For example, a custom detection regex pattern can target paths matching /debug-kit/mail-preview/ that contain %5C or raw backslash sequences.

Official Patches

cakephpPull Request #1078: Fix MailPreview class loading vulnerability

Fix Analysis (2)

Technical Appendix

CVSS Score
4.3/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

Affected Systems

Applications utilizing CakePHP Framework with the DebugKit plugin enabled

Affected Versions Detail

Product
Affected Versions
Fixed Version
debug_kit
cakephp
< 4.10.34.10.3
debug_kit
cakephp
>= 5.0.0, < 5.2.45.2.4
AttributeDetail
CWE IDCWE-470
Attack VectorNetwork
CVSS v3.14.3 (Medium)
Exploit Statuspoc
KEV StatusNot Listed
ImpactUnsafe Reflection / Arbitrary Class Instantiation / Potential Remote Code Execution

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1106Native API
Execution
T1211Exploit Exploitation for Defense Evasion
Defense Evasion
CWE-470
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

The application uses input from an external source to determine which class to instantiate or which method to execute, without verifying that the class or method is authorized.

Known Exploits & Detection

GitHubExploit concepts and validation test cases within the official security pull request

Vulnerability Timeline

Initial security patch commits pushed to 5.x and 4.x branches
2026-06-04
Security pull request finalized and merged into debug_kit master
2026-06-06
CVE-2026-54614 and GHSA-p46m-g734-vpc4 publicly disclosed
2026-08-26

References & Sources

  • [1]GHSA-p46m-g734-vpc4: cakephp/debug_kit Unsafe Reflection Vulnerability
  • [2]CakePHP DebugKit 4.10.3 Release Notes
  • [3]CakePHP DebugKit 5.2.4 Release Notes

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

•15 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
0 views•11 min read
•about 1 hour 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
2 views•10 min read
•about 2 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
3 views•10 min read
•about 3 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
4 views•9 min read
•about 4 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 5 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