CAN Firewall
Inline intrusion-prevention system for automotive CAN buses · accepted at IEEE ICTBIG 2026
- The question
- How do you reject malicious vehicle messages without missing a real-time deadline?
- My approach
- I paired a deterministic policy gate with an on-device anomaly detector, measured both on hardware against the time budget, and made the anomaly gate opt-in when the replays showed it cost more delivery than it added in blocking.
Behind the buildThe decisions, details & tradeoffs for CAN Firewall
My role
Lead developer · paper co-author
Built with
An inline, hardware-isolated Intrusion Prevention System for automotive CAN buses on an STM32F446RE. It sits between an untrusted segment and a protected one (engine, brakes, steering) and decides frame by frame what is allowed to cross, because classical CAN has no source authentication or replay protection.
Gate 1 is a deterministic policy engine: ID allowlist, direction, DLC, a per-ID bit-invariant payload mask, GCRA rate conformance and a flood-tier repeated-payload check. Gate 2 is an on-device Mahalanobis-distance anomaly detector over payload change and burst density, chosen after an Isolation Forest and two of four features were measured out.
Hardware replays of the processed HCRL captures showed that Gate 2 added little blocking and cost legitimate delivery, so Gate 1 is now the default and Gate 2 is opt-in. The work includes a Python/Kvaser measurement bench, a Flask + SocketIO attack-simulation dashboard, a native C++ benchmarking engine and a custom CAN carrier board. The paper was accepted for presentation at IEEE ICTBIG 2026.
What came out of it
- Gate 1 blocked all 654,896 RPM-spoof, 97.57% of gear-spoof and 6,679 of 6,681 fuzzing injections on complete processed replays
- 99.95% or more of legitimate frames delivered by Gate 1 across the benign and attack replays
- Largest observed two-gate cost: 2,557 cycles (14.2 µs), 7.1% of the 200 µs design budget
- Reported the limit openly: these gates cannot reliably stop a spoofer that matches a legitimate ID and cadence
- Paper accepted at IEEE ICTBIG 2026 (Indore, December 2026)