Phantom of the Masquerade: Graph Neural Network-Based Detection of Masquerade Attacks in Controller Area Networks

Nehal Ameen, Pablo Moriano, Irfan AhmedarXiv 2026 · arXiv

TL;DR

PhantoMasq is a new deep-learning framework that uses Graph Neural Networks (GNNs) to detect stealthy "masquerade" attacks in vehicle communication networks. By representing message sequences as graphs enriched with lightweight signal statistics, it achieves near-perfect detection for many attack types while maintaining the low latency required for real-time automotive security.

What Problem Does This Paper Address?

Modern vehicles rely on the Controller Area Network (CAN) protocol for communication between various Electronic Control Units (ECUs)—the "computers" that control everything from your brakes to your infotainment. Designed in the early 1980s, CAN lacks built-in security features like encryption or authentication.

This makes vehicles vulnerable to masquerade attacks. In these scenarios, an attacker compromises one ECU, silences it, and then sends malicious messages using that ECU's identity. Because these messages use valid IDs and mimic legitimate timing patterns, they are incredibly difficult for traditional intrusion detection systems (IDS) to catch. Previous attempts at graph-based detection often separated the "learning" of the graph structure from the "classification" of the attack, which limits their ability to spot subtle deviations in the actual data signals.

Methods

The authors propose PhantoMasq, a four-stage pipeline that treats intrusion detection as a graph-level classification problem.

  1. Graph Creation: CAN traffic is partitioned into sliding windows. Each window is transformed into a Message Sequence Graph (MSG), where nodes represent unique Message IDs and directed edges represent the sequential flow of messages.
  2. Graph Annotation: This is a key innovation. The system decodes the raw binary data in the messages into real-valued signals (like vehicle speed or engine temp). It then calculates simple statistics—mean and standard deviation—for these signals and attaches them as attributes to the nodes in the graph.
  3. Model Training: The annotated graphs are fed into a two-layer Graph Convolutional Network (GCN). Unlike previous methods, this allows the model to jointly learn the structural relationships (who is talking to whom) and the temporal signal behavior (what they are saying) in an end-to-end fashion.
  4. Model Evaluation: The GCN outputs a prediction for each graph window: benign or malicious.
Fig. 1. Overview of the PhantoMasq four-stage pipeline for graph-level CAN intrusion detection.

Datasets

The researchers evaluated PhantoMasq using the ROAD (Real ORNL Automotive Dynamometer) dataset. This is a publicly available benchmark containing over 3.5 hours of real-world CAN traffic, including both normal driving and various simulated masquerade attacks.

Crucially, the authors employed a rigorous evaluation protocol that ensures training and testing data do not overlap within the same time window, a common source of "data leakage" that can lead to over-optimistic results in other studies.

Key Insights and Ideas

  • The Power of Joint Learning: By using a GCN, PhantoMasq doesn't just look at message IDs or signal values in isolation. It learns how a change in a signal (e.g., a sudden spike in reported wheel speed) correlates with the overall communication structure of the network.
  • Lightweight Features are Sufficient: You don't need computationally expensive deep learning for feature extraction. Simple statistics (mean and variance) of decoded signals, when placed in a graph context, provide enough information to distinguish between legitimate traffic and sophisticated mimics.
  • Contextual Difficulty: The paper highlights that detection difficulty is highly dependent on the "traffic share" of the targeted ID. Attacks on high-frequency messages (like those sent at 100 Hz) are caught almost instantly, whereas attacks on infrequent messages (10 Hz) require longer observation windows to become statistically visible.

Key Results

  • High Accuracy: PhantoMasq achieved a mean AUC-ROC between 0.831 and 0.999 across five different masquerade attack types.
  • Superior Performance: When compared to a state-of-the-art graph-embedding baseline, PhantoMasq improved the AUC-ROC by 0.13 to 0.36, showing that end-to-end GNN learning is significantly more robust than shallow embedding methods.
  • Real-Time Ready: The system is highly efficient. Processing a single window takes between 2.33 and 5.94 ms on a standard CPU. This translates to a throughput of up to 429 windows per second, which is more than enough to keep pace with the high-speed data flow of a real vehicle's CAN bus.
Fig. 2. Parsing CAN messages to extract ID, time stamps, and signal data, then sliding window partitioning to determine the number of nodes in each graph (graph construction). Annotating with node and edge attributes (graph annotation).

Limitations and Future Work

While promising, the authors note several areas for further research:

  • Generalization: The model was tested on a single vehicle dataset. Future work needs to verify if a model trained on one car model can generalize to others without extensive retraining.
  • Signal Dependency: The method relies on "DBC files" to decode signals. If an attacker uses undocumented IDs or if the decoding map is unavailable, the system's effectiveness might decrease.
  • Embedded Hardware: While CPU performance was good, the next step is validating PhantoMasq on the actual low-power embedded processors found inside vehicles.
  • Stealthier Adversaries: The study assumes the attacker cannot perfectly replicate the joint statistical dependencies of the network. A "perfect" mimicry attack remains a theoretical challenge.

Summary updated

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.
BibTeX
@misc{ameen2026phantom,
  author = {Nehal Ameen and Pablo Moriano and Irfan Ahmed},
  title = {{Phantom of the Masquerade: Graph Neural Network-Based Detection of Masquerade Attacks in Controller Area Networks}},
  year = {2026},
  eprint = {2611.26094},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.26094},
}
Figure