← Back to Pull requests

fix(security): fix security issue in axios via minor version upgrade from 1.13.4 to 1.21.0 #175

Re-review Required
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 06, 2026 03:41 UTC
Author

<!-- For fixing bugs use https://github.com/Typeform/js-api-client/compare/?template=bugs.md -->
<!-- For pull requesting new features, improvements and changes use https://github.com/Typeform/js-api-client/compare/?template=features.md -->

---

Summary / Description

Upgrade axios to fix critical security vulnerabilities including proxy bypass/SSRF, prototype pollution MITM attacks, header injection, credential leakage on redirects, and HTTPS proxy cleartext exposure.

Security Impact — CVE vulnerabilities fixed by this PR

<details>
<summary>✅ 11 CVEs resolved by this upgrade</summary>
<br>

This PR will resolve the following CVEs:
| Issue | Severity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Description |
| --- | --- | --- |
| <pre>CVE-2025-62718</pre> | <pre>HIGH</pre> | [axios] Improper hostname normalization in NO_PROXY rule checking allows requests to loopback addresses (localhost., [::1]) to bypass proxy protections, enabling proxy bypass and potential SSRF attacks against internal services. This vulnerability permits attackers to reach sensitive services despite configured NO_PROXY protections. |
| <pre>CVE-2026-44494</pre> | <pre>HIGH</pre> | [axios] Axios is a promise based HTTP client for the browser and Node.js. From 1.0.0 to before 1.16.0, the Axios library is vulnerable to a Prototype Pollution "Gadget" attack that allows any Object.prototype pollution in the application's dependency tree to be escalated into a full Man-in-the-Mi... |
| <pre>CVE-2026-40175</pre> | <pre>HIGH</pre> | [axios] A prototype pollution vulnerability in a third-party dependency can be exploited to inject unsanitized header values into outbound HTTP requests. This allows attackers to manipulate request headers, potentially leading to request smuggling, cache poisoning, or other header-based attacks. |
| <pre>AIKIDO-2026-291630</pre> | <pre>HIGH</pre> | [axios] The Node.js HTTP adapter follows redirects through follow-redirects, which strips standard credential headers such as Authorization on cross-origin hops but leaves caller-defined secret headers like X-API-Key untouched. A server that responds with a cross-origin redirect can therefo... |
| <pre>AIKIDO-2026-10823</pre> | <pre>HIGH</pre> | [axios] The Node HTTP adapter could treat HTTPS origins like a forward HTTP proxy target, sending the full URL, headers, and request body to the proxy in cleartext instead of opening a CONNECT tunnel and running TLS directly to the server. An HTTP proxy on the path can observe request metadata an... |
| <pre>CVE-2026-44496</pre> | <pre>HIGH</pre> | [axios] Axios is a promise based HTTP client for the browser and Node.js. Axios versions before 0.32.0 on the 0.x line and before 1.16.0 on the 1.x line build a regular expression from the configured XSRF cookie name without escaping regex metacharacters. In standard browser environments, an atta... |
| <pre>CVE-2026-25639</pre> | <pre>MEDIUM</pre> | [axios] Axios is a promise based HTTP client for the browser and Node.js. Prior to versions 0.30.3 and 1.13.5, the mergeConfig function in axios crashes with a TypeError when processing configuration objects containing __proto__ as an own property. An attacker can trigger this by providing a mali... |
| <pre>AIKIDO-2026-38469</pre> | <pre>MEDIUM</pre> | [axios] Before adapter normalization, axios accepted malformed http: and https: URLs that omitted //, such as https:internal.example, which could evade naive allowlist or WAF checks and reach unintended hosts. The library silently normalized these inputs instead of rejecting them. The f... |
| <pre>AIKIDO-2026-10820</pre> | <pre>MEDIUM</pre> | [axios] The fetch-backed request path resolves the same size guard options as the HTTP adapter but previously skipped enforcing them, so responses and bodies could grow without the limits callers configured. The implementation now rejects oversized declared lengths, oversized outbound bodies when... |
| <pre>AIKIDO-2026-10822</pre> | <pre>LOW</pre> | [axios] A prototype pollution vulnerability in the formDataToJSON helper allows attackers to pollute Object.prototype through specially crafted multipart field names, potentially enabling remote code execution or other malicious actions. |
| <pre>AIKIDO-2026-10819</pre> | <pre>LOW</pre> | [axios] A regular expression vulnerability in browser cookie parsing allowed metacharacters in cookie names to cause incorrect matching or excessive CPU consumption. The vulnerability was fixed by switching to literal string comparison instead of regex-based matching. |

</details>

Breaking Changes & Upgrade Impact — prefer Warnings / Cautions / ⚠️ sections over implementation sections (upgrade risks, breaking changes, manual migration steps)

<details>
<summary>✅ Code not affected by breaking changes.</summary>
<br>

✅ No breaking changes from the axios upgrade affect this codebase.

Analysis performed:

1. Header Injection (CRLF): Searched for dynamic header construction with \r or \n characters. The codebase only uses static header values (Content-Type: application/json, Accept: application/json) and the Authorization header with bearer tokens. No user-controlled data is injected into headers that could contain CRLF characters.

2. Fetch adapter maxBodyLength/maxContentLength: Searched for these configuration options. The codebase does not configure or rely on these limits, so the enforcement change has no impact.

3. parseProtocol changes: Searched for usage of parseProtocol. This internal axios function is not used anywhere in the codebase.

4. Deprecated unescape() replacement: Searched for unescape() usage. The codebase does not use this function. URL encoding is handled by encodeURIComponent() in buildUrlWithParams().

5. Malformed URLs without //: Searched for URL construction patterns. All URLs in the codebase are properly formed:
- API base URL: https://api.typeform.com (properly formatted)
- Test URLs: http://test.com, http://localhost, https://www.typeform.com/logo.png (all properly formatted)
- The buildUrlWithParams() function only appends query parameters to existing URLs and doesn't construct protocol-level URLs.

The codebase uses axios in a straightforward manner with static headers and properly formatted URLs, making it unaffected by the breaking changes in this upgrade.
All breaking changes by upgrading axios from version 1.13.4 to 1.21.0 (CHANGELOG)
| Version | Description |
| --- | --- |
| <pre>1.15.0</pre> | Header Injection (CRLF): Headers with CR/LF now throw "Invalid character in header content" instead of being accepted. |
| <pre>1.16.0</pre> | Fetch adapter now enforces maxBodyLength and maxContentLength limits that were previously silently ignored. |
| <pre>1.16.0</pre> | parseProtocol now strictly requires a colon in the protocol separator; strings that loosely parsed as protocols before may no longer match. |
| <pre>1.16.0</pre> | Deprecated unescape() replaced with modern UTF-8 encoding; non-ASCII URL handling may produce different output bytes for consumers depending on legacy unescape() quirks. |
| <pre>1.20.0</pre> | HTTP Status Naming: Added ContentTooLarge (413) and UnprocessableContent (422), while retaining PayloadTooLarge and UnprocessableEntity as backward-compatible deprecated aliases. |
| <pre>1.21.0</pre> | Header Defaults: Only plain objects, null-prototype maps, and compatible AxiosHeaders instances are treated as common or method-specific defaults; custom class instances used as defaults must be converted to plain maps or compatible AxiosHeaders, otherwise they become literal header values. |
| <pre>1.21.0</pre> | Runtime Consistency: With proxy: false, native proxyEnv agents using unsupported pool-management or TLS-session lifecycle overrides now reject with ERR_BAD_OPTION_VALUE; such agents must be constructed without proxyEnv. |

</details>

Fix Details / Technical Implementation (detailed write-up of what was changed and why)

<details>
<summary>🤖 Remediation details</summary>

Bump axios to resolve multiple high- and medium-severity vulnerabilities

Short summary

This PR remediates a set of high- and medium-severity vulnerabilities in the axios HTTP client library. axios is declared as a direct runtime dependency in the root package.json, and the fix updates both the declared semver range there and the resolved entry in yarn.lock.

axios

axios was pinned at 1.13.4 via the range ^1.13.4 in the root package.json, a version affected by multiple vulnerabilities requiring a minimum fix version of 1.18.0. Because 1.18.0 falls within the same semver major (^1.x), the fix raises the declared floor to ^1.18.0 in package.json and refreshes yarn.lock, which Yarn resolved to 1.21.0 — the latest release satisfying that range and clearing all reported advisories across the 1.x line.

Version changes

| Package | From | To | Why updated |
|---------|------|----|-------------|
| axios | ^1.13.4 (resolved 1.13.4) | ^1.18.0 (resolved 1.21.0) | Direct CVE fix — raises semver floor to clear all reported vulnerabilities |

</details>

Diff: 650 lines (+487 / -163) across 8 files Reviewer: github-actions[bot] Review duration: 0m
Review confidence threshold not met — re-review recommended
Residual risk 0.68 = Change Risk (0.75) × (1 − Review Confidence (0.10)). Flagged for follow-up review before production rollout.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
0.75
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 2% · Reviewer familiarity: 35%
9%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.388
Shallow Review Depth shallow_review_depth
0.344
Sensitive Paths sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"LGTM"
rubber_stamp weight: 0
Assignees
Unassigned
Labels
risk: high confidence: 9.8% needs-re-review sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 75.2% (HIGH) · Higher = larger blast radius
75.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 9.8% · Lower = rushed or shallow review
9.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 67.8% · Re-review required
67.8%