Vulnerability DatabaseCVE-2026-142642

CVE-2026-142642: 
Laravel vulnerability analysis and mitigation

Overview

CVE-2026-142642 is a cross-site scripting (XSS) vulnerability in the Laravel PHP web application framework affecting the Blade templating engine's component attribute bag. Blade component attribute bags failed to HTML-escape non-Htmlable object values — such as Illuminate\Support\Stringable — when passed to ComponentAttributeBag::merge() or prepends(). This allows attackers to break out of HTML attributes and inject arbitrary attributes (e.g., event handlers), resulting in XSS executing in the application's origin. Affected versions are Laravel framework < 12.73.0 and >= 13.0.0, < 13.43.0. The vulnerability was published on December 2, 2026, with a CVSS v3.1 base score of 5.4 (Medium) (GitHub Advisory, Feedly).

Technical details

The root cause is classified as CWE-83 (Improper Neutralization of Script in Attributes in a Web Page). The shouldEscapeAttributeValue() method in ComponentAttributeBag previously skipped escaping for all object types, including Illuminate\Support\Stringable, because the check only applied HTML escaping to non-object, non-null, non-boolean values. An attacker who can control a Stringable value passed into a Blade component attribute (e.g., via request()->string('title')) can craft a payload such as x" onmouseover=alert(1) data-x=" that breaks out of the attribute context and injects arbitrary HTML attributes. The fix modifies shouldEscapeAttributeValue() to escape all values except null, booleans, and Htmlable instances, and also applies escaping to values wrapped with prepends() (GitHub Advisory, Fix Commit).

Impact

Successful exploitation enables stored or reflected XSS executing in the origin of the vulnerable Laravel application, allowing an attacker to hijack user sessions, perform actions on behalf of authenticated users, steal sensitive data accessible to the browser, or redirect users to malicious sites. The confidentiality and integrity impacts are rated Low, with no availability impact, as the attack requires user interaction (a victim must visit or interact with a crafted page) (GitHub Advisory, Feedly).

Exploitability

No public proof-of-concept exploit code or evidence of in-the-wild exploitation has been reported as of the disclosure date. The EPSS score is 0.0, indicating very low probability of exploitation in the near term, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. Exploitation requires that an application passes user-controlled Stringable values directly into Blade component attributes without prior sanitization, and also requires user interaction to trigger the injected script (Feedly, GitHub Advisory).

Exploitation steps

  1. Identify a vulnerable endpoint: Find a Laravel application running framework versions < 12.73.0 or 13.0.0–13.42.x that passes user-supplied input via request()->string() or similar Stringable-returning methods into a Blade component attribute using merge() or prepends().
  2. Craft a malicious payload: Construct an input value that breaks out of the HTML attribute context, such as x" onmouseover=alert(document.cookie) data-x=".
  3. Submit the payload: Send the crafted value via the relevant HTTP request parameter (e.g., a query string or form field) that the application passes to the vulnerable component attribute.
  4. Trigger victim interaction: Deliver a link or page containing the rendered component to a victim user. When the victim's browser renders the page, the injected event handler (e.g., onmouseover) executes arbitrary JavaScript in the application's origin.
  5. Achieve objective: Use the executed script to steal session cookies, perform CSRF actions, exfiltrate data, or redirect the victim (GitHub Advisory, Fix Commit).

Indicators of compromise

  • Network: HTTP requests containing attribute-breaking patterns (e.g., ", onmouseover=, onerror=, javascript:) in query parameters or form fields that are rendered into Blade component attributes.
  • Logs: Web server or Laravel application logs showing requests with URL-encoded or raw XSS payloads (e.g., %22, %20on, alert() in parameters mapped to component attributes.
  • Browser/Client-Side: Unexpected JavaScript execution or alert dialogs triggered by mouse events on rendered Blade components; unusual outbound requests from the victim's browser to attacker-controlled domains following page interaction.

Mitigation and workarounds

Upgrade the Laravel framework to version 12.73.0 or 13.43.0, which include the fix that escapes all attribute values except null, booleans, and Htmlable instances in ComponentAttributeBag::merge() and prepends(). As an immediate workaround without upgrading, cast user-controlled Stringable values to plain PHP strings before passing them to merge() or prepends() — for example, use request()->string('title')->toString() instead of request()->string('title'). This prevents the object from bypassing the previous escaping logic (GitHub Advisory, v12.73.0 Release, v13.43.0 Release).

Community reactions

The advisory was published by Laravel maintainer olivernybroe on GitHub with AI assistance noted. The fix was implemented by crynobone (Mior Muhammad Zaki) and merged by Taylor Otwell (Laravel's creator) on November 16, 2026. The vulnerability was also mirrored and addressed in downstream projects such as hypervel/components and One-Learning-Community/grease, indicating community awareness and prompt response across the Laravel ecosystem (GitHub PR #62503, GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related Laravel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-142642MEDIUM5.4
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026
CVE-2026-142644MEDIUM5.3
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026
CVE-2026-142643MEDIUM5.3
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026
CVE-2026-142647MEDIUM4.8
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026
CVE-2026-142645MEDIUM4.8
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management