High, CVSS 7.4NuGetPublished
Git Credential Manager carriage-return character in remote URL allows malicious repository to leak credentials
CVE-2024-50338 · GHSA-86c2-4x57-wc8g
- Affected
- NuGet git-credential-manager <= 2.6.0
- Fixed in
- 2.6.1· Vendor fix available
- Issue
- The Git credential protocol is text-based over standard input/output, and consists of a series of lines of key-value pairs in the format key=value. Git's documentation restricts the use of the NUL (\0) character and newlines to form part of the keys[^1] or values. When Git reads from standard input, it considers both LF and CRLF[^2] as newline characters for the credential protocol by virtue of calling strbufgetline that calls to strbufgetdelimstripcrlf. Git also validates that a newline is not present in the value by checking for the presence of the line-feed character (LF, \n), and errors if this is the case. This captures both LF and CRLF-type newlines. Git Credential Manager uses the .NET standard library StreamReader class to read the standard input stream line-by-line and parse the key=value credential protocol format. The implementation of the ReadLineAsync method considers LF, CRLF, and CR as valid line endings. This is means that .NET considers a single CR as a…
Recommended action: Upgrade to 2.6.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.