Lune

USENIX Security2023Top-tier venue

Trojan Source: Invisible Vulnerabilities

Nicholas Boucher, Ross Anderson

Abstract

We present a new type of attack in which source code is maliciously encoded so that it appears different to a compiler and to the human eye. This attack exploits subtleties in text-encoding standards such as Unicode to produce source code whose tokens are logically encoded in a different order from the one in which they are displayed, leading to vulnerabilities that cannot be perceived directly by human code reviewers. 'Trojan Source' attacks, as we call them, pose an immediate threat both to first-party software and of supply-chain compromise across the industry. We present working examples of Trojan Source attacks in C, C++, C#, JavaScript, Java, Rust, Go, Python, SQL, Bash, Assembly, and Solidity. We propose definitive compiler-level defenses, and describe other mitigating controls that can be deployed in editors, repositories, and build pipelines while compilers are upgraded to block this attack. We document an industry-wide coordinated disclosure for these vulnerabilities; as they affect most compilers, editors, and repositories, the exercise teaches how different firms, open-source communities, and other stakeholders respond to vulnerability disclosure.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Architectural Neural Backdoors from First Principles cites Bad Characters: Imperceptible NLP Attacks
  • Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application Security cites You Get Where You're Looking for: The Impact of Information Sources on Code Security
  • Impeding LLM-assisted Cheating in Introductory Programming Assignments via Adversarial Perturbation cites Bad Characters: Imperceptible NLP Attacks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. Impeding LLM-assisted Cheating in Introductory Programming Assignments via Adversarial PerturbationSaiful Islam Salim, Rubin Yuchan Yang, Alexander Cooper, Suryashree Ray et al.EMNLP 2024 · 4 citations
  2. Exposing the Hidden Layer: Software Repositories in the Service of Seo ManipulationMengying Wu, Geng Hong, Wuyuao Mai, Xinyi Wu et al.ICSE 2025 · 1 citation
  3. Architectural Neural Backdoors from First PrinciplesHarry Langford, Ilia Shumailov, Yiren Zhao, Robert Mullins et al.S&P 2025
  4. The First Large-Scale Systematic Study of Python Class Pollution VulnerabilityZhengyu Liu, Jiacheng Zhong, Jianjia Yu, Muxi Lyu et al.S&P 2026
  5. ChainFuzz: Exploiting Upstream Vulnerabilities in Open-Source Supply ChainsPeng Deng, Lei Zhang, Yuchuan Meng, Zhemin Yang et al.USENIX Security 2025

Builds on3

  1. You Get Where You're Looking for: The Impact of Information Sources on Code SecurityYasemin Acar, Michael Backes, Sascha Fahl, Doowon Kim et al.S&P 2016 · 325 citations
  2. Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application SecurityFelix Fischer, Konstantin Böttinger, Huang Xiao, Christian Stransky et al.S&P 2017 · 293 citations
  3. Bad Characters: Imperceptible NLP AttacksNicholas Boucher, Ilia Shumailov, Ross Anderson, Nicolas PapernotS&P 2022 · 133 citations

Related papers

  1. Cross-Language AttacksSamuel Mergendahl, Nathan Burow, Hamed OkhraviNDSS 2022
  2. SandDriller: A Fully-Automated Approach for Testing Language-Based JavaScript SandboxesAbdullah AlHamdan, Cristian-Alexandru StaicuUSENIX Security 2023
  3. SoK: Taxonomy of Attacks on Open-Source Software Supply ChainsPiergiorgio Ladisa, Henrik Plate, Matias Martinez, Olivier BaraisS&P 2023
  4. The Philosopher's Stone: Trojaning Plugins of Large Language ModelsTian Dong, Minhui Xue, Guoxing Chen, Rayne Holland et al.NDSS 2025
  5. An Empirical Study on Reproducible Packaging in Open-Source EcosystemsGiacomo Benedetti, Oreofe Solarin, Courtney Miller, Greg Tystahl et al.ICSE 2025 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines