arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2111.00169cs.CRcs.PL
收藏

木马来源:隐形漏洞

Trojan Source: Invisible Vulnerabilities

Nicholas Boucher, Ross Anderson

摘要:

我们提出了一种新型的攻击,其中源代码被恶意编码,使它看起来不同的编译器和人眼。这种攻击利用Unicode等文本编码标准中的微妙之处来生成源代码,这些源代码的令牌在逻辑上的编码顺序与它们显示的顺序不同,从而导致人类代码审查人员无法直接感知的漏洞。我们称之为“特洛伊木马源”攻击,对第一方软件和整个行业的供应链构成直接威胁。我们展示了C、C++、C#、JavaScript、Java、Rust、Go、Python、SQL、Bash、Assembly和Solidity中特洛伊木马源攻击的工作示例。我们提出了明确的编译器级防御,并描述了其他缓解控制,可以部署在编辑器,存储库和构建管道,而编译器升级,以阻止这种攻击。我们记录了这些漏洞的全行业协调披露;由于它们影响到大多数编译器,编辑器和存储库,因此该练习教授不同的公司,开源社区和其他利益相关者如何应对漏洞披露。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑