CVE-2020-28407: swtpm Symlink Vulnerability

You're tweaking a VM, thinking TPM emulation's rock-solid. Wrong. CVE-2020-28407 turns tmp files into weapons.

swtpm's Sneaky Symlink Trap: CVE-2020-28407 Still Bites in 2024 — theAIcatchup

Key Takeaways

  • CVE-2020-28407 enables arbitrary file overwrites via symlinks in old swtpm versions.
  • Still relevant in 2024 due to stale container images and legacy VMs.
  • Patch immediately; echoes ancient bugs like OpenSSH's 2002 symlink flaw.

Smoke curls from a sysadmin’s monitor in a dimly lit data center, as another virtual machine crashes—not from overload, but from a ghost in the TPM machine.

CVE-2020-28407. Yeah, that one. Buried in swtpm, the open-source software TPM emulator devs love for virtualized trust roots. Here’s the kicker: before version 0.4.2 or 0.5.1, a local punk with basic access can symlink-bomb temporary files like TMP2-00.permall and overwrite whatever the hell they want. Arbitrary files. Your configs. Secrets. Poof.

In swtpm before 0.4.2 and 0.5.x before 0.5.1, a local attacker may be able to overwrite arbitrary files via a symlink attack against a temporary file such as TMP2-00.permall.

That’s straight from the CVE bible. NVD enriched it, sure, but the dirt’s the same. Local attacker. Sounds tame? Laughable, even. Until you remember “local” often means anyone who SSHs into your prod server or sneaks a foot in via some other slip-up.

What Even is swtpm, and Why Should You Care?

swtpm. Software TPM. It’s the fake hardware key that lets virtual machines pretend they’ve got a real Trusted Platform Module. QEMU, libvirt, KVM—all lean on it for attestation, sealing, PCRs. Essential for cloud workloads chasing compliance badges like TPM 2.0.

But software’s squishy. Always has been. This flaw? Classic symlink race. App dumps a temp file—boom, attacker points it at /etc/passwd or your SSH keys. No root needed upfront. Just timing and malice.

Idiots thought temp files were safe in /tmp. Newsflash: they’re not. Ever.

Patch dropped in ‘21. Most grabbed it. But here’s my hot take—and it’s one the CVE page skips: this reeks of the 2002 OpenSSH symlink bug (CVE-2002-0082), where privsep temps got owned the same way. History repeats because devs nap on TOCTOU. We’re patching the same damn hole twenty years later. Pathetic.

How Does CVE-2020-28407 Actually Work?

Step one: attacker lurks with write access to /tmp. swtpm spins up, crafts TMP2-00.permall or kin. Before it writes, symlink that name to your target—say, /root/.ssh/id_rsa.

Race won. swtpm scribbles permissions or state. Your root key? Now world-readable. Or wiped. Or filled with garbage.

Short sentences for drama. It’s trivial. Predictable filenames seal the deal. No crypto. No exploits. Just unix 101 abuse.

And get this sprawling truth: in a world where containers nest VMs, and orchestration tools like Kubernetes fling pods with shared volumes, that “local” boundary blurs faster than a politician’s promise—turning a CVSS 5.5 into real headache when chained with container escapes or weak RBAC, which, let’s face it, plagues half the clusters out there.

Is Your Setup Vulnerable to This swtpm Nonsense?

Check your version. swtpm –version. Below 0.4.2? Or 0.5.x pre-0.5.1? You’re toast.

QEMU guests. Proxmox. OpenStack. Anywhere swtpm hums. Even Fedora, Ubuntu repos lagged months post-patch.

But wait—it’s 2024. Who runs ancient swtpm? Container images do. Docker Hub’s littered with unpatched layers. Devs yank old tags, but mirrors linger. Your CI/CD pipeline? Probably slurping vuln’d swtpm right now.

Dry humor alert: it’s like finding lead paint in a “renovated” apartment. Surprise!

Unique twist nobody mentions: cloud providers like AWS Nitro or GCP Confidential VMs sidestep software TPMs with hardware, but hybrid shops mixing on-prem virt with cloud? They’re symlink bait. Prediction: we’ll see exploit chains in ransomware kits by summer, targeting air-gapped test labs first.

Why Ignore a ‘Fixed’ CVE? Because Stupidity Persists

NVD says “modified.” Enrichment done. Yawn.

Reality bites harder. swtpm’s niche, but critical. TPMs underpin everything from BitLocker to secure boot in VMs. Flub this, and your attestation chain snaps—goodbye, zero-trust dreams.

Corporate spin? None here—it’s FOSS. But distro maintainers? Sloppy. Red Hat patched quick; Debian dawdled. Blame game forever.

One-paragraph rant: look, if you’re still on unpatched swtpm, you’re not skeptical—you’re suicidal; this isn’t rocket science, it’s file perms 101, yet here we are, four years later, with GitHub issues piling on forks that never updated, because “it works on my machine” trumps security every time.

Patch. Now. Or enjoy the overwrite party.


🧬 Related Insights

Frequently Asked Questions

What is CVE-2020-28407?

It’s a symlink vulnerability in older swtpm versions letting locals overwrite files via temp file races.

Does swtpm CVE-2020-28407 affect modern VMs?

Yes, if you’re on unpatched versions in containers or legacy setups—update to 0.5.1+ or 0.4.2+.

How to fix CVE-2020-28407 in swtpm?

Upgrade swtpm, use secure tmp dirs like systemd’s RuntimeDirectory, and audit /tmp perms.

James Kowalski
Written by

Investigative tech reporter focused on AI ethics, regulation, and societal impact.

Frequently asked questions

What is CVE-2020-28407?
It's a symlink vulnerability in older swtpm versions letting locals overwrite files via temp file races.
Does swtpm CVE-2020-28407 affect modern VMs?
Yes, if you're on unpatched versions in containers or legacy setups—update to 0.5.1+ or 0.4.2+.
How to fix CVE-2020-28407 in swtpm?
Upgrade swtpm, use secure tmp dirs like systemd's RuntimeDirectory, and audit /tmp perms.

Worth sharing?

Get the best AI stories of the week in your inbox — no noise, no spam.

Originally reported by NVD Vulnerabilities

Stay in the loop

The week's most important stories from theAIcatchup, delivered once a week.