Skip to content
File upload Write-up Advanced

Finding vulnerabilities in Swiss Post’s future e-voting system - Part 1

The SDM's USB import operation copied every file from the supplied USB drive into the SDM directory without validating or whitelisting them, overwriting existing files including the platform's trusted CA. An attacker with a crafted USB drive could therefore bypass signature verification, overwrite key material and run arbitrary commands, fully compromising the SDM and the integrity of the election.

Ruben Santamarta Follow

Published on reversemode.com

January 18, 2022

Ruben Santamarta (@reversemode), on reversemode.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the import routine copied the whole USB folder with a replace-existing option and no file whitelist or path validation, so attacker-supplied files could overwrite trusted files such as the CA certificate.

Impact

An attacker could fully compromise the SDM and thereby compromise the integrity of the election process; the report notes Swiss Post considers the USB key and SDM a single trustworthy unit, which limits the accepted threat model.

What the attacker needed

Physical access to supply a crafted USB drive; staff run the SDM import operation

How it was found

  1. Supply a crafted USB mass storage device containing malicious files and a custom directory structure.
  2. Trigger the SDM import operation so the USB contents are copied into the SDM directory.
  3. The copied files overwrite existing files, including the trusted CA, bypassing later signature verification.
  4. Use the overwritten material or custom phase plugins to run arbitrary commands and compromise the SDM.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The Secure Data Manager (SDM) is a machine that moves election data between an offline computer and an online one using a USB stick. The import feature simply copied everything on the stick into its own folder, replacing files that were already there, so a booby-trapped stick could swap out trusted files and take over the machine. The report notes the USB stick was assumed to be trustworthy, which is why this was not caught earlier.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by Ruben Santamarta

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.