Phantom of the Masquerade: Graph Neural Network-Based Detection of Masquerade Attacks in Controller Area Networks
Organizations: Department of Computer Science, Virginia Commonwealth University, Richmond, VA 23284, USA · Computer Science and Mathematics Division, Oak Ridge National Laboratory, Oak Ridge, TN 37830, USA
Abstract
The lack of built-in security in controller area networks (CANs) exposes modern vehicles and industrial systems to masquerade attacks that can compromise safety and reliability. These attacks inject malicious messages that mimic legitimate communication patterns, making them difficult to detect using existing intrusion detection systems (IDS). Prior graph-based IDS approaches often rely on shallow embeddings that decouple representation learning from classification, which may limit their ability to fully exploit structural and signal-level information. In this paper, we propose PhantoMasq, a graph neural network (GNN)-based framework for detecting masquerade attacks in CAN systems. PhantoMasq models CAN traffic as message sequence graphs enriched with lightweight statistical features derived from signal behavior, enabling joint learning of structural dependencies and temporal characteristics. The detection task is formulated as a graph-level classification problem and solved using graph convolutional networks (GCNs). We evaluate PhantoMasq on the ROAD dataset under a protocol that prevents overlapping windows from spanning training and test data. Across five masquerade attack types, PhantoMasq achieves mean AUC-ROC between 0.831 and 0.999, with performance depending on the transmission rate of the targeted identifier and the magnitude of the induced signal deviation. Against a state-of-the-art graph-embedding baseline evaluated on the same sliding-window configurations, PhantoMasq achieves higher AUC-ROC on all five attack types, by 0.13 to 0.36, and is less sensitive to window configuration. Window-processing latency ranges from 2.33 to 5.94 ms per window on CPU, corresponding to a throughput of 168 to 429 windows per second. We make our implementation and experimental artifacts available to support reproducibility.
Figures & tables
| Reference | Problem Setting | Model | Dataset(s) | Metrics | Code/Data |
| Zhang et al. (2023) [ 35 ] | Graph-level anomaly + classification | Federated GNN | Ford Transit, HCRL | Accuracy, Recall, F1, latency | ✗ |
| Yang et al. (2024) [ 17 ] | Node + graph anomaly detection | ASTGCN | Survival Dataset, Car Hacking | Accuracy, Precision, Recall, F1 | ✗ |
| He et al. (2024) [ 21 ] | Graph-level detection | A&D-GNN | OTIDS | Precision, Recall, F1 | ✗ |
| El-Dawy et al. (2024) [ 22 ] | Graph-level detection | GCN + GAT | OTIDS | Accuracy, latency | ✗ |
| Wang et al. (2025) [ 36 ] | Node-level detection | TGAT | Car Hacking | Accuracy, F1, AUC | ✗ |
| Gao et al. (2025) [ 37 ] | Node + graph detection | Graph Transformer | Car Hacking, Car-Injection (self-collected) | Precision, Recall, F1 | ✗ |
| Attack | ID | Rate | Share | Manipulated signal |
| Correlated signal | 0x6E0 | 100 Hz | 4.46% | Wheel speeds (2-byte, 4) |
| Max speedometer | 0xD0 | 100 Hz | 4.42% | Speedometer (1-byte 0xFF) |
| Max engine coolant | 0x4E7 | 10 Hz | 0.45% | Coolant temp. (1-byte 0xFF) |
| Reverse lights off | 0xD0 | 100 Hz | 4.46% | Reverse lights (1-bit) |
| Reverse lights on | 0xD0 | 100 Hz | 4.46% | Reverse lights (1-bit) |
| Attack Type | AUC-ROC | AUC-PR | Prevalence | Model-Side TTW (ms) | Window-processing TTW (ms) | Throughput (windows/sec) | ||
| Correlated_Signal | 250 | 100 | 1.000 | 1.000 | 0.244 | 0.218 | 4.64 | 216 |
| Max_Speedometer | 150 | 50 | 0.999 | 0.997 | 0.310 | 0.189 | 3.95 | 253 |
| Max_Engine_Coolant | 400 | 150 | 0.889 | 0.299 | 0.053 | 0.255 | 5.06 | 198 |
| Reverse_Lights_Off | 50 | 50 | 0.949 | 0.794 | 0.196 | 0.165 | 2.44 | 410 |
| Reverse_Lights_On | 250 | 100 | 0.936 | 0.808 | 0.237 | 0.182 | 4.86 | 206 |
| Attack Type | Mean | Standard Deviation | Median | Minimum | Maximum |
| Correlated_Signal | 4.63 | 0.67 | 4.89 | 2.33 | 5.43 |
| Max_Speedometer | 4.80 | 0.67 | 5.03 | 2.48 | 5.94 |
| Max_Engine_Coolant | 4.63 | 0.67 | 4.87 | 2.47 | 5.29 |
| Reverse_Lights_Off | 4.62 | 0.64 | 4.86 | 2.38 | 5.47 |
| Reverse_Lights_On | 4.70 | 0.64 | 4.94 | 2.51 | 5.27 |
| Attack Type | PhantoMasq AUC-ROC | Marfo et al. AUC-ROC ∗ | PhantoMasq TTW (ms) | Marfo et al. TTW (ms) † |
| Correlated_Signal | 0.994 - 1.000 | 0.6000 - 0.840 | 2.37 - 5.32 | 24.00 - 6840.00 |
| Max_Speedometer | 0.961 - 0.999 | 0.520 - 0.700 | 2.55 - 5.37 | 5.00 - 20820.00 |
| Max_Engine_Coolant | 0.727 - 0.889 | 0.240 - 0.970 | 2.47 - 5.29 | 237.00 - 4890.00 |
| Reverse_Lights_Off | 0.877 - 0.949 | 0.580 - 0.810 | 2.44 - 5.19 | 27.00 - 6220.00 |
| Reverse_Lights_On | 0.798 - 0.936 | 0.520 - 0.720 | 2.54 - 5.22 | 5.00 - 8530.00 |
| Overall Range | 0.727 - 1.000 | 0.240 - 0.970 | 2.37 - 5.37 | 5.00 - 20820.00 |
Network Intrusion Detection
Network intrusion detection identifies malicious or abnormal network activity to help protect computers, connected devices, and critical infrastructure.
See all 188 papers