CVE-2017-16228: Dulwich SSH Command Execution

dulwich Updated 02 Oct 2025

Summary

29/10/2017
Yes i
Critical
9.8

CVE-2017-16228: Dulwich before 0.18.5, when an SSH subprocess is used, allows remote attackers to execute arbitrary commands via an ssh URL with an initial dash character in the hostname, a related issue to CVE-2017-9800, CVE-2017-12836... Affects dulwich versions < 0.18.5. Fixed in 0.18.5. How to fix ↓

Also tracked for

The same CVE-2017-16228 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Dulwich is a Python library that provides an interface to interact with Git repositories. It allows users to perform various Git operations programmatically. However, versions of Dulwich prior to 0.18.5 are vulnerable to a command execution issue when an SSH subprocess is used. This vulnerability can be exploited by remote attackers through an SSH URL with an initial dash character in the hostname. This issue is related to several other CVEs, including CVE-2017-9800, CVE-2017-12836, CVE-2017-12976, CVE-2017-1000116, and CVE-2017-1000117.

Vulnerability Detail

The vulnerability in Dulwich allows remote attackers to execute arbitrary commands. By crafting a malicious SSH URL with a dash character at the beginning of the hostname, an attacker can inject arbitrary commands that will be executed by the SSH subprocess. This can lead to unauthorized access, data leakage, or even complete compromise of the affected system. It is crucial to update Dulwich to version 0.18.5 or later to mitigate this vulnerability.

How To Fix

Latest published version: 1.2.19 as of 23 Oct 2026

pip install --upgrade "dulwich==1.2.19"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.18.5

This is the first release that contains the fix.

pip install --upgrade "dulwich==0.18.5"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Conclusion

The vulnerability in Dulwich allows remote command execution, posing a significant risk to the affected systems. It is crucial to update Dulwich to version 0.18.5 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for dulwich →

Share this vulnerability

FAQ

Dulwich is a Python library that provides an interface to interact with Git repositories. It allows users to perform various Git operations programmatically.

This vulnerability allows remote attackers to execute arbitrary commands on the affected system. It can lead to unauthorized access, data leakage, or complete compromise of the system.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. No signup is required, and you can simply provide your Pipfile.lock to analyze the vulnerability status.

Currently, there are no known workarounds for this vulnerability. It is recommended to update Dulwich to the latest version.

Related vulnerabilities

Recent vulnerabilities recorded for dulwich.

How To Fix

Latest published version: 1.2.19 as of 23 Oct 2026

pip install --upgrade "dulwich==1.2.19"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.18.5

This is the first release that contains the fix.

pip install --upgrade "dulwich==0.18.5"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback