Skip to content

[BUG] - paramiko crashes on Ubuntu Jammy (22.04) in FIPS mode #2442

Open

Description

@ericeberry

Are you using paramiko as a client or server?

Client

What feature(s) aren't working right?

Something else

What version(s) of paramiko are you using?

2.9.3

What version(s) of Python are you using?

3.10.12

What operating system and version are you using?

Ubuntu 22.04 FIPS mode

If you're connecting as a client, which SSH server are you connecting to?

No response

If you're using paramiko as part of another tool, which tool/version?

No response

Expected/desired behavior

Importing paramiko should not crash

Actual behavior

Paramiko crashes on import. Ubuntu 22.04 FIPS has X25519 listed as unsupported. The Python cryptography module returns an cryptography.exceptions.InternalError when checking to see if X25519 keys are available.

How to reproduce

Run on Ubuntu 22.04 with FIPS mode enabled.
Run the Python3 interpreter.
import paramiko.

Anything else?

https://bugs.launchpad.net/ubuntu/+source/paramiko/+bug/2072974

root@jipster:~# python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 133, in <module>
    class Transport(threading.Thread, ClosingContextManager):
  File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 208, in Transport
    if KexCurve25519.is_available():
  File "/usr/lib/python3/dist-packages/paramiko/kex_curve25519.py", line 30, in is_available
    X25519PrivateKey.generate()
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/asymmetric/x25519.py", line 46, in generate
    return backend.x25519_generate_key()
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 2317, in x25519_generate_key
    evp_pkey = self._evp_pkey_keygen_gc(self._lib.NID_X25519)
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 2305, in _evp_pkey_keygen_gc
    self.openssl_assert(evp_pkey_ctx != self._ffi.NULL)
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 242, in openssl_assert
    return binding._openssl_assert(self._lib, ok, errors=errors)
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 77, in _openssl_assert
    raise InternalError(
cryptography.exceptions.InternalError: Unknown OpenSSL error. This error is commonly encountered when another library is not cleaning up the OpenSSL error stack. If you are using cryptography with another library that uses OpenSSL try disabling it before reporting a bug. Otherwise please file an issue at https://github.com/pyca/cryptography/issues with information on how to reproduce this. ([_OpenSSLErrorWithText(code=50856204, lib=6, reason=524556, reason_text=b'error:0308010C:digital envelope routines::unsupported')])

In the above trace, it appears to be attempting to generate an x25519 key, which isn't an acceptable alg's in FIPS 140-3 and thus fails to work.

  1. root@jipster:~# lsb_release -rd
    Description: Ubuntu 22.04.4 LTS
    Release: 22.04

  2. root@jipster:~# apt-cache policy python3-paramiko
    python3-paramiko:
    Installed: 2.9.3-0ubuntu1.2
    Candidate: 2.9.3-0ubuntu1.2

  3. Expect that one can import the paramiko module successfully for use

  4. Module crashes when (presumably) it attempts to use disallowed alg

Activity

  1. changed the title [-][BUG] - paramiko is crashes on Ubuntu Jammy (22.04) in FIPS mode[/-] [+][BUG] - paramiko crashes on Ubuntu Jammy (22.04) in FIPS mode[/+] on Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions