Detecting Ladder Logic Bombs in IEC 61131-3 PLC Programs using ESBMC-PLC+: A Formal Verification Approach with Trigger Synthesis
This paper presents ESBMC-LLB, a formal verification framework that extends ESBMC-PLC+ to detect Ladder Logic Bombs in IEC 61131-3 PLC programs by exposing hidden function-block logic and synthesizing triggers, achieving near-perfect detection rates and robustness against adaptive triggers on public datasets where existing methods fail.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine a Programmable Logic Controller (PLC) as the brain of a factory, constantly running a loop: it looks at sensors, makes a decision, moves a machine, and then starts all over again in a split second. Now, imagine a sneaky hacker hiding a "logic bomb" inside this brain. This bomb is like a sleeping dragon; it does nothing while the factory is running normally, but the moment a specific, hidden condition happens (like a counter hitting a certain number), it wakes up and causes chaos—either by freezing the machine, lying about sensor readings, or making a valve open when it should stay closed.
For a long time, the tools used to check these factory brains had a blind spot. They would look at the main code but ignore the "function blocks"—which are like little sub-routines or mini-programs inside the main code. The paper explains that the sleeping dragons (the bombs) were hiding inside these ignored function blocks. Because the old tools dropped these blocks from their view, the malicious code and the safe code looked exactly the same to the checker. It was like trying to find a spy in a crowd by only looking at the people's faces, while the spy was hiding inside a coat that the checker didn't even look at.
The Big Fix: Opening the Coat
The authors, Pierre Dantas, Lucas Cordeiro, and Waldir Junior, built a new method called ESBMC-LLB. Their main trick was simple but powerful: they made the checker look inside the function blocks. They added a "translation layer" that takes the hidden code inside these blocks and lays it out flat so the checker can see it.
Once the code is visible, they use two clever tricks to catch the bomb:
- The Stopwatch (Scan-Watchdog): If the bomb tries to freeze the machine by making the program run in an endless loop, the checker acts like a strict referee with a stopwatch. It says, "You have 100 steps to finish this task. If you go over, you're out!" If the bomb tries to loop forever, the checker catches it immediately.
- The Wire Tester (Output Wiring): If the bomb tries to lie about a sensor or force a machine to move, the checker connects the wires from the hidden code to the main system. If the hidden code tries to send a "lie" (like telling a valve to open when it shouldn't), the checker sees it break the safety rules.
The Magic Result: Finding the "Secret Code"
Here is the coolest part. When the checker finds a bomb, it doesn't just say "Error!" It actually spits out the exact trigger. It's like the checker saying, "I found the dragon, and here is the secret password that wakes it up: 'If the counter hits 12'." This is called "trigger synthesis."
How Well Did It Work?
The team tested their method on several sets of data, and the results were impressive, but with some important limits:
- The Public Test: On a famous dataset of 60 programs (30 safe, 30 with bombs), their method found all 30 of the bombs. It caught every single one and found the secret trigger for each. It also proved that the 29 safe programs were truly safe. One safe program was so complex the checker couldn't be 100% sure (it said "I don't know" instead of "Safe"), but it didn't falsely accuse it.
- The "Smart" Hacker Test: They tried to trick their system by hiding the trigger in math puzzles (like using a complex calculation instead of a simple number). Old tools that just look for patterns missed these tricks. ESBMC-LLB, however, understood the meaning of the math and caught all 5 of these tricky versions.
- The Big Scale Test: They generated 310 programs (155 safe, 155 with bombs) to test speed. The system caught 100% of the bombs in an average of 70 milliseconds (that's faster than a blink!).
- The Real-World Water Plant Test: They tested this on a real-world simulation of a water treatment plant (the SWaT corpus).
- On the older version of the data (with simple math triggers), they found 149 out of 150 bombs (99%) with zero false alarms.
- The Limit: When they tested a newer version with very complex, non-linear math (like multiplying a number by itself repeatedly), the system got stuck. The math was too hard for the checker to solve in time, and detection dropped to 49%. The paper is very clear here: their method is great for standard logic and simple math, but it hits a wall with complex, non-linear math. In those specific cases, a different type of tool (called a CFG-triage detector) is still better.
What They Don't Claim
The authors are very honest about what their tool can't do. They explicitly state that if a bomb is designed to finish its task quickly (without looping forever) and doesn't break any specific safety rule they told the checker to look for, the tool might miss it. It's not a magic wand that finds every possible bad thing; it finds the ones that either freeze the system or break the safety rules they defined.
The Bottom Line
This paper shows that by simply "opening the coat" to look inside the function blocks and using a smart checker that understands the meaning of the code, we can catch sneaky industrial bombs that used to hide in plain sight. It finds the bombs, tells us exactly how to trigger them (so we can stop it), and proves that the rest of the system is safe—unless the math gets too crazy, in which case we need a different kind of detective. The authors present this as a powerful new tool that works alongside existing methods, not one that replaces everything.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.