Developers, the weakest link in the supply chain?
David Leadbeater (G-Research Open Source)
BSides Canberra VIII (2025) · Day 2 · Off-Main Track
Overview
In this compelling talk at BSides Canberra, David Leadbeater, representing G-Research Open Source, delved into the often-overlooked vulnerabilities lurking within the software supply chain: those introduced by developers and their everyday tools. Titled "Developers, the weakest link in the supply chain?", the presentation meticulously explored how seemingly innocuous features, edge cases, and unexpected interactions within core development tools like Go, OpenSSH, and Git can be exploited to facilitate supply chain attacks. Leadbeater's insights highlight that while much attention is paid to dependency vulnerabilities, the attack surface extends significantly into the developer's local environment, build processes, and the very tools they rely upon daily.

Key moments
- 0:00 Introduction: Developers, the weakest link?
- 2:30 Software Bills of Materials (SBOMs) for dependency tracking
- 4:45 Go module insecure fallback vulnerability
- 9:45 OpenSSH hostname comma vulnerability (knownhosts bypass)
- 17:30 Git submodule carriage return (CR) RCE vulnerability
- 21:30 GitHub Actions pullrequesttarget security risks
- 23:30 The challenges of open source bug bounties
- 25:40 XZ backdoor and trust in open-source developers
Developers, the weakest link in the supply chain?
Speakers: David Leadbeater, G-Research Open Source
Conference: BSides Canberra
YouTube: https://www.youtube.com/watch?v=HPQwXX7JOuc
Overview
In this compelling talk at BSides Canberra, David Leadbeater, representing G-Research Open Source, delved into the often-overlooked vulnerabilities lurking within the software supply chain: those introduced by developers and their everyday tools. Titled "Developers, the weakest link in the supply chain?", the presentation meticulously explored how seemingly innocuous features, edge cases, and unexpected interactions within core development tools like Go, OpenSSH, and Git can be exploited to facilitate supply chain attacks. Leadbeater's insights highlight that while much attention is paid to dependency vulnerabilities, the attack surface extends significantly into the developer's local environment, build processes, and the very tools they rely upon daily.
The talk serves as a critical reminder that the software supply chain is not merely a collection of third-party libraries but an intricate ecosystem encompassing development environments, build pipelines, and human factors. Leadbeater, identifying as a bridge between developers and security engineers, demonstrated several real-world vulnerabilities he discovered, ranging from subtle protocol downgrade issues in Go to complex remote code execution (RCE) vectors in Git. His work underscores the necessity for a holistic security approach that scrutinizes the entire development lifecycle, from code authoring to deployment, and acknowledges the developer as a potential, albeit unintentional, vector for sophisticated attacks.
The relevance of this discussion is amplified by recent high-profile supply chain incidents, such as the XZ Utils backdoor, which exposed how deeply malicious actors can embed themselves into foundational open-source projects. Leadbeater's talk provides actionable intelligence and a deep technical understanding of how such attacks might manifest, urging both developers and security professionals to adopt a more vigilant posture towards the tools and configurations that underpin modern software development.
Background
▶ Watch: Introduction: Developers, the weakest link? (0:00)
The concept of a "supply chain" traditionally conjures images of physical goods, like the Evergiven blocking the Suez Canal in 2021, causing global economic disruption. However, the software world faces an equally, if not more, complex supply chain, where the "ingredients" are code dependencies, libraries, and tools. As Leadbeater illustrated with the iPod Nano's "Designed by Apple in California, Assembled in China" label, the intellectual property and software design—the "brains"—are as crucial as the physical components. This analogy extends to software, where an application's core functionality often relies on a vast network of open-source and proprietary components.
Modern software development heavily leverages ecosystems like Go, Rust, Node.js, and Python, each with its own dependency management system (e.g., go.mod, Cargo.toml, package.json, pyproject.toml). While these systems track direct dependencies, they often fall short in providing a comprehensive security overview. This gap led to the development of Software Bills of Materials (SBOMs), standardized formats like SPDX and CycloneDX, which aim to enumerate all components within a software product. SBOMs are vital for tracking dependencies and identifying known vulnerabilities, particularly in open-source components.
However, Leadbeater highlighted a critical limitation of current SBOMs: they primarily focus on dependencies and often fail to capture the entire toolchain used in development and build processes. This oversight leaves a significant attack surface unaddressed. The talk posits that the developer, through their interaction with these tools, their configurations, and their development environment, becomes a potential "weakest link." The problem isn't necessarily developer negligence, but rather the inherent complexity, subtle edge cases, and unexpected interactions within the tools themselves, which can be exploited by sophisticated attackers. This context sets the stage for exploring specific vulnerabilities that exploit these often-overlooked aspects of the software supply chain.
Key Findings
▶ Watch: Go module insecure fallback vulnerability (4:45)
David Leadbeater's talk unveiled several critical vulnerabilities and attack surfaces, demonstrating how fundamental development tools can be weaponized. His key findings underscore the importance of scrutinizing not just dependencies, but the entire developer toolchain.
- Go Module Insecure Fallback: Leadbeater discovered a bug in Go's module system where, contrary to documentation, it would fall back to insecure HTTP for fetching modules if HTTPS and SSH connections failed. While mitigated by Go's robust checksumming and Go Proxy/Sum Database mechanisms, this highlighted a conceptual flaw in protocol handling and the unexpected ways supply chain attacks can manifest, even in well-designed systems.
- OpenSSH Host Key Bypass via DNS Wildcard/Comma Injection: A significant finding involved a vulnerability in OpenSSH's Time of First Use (TOFU) host key verification. By injecting a comma (
,) or a backspace (\b) character into a hostname resolved via DNS, an attacker could trick SSH into treating a specific host key as valid for an entire domain, bypassing critical security checks and facilitating man-in-the-middle attacks. This attack surface exploited a discrepancy between valid DNS characters and valid SSH hostnames. - Git Submodule Remote Code Execution (RCE) via Carriage Return: This was arguably the most impactful discovery presented. Leadbeater demonstrated how a carriage return (
\r) character embedded in a submodule path within the.gitmodulesfile could confuse Git's parsing logic. This confusion, combined with a symlink and a malicious post-checkout hook, allowed for client-side Remote Code Execution (RCE) when a user cloned a malicious repository recursively. This vulnerability affectedgit clone --recursive, GitHub Desktop, and potentially GitHub Actions workflows usingpull_request_target. - Git
help autocorrectAttack Surface (Not a CVE): While not a direct vulnerability, Leadbeater showcased how Git'shelp autocorrectfeature could inadvertently execute arbitrary commands if a user mistyped a command in a specific way, leading to the invocation ofgit remote-x. Although this specific vector was blocked by other Git safeguards (e.g.,Xprotocol disallowed in submodules), it illustrated how seemingly helpful features can introduce unexpected execution paths. ProxyCommandShell Meta-character Injection (discovered by others): Leadbeater briefly referenced a vulnerability found by another researcher (Vinci) where specific configurations of SSH'sProxyCommandfeature could be exploited via shell meta-character injection when cloning Git repositories with submodules. This further emphasized the dangers of complex configurations and the interaction between different tools.
Collectively, these findings paint a picture of a software supply chain where the developer's tools, their configurations, and even subtle character encodings can be leveraged for sophisticated attacks. They highlight the need for extreme vigilance and defense-in-depth across the entire development ecosystem.
Technical Deep Dive
▶ Watch: Git submodule carriage return (CR) RCE vulnerability (17:30)
The technical core of Leadbeater's presentation revolved around dissecting vulnerabilities in Go, OpenSSH, and Git, revealing how fundamental design choices and edge cases create attack vectors.
Go Module Insecure Fallback
Go's module system is designed for robust dependency management. When a Go program imports a package, say github.com/some/package, Go typically resolves this via HTTPS. The mechanism involves looking for a go-import meta tag in the HTML source of the specified URL, which then directs Go to the actual version control repository (e.g., Git over HTTPS or SSH).
The vulnerability (found by Leadbeater in 2023) emerged from an undocumented fallback mechanism. Go's documentation states that if a URL lacks a scheme (e.g., git.example.com/foo.git), it will attempt HTTPS first, then fall back to Git over SSH. The bug was that if both HTTPS and SSH failed, Go would then fall back to plain HTTP, even if the go-insecure environment variable was not set for that module path. This created a potential man-in-the-middle (MITM) downgrade attack scenario. An attacker could block HTTPS/SSH connections, forcing Go to retrieve the module over unencrypted HTTP, allowing for code injection.
However, Go employs significant defense-in-depth. When a package is added to a module, its cryptographic checksum is recorded in the go.sum file. Any subsequent download is validated against this checksum, making the package effectively immutable. Furthermore, Go uses the Go Proxy (a secure, HTTPS-only cache of modules) and the Go Sum Database (a central repository of expected checksums). These mitigations significantly reduce the practical impact of the HTTP fallback, making it a "very low severity CVE," as Leadbeater noted. It primarily posed a risk to developers on untrusted networks (e.g., public Wi-Fi) when fetching a new module version for the first time without the proxy.
Leadbeater also highlighted Go's go.mod file, which declares the Go toolchain version. Go can automatically download the correct toolchain, meaning that updating the Go version in go.mod effectively upgrades the entire build environment, including potential security fixes in the Go compiler or tools. This mechanism helps capture build-time dependencies, addressing a gap often left by SBOMs.
OpenSSH Host Key Bypass
The next deep dive focused on OpenSSH's Time of First Use (TOFU) security model, where SSH records the fingerprint of a host's public key in ~/.ssh/known_hosts upon the first connection. Subsequent connections verify against this stored key.
Leadbeater's vulnerability (found in 2023) exploited a discrepancy between valid characters in DNS hostnames and those expected by SSH for known_hosts entries. DNS allows a broader set of characters than typically valid in hostnames, including the comma (,). An attacker could register a wildcard DNS entry (e.g., *.example.com) and then trick a user into connecting to a specially crafted hostname like wild.example.com,.
When SSH attempted to record this in known_hosts, the comma would be interpreted as a field separator, leading to an entry like wild.example.com,,example.com ssh-rsa AAAA.... This entry would effectively accept any* host key for example.com, bypassing the TOFU check for any future connection to that domain. An attacker could then MITM any SSH connection to example.com by presenting their own host key.
Leadbeater further demonstrated variations:
- ASCII Escape Character Injection: By injecting an ASCII escape character (e.g.,
\x1b[31mfor red text) into the hostname, the SSH client's output could be manipulated, potentially confusing the user about the host they were connecting to. - Backspace Character (
\b) Injection: A more insidious variant involved using a backspace character (\b) after the comma, e.g.,github.com,\b. When theknown_hostsentry was displayed, the backspace would visually hide the comma, making the accepted key appear to be forgithub.comitself, rather than a wildcard. This could allow an attacker to replace a legitimate GitHub SSH host key with their own.
The fix, as implemented in OpenBSD, involved restricting the characters allowed by the system's DNS resolver, preventing the creation of such malicious hostnames. Leadbeater noted that Windows already filters these characters, while macOS had not addressed the issue at the time of the talk.
Git Submodule Remote Code Execution (RCE)
This was a critical vulnerability discovered by Leadbeater himself. Git submodules allow one Git repository to refer to another. The configuration is stored in the .gitmodules file.
The core of the exploit lay in the carriage return (\r or ^M) character. If a submodule was named with a carriage return, e.g., git add submodule https://example.com/repo foo\r, Git's internal parsing of the .gitmodules file could be confused. Specifically, when Git encountered a DOS-style line ending (\r\n), it would strip the \r. If the submodule path itself contained a \r, Git would internally strip it, leading to a mismatch between the expected path and the actual path on the filesystem.
The exploit sequence was:
- An attacker creates a repository with a submodule entry in
.gitmoduleslikepath = foo\r. - On the filesystem, the attacker creates a directory
foowhich is a symlink to the.gitdirectory of the parent repository. - Inside the symlinked
.gitdirectory (which is effectively the parent repository's.git), the attacker places a malicious post-checkout hook script (e.g.,echo "RCE!" > /tmp/rce.txt). - When a user clones this malicious repository using
git clone --recursiveor GitHub Desktop (which enables recursive cloning by default), Git attempts to process the submodule. Due to the carriage return, Git's internal state becomes confused about the submodule's path. - Crucially, when Git performs a
git checkoutoperation on the parent repository, it triggers thepost-checkouthook within its own.gitdirectory, which thefoosymlink points to. Becausefoois a symlink to.git, and the malicious hook is placed there, the hook executes, leading to client-side RCE.
This vulnerability was particularly dangerous because it affected common developer workflows and tools. It could lead to RCE simply by cloning a repository. Leadbeater mentioned its potential impact on GitHub Actions, specifically workflows using pull_request_target. While pull_request_target is generally discouraged for security reasons (it runs in the context of the target repository, not the fork, giving it more permissions), it could have been exploited if a malicious pull request introduced a submodule with this vulnerability. GitHub promptly patched Git on GitHub Actions upon discovery.
Leadbeater also shared his frustration with GitHub's bug bounty program regarding this finding. Despite proving RCE on GitHub Desktop, GitHub declined a bounty, categorizing it as a vulnerability in an "open-source dependency" (Git itself) rather than a direct GitHub product vulnerability. This highlighted the complex interplay between open-source project security and corporate bug bounty policies.
Demo / Proof of Concept
▶ Watch: GitHub Actions pull_request_target security risks (21:30)
David Leadbeater's presentation was rich with live demonstrations and screenshots illustrating the technical concepts and vulnerabilities he uncovered. These proofs of concept were crucial in making the abstract threats tangible.
While the Go module fallback vulnerability was conceptual and mitigated by Go's defense-in-depth, Leadbeater visually explained how a simple import statement could implicitly trigger insecure protocols under specific, adverse network conditions. He showed the Go documentation outlining the fallback logic and how the real-world behavior deviated, underscoring the subtle nature of the bug.
The OpenSSH host key bypass was extensively demonstrated using a terminal.
- He first showed a standard SSH connection to a host, prompting the familiar "authenticity of host can't be established" message and asking for verification.
- Next, he illustrated how connecting to a specially crafted hostname containing a comma (e.g.,
wild.example.com,) would result in an "invalid host name" error on a patched system (like OpenBSD), but on vulnerable systems, it would prompt the user to accept the host key. - Crucially, he then showed the contents of
~/.ssh/known_hostsafter accepting such a hostname. The entry would incorrectly include a wildcard (e.g.,wild.example.com,*,example.com), effectively nullifying the TOFU check for the entireexample.comdomain. - He further demonstrated the visual trickery with ASCII escape characters, showing how a hostname could be crafted to output red text in the terminal, or even overwrite parts of the SSH banner (
Authenticity of host...) to present a misleading message to the user, although this was more for confusion than direct exploit. - The most potent variant involved the backspace character (
\b). Leadbeater showed howgithub.com,\bas a hostname would appear to be justgithub.comin the terminal output, but upon acceptance, it would write a wildcard entry toknown_hoststhat visually masked the comma, making it seem like the user had accepted a key for the legitimategithub.com.
The Git submodule RCE demonstration was particularly impactful.
- Leadbeater started by showing a
git add submodulecommand where he attempted to add a submodule with a carriage return (\r) in its name, highlighting how Git's command line would initially reject it or show unexpected output (e.g., stripping the last character or showing a?). - He then demonstrated the
git mvcommand, showing how renaming a valid submodule to include\r(e.g.,path = foo^Mwhere^Mis a carriage return) within the.gitmodulesfile could confuse Git. - He ran
git status, which then showed a "fatal: can't change directory to..." error, indicating Git's internal state was corrupted due to the\rcharacter. - The culminating proof of concept involved cloning a specially crafted repository using GitHub Desktop. The demo showed GitHub Desktop successfully cloning the repository, and then, upon completion, a new file (
/tmp/rce.txt) would appear on the system, containing "RCE!", demonstrating arbitrary code execution triggered by the clone operation. This visually confirmed the client-side RCE. - He also briefly touched upon the
git help autocorrectfeature, showing how a mistyped command likegit cloncould lead to Git executinggit remote-xif configured, although he clarified this wasn't a practical vulnerability due to other Git safeguards.
These demos vividly illustrated the subtle yet powerful ways attackers could leverage unexpected behaviors in developer tools, turning common actions like cloning a repository or connecting via SSH into critical security risks.
Defensive Implications
▶ Watch: XZ backdoor and trust in open-source developers (25:40)
The vulnerabilities and attack vectors highlighted by David Leadbeater carry significant defensive implications for organizations and individual developers alike. The core message is to extend security scrutiny beyond just code and dependencies to the entire developer toolchain and environment.
- Prioritize Tooling Updates: The most immediate defensive action is to keep development tools like Go, OpenSSH, and Git consistently updated. These tools are foundational, and vulnerabilities, even if low severity like the Go HTTP fallback, can expose developers. The Git submodule RCE underscores the critical need for rapid patching of client-side tools. Organizations should enforce tool versioning and update policies.
- Beware of Network Environments: The Go module vulnerability, however low its severity, serves as a reminder that developers working on untrusted networks (e.g., public Wi-Fi at conferences) are more susceptible to MITM attacks, especially when fetching new dependencies. VPNs or secure network configurations should be standard practice for development activities.
- Harden SSH Configurations:
- DNS Resolution: System administrators should ensure that DNS resolvers are configured to restrict invalid characters in hostnames, as OpenBSD did. This prevents the SSH
known_hostsbypass. ProxyCommandAuditing: Developers and security teams should audit~/.ssh/configfiles, especially for configurations involvingProxyCommand, to ensure they don't allow shell meta-character injection.- Educate on TOFU: Developers should be educated on the Time of First Use (TOFU) mechanism and the importance of verifying SSH host key fingerprints, being wary of unusual prompts or unexpected characters in hostnames.
- Mitigate Git Submodule Risks:
- Recursive Clone Caution: While
git clone --recursiveis convenient, developers should be aware of the RCE risk associated with cloning untrusted repositories. Organizations might consider scanning repositories for malicious.gitmodulesfiles before allowing recursive clones in automated systems. - GitHub Actions
pull_request_target: This action context is inherently risky as it runs with permissions of the target repository. As recommended by auditing tools like Zismo, avoidpull_request_targetwhere possible, or implement stringent security checks and sandboxing for workflows that must use it, especially when processing external contributions (e.g., pull requests from forks). GitHub's prompt update of Git on GitHub Actions mitigated immediate risk for this particular CVE, but the principle remains.
- Expand SBOM Scope: While SBOMs are valuable, Leadbeater's talk highlights their current limitation in capturing the full build toolchain. Future SBOM standards or supplementary tooling should aim to include information about compiler versions, build system configurations, and other critical development tools.
- Developer Awareness and Training: Developers are the first line of defense. Training should go beyond secure coding practices to include:
- Understanding the attack surface of their daily tools.
- Recognizing phishing attempts, as exemplified by the npm.js.help vs .org scenario.
- The dangers of subtle character manipulations (e.g., carriage returns, commas, backspaces).
- The "Ken Thompson attack" concept: understanding that even trusted compilers or tools can be backdoored.
- Automated Security Auditing for CI/CD: Tools like Zismo for GitHub Actions can automatically audit CI/CD workflows for risky configurations, such as the use of
pull_request_target. Integrating such checks into the development pipeline can catch misconfigurations before they become exploitable. - Open Source Stewardship: The XZ Utils attack and Leadbeater's experience with GitHub's bug bounty highlight the complex relationship between open-source security and corporate responsibility. Companies relying heavily on open-source projects should consider contributing to their security, both financially and through active participation in vulnerability discovery and patching.
By adopting a comprehensive security posture that encompasses the entire software supply chain, from dependencies to developer tools and configurations, organizations can significantly strengthen their resilience against sophisticated attacks.
Key Takeaways
- The Software Supply Chain Extends Beyond Dependencies: While SBOMs and dependency scanning are crucial, the attack surface includes developer tooling (Go, SSH, Git), configurations, and local environments, which are often overlooked.
- Subtle Character Manipulations are Powerful Attack Vectors: Seemingly innocuous characters like carriage returns (
\r), commas (,), or backspaces (\b) can exploit parsing discrepancies in core tools, leading to significant vulnerabilities like RCE or security bypasses. - Defense-in-Depth is Essential, But Not Always Perfect: Go's robust checksumming and proxy system significantly mitigated a protocol downgrade vulnerability, demonstrating the value of layered security. However, even well-designed systems can have unexpected edge cases.
- Developer Tooling and Configuration are Critical Attack Surfaces: Vulnerabilities in OpenSSH's host key verification and Git's submodule handling demonstrate how standard development actions (SSH connections, repository cloning) can be weaponized if tools are misconfigured or contain subtle bugs.
- GitHub Actions
pull_request_targetPoses Significant Risk: This CI/CD feature can run untrusted code with elevated permissions in the target repository's context, making it a prime target for supply chain attacks, especially when combined with vulnerabilities like the Git submodule RCE. - The Human Factor and Trust Remain Central: From phishing attempts (npm example) to the implications of the XZ Utils backdoor, the talk underscored that developer vigilance, awareness, and the inherent trust placed in open-source contributors are critical, yet fragile, components of supply chain security.
About the Speaker(s)
David Leadbeater is a security researcher and developer working with G-Research Open Source. He identifies himself as operating "in between a developer and a security engineer," a unique position that allows him to bridge the gap between practical development workflows and deep security analysis. His work focuses on improving tooling and enhancing the understanding of security within the development ecosystem. Leadbeater's expertise is evident in his ability to uncover subtle yet impactful vulnerabilities in widely used software like Go, OpenSSH, and Git, demonstrating a keen eye for edge cases and unexpected system interactions. He is a proponent of defense-in-depth and continuous improvement in development security practices.
Reviews
- Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★
- Heather Calloway (CISO) — MUST SEE ★★★★★