Telling Cyber-Attack from Rust in Legacy Control Systems

When a water-treatment controller's tank levels start drifting, the operator faces a question that today's anomaly detectors cannot answer: is someone injecting commands into the unauthenticated PLC, or is a valve simply wearing out? Legacy industrial controllers — the programmable logic computers that run pumps, valves, and substations — were designed decades ago under the assumption that whoever could physically reach the wire was trustworthy. Now roughly 520,000 of them are reachable from the public internet, and tools like ICS-ARC can automatically decompile their logic and write malicious payloads back into memory, holding physical variables in subtly destabilized states without ever tripping an alarm limit. Meanwhile, the detectors built to watch these systems — variational autoencoders, graph neural networks, one-class SVMs — flag statistical deviations in sensor streams but, as their own authors concede, cannot tell a malicious intrusion from a failing sensor or a fouling pipe. Every flag forces the operator into an expensive choice between ignoring a possible attack and shutting down a plant that must run 99.999% of the time.

The core insight this proposal builds on comes from the other direction in the file: experimental validation. Engineers who calibrate simulations against instrumented physical testbeds have spent decades learning how real degradation behaves — valve hysteresis and bonding-adhesive delays in a piezoelectric pump, wall-thickness imperfections in cryogenic hoses, micro-cracking in bridge piers. Degradation is physically consistent: it shifts calibrated parameters smoothly while the conservation laws still close. A cyber-attack is different in a specific, detectable way. A spoofed sensor reading or a rewritten control law creates a signal that violates the plant's own dynamics — a tank level cannot jump discontinuously, and an actuator command that the physics says was never issued leaves a signature in the momentum balance. That structural difference between "consistent but drifting" and "inconsistent with any physical parameters" is, to my knowledge, unexploited, because the security literature validates detectors only on attack logs and the validation literature calibrates models only against benign aging. Nobody has put a physics-calibrated twin and a live PLC exploit in the same room.

Core Claim

If we calibrate a physics-based digital twin of a legacy-controlled plant against deliberately induced benign degradation on a physical testbed, then the twin's residuals decompose into two qualitatively different failure signatures: cyber-induced anomalies produce command–physics inconsistencies that no parameter setting can explain, while degradation produces smooth, explainable parameter drift. This decomposition yields not just detection but attribution — the missing capability that A Lightweight Unsupervised Intrusion Detection Model Based on Variational Auto-Encoder (F1 84.81% on the SWaT water-treatment benchmark) explicitly lists as open future work — and it should hold even for zero-day attacks, because it relies on physical laws rather than learned attack patterns.

Formally, let $y_t$ be measured sensor values, $u_t$ the actuator commands observed on the wire, and $f(\theta, u)$ the calibrated physical model with parameters $\theta$ (valve coefficients, pipe roughness, tank geometry). We track two quantities: the physics residual $r_t = y_t - f(\hat\theta_t, u_t)$ after online parameter re-estimation, and the parameter drift $\Delta\theta_t = \hat\theta_t - \hat\theta_{t-k}$. The attribution rule is: large $r_t$ with bounded $\Delta\theta_t$ implies an inconsistency no physical parameters can absorb (spoofed measurements or uncommanded actuation — cyber); bounded $r_t$ with sustained directional $\Delta\theta_t$ implies the physics still closes but the plant is changing (degradation). This is the same logic the structural-validation community already uses when reconciling finite-element predictions with accelerometer and strain-gage measurements — Estimation of vehicle-induced bridge dynamic responses using fiber Bragg grating strain gages matched predicted and measured modal frequencies to within 3.63% by adjusting the model until residuals were explained — turned into a security discriminator.

Research Program

Three components. First, a physical testbed: a scaled water-storage and distribution stage controlled by a genuine legacy PLC (Siemens S7-300 or Schneider Modicon M221, both documented in the file as exploitable), instrumented with independent flow, level, and pressure sensors, and mirrored by a hydraulic twin whose calibration follows established experimental-validation practice — the same paradigm as the PZT pump study, where CFD predictions were matched against laser displacement sensing and weighed flow rates until theory and experiment agreed to within a few percent (Design and Experimental Verification of a PZT Pump with Streamlined Flow Tubes). Crucially, we will validate the twin against induced degradations — progressive orifice fouling to mimic pipe scaling, added spring resistance to mimic valve stiction, injected sensor bias — so that the "consistent drift" signature is empirically characterized, not assumed. Second, an attack harness: replay of ICS-ARC-style logic rewrites and camouflaged Modbus setpoint injections modeled on Defeat Magic with Magic, plus telemetry-spoofing attacks, executed live against the PLC. Third, the attribution monitor itself: a lightweight joint estimator that runs the twin forward, re-estimates $\theta$ online, and applies the residual/drift rule above — designed for edge deployment, heeding the compute-ceiling warnings in Smart Grid: Cyber Attacks, Critical Defense Approaches, and Digital Twin.

This is deliberately different from the closest existing work. Machine Learning-Based Digital Twin for Water Distribution Network Anomaly Detection and Localization built a data-driven twin on a real pipe network and localized accidental leaks with up to 100% accuracy at full sensor coverage — but it tested no cyber-attacks and noted that compromised telemetry would defeat it. We replace its learned regression with a calibrated physical model precisely because physical laws are the one thing an attacker cannot spoof away, and we add the cyber dimension entirely absent there. Defending Water Treatment Networks and the SWaT DNN-LSTM study (Anomaly Detection for a Water Treatment System Using Unsupervised Machine Learning) detect but do not attribute, and both evaluate offline on archived logs. On the "Twin's Vulnerability Paradox" raised by the smart-grid survey — that a synchronized twin becomes an attacker's blueprint — we note that our twin is a read-only monitor consuming the same telemetry the PLC sees; an attacker who spoofs the telemetry consistently to both must still violate hydraulic inertia, which the residual rule catches.

Baselines

The do-nothing reference point is the static high/low threshold alarm already standard in SCADA systems. The file gives direct evidence it fails here: Avocado: An Interpretable Fine-Grained Intrusion Detection Model for Advanced Industrial Control Network Attacks documents attacks fragmented into minute perturbations within nominal operating bands, and the ICS-ARC tool (Defeat Magic with Magic) was explicitly designed to hold variables in destabilized states without tripping binary limit switches. On our testbed we will implement equivalent limit alarms and report their detection rate and false-alarm behavior as the floor.

The strongest existing competitor on the attribution question is A Lightweight Unsupervised Intrusion Detection Model Based on Variational Auto-Encoder (LVA-SP), which reports an F1-score of 84.81% on the SWaT dataset — the best SWaT figure in the file — and whose authors state that differentiating malicious intrusions from sensor failures and other non-malicious events is open future work. That is exactly the capability we claim, so it is the right head-to-head. We will reproduce LVA-SP on identical data splits (SWaT's 7 normal training days, 4 attack days) with the same tuning budget in parameter sweeps, and then run both systems on our physical testbed's mixed scenarios. Beating it means two things: comparable-or-better detection F1 on SWaT, and materially better attribution accuracy — LVA-SP outputs a binary anomaly flag, so on a three-way discrimination task (cyber / degradation / both) it performs at chance unless retrained per cause, which we will also try to give it its best shot. We will additionally run the spatio-temporal detector of Defending Water Treatment Networks (reported 91.65% accuracy, F1 82.78% on SWaT) and, on the network side, a byte-level detector in the spirit of Avocado (reported F1 96.9% on CLIA-M221) to show that packet-level detection, however accurate, still yields no physical attribution. The DNN-LSTM of the SWaT unsupervised study (F-measure 0.802, but "roughly two weeks to train on a GPU cluster") is included only as a reference point; its training cost is not a fair comparison and the file itself flags it as operationally infeasible.

The key ablation removes the physics: an otherwise identical pipeline in which the calibrated hydraulic model $f(\theta, \cdot)$ is replaced by a black-box sequence predictor trained on normal operation, with the same residual/drift logic applied to its outputs. If attribution accuracy collapses to the black-box detector's level, the experimental-validation ingredient — physical calibration against instrumented degradation — is what carries the result. If it does not collapse, the honest conclusion is that the win comes from the residual decomposition, not the physics, and the proposal should be read accordingly.

Why not just…?

Why not just air-gap the controllers or add encryption? The file's own evidence rules this out as a general fix. Industry 4.0 telemetry and digital-twin synchronization have already eroded the air gap (Leveraging Digital Twins for Enhanced PLC Performance and Maintenance in Industrial Automation), about 520,000 PLCs are currently internet-facing (Defeat Magic with Magic), and legacy firmware cannot take modern patches without downtime that costs millions (Vulnerabilities of Legacy Industrial Protocols). More fundamentally, encryption authenticates the channel, not the command: a validly encrypted instruction to hold a valve shut is still executed under the implicit-trust flaw documented by Gidlund et al.. Encryption and isolation are worth deploying, but they leave the residual risk this proposal targets.

Why not just improve the data-driven detector? This is the real threat, and it gets a genuine experiment rather than an argument. The file's evidence says pure statistics hit a ceiling: the SWaT one-class SVM raised false alarms during normal operational transitions, Defending Water Treatment Networks needed to bolt on physics-derivative features to reach its 82.78% F1, and LVA-SP's authors state that cause discrimination is unsolved. But a defender could reply that with enough training data covering degradation and attack, a learned model might discriminate too. We will test this directly by giving the ablation baseline exactly that data — labeled degradation and attack episodes from our testbed — and comparing its three-way attribution accuracy against ours on held-out attack types it never saw. Our claim survives only if the physics-based attribution generalizes to unseen attacks where the learned discriminator does not; if it does generalize equally well, the data-driven route wins on simplicity and we should say so.

Why not just use static threshold alarms on physical limits? The evidence against this is concrete: attacks in the corpus are built to stay inside nominal bands (Avocado), ICS-ARC exploits persistent subtle destabilization rather than limit violations, and in multi-stage plants like SWaT an upstream attack produces delayed downstream impacts that per-sensor thresholds miss until damage is done (Defending Water Treatment Networks). We will nonetheless run threshold alarms on the testbed so the comparison is empirical, not rhetorical.

Why not just simulate everything in software (OpenPLC, Simulink) instead of building a physical testbed? Because the attribution rule depends on real non-idealities. The validation literature shows that idealized models miss exactly the effects that matter here — adhesive-bonding volume changes shifted the PZT pump's measured resonant frequency away from theory (Design and Experimental Verification of a PZT Pump), and manufacturing wall-thickness variations dominated cryogenic hose buckling (Mechanism of Mechanical Analysis on Torsional Buckling of U-Shaped Bellows in FLNG Cryogenic Hoses). The ICS-ARC authors themselves found that emulator results did not substitute for the physical Siemens S7-300 testbed, where fluid inertia and actuator timing produced behaviors simulation missed (Defeat Magic with Magic). A simulated degradation signature would bias the whole calibration, so the physical testbed is load-bearing, not decorative.

Proposed Experiments and Decisive Checks

Experiment 1 (retrospective, SWaT benchmark): train the twin's data-side on the 7 normal days, evaluate on the 4 attack days (36 scenarios), and compare detection F1 against our reproduced LVA-SP (reported 84.81%) and STDO (reported 82.78%), under matched tuning budgets. SWaT contains no labeled degradation episodes, so this experiment establishes detection parity only; attribution claims must come from the testbed. Experiment 2 (physical, the decisive one): on the PLC-controlled water stage, run four scenario families — induced benign degradation, camouflaged setpoint injection within nominal bands, ICS-ARC-style logic rewrite, and spoofed telemetry — plus the hardest case, attack launched during ongoing degradation. Report a three-way attribution confusion matrix, detection F1, time-to-detect, and false-alarm rate during sharp normal transitions (the documented failure mode of the SWaT one-class SVM). The decisive check is the mixed scenario: attribution accuracy materially above what any binary detector plus chance can achieve there, with detection at least matching LVA-SP's SWaT F1 of 84.81% on comparable scenarios. Experiment 3 (robustness): reduce the sensor count following the finding from the IISc pipe network that three spatially scattered sensors preserved over 70% localization accuracy where clustered ones did not (Machine Learning-Based Digital Twin for Water Distribution Network Anomaly Detection and Localization), and measure how attribution degrades — connecting to the Chulitna bridge result that a poorly placed strain gage was blind to an entire vibration mode (Estimation of vehicle-induced bridge dynamic responses). If attribution survives at three well-placed sensors, the method is deployable on real sparse legacy plants; if it collapses, that boundary is itself a useful, publishable result.