Multiple security vulnerabilities have been revealed in GitHub Desktop and other Git-related projects that, if exploited, could allow attackers to gain unauthorized access to a user’s Git credentials.
According to GMO Flatt security researcher Ry0taK, who identified the flaws, “Git uses the Git Credential Protocol to retrieve credentials from the credential helper. Due to improper message handling, numerous projects became susceptible to credential leaks in various ways,” he explained in an analysis published on Sunday.
The identified vulnerabilities are as follows:
While the credential helper is designed to return credentials separated by the newline control character (“\n”), research has shown that GitHub Desktop is vulnerable to carriage return (“\r”) smuggling. By injecting this character into a crafted URL, an attacker can potentially leak credentials to an attacker-controlled host.
Hackers Inject Malicious Code in Chrome Extensions
“By using a maliciously crafted URL, it’s possible to cause the credential request from Git to be misinterpreted by GitHub Desktop, resulting in the credentials being sent to a different host than the one Git is communicating with, thus enabling secret exfiltration,” GitHub explained in an advisory.
A similar flaw was found in the Git Credential Manager NuGet package, where credentials can be exposed to unrelated hosts. Additionally, Git LFS was discovered to not check for embedded control characters, allowing for CRLF injection through crafted HTTP URLs.
The vulnerability in GitHub CLI exploits the fact that access tokens are configured to be sent to hosts other than github[.]com and ghe[.]com, as long as the environment variables GITHUB_ENTERPRISE_TOKEN, GH_ENTERPRISE_TOKEN, and GITHUB_TOKEN are set, and CODESPACES is enabled (set to “true”).
“While the enterprise-related variables are less common, the CODESPACES environment variable is always set to ‘true’ when running on GitHub Codespaces,” Ry0taK noted. “Thus, cloning a malicious repository in GitHub Codespaces using GitHub CLI will always leak the access token to the attacker’s hosts.”
Successful exploitation of these vulnerabilities could allow malicious third parties to use the leaked authentication tokens to access privileged resources.
Now that React Native is your go-to framework for building cross-platform mobile applications efficiently, it's…
When dealing with complex data structures. For example, you might have an array of user…
If you've played Fortnite, watched a live ESPN match, or used Slack or Microsoft Teams,…
A custom hook in React is a JavaScript function that leverages React’s built-in hooks—like useState,…
The South Korean government announced on Monday that it had temporarily halted new downloads of…
As a software developer, choosing the right programming language for software development can be a…