Published: June 2024

Introduction

A new security vulnerability, CVE-2025-32754, has been discovered in the widely used jenkins/ssh-agent Docker images (version 6.11.1 and earlier). It affects users running Jenkins agents with SSH, a common setup for scaling and coordinating Jenkins workloads. This flaw may allow network attackers to impersonate your build agents, potentially compromising build output and stealing secrets.

To help you understand the risk and take the right steps, let's break down what happened, how the vulnerability works, and what you can do to stay secure.

What Exactly is CVE-2025-32754?

When you use the jenkins/ssh-agent Docker images (built on Debian) to run Jenkins agents, SSH host keys are generated once at image creation time—not when the container starts. This means *every* container spun up from that image shares the same host SSH keys.

Why Do Host Keys Matter?

Host keys prove the identity of a server to clients. When the Jenkins controller (the central Jenkins instance) connects to an agent via SSH, it checks these keys to ensure it's talking to the correct server. If all agents share the same key across the world, an attacker could impersonate any agent.

The Risk: Letting Attackers in The Middle

If someone can get between your Jenkins controller and agent (for example, on a compromised or poorly segmented network), they can:

Send fake build results: Trick the controller into accepting malicious data or code.

This attacks the *trust* at the heart of your CI/CD pipeline.

A Real-World Example

Let's see a simplified demonstration to help you understand the mechanics.

You start your Jenkins agent with something like

docker run -d --name my-agent jenkins/ssh-agent:6.11.1

Since the SSH host keys were generated and baked into the image, every developer or company using this image now has agents with the exact same SSH key fingerprint.

Client Trust

The Jenkins controller (SSH client) keeps a record of known host keys. Normally, the first time it connects to an agent, it sees a unique host key:

The authenticity of host 'agent01 (192.168.1.100)' can't be established.
ECDSA key fingerprint is SHA256:abc123...
Are you sure you want to continue connecting (yes/no)?

But all agents in the world running this image will show the same fingerprint.

Attack Scenario: Man-in-the-Middle

- Step 1: Attacker spins up their own container from jenkins/ssh-agent:6.11.1 and gets the host key.
- Step 2: Attacker intercepts network traffic or poisons DNS so the controller tries to SSH to a rogue agent.

Step 3: Controller accepts the host key (since it's the known key from before).

- Step 4: The attacker can now read/write everything in the SSH session.

Here’s a code snippet showing how an attacker can extract the host keys from the public image

# Pull the affected image
docker pull jenkins/ssh-agent:6.11.1

# Start a container
docker run -d --name test-agent jenkins/ssh-agent:6.11.1

# Extract the SSH host private key
docker exec test-agent cat /etc/ssh/ssh_host_ecdsa_key

Any attacker doing this exercise will end up with exactly the same private key as your agent containers.

References

- Jenkins Security Advisory
- CVE Entry (NVD)
- jenkins/ssh-agent Docker Hub
- Related Discussion on GitHub

Mitigation: How to Protect Your Pipeline

- Upgrade to a patched version! Jenkins has patched this in recent images. They now generate new host keys at *container startup*, not during image creation.
- Rebuild existing agents: Make sure you’re not running containers built from the old (vulnerable) images.
- Regenerate known_hosts: On the Jenkins controller, clean any remembered fingerprints for agents recreated with patched images.

# Example: Remove old entry from known_hosts for agent01
ssh-keygen -R agent01.example.com

Conclusion

CVE-2025-32754 is a classic supply chain risk: simple, silent, and powerful. It proves that even infrastructure code—like Docker images for build agents—needs security reviews and best practices. If you use Jenkins ssh-agent images, double-check your versions and keys today.

*Stay safe, upgrade early, and never trust a host key you didn’t generate yourself!*


*Did you find this post helpful? Share with your DevOps team and subscribe for more real-world security breakdowns.*

Timeline

Published on: 04/10/2025 12:15:16 UTC
Last modified on: 04/11/2025 15:39:52 UTC