PortGate

Advisories · Linux & SSH

CVE-2023-38408 High CVSS 9.8

OpenSSH ssh-agent PKCS#11 remote code execution

Disclosed 2023 · Last reviewed 2 Dec 2026

A forwarded ssh-agent could be convinced to load a PKCS#11 module and run code as the user who forwarded the agent.

What happened

ssh-agent did not sufficiently constrain the PKCS#11 providers it would load when agent forwarding was enabled.

Affected and patched versions

Affected
OpenSSH before 9.3p2 when ssh-agent is forwarded to a host an attacker can reach.
Patched
OpenSSH 9.3p2 and later.

How to check your server

Check

sshd -V

How to fix and harden

  1. Run sshd -V. The version is on stderr.
  2. Upgrade OpenSSH to 9.3p2 or later.
  3. Stop forwarding the agent to hosts you do not administer. Forwarding is the condition this bug needs.

Fix

sshd -V

Sources

Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON