Skip to content

fix(deps): update dependency koa to v2.16.2 [security]#1672

Merged
confuser merged 1 commit into
masterfrom
renovate/npm-koa-vulnerability
Dec 16, 2025
Merged

fix(deps): update dependency koa to v2.16.2 [security]#1672
confuser merged 1 commit into
masterfrom
renovate/npm-koa-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
koa (source) 2.16.1 -> 2.16.2 age confidence

GitHub Vulnerability Alerts

CVE-2025-8129

Summary

In the latest version of Koa, the back method used for redirect operations adopts an insecure implementation, which uses the user-controllable referrer header as the redirect target.

Details

on the API document https://www.koajs.net/api/response#responseredirecturl-alt, we can see:

response.redirect(url, [alt])

Performs a [302] redirect to url.
The string "back" is specially provided for Referrer support, using alt or "/" when Referrer does not exist.

ctx.redirect('back');
ctx.redirect('back', '/index.html');
ctx.redirect('/login');
ctx.redirect('http://google.com');

however, the "back" method is insecure:

  back (alt) {
    const url = this.ctx.get('Referrer') || alt || '/'
    this.redirect(url)
  },

Referrer Header is User-Controlled.

PoC

there is a demo for POC:

const Koa = require('koa')
const serve = require('koa-static')
const Router = require('@​koa/router')
const path = require('path')

const app = new Koa()
const router = new Router()

// Serve static files from the public directory
app.use(serve(path.join(__dirname, 'public')))

// Define routes
router.get('/test', ctx => {
  ctx.redirect('back', '/index1.html')
})

router.get('/test2', ctx => {
  ctx.redirect('back')
})

router.get('/', ctx => {
  ctx.body = 'Welcome to the home page! Try accessing /test, /test2'
})

app.use(router.routes())
app.use(router.allowedMethods())

const port = 3000
app.listen(port, () => {
  console.log(`Server running at http://localhost:${port}`)
}) 

Proof Of Concept

GET /test HTTP/1.1
Host: 127.0.0.1:3000
Referer: http://www.baidu.com
Connection: close

GET /test2 HTTP/1.1
Host: 127.0.0.1:3000
Referer: http://www.baidu.com
Connection: close

image

image

Impact

https://learn.snyk.io/lesson/open-redirect/


Release Notes

koajs/koa (koa)

v2.16.2

Compare Source

What's Changed

Full Changelog: koajs/koa@v2.16.1...v2.16.2


Configuration

📅 Schedule: Branch creation - "" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@cypress

cypress Bot commented Aug 8, 2025

Copy link
Copy Markdown

BanManager-WebUI    Run #9128

Run Properties:  status check passed Passed #9128  •  git commit bb92832cf5 ℹ️: Merge 73d3e79dd7179deaf9eeb82086c94cd6ef82aeca into cae3b5e9a4bf965a9a0118c24827...
Project BanManager-WebUI
Branch Review refs/pull/1672/merge
Run status status check passed Passed #9128
Run duration 00m 46s
Commit git commit bb92832cf5 ℹ️: Merge 73d3e79dd7179deaf9eeb82086c94cd6ef82aeca into cae3b5e9a4bf965a9a0118c24827...
Committer renovate[bot]
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 15
View all changes introduced in this branch ↗︎

@renovate renovate Bot force-pushed the renovate/npm-koa-vulnerability branch from 3953e59 to 2166452 Compare September 8, 2025 02:31
@renovate renovate Bot force-pushed the renovate/npm-koa-vulnerability branch from 2166452 to b5dfd84 Compare October 29, 2025 01:43
@renovate renovate Bot force-pushed the renovate/npm-koa-vulnerability branch from b5dfd84 to c4c0287 Compare November 16, 2025 05:10
@renovate renovate Bot force-pushed the renovate/npm-koa-vulnerability branch 4 times, most recently from ba0be35 to 5be5dd4 Compare December 11, 2025 06:02
@renovate renovate Bot force-pushed the renovate/npm-koa-vulnerability branch from 5be5dd4 to 4f98d88 Compare December 13, 2025 05:00
@renovate renovate Bot force-pushed the renovate/npm-koa-vulnerability branch from 4f98d88 to 73d3e79 Compare December 15, 2025 17:31
@confuser confuser merged commit 3158af5 into master Dec 16, 2025
5 of 6 checks passed
@confuser confuser deleted the renovate/npm-koa-vulnerability branch December 16, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant