Medium

AdonisJS: Unencoded route parameters can produce open redirects

  • Disclosed: 08.10.2026
  • Updated: 11.10.2026 10:22

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:

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

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

This generates the following redirect:

http
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:

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

Wildcard parameters had the same behavior:

ts
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:

ts
if (isDefined) {
  uriSegments.push(`${encodeURIComponent(String(value))}${token.end}`)
}
ts
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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @adonisjs/http-server >= 9.0.0, < 9.3.0, < 8.2.3 9.3.0, 8.2.3

References

CVSS score 6.1/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness (CWE)
CWE-601
Platform
npm
Package
@adonisjs/http-server
Disclosed
08.10.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-2m6q-8v3h-jqww - CC BY 4.0

Vulnerability history: @adonisjs/http-server

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
04.2026 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Medium 2

Disclosures per year

  1. 2026: 2
  1. AdonisJS: Unencoded route parameters can produce open redirects this entry
    Medium · 6.1 CVE-2026-107718 >= 9.0.0, < 9.3.0, < 8.2.3 9.3.0, 8.2.3
  2. Medium · 6.1 CVE-2026-40255 >= 8.0.0-next.0, < 8.2.0, < 7.8.1 8.2.0, 7.8.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.