Sunday, April 13, 2025
Homecyber securityGitHub Vulnerability Exposes User Credentials via Malicious Repositories

GitHub Vulnerability Exposes User Credentials via Malicious Repositories

Published on

SIEM as a Service

Follow Us on Google News

A cybersecurity researcher recently disclosed several critical vulnerabilities affecting Git-related projects, revealing how improper handling of credential protocols can lead to sensitive data leaks.

From GitHub Desktop to Git Credential Manager and Git LFS, these issues were uncovered during a routine bug-hunting session for the GitHub Bug Bounty program, resulting in the assignment of multiple CVEs.

Improper Parsing in GitHub Desktop Enables Credential Leakage (CVE-2025-23040)

A flaw in GitHub Desktop’s handling of the Git Credential Protocol was identified as a potential vector for credential exposure.

- Advertisement - Google News

The issue stems from how the tool’s credential helper, called “trampoline,” parses user input.

Within the parseCredential function, an improper regular expression implementation led to the mishandling of carriage return characters (\r).

Since Git Credential Protocol primarily relies on newline characters (\n) to delineate properties, the inclusion of carriage return characters enables “carriage return smuggling.”

This allows attackers hosting malicious repositories to craft URLs like http://%0dprotocol=https%0dhost=github.com%0d@localhost, tricking the system into misinterpreting github.com as the target host.

Git Credential Manager Vulnerability via StreamReader Misuse (CVE-2024-50338)

Another critical issue was identified in Git Credential Manager, a cross-platform credential helper for Git built on .NET.

The vulnerability arises due to improper use of the StreamReader class, which processes input using multiple line terminators—\n, \r, and \r\n.

As a result, attackers can craft malicious URLs containing carriage return characters to manipulate how credentials are handled.

When Git Credential Manager receives such manipulated input, it may send credentials meant for legitimate hosts (e.g., github.com) to attacker-controlled endpoints, effectively exposing sensitive user data.

The researcher also discovered a vulnerability in Git LFS (Large File Storage). Unlike Git itself which robustly validates credential values to prevent newline injections Git LFS fails to sanitize input.

According to Flatt Security, by embedding a newline character in the .lfsconfig file, attackers can bypass validation safeguards and manipulate credential protocols, potentially leaking credentials.

For example, a crafted URL in .lfsconfig could trigger Git LFS to send the following malformed message to a credential helper:

protocol=http
host=localhost
username=
host=github.com
protocol=https

In such cases, the credential helper would interpret the last host and protocol fields as authoritative, inadvertently exposing github.com credentials to an unauthorized host.

Separate vulnerabilities were found in GitHub CLI and Codespaces. In GitHub CLI, faulty logic in the tokenForHost function caused tokens to be sent to unauthorized hosts under specific conditions.

The issue primarily affected enterprise environments and GitHub Codespaces, where the CODESPACES environment variable is universally set to true.

A malicious repository cloned on Codespaces could exploit this to exfiltrate access tokens.

Similarly, a basic credential helper script in Codespaces exposed tokens because it failed to validate the requested host.

Subsequent patches introduced domain validation to ensure credentials are only sent to trusted endpoints.

These vulnerabilities highlight how even minor architectural oversights in text-based protocols can lead to severe security breaches.

Credential leakage, particularly in widely used tools like GitHub Desktop, Git Credential Manager, and Git LFS, underscores the importance of rigorous input validation and adherence to secure coding practices.

While patches have been deployed to address these issues, the findings serve as a cautionary tale for the broader open-source community.

Are you from SOC/DFIR Teams? – Analyse Malware Files & Links with ANY.RUN Sandox -> Try for Free

Aman Mishra
Aman Mishra
Aman Mishra is a Security and privacy Reporter covering various data breach, cyber crime, malware, & vulnerability.

Latest articles

Threat Actors Manipulate Search Results to Lure Users to Malicious Websites

Cybercriminals are increasingly exploiting search engine optimization (SEO) techniques and paid advertisements to manipulate...

Hackers Imitate Google Chrome Install Page on Google Play to Distribute Android Malware

Cybersecurity experts have unearthed an intricate cyber campaign that leverages deceptive websites posing as...

Dangling DNS Attack Allows Hackers to Take Over Organization’s Subdomain

Hackers are exploiting what's known as "Dangling DNS" records to take over corporate subdomains,...

HelloKitty Ransomware Returns, Launching Attacks on Windows, Linux, and ESXi Environments

Security researchers and cybersecurity experts have recently uncovered new variants of the notorious HelloKitty...

Resilience at Scale

Why Application Security is Non-Negotiable

The resilience of your digital infrastructure directly impacts your ability to scale. And yet, application security remains a critical weak link for most organizations.

Application Security is no longer just a defensive play—it’s the cornerstone of cyber resilience and sustainable growth. In this webinar, Karthik Krishnamoorthy (CTO of Indusface) and Phani Deepak Akella (VP of Marketing – Indusface), will share how AI-powered application security can help organizations build resilience by

Discussion points


Protecting at internet scale using AI and behavioral-based DDoS & bot mitigation.
Autonomously discovering external assets and remediating vulnerabilities within 72 hours, enabling secure, confident scaling.
Ensuring 100% application availability through platforms architected for failure resilience.
Eliminating silos with real-time correlation between attack surface and active threats for rapid, accurate mitigation

More like this

Threat Actors Manipulate Search Results to Lure Users to Malicious Websites

Cybercriminals are increasingly exploiting search engine optimization (SEO) techniques and paid advertisements to manipulate...

Hackers Imitate Google Chrome Install Page on Google Play to Distribute Android Malware

Cybersecurity experts have unearthed an intricate cyber campaign that leverages deceptive websites posing as...

Dangling DNS Attack Allows Hackers to Take Over Organization’s Subdomain

Hackers are exploiting what's known as "Dangling DNS" records to take over corporate subdomains,...