Skip to content

Reflected XSS in AdonisJS HTTP exception handler

Moderate
RomainLanz published GHSA-cwm9-gfhc-46f6 Jul 27, 2026

Package

npm @adonisjs/http-server (npm)

Affected versions

>=8.0.0 <=8.2.0
>=9.0.0 <=9.0.2

Patched versions

8.2.1
9.1.0

Description

A reflected Cross-Site Scripting vulnerability (CWE-79) in the AdonisJS HTTP exception handler may allow a remote attacker to execute arbitrary JavaScript in a user’s browser by crafting a malicious URL that triggers an HTML error response.

Details

AdonisJS renders unhandled errors through the HTTP exception handler. When debug mode is disabled and no custom status page handles the error, the default HTML renderer interpolates error.message directly into an HTML response.

For missing routes, the generated exception message includes the requested URL. A crafted URL containing HTML or JavaScript event handlers can therefore be reflected into the response body without escaping.

Example payload pattern:

/not-found<img src=x onerror="fetch('/dashboard',{credentials:'include'})">

Validation error HTML rendering was also updated to escape field names and messages before joining them into the response body.

Impact

Exploitation requires a victim to open a crafted URL on an affected application that returns the default HTML error response.

If exploited, attacker-controlled JavaScript may execute in the origin of the affected application. Depending on the application and browser security controls, this may allow reading same-origin pages accessible to the victim, performing actions as the victim, or exfiltrating data.

Applications that define custom status pages for affected errors, return JSON responses, or otherwise avoid the default HTML exception renderer may not be exploitable through this path.

Patches

Users should upgrade to a patched version:

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

CVE ID

CVE-2026-61526

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Credits