Detecting Ladder Logic Bombs in IEC 61131-3 PLC Programs using ESBMC-PLC+: A Formal Verification Approach with Trigger Synthesis

2026-07-12

Authors: Pierre Dantas, Lucas Cordeiro, Waldir Junior

ArXiv: 2607.08417v1

PDF: Download PDF

Imagine a factory floor: conveyor belts, robotic arms, chemical mixers. Behind the scenes, small industrial computers called Programmable Logic Controllers (PLCs) run the show. They read sensors, flip switches, and keep everything running safely. Now imagine someone slips a hidden piece of malicious code into one of those controllers — code that sits quietly for months, then suddenly, at 3 AM on a Tuesday, spins a motor to twice its safe speed or falsely reports that a pressure tank is empty when it's about to burst. That's a Ladder Logic Bomb (LLB), and it's basically Stuxnet's little cousin.

The problem: existing tools that try to prove PLC programs are safe have a blind spot. PLC code is often organized into reusable "function blocks" — small subroutines, like functions in any other programming language. The verifiers that check for malicious behavior have historically thrown away the guts of those function blocks when converting the program into their internal representation. So if you hide your bomb inside a function block, the verifier literally can't see it. Attackers know this.

The authors built ESBMC-LLB, a tool that fixes this by keeping function-block bodies intact during analysis. But detection is only half the job. The really clever part is trigger synthesis: once the tool suspects malicious logic, it doesn't just say "something's fishy in here." It actually works backward through the code to compute the exact conditions — the specific combination of sensor values, timer states, and inputs — that would wake the bomb up. So operators get a concrete witness: "if temperature = X and valve 3 is open for Y seconds, this code will fire the payload."

Under the hood, the tool leans on bounded model checking, which is a technique that unrolls a program's execution over a finite number of steps and asks a solver whether any bad state is reachable. It's the same mathematical machinery used to verify aerospace and safety-critical software, now aimed at ICS security.

Why this is a big deal: real-world industrial malware — the stuff that trips power grids and damages centrifuges — often hides in exactly the code structures this tool now covers. Making trigger conditions explicit means defenders can add runtime detection rules, forensic analysts can reconstruct what an attacker planned, and auditors can catch bombs before deployment rather than after an incident.

Why it matters: This closes a long-standing blind spot in PLC verification and gives ICS defenders a concrete way to find and characterize sabotage logic before it's ever triggered in the field.

All newsletters