Gradient Inversion Attack on Graph Neural Networks

Divya Anand Sinha, Yezi Liu, Ruijie Du, Athina Markopoulou, Yanning Shen

Abstract

Graph federated learning is of essential importance for training over large graph datasets while protecting data privacy, where each client stores a subset of local graph data, while the server collects the local gradients and broadcasts only the aggregated gradients. Recent studies reveal that a malicious attacker can steal private image data from the gradient exchange of neural networks during federated learning. However, the vulnerability of graph data and graph neural networks under such attacks, i.e., reconstructing both node features and graph structure from gradients, remains largely underexplored. To answer this question, this paper studies the problem of whether private data can be reconstructed from leaked gradients in both node classification and graph classification tasks and proposes a novel attack named Graph Leakage from Gradients (GLG). Two widely used GNN frameworks are analyzed, namely GCN and GraphSAGE. The effects of different model settings on reconstruction are extensively discussed. Theoretical analysis and empirical validation demonstrate that, by leveraging the unique properties of graph data and GNNs, GLG achieves more accurate reconstruction of both nodal features and graph structure from gradients.

Introduction

Federated Learning (FL) is widely adopted for its promise of privacy-preserving model training, where raw data remains on local devices and only model gradients are shared with a central server. However, recent research into "gradient inversion" has demonstrated that shared gradients can inadvertently leak sensitive information, allowing attackers to reconstruct original images or text.

Graphs present a distinct and more complex challenge for privacy. Unlike grid-like pixel data, graph data is inherently "intertwined": node features ($X$) and the graph structure ($A$) are inextricably linked during the aggregation steps of a Graph Neural Network (GNN). Previous attempts to attack GNNs were limited, often failing to reconstruct the underlying structure or requiring significant prior knowledge, such as node degrees. This research introduces Graph Leakage from Gradients (GLG), a novel attack demonstrating that a curious server can indeed reconstruct both features and structure from leaked gradients alone.

Overview of the GLG attack model where a malicious server reconstructs private graph data from leaked gradients.

The GLG Attack Framework

GLG is an optimization-based attack that operates by generating "dummy" graph data and iteratively refining it. The attacker passes this dummy data through a local copy of the target GNN and updates it until the resulting gradients match the "real" gradients received from the client.

To navigate the complexities of graph data, GLG incorporates several key technical innovations:

  • Graph-Specific Regularization: The attack leverages Feature Smoothness—the observation that connected nodes in real-world graphs often share similar features—and a Frobenius Norm regularizer to encourage sparsity in the reconstructed adjacency matrix.
  • Analytical Foundations: The authors provide mathematical proofs showing that for architectures like GCN and GraphSAGE, it is theoretically possible to solve for $X$ or $A$ directly under specific conditions, such as when feature matrices are full-rank.
  • Projected Gradient Descent: A projection operator is used during optimization to ensure the reconstructed adjacency matrix remains valid, with values constrained between 0 and 1.
Comparison of GLG with existing gradient leakage methods, highlighting its ability to reconstruct both features and structure without prior knowledge.

Vulnerability Analysis and Key Insights

The effectiveness of the GLG attack was evaluated across diverse benchmarks, including social networks (GitHub, Facebook), citation networks (OGBN-Arxiv), and molecular datasets (MUTAG, Tox21). Several critical insights emerged:

  • Architectural Vulnerabilities: GraphSAGE was found to be significantly more "leaky" than GCN. Its design, which often separates a node's own features from its neighbors' during updates, allows attackers to more easily isolate and reconstruct individual attributes.
  • Structure vs. Features: In many tests, GLG achieved near-perfect reconstruction of the graph structure (AUC/AP of 1.0), even when feature reconstruction proved more difficult.
  • Model Capacity: "Wider" networks with more hidden channels are more vulnerable. They provide a richer gradient signal that the GLG optimization can exploit to minimize reconstruction error.
  • Exploiting Homophily: By incorporating the assumption of homophily ("friends look like friends"), the attacker can significantly enhance the quality of the reconstructed graph, turning a common social network property into a privacy risk.

Conclusion

The GLG attack demonstrates that gradients in federated graph learning are far from private. While increasing batch sizes can mitigate the risk, GLG remains effective even with larger batches. Future work is needed to explore the vulnerability of more complex architectures like Graph Attention Networks (GAT) and to develop "graph-aware" defenses. While Differential Privacy offers a potential safeguard, its impact on model accuracy remains a significant hurdle for practical deployment.

Summary updated

BibTeX
@article{sinha2025gradient,
  author = {Divya Anand Sinha and Yezi Liu and Ruijie Du and Athina Markopoulou and Yanning Shen},
  title = {{Gradient Inversion Attack on Graph Neural Networks}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=a0mLrqkWyx},
}
Figure