<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Quarkslab's blog - paramiko</title><link href="http://blog.quarkslab.com/" rel="alternate"></link><link href="http://blog.quarkslab.com/feeds/paramiko.rss.xml" rel="self"></link><id>http://blog.quarkslab.com/</id><updated>2026-05-05T00:00:00+02:00</updated><entry><title>Paramiko Security Audit</title><link href="http://blog.quarkslab.com/paramiko-security-audit.html" rel="alternate"></link><published>2026-05-05T00:00:00+02:00</published><updated>2026-05-05T00:00:00+02:00</updated><author><name>Dahmun Goudarzi</name></author><id>tag:blog.quarkslab.com,2026-05-05:/paramiko-security-audit.html</id><summary type="html">&lt;p&gt;The &lt;a href="https://ostif.org/"&gt;OSTIF&lt;/a&gt; collaborated with Quarkslab to conduct a security audit of &lt;a href="https://www.paramiko.org/"&gt;Paramiko&lt;/a&gt;, a pure-Python implementation of SSHv2 that provides both client- and server-side functionality. Given the sensitivity and importance of the target, the review focused not only on Paramiko itself but also on its dependencies. The assessment covered its interaction with rust-openssl bindings, the use of secure entropy sources, adherence to constant-time requirements, as well as code quality, testing practices, and the CI/CD pipeline, with the goal of identifying opportunities for further hardening.&lt;/p&gt;</summary><content type="html">&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Paramiko is a pure-Python implementation of SSHv2 that provides both client- and server-side functionality. It serves as the foundation for the high-level SSH library Fabric and is widely regarded as one of the most popular SSH solutions in the Python ecosystem.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://cryptography.io/"&gt;Cryptography&lt;/a&gt; library, for its part, offers Python developers access to a broad range of cryptographic algorithms and primitives. It is a widely adopted Python/Rust library with more than 25,000 known dependencies.&lt;/p&gt;
&lt;p&gt;The engagement between OSTIF, Paramiko, and Quarkslab involved a comprehensive assessment of the Paramiko library, along with a detailed analysis of how Cryptography interacts with the rust-openssl bindings, the reliability of entropy sources, constant-time execution requirements, code quality, testing practices, and the CI/CD pipeline. Recommendations were provided to strengthen each of these areas.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/quarkslab/public-reports/blob/main/Reports/25-11-2415-REP_paramiko-security-audit_v1.1.pdf"&gt;report&lt;/a&gt; describes the steps of the vulnerability research we conducted.&lt;/p&gt;
&lt;h1 id="scope"&gt;Scope&lt;/h1&gt;
&lt;p&gt;The Paramiko library is designed to be compact, easy to understand, and limited in functionality to minimize the attack surface. Attacks on SSH implementations are well researched and
documented, so OSTIF will direct its efforts towards examining Paramiko&amp;rsquo;s testing, building,
and CI systems. This will lead to sustainable enhancements in the library&amp;rsquo;s resilience. It will also examine how the Paramiko initiative ensures that its dependencies are properly implemented.
Finally, a manual code review will be conducted to verify correctness and that Paramiko is not
vulnerable to known attacks from other SSH implementations.&lt;/p&gt;
&lt;p&gt;The Cryptography library boasts a vast array of features and functions, encompassing
numerous use cases. Despite its extensive attack surface, this is made possible through the integration of OpenSSL (via rust-openssl). As such, evaluating the Cryptography library amounts
to examining the proper utilization of rust-openssl&amp;rsquo;s capabilities, rather than re-examining
cryptographic primitives from the ground up. This review of the library should be initially
triaged to focus on the use cases that affect Paramiko. All remaining time and resources that
are available after the review of the Paramiko use-case should be used in a time-boxed and risk-
based approach to evaluate the rest of the Cryptography project.&lt;/p&gt;
&lt;p&gt;OpenSSL and rust-openssl themselves are not part of this evaluation, only how they are
invoked by Cryptography and Paramiko. If a researcher finds a potential bug in OpenSSL or
rust-openssl incidentally during this research, they are free to investigate the issue, report it responsibly and include their findings in the final report. However, this engagement is not a
review of OpenSSL nor rust-openssl.&lt;/p&gt;
&lt;h1 id="findings"&gt;Findings&lt;/h1&gt;
&lt;p&gt;The table below summarizes the findings of the audit. A total of 30 vulnerabilities were identified: 2 of high severity, 6 of medium severity, 6 of low severity and 16 of informatives issues.&lt;/p&gt;
&lt;table class="table table-striped"&gt;
&lt;thead&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Title&lt;/th&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;Perimeter&lt;/th&gt;
&lt;th&gt;Fix commit &lt;/th&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;HIGH-21&lt;/th&gt;
&lt;td&gt;Insecure parameters for digital signatures with RSA  &lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;paramiko/rsakey.py.&lt;/td&gt;
&lt;td&gt;a448945&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;HIGH-28&lt;/th&gt;
&lt;td&gt;Insecure key sizes accepted for Triple DES &lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;TripleDES in Cryptography&lt;/td&gt;
&lt;td&gt;https://github.com/pyca/cryptography/pull/13928&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MED-15&lt;/th&gt;
&lt;td&gt;Deprecated group exchange method  &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;paramiko/kex_gex.py&lt;/td&gt;
&lt;td&gt;9bf5fca&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MED-16&lt;/th&gt;
&lt;td&gt;Insecure minimum modulus size in Diffie-Hellman group exchange &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;paramiko/kex_gex.py&lt;/td&gt;
&lt;td&gt;6fa1556&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MED-17&lt;/th&gt;
&lt;td&gt;Deprecated Diffie-Hellman group  &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;paramiko/kex_group1.py&lt;/td&gt;
&lt;td&gt;9bf5fca&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MED-18&lt;/th&gt;
&lt;td&gt;Deprecated GSS-API key exchange methods&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;paramiko/kex_gss.py&lt;/td&gt;
&lt;td&gt;1ecc933&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MED-22&lt;/th&gt;
&lt;td&gt;Use of 8-byte seed for TripleDES key generation &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Encryption&lt;/td&gt;
&lt;td&gt;https://github.com/pyca/cryptography/pull/13928&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MED-24&lt;/th&gt;
&lt;td&gt;Wrong type usage in SHA-1 in KexGSSGroup1 and KexGSSGroup14 &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;paramiko/kex_gss.py&lt;/td&gt;
&lt;td&gt;9bf5fca&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;LOW-1&lt;/th&gt;
&lt;td&gt;CVE impacting black &lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Development&lt;/td&gt;
&lt;td&gt;/&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;LOW-19&lt;/th&gt;
&lt;td&gt;Use of MD5 as a Key Derivation Function&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;paramiko/pkey.py&lt;/td&gt;
&lt;td&gt; acd4bc1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;LOW-25&lt;/th&gt;
&lt;td&gt;Invalid Ed25519 signature causes mishandled exception&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;ed25519key.py&lt;/td&gt;
&lt;td&gt;/&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;LOW-27&lt;/th&gt;
&lt;td&gt;Invalid Ed25519 signature cause transport thread to crash &lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;paramiko/ed25519key.py&lt;/td&gt;
&lt;td&gt;/&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;LOW-29&lt;/th&gt;
&lt;td&gt;Insecure RSA key size allowed &lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;RSA Keys in Paramiko and Cryptography&lt;/td&gt;
&lt;td&gt;/&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;LOW-30&lt;/th&gt;
&lt;td&gt;Server can be instantiated over UDP socket &lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;paramiko/transport.py&lt;/td&gt;
&lt;td&gt;/&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1 id="conclusion"&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Quarkslab has been mandated on behalf of OSTIF to perform the first public security
audit of Paramiko performed by an audit firm. Since critical security features of Paramiko
involve cryptographic primitives, the scope was expanded to PYCA Cryptography and, more
specifically, how Paramiko uses it.&lt;/p&gt;
&lt;p&gt;Our work was primarily focused on a detailed, in-depth static analysis, identifying and
developing targeted test enhancements, and dynamic testing where possible. We also addressed
potential security risks in the CI/CD pipeline to ensure a secure and robust deployment process.
During the audit period, we found a few issues, but nothing that raises security concerns for Paramiko or Cryptography.&lt;/p&gt;
&lt;p&gt;To date, previously identified vulnerabilities have been reviewed and successfully remediated, reflecting a sustained commitment to improving the security posture and overall resilience of Paramiko.&lt;/p&gt;
&lt;p&gt;We truly enjoyed collaborating with the OSTIF and we extend our sincere thanks to Jeff Forcier for his availability, responsiveness, and the constructive discussions that made this collaboration so effective.&lt;/p&gt;
&lt;h1 id="further-reading"&gt;Further reading&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ostif.org/paramiko-audit-complete/"&gt;OSTIF blog post&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/paramiko/paramiko"&gt;Paramiko github&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="Cryptography"></category><category term="audit"></category><category term="OSTIF"></category><category term="software"></category><category term="cryptography"></category><category term="paramiko"></category><category term="ssh"></category><category term="2026"></category></entry></feed>