fix(security): fix 16 security issues in axios, undici - #272
Open
aikido-autofix[bot] wants to merge 1 commit into
Open
aikido-autofix[bot] wants to merge 1 commit into
aikido-autofix[bot] wants to merge 1 commit into
Conversation
3 tasks
✅ Security Analysis ResultsNo security issues found. 2 files reviewed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Jira ticket: https://typeform.atlassian.net/browse/<TICKET_ID>
Upgrade axios and undici to fix SSRF/proxy bypass, prototype pollution header injection, credential leakage on cross-origin redirects, and unsafe error serialization vulnerabilities.
Changes
🤖 Remediation details
Fix security vulnerabilities in
axiosandundicitransitive dependenciesShort summary
This PR remediates high- and medium-severity vulnerabilities in two transitive dependencies —
axiosandundici— withinshared-actions/send-deployment-event. Changes touchshared-actions/send-deployment-event/package.json(new directaxiosentry and aresolutionsfield) and the correspondingyarn.lock.axios
axioswas pulled in transitively byanalytics-node@6.2.0via a^0.27.2range, resolving to the vulnerable0.27.2. Becauseanalytics-node@6.2.0is the latest published release and still declaresaxios@^0.27.2(a 0.x range that cannot satisfy the required^1.18.0floor), no parent bump was available to pull in a patched version. As a result,axios@^1.18.0was added as a direct dependency inpackage.json, and aresolutions: { "axios": "^1.18.0" }field was added to force Yarn Classic to collapseanalytics-node's nestedaxios@0.27.2instance into the same patched resolution — without the resolution, Yarn Classic would have continued installing a vulnerable nested copy underanalytics-node. Both the^0.27.2and^1.18.0lockfile selectors now resolve to1.20.0.undici
undiciwas pulled in transitively by@actions/http-client@4.0.0(itself a dependency of the direct@actions/core@3.0.1) via a^6.23.0range, resolving to the vulnerable6.24.1. The existing^6.23.0range already admits the patched6.28.1, so no manifest change was required for this package — a lockfile refresh viayarn upgrade 'undici@^6.23.0'was sufficient to advance the resolved version to6.28.1.Version changes
axios0.27.21.20.0resolutionsoverride to replace vulnerable transitive fromanalytics-node@6.2.0undici6.24.16.28.1^6.23.0range from@actions/http-client@4.0.0already admitted the patched versionTesting
Docs
Security Impact — CVE vulnerabilities fixed by this PR
✅ 16 CVEs resolved by this upgrade
This PR will resolve the following CVEs:
X-API-Key) during cross-origin redirects, potentially leaking API keys and authentication tokens to unintended hosts. This information disclosure vulnerability affects shared environments where secret headers are set by default.allowAbsoluteUrlsnot being set tofalseby default inbuildFullPath(), allowing attackers to bypass URL restrictions and process unintended URLs.//(e.g.,https:internal.example), allowing attackers to bypass URL allowlists or WAF checks and reach unintended hosts. The vulnerability enables URL validation bypass through silent normalization of invalid URLs.formDataToJSONfunction allows attackers to modify object prototypes. Additionally, a ReDoS vulnerability incombineURLscan cause denial of service through malicious input.Breaking Changes & Upgrade Impact
✅ No breaking changes from either axios or undici upgrades affect this codebase.
Axios (0.27.2 => 1.18.0):
The codebase uses
analytics-nodelibrary which internally uses axiosThe axios instance is created via
axios.create(options.axiosConfig)without anybaseURLconfigurationAll requests use absolute URLs via
this.axiosInstance.post(\${this.host}${this.path}`, data, req)wherehostdefaults to'https://api.segment.io'` andpathto'/v1/batch'Since no
baseURLis configured and requests use absolute URLs, the axios 1.8.0 URL combining behavior change does not applyUndici (6.24.1 => 6.28.1):
Undici is a dependency of
@actions/http-client(used by@actions/core)The codebase does not directly use any undici-specific features:
No
parseSetCookieorsetCookiecallsNo WebSocket usage (only internal undici code references found in dist bundle)
No direct cookie manipulation
No retry interceptor usage with partial responses
No blob-like request bodies
All undici usage is abstracted through the
@actions/corelibrary for basic input/output operationsAll breaking changes by upgrading undici from version 6.24.1 to 6.28.1 (CHANGELOG)
parseSetCookieno longer applies percent-decoding to cookie values, changing behavior for cookies containing encoded sequences like%0D%0Aand%00SameSitevalues (Strict,Lax,None) rather than accepting them as substrings, rejecting previously accepted values likeSameSite=NoneOfYourBusinessContent-Lengthis inconsistent withContent-Range, where previously inconsistent responses may have been acceptedsetCookie()now applies stricter validation that may reject previously accepted unsanitized domain and unparsed valuestypeproperties on duck-typed blob-like HTTP/1.1 request bodies are now coerced and validated, potentially rejecting previously accepted valuesFor contributions to the
Typeform/.githubrepoNote: Please do not use this repository for new internal shared workflows and actions. Use https://github.com/Typeform/.github-private instead!
Please check that your contribution applies to one of these cases below. If this is not the case, please contribute to https://github.com/Typeform/.github-private instead.