chore(deps): @adonisjs/http-server v7.8.1 [security]#509
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
chore(deps): @adonisjs/http-server v7.8.1 [security]#509renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
|
Visit the preview URL for this PR (updated for commit 3251775): https://whatsappapijs--pr509-renovate-npm-adonisj-zhddvy4x.web.app (expires Tue, 21 Apr 2026 20:06:20 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 80a8dc4ceea5c783aae1d47b75797ee5b6c2f4be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
7.8.0→7.8.1@adonisjs/http-server has an Open Redirect vulnerability
CVE-2026-40255 / GHSA-6qvv-pj99-48qm
More information
Details
Impact
The
response.redirect().back()method in@adonisjs/http-serveris vulnerable to open redirects. The method reads theRefererheader from the incoming HTTP request and redirects to that URL without validating the host. An attacker who can influence theRefererheader (for example, by linking a user through an attacker-controlled page before a form submission) can cause the application to redirect users to a malicious external site.This affects all AdonisJS applications that use
response.redirect().back()orresponse.redirect('back').The vulnerability is classified as CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Patches
This has been fixed in
@adonisjs/http-serverversion 8.2.0. Theback()method now validates theRefererheader's host against the request's ownHostheader. Referrers from unrecognized hosts are rejected and the redirect falls back to/(or a developer-provided fallback URL).Applications that operate across multiple domains can configure additional trusted hosts via the
redirect.allowedHostsoption inconfig/app.ts.Users should upgrade to
@adonisjs/http-server@^8.2.0(or@adonisjs/core@^7.4.0if using the core meta-package).Workarounds
If upgrading is not immediately possible, avoid using
response.redirect().back()in routes that are reachable by unauthenticated users or from pages that accept external traffic. Instead, redirect to a known safe path explicitly usingresponse.redirect().toPath('/dashboard').References
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
adonisjs/http-server (@adonisjs/http-server)
v7.8.1: Security fix: open redirect in response.redirect().back()Compare Source
Fixes an open redirect vulnerability in
response.redirect().back()where a craftedRefererheader could redirect users to an attacker-controlled destination. The referrer is now validated against the request'sHostheader and a configurableallowedHostslist; invalid or cross-host referrers fall through to a safe fallback. Backported from 8.x (8.1.3).response.redirect().back()no longer blindly trusts theRefererheader. If the referrer host does not match the request host and is not listed inredirect.allowedHosts,back()now returns the fallback (/by default). Apps that legitimately redirect back to an external host must add it toallowedHosts.Features
isValidRedirectUrl(url, currentHost?, allowedHosts?)— reusable URL validator (rejects protocol-relative//evil.com, validates absolute URL hosts)getPreviousUrl(headers, allowedHosts, fallback)— helper used internallyrequest.getPreviousUrl(allowedHosts, fallback?)— exposed onHttpRequestredirect.getPreviousUrl(fallback)— exposed onRedirectredirect.back(fallback = '/')—back()now accepts a custom fallbackredirect.withQs(boolean)— overload to explicitly enable/disable query-string forwarding (useful whenforwardQueryString: trueis set as the default)Bug Fixes
Full Changelog: adonisjs/http-server@v7.8.0...v7.8.1