axios
1.21.1 · 9 Nov 2026MIT150.1M / weekRepositoryHomepagenpmAtom feed
Upgrading axios From 1.18.0 to 1.20.0
3 releases in betweenevery note read
Before you upgrade
Tick each one off as you go- Breaking1.20.0
Security
Fixes 12 advisories affecting 1.18.0
- Axios: HTTP/2 adapter bypasses configured DNS lookup and proxy controlshigh · GHSA-3pq3-5fj3-cg6v
- Axios: CIDR-form NO_PROXY entries are ignored, causing proxy exclusion bypass for internal IP rangesmoderate · GHSA-44g4-m2mj-wpvx
- Axios: Fetch Adapter Header Injection via Inherited FormData getHeadersmoderate · GHSA-4hqw-qxg8-jxx2
- Axios: Denial of Service via Unhandled 'error' Event in HTTP/2 ClientHttp2Session Initializationhigh · GHSA-542g-h47m-68v8
- Axios: Prototype-Pollution Gadget in the Default Instance Allows Inherited Object.prototype.method to Override HTTP Methodmoderate · GHSA-9fr6-4gfg-395g
- Axios: ReDoS in fromDataURI data: URL parser freezes the Node event loop (DoS)high · GHSA-c29m-xwm3-cm6r
- Axios: Header Injection via Inherited headers After Minimal Interceptormoderate · GHSA-j8rh-479h-cp32
- Axios: Node HTTP adapter prototype-pollution gadget allows request socket hijack via inherited createConnectionhigh · GHSA-m8m8-qj5v-23w3
- Axios: ReDoS (O(N²)) in shouldBypassProxy host normalization, reachable via untrusted redirect Locationhigh · GHSA-mghh-pgcx-3jjj
- Axios: maxRedirects: 0 is not enforced by the fetch adapter, allowing redirect-based SSRFhigh · GHSA-r4gj-5m52-g5wh
- Axios: Prototype pollution gadget in fetch adapter can alter outbound requestsmoderate · GHSA-vh66-26gq-q6x8
- Axios: Prototype Pollution Gadget in axios toFormData Optionshigh · GHSA-x97p-jq2g-jp4f
- 1.20.0
Runtime Option Handling: Hardened behavioral configuration reads against shared and foreign prototype pollution and normalized unsafe interceptor replacement objects. This also clarifies Fetch redirect and custom implementation behavior, HTTP/2 DNS and proxy handling, CIDR-based NO_PROXY matching, and malformed data URI rejection; see the PR for documented compatibility effects.
- 1.19.0
Multipart Form Data: Raised the form-data dependency floor to ^4.0.6, preventing fresh installations from resolving versions affected by the CRLF injection vulnerability GHSA-hmw2-7cc7-3qxx (github.com/advisories/GHSA-hmw2-7cc7-3qxx).
Release by release
- Security
Runtime Option Handling: Hardened behavioral configuration reads against shared and foreign prototype pollution and normalized unsafe interceptor replacement objects. This also clarifies Fetch redirect and custom implementation behavior, HTTP/2 DNS and proxy handling, CIDR-based NO_PROXY matching, and malformed data URI rejection; see the PR for documented compatibility effects.
- Breaking
HTTP Status Naming: Added ContentTooLarge (413) and UnprocessableContent (422), while retaining PayloadTooLarge and UnprocessableEntity as backward-compatible deprecated aliases.
- Fixed
Interceptor Lifecycle: Prevented unbounded handler-array growth by trimming trailing ejected interceptors without changing iteration semantics, and kept interceptor operations safe when the public handlers field is nullish. (#11087, #11118)
- Fixed
Request Error Preservation: Prevented custom Error.prepareStackTrace implementations that return non-string values from replacing the original request failure with an unrelated TypeError.
- Fixed
XHR Reliability: Navigation-canceled requests now reject with ECONNABORTED instead of resolving with status 0, while successful downloads flush their final progress callback during the live loadend dispatch. (#11094, #11121)
- Fixed
Node.js Socket Memory: Removed request-context retention from per-socket error listeners, preventing completed response data from being pinned for the lifetime of pooled keep-alive sockets.
- Fixed
Core Methods and HTTP Errors: Prevented structural method-header buckets from leaking into outgoing headers, standardized invalid DNS lookup and httpVersion failures as AxiosError.ERR_BAD_OPTION_VALUE, and corrected the timeoutErrorMessage merge strategy.
- Security
- Security
Multipart Form Data: Raised the form-data dependency floor to ^4.0.6, preventing fresh installations from resolving versions affected by the CRLF injection vulnerability GHSA-hmw2-7cc7-3qxx (github.com/advisories/GHSA-hmw2-7cc7-3qxx).
- New
Configuration Extensibility: Preserved own-enumerable symbol-keyed fields through mergeConfig and added a generic params type across public TypeScript declarations, responses, errors, adapters, and serializers. (#11043, #11081)
- New
Header Parameter Parsing: Added the opt-in AxiosHeaders.parseParameters() parser for quote-aware, RFC-style HTTP parameter parsing while preserving legacy parsing behavior.
- New
HTTP Status Codes: Added the missing Cloudflare 520 WebServerReturnsAnUnknownError status and matching ESM/CJS declarations.
- Security
- Fixed
AxiosError Serialisation: Made AxiosError#cause non-enumerable to prevent circular JSON serialisation failures when errors include nested causes.
- Fixed
Node HTTP Adapter: Guarded socket.setKeepAlive for proxy agent streams, accepted path-only URLs when socketPath is configured, deferred environment proxy handling to Node, and explicitly passed maxBodyLength through to follow-redirects. (#10917, #10930, #10942, #10993)
- Fixed
Runtime and Type Correctness: Fixed several runtime crashes, type definition mismatches, and incorrect error handling paths. (#10959, #11021)
- Fixed
AxiosURLSearchParams: Switched the encoder callback to an arrow function so
encoder.call(this)receives theAxiosURLSearchParamsinstance correctly.
- Fixed
12 internal lines (docs, tests, tooling) left out.
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.