SSH agent hijacking and mishandled keys
The SSH agent keeps decrypted keys in memory and exposes a socket to sign challenges. Whoever accesses the socket can use the keys without knowing the passphrase.
The routes
Accessible socket: if root (or another compromised user) finds a session's SSH_AUTH_SOCK, they reuse it to authenticate wherever those keys are valid:
SSH_AUTH_SOCK=/tmp/ssh-XXXX/agent.1234 ssh-add -l
SSH_AUTH_SOCK=... ssh target # signs with the victim's keysAgent forwarding (ssh -A): if you connect with forwarding to a compromised host, that host's admin uses your agent to hop to other systems as you.
Defence
Do not use -A toward untrusted hosts (use ProxyJump). Passphrase-protected keys, and confirmation per signature (ssh-add -c). Hardware keys (FIDO2/PIV) that cannot be exfiltrated. Tight socket permissions. Per-host, expiring keys (SSH certificates).