CVE-2024-40636: Steeltoe Leaks Basic Auth Credentials to Logs After Fetch Registry Error
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.
Published Jul 17, 2024 · Updated Aug 6, 2024
Affected packages
Steeltoe.Discovery.Eureka
- Ecosystem
- NuGet
- Affected
- <= 3.2.7
- Fixed in
- 3.2.8
- Check
dotnet list package --include-transitive
Steeltoe.Discovery.EurekaBase
- Ecosystem
- NuGet
- Affected
- <= 2.5.5
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Steeltoe.Discovery.ClientCore
- Ecosystem
- NuGet
- Affected
- < 3.0.0
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Steeltoe.Discovery.ClientAutofac
- Ecosystem
- NuGet
- Affected
- <= 2.5.5
- Fixed in
- No patched version yet
- Check
dotnet list package --include-transitive
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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:[email protected]: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
- Set Eureka config with multiple server URLs with basic auth
- Apologies for not being more descriptive for this step, but I believe we would just need to trigger an exception in
FetchFullRegistryAsync. - 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
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
