The CAN bus
The CAN bus
The network almost every attack eventually travels over. How it works, why it is so reliable, and why that very reliability makes it a target.
A single wire for everyone
CAN stands for Controller Area Network. Bosch designed it in 1986 to link a car's electronic control units with a minimum of wiring. Before it, every function needed its own pair of wires; CAN replaces all of that with a single shared twisted pair, CAN-H and CAN-L, over which every ECU both talks and listens.
Transmission is differential: the information is not an absolute voltage but the difference between the two wires. Electromagnetic noise from the engine hits both conductors the same way and cancels out. The typical bitrate is 500 kbit/s for high-speed CAN and 125 kbit/s for comfort functions, with a 120 ohms termination resistor at each end.
CAN is multi-master and address-free. There is no sender and no recipient: each frame carries an identifier that describes its content (for example "engine RPM"), not a machine. Every ECU decides on its own which identifiers matter to it and ignores the rest.
Anatomy of a frame
A standard data frame comes down to a handful of fields. For an attacker, two of them carry the weight: the identifier, which sets priority and meaning, and the data, up to eight bytes.
SOF | IDENTIFIER 11 bits | RTR | IDE r0 | DLC | DATA 0-8 B | CRC | ACK | EOF
1 | 0x0C4 | 0 | | 8 | 3F 00 ... 00 | | |
- SOF: a dominant bit that announces the start of frame and synchronises everyone.
- Identifier (11 or 29 bits): describes the content and drives arbitration. The lower it is, the higher the frame's priority.
- RTR: tells a request apart from an actual data transmission.
- DLC: the number of data bytes that follow, from 0 to 8.
- Data: the payload, up to 8 bytes (64 with CAN-FD).
- CRC: an integrity check computed over the frame.
- ACK: every node that received the frame correctly drives a dominant bit, so the transmitter knows someone read it.
- EOF: the end of frame.
Decoding a frame, in practice
Reading the bus is good; understanding what a frame means is better. Decoding is going from raw bytes to a physical quantity: a speed, an RPM, the state of a lock. Take a speed frame as you see it on the ICSim simulator.
vcan0 244 [8] 00 00 2E E0 00 00 00 00
- The identifier 0x244 names the frame: on this simulator, it is the speed.
- The useful bytes are the two in the middle, at positions 3 and 4: 0x2E and 0xE0.
- Read big-endian (the most significant byte first), they form 0x2EE0, that is 12000.
- Apply the signal's scale factor, here 0.01: 12000 x 0.01 = 120. The car is doing 120 km/h.
All of reverse engineering comes down to this loop: spot the identifier that moves when you act, isolate the bytes involved, then find the endianness, factor and offset that yield a sensible value. The decoder on this site lets you tweak these settings live.
Who speaks first: arbitration
Two ECUs may want to transmit at the same time. CAN resolves the collision without destroying it. A dominant bit (0) electrically overrides a recessive bit (1). Each transmitter reads back the bus while it writes its identifier: the moment it drives a recessive bit while another forces a dominant one, it realises a higher-priority frame is in progress and goes silent at once.
The result: the lowest identifier wins, bit by bit, with no collision and no retransmission. Priority is deterministic. That is why critical messages (braking, steering, airbags) are given the lowest identifiers: they always go first, even on a busy bus.
What makes it an excellent network
- Robust: the differential pair shrugs off a hostile electrical environment.
- Cheap: two wires connect dozens of ECUs.
- Deterministic: priority-based arbitration guarantees real-time behaviour for vital functions.
- Multi-master: no conductor, and therefore no single point of failure.
- Self-checking: CRC, acknowledgement and error counters are built into the protocol.
- Fault-tolerant: a node that piles up errors takes itself offline (bus-off) so it does not pollute the network.
Its weaknesses, seen by an attacker
Everything that makes it strong on reliability turns against it on security: CAN was never designed for an adversary already sitting on the bus.
- No authentication: any node can emit any identifier. Nothing proves where a frame came from.
- No encryption: traffic is in the clear, so sniffing is immediate.
- Full broadcast: every message reaches everyone, so confidentiality does not exist.
- No concept of source: a genuine frame cannot be told apart from a forged one; spoofing is undetectable at the protocol level.
- Hijackable arbitration: endlessly sending identifier 0 saturates the bus (denial of service); forcing a target node's errors pushes it into bus-off and silences it.
- Implicit trust: without a filtering gateway, an exposed entry point (infotainment, OBD) grants access to the critical domains.
From weakness to attack
These properties translate directly into families of techniques. Each one exploits a specific gap in the protocol.
The missing property
- No confidentiality
- No origin integrity check
- No authentication
- Priority-based arbitration
The technique it opens up
- Passive reading (sniffing) and reverse engineering of identifiers
- Replaying a capture verbatim
- Injection and spoofing of forged frames, fuzzing
- Denial of service through saturation or forced bus-off
Each of these families is detailed, with tools and real-world cases, in the attack explorer.
How it gets hardened
You do not rewrite CAN: you add layers on top. SecOC authenticates each message with a message authentication code and a freshness counter, which closes off spoofing and replay. The central gateway segments the domains and filters what crosses from infotainment toward braking. A CAN IDS learns normal traffic and flags the abnormal. Finally, recent functions are migrating to CAN-FD and automotive Ethernet.
None of these countermeasures actually encrypts the bus, and that is the point to remember: denial of service by saturating the arbitration remains very hard to prevent. Defence targets authenticity and partitioning first, not secrecy.
Frequently asked questions
- Is the CAN bus encrypted?
- No. Traffic flows in the clear: any node present on the bus reads everything. It was a design choice from the start, driven by real-time constraints and cost. Recent countermeasures authenticate messages (SecOC) without encrypting them.
- How fast does the CAN bus run?
- 500 kbit/s for high-speed CAN (engine, chassis), 125 kbit/s for comfort functions. CAN-FD raises the data phase to several Mbit/s.
- What is the difference between CAN and CAN-FD?
- CAN-FD (Flexible Data rate) keeps the same principle but carries up to 64 bytes per frame instead of 8, and speeds up data transmission. It is gradually replacing classic CAN.
- Can the CAN bus be secured?
- You do not rewrite it, you add layers: SecOC for authenticity and anti-replay, a gateway that segments the domains, an IDS that spots the abnormal. Denial of service by saturation, though, remains hard to prevent.
- Can I analyse the CAN bus of my own car?
- Yes, on your own vehicle: an OBD-II port and a USB-CAN adapter are enough to listen. Still, start in a simulator (vcan and ICSim), with no risk at all. Never touch the bus of a third-party vehicle or one in traffic.