CVE-2024-28849: Follow redirects Follow-redirects' Proxy-Authorization Header Kept Across Vulnerability

MODERATE
Advisory Identifier: GHSA-cxjh-pqwp-8mfp
CVSS 6.5
CWE-200
Published
Advisory Summary

CVE-2024-28849 is a MODERATE (CVSS 6.5) follow-redirects' proxy-authorization header kept across vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Follow redirects libraries in the npm ecosystem. The issue involves follow-redirects' proxy-authorization header kept across hosts. Remediation is available by upgrading affected packages to version 1.15.6.

CVE-2024-28849 at a Glance

CVE Identifier CVE-2024-28849
GHSA Identifier GHSA-cxjh-pqwp-8mfp
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Follow redirects
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-28849

To remediate this vulnerability, upgrade all affected Follow redirects dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

follow-redirects fixed: 1.15.6
npm install follow-redirects@1.15.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls follow-redirects

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-28849, inspect your project dependencies using npm:

npm ls follow-redirects

Analyze the terminal output to locate any version of Follow redirects in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.15.6), your application is affected.

Note: The npm ls follow-redirects command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Follow redirects, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

When using [axios](https://github.com/axios/axios), its dependency follow-redirects only clears authorization header during cross-domain redirect, but allows the proxy-authentication header which contains credentials too. ## Steps To Reproduce & PoC Test code: ```js const axios = require('axios'); axios.get('http://127.0.0.1:10081/', { headers: { 'AuThorization': 'Rear Test', 'ProXy-AuthoriZation': 'Rear Test', 'coOkie': 't=1' } }) .then((response) => { console.log(response); }) ``` When I meet the cross-domain redirect, the sensitive headers like authorization and cookie are cleared, but proxy-authentication header is kept. ## Impact This vulnerability may lead to credentials leak. ## Recommendations Remove proxy-authentication header during cross-domain redirect ### Recommended Patch [follow-redirects/index.js:464](https://github.com/follow-redirects/follow-redirects/commit/c4f847f85176991f95ab9c88af63b1294de8649b) ```diff - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + removeMatchingHeaders(/^(?:authorization|proxy-authorization|cookie)$/i, this._options.headers); ```

CVE-2024-28849 Affected Follow redirects Versions

1 component(s)
Fixed Versions:
1.15.6
Product / Package Ecosystem Affected Versions Fixed Version
follow-redirects
npm
< 1.15.6
1.15.6

References

Frequently Asked Questions

What is CVE-2024-28849?
CVE-2024-28849 is a security vulnerability in Follow redirects involving follow-redirects' Proxy-Authorization header kept across hosts under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Follow redirects versions are affected?
Affected versions include releases prior to 1.15.6 across affected packages: follow-redirects.
What version fixes CVE-2024-28849?
Upgrading to 1.15.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is follow-redirects affected?
Yes, follow-redirects is affected in releases prior to 1.15.6. Upgrade your dependency to 1.15.6 or later.
What is the CVSS score of CVE-2024-28849?
CVE-2024-28849 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-28849?
CVE-2024-28849 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check npm dependencies for CVE-2024-28849?
Run the dependency tree command: 'npm ls follow-redirects'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cxjh-pqwp-8mfp",
  "modified" : "2024-04-02T17:54:20Z",
  "published" : "2024-03-14T17:19:42Z",
  "aliases" : [ "CVE-2024-28849" ],
  "summary" : "follow-redirects' Proxy-Authorization header kept across hosts",
  "details" : "When using [axios](https://github.com/axios/axios), its dependency follow-redirects only clears authorization header during cross-domain redirect, but allows the proxy-authentication header which contains credentials too.\n\n## Steps To Reproduce & PoC\n\nTest code:\n\n```js\nconst axios = require('axios');\n\naxios.get('http://127.0.0.1:10081/', {\n headers: {\n 'AuThorization': 'Rear Test',\n 'ProXy-AuthoriZation': 'Rear Test',\n 'coOkie': 't=1'\n }\n})\n .then((response) => {\n console.log(response);\n })\n```\n\nWhen I meet the cross-domain redirect, the sensitive headers like authorization and cookie are cleared, but proxy-authentication header is kept.\n\n## Impact\n\nThis vulnerability may lead to credentials leak.\n\n## Recommendations\n\nRemove proxy-authentication header during cross-domain redirect\n\n### Recommended Patch\n\n[follow-redirects/index.js:464](https://github.com/follow-redirects/follow-redirects/commit/c4f847f85176991f95ab9c88af63b1294de8649b)\n\n```diff\n- removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n+ removeMatchingHeaders(/^(?:authorization|proxy-authorization|cookie)$/i, this._options.headers);\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "follow-redirects"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.15.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.15.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/follow-redirects/follow-redirects/security/advisories/GHSA-cxjh-pqwp-8mfp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-28849"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/psf/requests/issues/1885"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/follow-redirects/follow-redirects/commit/c4f847f85176991f95ab9c88af63b1294de8649b"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/2390009"
  }, {
    "type" : "WEB",
    "url" : "https://fetch.spec.whatwg.org/#authentication-entries"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/follow-redirects/follow-redirects"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VOIF4EPQUCKDBEVTGRQDZ3CGTYQHPO7Z"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-14T17:19:42Z",
    "nvd_published_at" : "2024-03-14T17:15:52Z"
  }
}