Skip to content

AdonisJS: Unencoded route parameters can produce open redirects

Moderate severity GitHub Reviewed Published Aug 24, 2026 in adonisjs/http-server • Updated Oct 8, 2026

Package

npm @adonisjs/http-server (npm)

Affected versions

>= 9.0.0, <= 9.2.0
<= 8.2.2

Patched versions

9.3.0
8.2.3

Description

Route parameters are inserted into generated URLs without URI encoding.

When an application passes untrusted input to a route whose first path segment is dynamic, a value beginning with / can produce a scheme-relative URL. For example:

router.get('/:page', handler).as('pages.show')

response.redirect().toRoute('pages.show', {
  page: '/evil.example.com',
})

This generates the following redirect:

Location: //evil.example.com

Browsers interpret this value as an external URL and redirect the user to https://evil.example.com.

Details

The shared createURL() helper is used by route URL builders, including Router.makeUrl() and Response.redirect().toRoute().

Route parameter values were appended without encoding:

if (isDefined) {
  uriSegments.push(`${value}${token.end}`)
}

Wildcard parameters had the same behavior:

uriSegments.push(`${values.join('/')}${token.end}`)

The issue does not affect APIs that intentionally accept complete redirect URLs. Exploitation requires an application to pass attacker-controlled data as a route parameter and use the generated URL as a redirect destination.

Impact

An attacker may craft a link on a trusted application domain that redirects a victim to an attacker-controlled website.

This can facilitate phishing and may be chained with authentication or OAuth flows that rely on trusted redirect destinations.

Applications are affected when they:

  • define a route whose first path segment is dynamic; and
  • pass request-derived data to that segment when generating a redirect URL.

Patches

Route parameter values are now encoded using encodeURIComponent.

Wildcard values are encoded individually before being joined with /, preserving their intended segment separators:

if (isDefined) {
  uriSegments.push(`${encodeURIComponent(String(value))}${token.end}`)
}
uriSegments.push(
  `${values.map((value) => encodeURIComponent(String(value))).join('/')}${token.end}`
)

With the fix, /evil.example.com becomes:

/%2Fevil.example.com

Fixes targeting v6 and v7 have been published below.

References

@RomainLanz RomainLanz published to adonisjs/http-server Aug 24, 2026
Published to the GitHub Advisory Database Oct 8, 2026
Reviewed Oct 8, 2026
Last updated Oct 8, 2026

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

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(19th percentile)

Weaknesses

URL Redirection to Untrusted Site ('Open Redirect')

The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. Learn more on MITRE.

CVE ID

CVE-2026-107718

GHSA ID

GHSA-2m6q-8v3h-jqww

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.