Jun 3, 2026·6 min read·10 visits
Unescaped exception messages in Laravel Backpack's default error views allow attackers to execute arbitrary JavaScript in the context of an authenticated administrator via crafted links.
CVE-2022-31114 is a Reflected Cross-Site Scripting (XSS) vulnerability affecting the popular administrative panel package 'backpack/crud'. The flaw is rooted in the unsafe, raw rendering of PHP exception messages within the default error templates. When an unescaped exception message reflects malicious user-provided input, arbitrary JavaScript can execute within an administrator's browser session.
The PHP package backpack/crud is a popular administration panel framework for Laravel, designed to accelerate backend development. Because it manages administrative access, it occupies a highly privileged position within the web application architecture. This makes its user interfaces and error handling routines high-value targets for malicious actors seeking administrative access.
This vulnerability, CVE-2022-31114, is classified as an instance of Reflected Cross-Site Scripting (CWE-79). The flaw is located in the custom error-rendering templates bundled with the package. If an attacker can craft a request that triggers an application exception containing malicious input, the application will render that input back to the user without prior sanitization.
In administrative panels, Reflected Cross-Site Scripting carries severe implications. Although categorized as medium severity due to the requirement of user interaction, successful exploitation can result in full session hijacking. If the victim has administrative privileges, the execution of arbitrary JavaScript can lead to unauthorized backend configurations or administrative credential theft.
In standard Laravel development, the Blade template engine provides two main types of echo statements. The default syntax {{ $variable }} automatically passes the variable through PHP's htmlspecialchars function to prevent XSS. Conversely, the unescaped syntax {!! $variable !!} renders the variable directly without any sanitation, which is intended for trusted HTML content.
In vulnerable versions of backpack/crud, the templates responsible for displaying error codes and exception messages utilized the unescaped syntax. Specifically, the exception message was outputted using {!! $exception->getMessage() !!}. This design choice meant that any HTML or JavaScript contained within the exception message was executed directly by the rendering web browser.
Exception messages often incorporate raw, unvalidated input. For example, database query exceptions generated during an invalid search filter may include the search parameter directly in the SQL error output. Similarly, validation and routing systems often echo back requested identifiers in their error messages. This direct echo behavior provides the necessary reflection point to execute the XSS payload.
The vulnerable code path revolves around how the error layout displays the message variable. The template previously loaded the exception's message using raw execution delimiters, exposing the application to injection attacks.
<!-- Vulnerable Implementation (layout.blade.php) -->
<div class="row m-t-40">
<div class="col-md-12 text-center">
<div class="error_number">
@yield('title')
</div>
<div class="error_message">
{!! $exception->getMessage() !!}
</div>
</div>
</div>The patch resolved this by applying the e() helper function, which acts as a wrapper for htmlspecialchars. This neutralizes any HTML tags or script directives injected into the exception message before rendering.
<!-- Patched Implementation (layout.blade.php) -->
<div class="row m-t-40">
<div class="col-md-12 text-center">
<div class="error_number">
@yield('title')
</div>
<div class="error_message">
{!! e($exception->getMessage()) !!}
</div>
</div>
</div>While the patch successfully closes the vulnerability within the vendor's source files, Laravel applications often publish views locally using php artisan vendor:publish. This results in copies of the vulnerable template remaining in resources/views/errors/ even after the composer dependency is updated. To address this, the vendor introduced the php artisan backpack:fix command to programmatically locate and rewrite these locally published templates.
To exploit this vulnerability, an attacker must identify an endpoint controlled by Backpack that triggers an exception containing user-supplied input. A typical vector involves input fields that feed directly into database queries or model resolvers, where validation is absent or handled post-execution. If the input triggers a database unique-constraint or a data-type mismatch, the database exception will propagate to the error view.
Once an administrative endpoint with reflective exception output is identified, the attacker crafts a specialized payload. This payload is embedded in a URL and delivered to an authenticated administrator via spear-phishing or cross-site requests. Since administrative interfaces often run on restricted subdomains, targeting a specific user session is a key prerequisite.
Upon clicking the link, the administrator's browser sends the request to the backend. The backend throws an exception, and the custom Backpack error handler returns the rendering containing the unescaped script block. The script executes within the context of the administrator's active session, allowing the script to make API requests with administrative authority.
The primary risk of Reflected XSS within an administrative interface is the compromise of elevated user sessions. Because the script executes within the context of an authenticated session, the attacker inherits the full permissions of the administrative user. This bypasses authentication mechanisms, including multi-factor authentication (MFA), which has already been satisfied by the victim.
Using the active session, the malicious script can perform asynchronous HTTP requests (AJAX) to the backend API. An attacker can silently trigger state-changing actions such as creating a new administrative account, modifying system configuration parameters, or exfiltrating sensitive client databases. This turns a client-side scripting bug into an entry point for absolute system takeover.
Additionally, if administrative session cookies lack the HttpOnly attribute, the script can read the session identifier and transmit it directly to an attacker-controlled listener. Even with HttpOnly flags set, the DOM remains fully controllable. The attacker can execute arbitrary administrative tasks or display convincing overlay pages to capture secondary credentials.
The primary remediation is updating the backpack/crud composer package to a secured version. Organizations running older versions should identify their active branch and apply the corresponding patch. The secure versions are 5.0.13 for the 5.x branch, 4.1.69 for the 4.1.x branch, and 4.0.63 for the 4.0.x branch.
After updating the composer dependencies, administrators must execute the command php artisan backpack:fix. This step is crucial because it ensures that any local error templates published to resources/views/errors/ are scanned and updated. If this command is skipped, the application may remain vulnerable despite updating the vendor directory.
For defense-in-depth, security teams should implement a strict Content Security Policy (CSP). Restricting inline scripts via policies like script-src 'self' 'nonce-random' or blocking unsafe-inline execution prevents the browser from executing reflected payloads. Additionally, ensuring all cookies use the HttpOnly and SameSite=Strict attributes minimizes the risk of session theft.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
backpack/crud Laravel Backpack | >= 5.0.0, < 5.0.13 | 5.0.13 |
backpack/crud Laravel Backpack | >= 4.1.0, < 4.1.69 | 4.1.69 |
backpack/crud Laravel Backpack | < 4.0.63 | 4.0.63 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-79 |
| Vulnerability Class | Reflected Cross-Site Scripting (XSS) |
| CVSS v4.0 Score | 5.1 |
| Attack Vector | Network (AV:N) |
| Exploit Status | None / Unproven |
| CISA KEV Status | Not Listed |
An improper authentication vulnerability (CWE-287) exists in the legacy, deprecated Internet Key Exchange version 1 (IKEv1) key exchange protocol implementation in Check Point Security Gateways. The vulnerability is caused by a logic flow weakness during the certificate validation process for Remote Access VPN and Mobile Access (SSL VPN) connections. An unauthenticated remote attacker can exploit this weakness to bypass user authentication entirely, establishing a fully functional Remote Access VPN connection without a valid password.
GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.
CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.
NocoDB is subject to an insufficient session expiration vulnerability where OAuth access and refresh tokens are not invalidated or revoked during security-sensitive actions such as password changes, forgot-password requests, or password resets. This allows an attacker possessing an active OAuth token to maintain unauthorized persistence.
A vulnerability in the vantage6 federated learning framework allows unauthenticated remote attackers to gain administrative control of the server via hardcoded default credentials (root/root) when deployed under default configurations in versions 4.2.3 and below.
An improper access control vulnerability in the vantage6 node component allows concurrently running algorithm containers to read and modify sensitive input and output files of other tasks. The lack of strict workspace directory isolation exposes a significant attack surface in multi-tenant or federated environments where untrusted algorithms are executed.