Public bug reported:

paramiko 4.0.0 in Ubuntu 26.04 (4.0.0-1ubuntu2) and 26.10 (4.0.0-2ubuntu1)
fails publickey authentication with

    AttributeError: public_blob

as soon as the SSH agent offers a key whose type paramiko 4 cannot parse:
ssh-dss (paramiko 4.0 dropped DSA), or security keys 
([email protected],
[email protected]). The agent can hold such keys even when
"ssh-add -l" does not list them (OpenSSH 10 has no DSA; gcr's agent still loads 
a
DSA key file from ~/.ssh). Any program that authenticates through paramiko with
the agent stops there instead of trying the next key: here, dput-ng's sftp 
upload
to a Launchpad PPA failed at login.

Cause: AgentKey.__init__ (paramiko/agent.py) does not set public_blob, and 
leaves
inner_key as None for an unknown key type; AgentKey.__getattr__ then raises
AttributeError for any proxied name, and AuthHandler._get_key_type_and_bits
(paramiko/auth_handler.py) reads key.public_blob first.

Upstream fixed it in paramiko 5.1.0 (issue 
https://github.com/paramiko/paramiko/issues/2462):
AgentKey.__init__ sets public_blob = None, and _get_key_type_and_bits reads it 
with
getattr(). The same two lines apply to 4.0.0 (patch attached); paramiko 4.0.0's
tests/agent.py and tests/auth.py pass with it.

Reproducer (no agent or network needed), attached as repro.py:
  4.0.0: "ssh-dss AttributeError: public_blob"
  patched / 5.1.0: "ssh-dss ok: ssh-dss"

Workaround: run the program under an ssh-agent holding only keys paramiko knows
(ssh-agent with ssh-add of that one key), or remove the DSA/sk keys from the 
agent.

** Affects: paramiko (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "Backport of the 5.1.0 fix to 4.0.0"
   
https://bugs.launchpad.net/bugs/2175133/+attachment/6019606/+files/agentkey-public-blob.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175133

Title:
  AttributeError: public_blob during SSH agent auth when the agent holds
  a key type paramiko does not know (fixed in 5.1.0)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/paramiko/+bug/2175133/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to