← Lab /Security & privacy

Smartphone magnetometer reveals train riding and co-location of passengers

Smartphone magnetometer data can determine if a user is on an electric train and infer other passengers sharing the same train

Security & privacy arXiv 13 Nov 2026 Attack Prototype evidence Threat model

Published as “On the Same Track: Privacy Leaks in Electric Rail Transport via Magnetic Fields”

Why it matters

The results suggest that mobile OSes should require explicit user permission for magnetometer access to prevent covert tracking of rail passengers.

Summary

The authors show that a smartphone magnetometer can reveal whether a user is on an electric train and whether two users share the same carriage, achieving a Matthews correlation coefficient of 0.93 (F1: 0.98) for transport-mode detection and 0.79 (F1: 0.89) for colocation inference. They collected 217 train rides (482.6 h of recordings) across long-distance and regional services and evaluated a simple DFT-based frequency detector and a CNN-based colocation classifier. The evidence is strong: the reported MCC scores are based on a real-world dataset and compared against many prior TMD baselines. However, the attacks only work on AC-powered trains and performance degrades for longer recording windows, requiring majority-vote aggregation.

What they found 2

  1. Transport-mode detection achieves MCC 0.93 (F1 0.98) with majority voting.

    “we achieve a Matthews correlation coefficient (MCC) score of 0.93 (F1: 0.98)”

  2. Colocation inference achieves MCC 0.79 (F1 0.89).

    “we achieve an MCC score of 0.79 (F1: 0.89) using a learning-based approach”

Caveats 4

  • Performance drops for longer post-departure windows; using all data reduces MCC compared to the first 300 s (Table 5).
  • The attacks only apply to electric trains with AC traction (16.7 Hz) and not to diesel or DC-powered lines.
  • Both attacks apply specifically to electric trains operating on alternating current (AC) and thus not to diesel routes or DC-powered subway lines.
  • Consequently, the trace hinders precise localization or the identification of a particular train line.

What’s new here 4

  • Uses only the magnetometer (no accelerometer or GPS) to detect electric-train rides via the 16.7 Hz power-line frequency.
  • Introduces colocation inference by comparing magnetic-field traces between devices on the same train.
  • Applies a lightweight DFT-based detector that matches or exceeds multi-sensor TMD methods.
  • Provides a public dataset of 217 journeys with labeled inertial-sensor recordings for rail-privacy research.

Threat model stated by the source

Adversaryany party that can distribute or compromise a smartphone app
Capabilitycontinuous background access to magnetometer data without runtime permissions, ability to transmit recordings to a server
AssumesMagnetometer readings are not rate-limited beyond 100-200 Hz; Device clocks are sufficiently synchronized to align traces