Vulnerabilities in pkg:nuget/Steeltoe.Discovery.ClientAutofac

PACKAGE
Advisory Identifier: GHSA-vmcp-66r5-3pcp
Advisory Summary

CVE-2024-40636 is a LOW (CVSS 2.5) steeltoe leaks basic auth credentials vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Steeltoe.Discovery.Eureka libraries in the NuGet ecosystem. The issue involves steeltoe leaks basic auth credentials to logs after fetch registry error. Remediation is available by upgrading affected packages to version 3.2.8.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:nuget/Steeltoe.Discovery.ClientAutofac

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:nuget/Steeltoe.Discovery.ClientAutofac. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vmcp-66r5-3pcp CVE-2024-40636 LOW Steeltoe Leaks Basic Auth Credentials to Logs After Fetch Registry Error

CVE-2024-40636 at a Glance

CVE Identifier CVE-2024-40636
GHSA Identifier GHSA-vmcp-66r5-3pcp
Severity LOW
CVSS v3.1 Base Score 2.5
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Steeltoe.Discovery.Eureka
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 2.5

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

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

How to Fix CVE-2024-40636

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

Steeltoe.Discovery.Eureka fixed: 3.2.8
Upgrade Steeltoe.Discovery.Eureka to 3.2.8
Steeltoe.Discovery.EurekaBase fixed: Latest secure release
Upgrade Steeltoe.Discovery.EurekaBase to Latest secure release
Steeltoe.Discovery.ClientCore fixed: Latest secure release
Upgrade Steeltoe.Discovery.ClientCore to Latest secure release
Steeltoe.Discovery.ClientAutofac fixed: Latest secure release
Upgrade Steeltoe.Discovery.ClientAutofac to Latest secure release
Verify Direct and Transitive Dependencies

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

inspect dependencies for Steeltoe.Discovery.Eureka

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-40636, inspect your project dependencies for Steeltoe.Discovery.Eureka:

inspect dependencies for Steeltoe.Discovery.Eureka

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

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Steeltoe.Discovery.Eureka, 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

### Summary When utilizing multiple Eureka server service URLs with basic auth and encountering an issue with fetching the service registry, an error is logged with the Eureka server service URLs but only the first URL is masked. ### Details Package: Steeltoe.Discovery.Eureka Package version: 3.2.1 Branch: "release/3.2" File name: `DiscoveryClient.cs` Line number: 325 Code in question: `_logger.LogError(e, "FetchRegistry Failed for Eureka service urls: {EurekaServerServiceUrls}", new Uri(ClientConfig.EurekaServerServiceUrls).ToMaskedString());` Error message in logs: `FetchRegistry Failed for Eureka service urls: https://****:****@eureka1.com:443/eureka,https://user:password@eureka2.com:443/eureka` I thought `new Uri(clientOptions.EurekaServerServiceUrls)` would throw a `UriFormatException` since there are multiple URLs but my logs are showing two URLs regardless. ### PoC 1. Set Eureka config with multiple server URLs with basic auth 2. Apologies for not being more descriptive for this step, but I believe we would just need to trigger an exception in `FetchFullRegistryAsync`. 3. Check the logs and should see the error ### Impact Vulnerability: Credential leakage in the logs Who does it impact?: Users who are using peer awareness with Spring Eureka

CVE-2024-40636 Affected Steeltoe.Discovery.Eureka Versions

4 component(s)
Fixed Versions:
3.2.8
Product / Package Ecosystem Affected Versions Fixed Version
Steeltoe.Discovery.Eureka
NuGet
< 3.2.8
3.2.8
Steeltoe.Discovery.EurekaBase
NuGet
≤ 2.5.5
Steeltoe.Discovery.ClientCore
NuGet
Steeltoe.Discovery.ClientAutofac
NuGet
≤ 2.5.5

References

Frequently Asked Questions

What is CVE-2024-40636?
CVE-2024-40636 is a security vulnerability in Steeltoe.Discovery.Eureka involving Steeltoe Leaks Basic Auth Credentials to Logs After Fetch Registry Error under CWE-532: Insertion of Sensitive Information into Log File.
Which Steeltoe.Discovery.Eureka versions are affected?
Affected versions include releases prior to 3.2.8 across affected packages: Steeltoe.Discovery.Eureka, Steeltoe.Discovery.EurekaBase, Steeltoe.Discovery.ClientCore, Steeltoe.Discovery.ClientAutofac.
What version fixes CVE-2024-40636?
Upgrading to 3.2.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Steeltoe.Discovery.Eureka affected?
Yes, Steeltoe.Discovery.Eureka is affected in releases prior to 3.2.8. Upgrade your dependency to 3.2.8 or later.
Is Steeltoe.Discovery.EurekaBase affected?
Yes, Steeltoe.Discovery.EurekaBase is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-40636?
CVE-2024-40636 has a CVSS v3.1 base score of 2.5 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-40636?
CVE-2024-40636 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check NuGet dependencies for CVE-2024-40636?
Run the dependency tree command: 'inspect dependencies for Steeltoe.Discovery.Eureka'. 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-vmcp-66r5-3pcp",
  "modified" : "2024-07-17T19:13:43Z",
  "published" : "2024-07-17T16:00:10Z",
  "aliases" : [ "CVE-2024-40636" ],
  "summary" : "Steeltoe Leaks Basic Auth Credentials to Logs After Fetch Registry Error",
  "details" : "### Summary\nWhen utilizing multiple Eureka server service URLs with basic auth and encountering an issue with fetching the service registry, an error is logged with the Eureka server service URLs but only the first URL is masked.\n\n### Details\nPackage: Steeltoe.Discovery.Eureka\nPackage version: 3.2.1\nBranch: \"release/3.2\"\nFile name: `DiscoveryClient.cs`\nLine number: 325\nCode in question:  `_logger.LogError(e, \"FetchRegistry Failed for Eureka service urls: {EurekaServerServiceUrls}\", new Uri(ClientConfig.EurekaServerServiceUrls).ToMaskedString());`\n\n\nError message in logs: `FetchRegistry Failed for Eureka service urls: https://****:****@eureka1.com:443/eureka,https://user:password@eureka2.com:443/eureka`\n\nI thought `new Uri(clientOptions.EurekaServerServiceUrls)` would throw a `UriFormatException` since there are multiple URLs but my logs are showing two URLs regardless.\n\n### PoC\n1. Set Eureka config with multiple server URLs with basic auth\n2. Apologies for not being more descriptive for this step, but I believe we would just need to trigger an exception in `FetchFullRegistryAsync`.\n3. Check the logs and should see the error \n\n### Impact\nVulnerability: Credential leakage in the logs\nWho does it impact?: Users who are using peer awareness with Spring Eureka",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Steeltoe.Discovery.Eureka"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.2.7"
    }
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Steeltoe.Discovery.EurekaBase"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.5.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Steeltoe.Discovery.ClientCore"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 3.0.0"
    }
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Steeltoe.Discovery.ClientAutofac"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.5.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/SteeltoeOSS/security-advisories/security/advisories/GHSA-vmcp-66r5-3pcp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-40636"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/SteeltoeOSS/Steeltoe/commit/c5d4a94e90ccb77f8e851bc681a2e348a95e7ecb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/SteeltoeOSS/security-advisories"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-17T16:00:10Z",
    "nvd_published_at" : "2024-07-17T18:15:04Z"
  }
}