koa
3.3.0 · 3 Nov 2026MIT9.7M / weekRepositoryHomepagenpmAtom feed
3.3.0 is the newest release of 3.x.
In short
8 breaking1 security3 new8 fixed6 internal
- Breaking
Minimum node v18
- Breaking
Removes
.redirect('back'), adds.back(fallback_url)@fl0w #1115 - Breaking
For
.redirect(), don't render redirect values in anchor ref ff25eb4 - Breaking
req.originshould display the origin header if it exists, not the current hostname #1008.originnow aligns with theOriginheader as used in CORS. - Breaking
.body=<json>should not overwrite type if type already json #1120 - Breaking
Remove special ENOENT support #1861 - this is a big change and will require any file servers to adapt to this change for handling 404s / files not found
- Breaking
Removes generator deprecation messages. Generators are no longer supported. Koa no longer asserts if generators are used. Set content-length: 0 if body is explicitly set to null @ognjenjevremovic #1528 Remove obsolete createAsyncCtxStorageMiddleware #1817
- Breaking
ctx.thrownow requires a format ofctx.throw(status, error, properties). See: npmjs.com/package/http-errors
Security
2 advisories affect 3.0.0; 3.1.2 fixes them
- HighKoa has Host Header Injection via ctx.hostnameGHSA-7gcc-r8m5-44qm · 26 Feb 2026Fixed in 3.1.2
- LowKoa Open Redirect via Referrer Header (User-Controlled)GHSA-jgmv-j7ww-jx2x · 29 Jul 2025Fixed in 3.0.1
Release note
This is a major release.
Breaking
- Breaking
Minimum node v18
- Breaking
Removes
.redirect('back'), adds.back(fallback_url)@fl0w #1115 - Breaking
For
.redirect(), don't render redirect values in anchor ref ff25eb4 - Breaking
req.originshould display the origin header if it exists, not the current hostname #1008.originnow aligns with theOriginheader as used in CORS. - Breaking
.body=<json>should not overwrite type if type already json #1120 - Breaking
Remove special ENOENT support #1861 - this is a big change and will require any file servers to adapt to this change for handling 404s / files not found
- Breaking
Removes generator deprecation messages. Generators are no longer supported. Koa no longer asserts if generators are used.
Set content-length: 0 if body is explicitly set to null @ognjenjevremovic #1528
Remove obsolete createAsyncCtxStorageMiddleware #1817 - Breaking
ctx.thrownow requires a format ofctx.throw(status, error, properties). See: npmjs.com/package/http-errors
New
Support custom streams @KristapsR #1825
Support WHATWG response bodies #1830 @kravorkid
Use asyncLocalStorage to get current context from app, e.g.:
const ctx = app.currentContext.
Fixes
Handle responses when socket is no longer writable @titanism @azlond #1593
Do not response Content-Length if Transfer-Encoding is defined #1562 @charlyzeng
Set body to 'null' if
ctx.type = 'json'andctx.body = null#1059 @likegunCan not get currentContext in error handler (#1758) (Gxkl <gxkl203@gmail.com>)
Fix exports.defaults in package.json #1630
Fix leaky handles in tests #1838
Fix body null checks #1814
Fix passing ctx in error handler #1758
- Security
Avoid redos on host and protocol getter
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.