From d62265b7056f7062ca17b70e8f792052cc8314f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 00:38:50 +0000 Subject: [PATCH 1/2] fix: apply audit fixes --- dist/index.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index b69acda..c6440ee 100644 --- a/dist/index.js +++ b/dist/index.js @@ -37972,6 +37972,13 @@ catch (error) { useNativeURL = error.code === "ERR_INVALID_URL"; } +// HTTP headers to drop across HTTP/HTTPS and domain boundaries +var sensitiveHeaders = [ + "Authorization", + "Proxy-Authorization", + "Cookie", +]; + // URL fields to preserve in copy operations var preservedUrlFields = [ "auth", @@ -38053,6 +38060,11 @@ function RedirectableRequest(options, responseCallback) { } }; + // Create filter for sensitive HTTP headers + this._headerFilter = new RegExp("^(?:" + + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + + ")$", "i"); + // Perform the first request this._performRequest(); } @@ -38236,6 +38248,9 @@ RedirectableRequest.prototype._sanitizeOptions = function (options) { if (!options.headers) { options.headers = {}; } + if (!isArray(options.sensitiveHeaders)) { + options.sensitiveHeaders = []; + } // Since http.request treats host as an alias of hostname, // but the url module interprets host as hostname plus port, @@ -38418,7 +38433,7 @@ RedirectableRequest.prototype._processResponse = function (response) { redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { - removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); + removeMatchingHeaders(this._headerFilter, this._options.headers); } // Evaluate the beforeRedirect callback @@ -38611,6 +38626,10 @@ function isSubdomain(subdomain, domain) { return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } +function isArray(value) { + return value instanceof Array; +} + function isString(value) { return typeof value === "string" || value instanceof String; } @@ -38627,6 +38646,10 @@ function isURL(value) { return URL && value instanceof URL; } +function escapeRegex(regex) { + return regex.replace(/[\]\\/()*+?.$]/g, "\\$&"); +} + // Exports module.exports = wrap({ http: http, https: https }); module.exports.wrap = wrap; From 318f47717230978071f1e2ef8fd73d42d9d60727 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 00:38:52 +0000 Subject: [PATCH 2/2] fix: apply audit fixes --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f864d8..35dc64e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2678,9 +2678,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.11", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", - "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", "funding": [ { "type": "individual",