Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Apr 9, 2025

This PR contains the following updates:

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

GitHub Vulnerability Alerts

CVE-2025-32379

Summary

In koa < 2.16.1 and < 3.0.0-alpha.5, passing untrusted user input to ctx.redirect() even after sanitizing it, may execute javascript code on the user who use the app.

Patches

This issue is patched in 2.16.1 and 3.0.0-alpha.5.

PoC

Coming soon...

Impact

  1. Redirect user to another phishing site
  2. Make request to another endpoint of the application based on user's cookie
  3. Steal user's cookie

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('@&#8203;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

v2.16.1

Compare Source

fix: don't render redirect values in anchor ref

v2.16.0

Compare Source

This is a backported release to fix core underlying issue with HEAD requests when using http2.createSecureServer. See discussion at #​1593 and #​1547.

  • fix missing cleanup, if response socket is no longer writeable (issue 1547) (#​1593) 399cb6b

v2.15.4

Compare Source

Full Changelog: koajs/koa@2.15.3...2.15.4

Fix: avoid redos on host and protocol getter, see GHSA-593f-38f6-jp5m


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

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


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

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

@renovate renovate bot added the dependencies Pull requests that update a dependency label Apr 9, 2025
@netlify
Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit a89e74a
🔍 Latest deploy log https://app.netlify.com/projects/brilliant-pasca-3e80ec/deploys/6904df806f3e8a000874a5cd

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

🚀 Performance Test Results

Test Configuration:

  • VUs: 4
  • Duration: 1m0s

Test Metrics:

  • Requests/s: 42.08
  • Iterations/s: 14.04
  • Failed Requests: 0.00% (0 of 2532)
📜 Logs

> [email protected] run-tests:testenv /home/runner/work/rafiki/rafiki/test/performance
> ./scripts/run-tests.sh -e test "-k" "-q" "--vus" "4" "--duration" "1m"

Cloud Nine GraphQL API is up: http://localhost:3101/graphql
Cloud Nine Wallet Address is up: http://localhost:3100/
Happy Life Bank Address is up: http://localhost:4100/
cloud-nine-wallet-test-backend already set
cloud-nine-wallet-test-auth already set
happy-life-bank-test-backend already set
happy-life-bank-test-auth already set
     data_received..................: 914 kB 15 kB/s
     data_sent......................: 1.9 MB 32 kB/s
     http_req_blocked...............: avg=8.28µs  min=2.31µs   med=5.05µs   max=1.73ms   p(90)=6.2µs    p(95)=6.58µs  
     http_req_connecting............: avg=1.75µs  min=0s       med=0s       max=1.25ms   p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=94.36ms min=7.4ms    med=77.63ms  max=577.6ms  p(90)=161.15ms p(95)=180.96ms
       { expected_response:true }...: avg=94.36ms min=7.4ms    med=77.63ms  max=577.6ms  p(90)=161.15ms p(95)=180.96ms
     http_req_failed................: 0.00%  ✓ 0         ✗ 2532
     http_req_receiving.............: avg=82.72µs min=24.05µs  med=72.65µs  max=3.64ms   p(90)=106.94µs p(95)=131.39µs
     http_req_sending...............: avg=38.24µs min=10.02µs  med=26.87µs  max=1.68ms   p(90)=39.16µs  p(95)=55.37µs 
     http_req_tls_handshaking.......: avg=0s      min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=94.23ms min=7.26ms   med=77.4ms   max=577.54ms p(90)=161.03ms p(95)=180.85ms
     http_reqs......................: 2532   42.084517/s
     iteration_duration.............: avg=284.3ms min=184.07ms med=270.67ms max=1.1s     p(90)=341.35ms p(95)=395.1ms 
     iterations.....................: 845    14.044793/s
     vus............................: 4      min=4       max=4 
     vus_max........................: 4      min=4       max=4 

@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from 9032fa3 to 71640f1 Compare April 24, 2025 10:45
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from 71640f1 to 5a790b4 Compare May 19, 2025 18:01
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch 2 times, most recently from 6d53195 to c9e4cef Compare June 4, 2025 08:12
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch 2 times, most recently from 30058d2 to 868e72f Compare June 12, 2025 17:03
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from 868e72f to 20cf163 Compare June 22, 2025 15:06
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from 20cf163 to e123166 Compare July 2, 2025 15:44
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from e123166 to 1e9b16c Compare July 16, 2025 11:48
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from 1e9b16c to 087ad82 Compare July 28, 2025 20:51
@renovate renovate bot changed the title fix(deps): update dependency koa to v2.16.1 [security] fix(deps): update dependency koa to v3 [security] Jul 28, 2025
@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. pkg: auth Changes in the GNAP auth package. labels Jul 28, 2025
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from 087ad82 to c26c97f Compare July 30, 2025 20:09
@renovate renovate bot changed the title fix(deps): update dependency koa to v3 [security] fix(deps): update dependency koa to v2.16.2 [security] Jul 30, 2025
@github-actions github-actions bot removed type: tests Testing related pkg: backend Changes in the backend package. pkg: auth Changes in the GNAP auth package. labels Jul 30, 2025
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from c26c97f to 73a56e6 Compare July 31, 2025 12:16
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch 3 times, most recently from 9f6c1c5 to f65afb0 Compare August 13, 2025 16:51
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from f65afb0 to 989f440 Compare August 19, 2025 16:16
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from 989f440 to 6a9600d Compare August 31, 2025 14:36
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from 6a9600d to f2a2429 Compare September 25, 2025 14:51
@renovate renovate bot changed the title fix(deps): update dependency koa to v2.16.2 [security] chore(deps): update dependency koa to v2.16.2 [security] Sep 25, 2025
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from f2a2429 to b4120f3 Compare September 25, 2025 15:57
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch 3 times, most recently from 68ce034 to fe6ab7e Compare October 21, 2025 12:31
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch 2 times, most recently from 77f9c2e to b3dbe1c Compare October 30, 2025 18:55
@renovate renovate bot force-pushed the renovate-npm-koa-vulnerability branch from b3dbe1c to a89e74a Compare October 31, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant