安全与隐私freedom-to-tinker.com
2003 年那次 Linux 后门企图(2013)
The Linux Backdoor Attempt of 2003 (2013)
2018 — 2023,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这篇文章回顾了 2003 年有人试图向 Linux 内核源码(CVS 仓库)中植入后门的事件:攻击者通过在 wait/waitpid 相关代码中把比较运算符 == 改成赋值 =,试图让特定标志组合下的进程以 root 权限运行。这一改动被开发者及时发现并撤销,事件也成为开源代码审查机制有效性的经典案例。
为什么经久不衰:它展示了开源社区如何通过版本控制和同行审查发现并阻止后门,对理解供应链安全和代码审查的价值至今仍有启发。
HN 评论精选
手法太粗糙,不像 NSA 级别机构所为,更可能是脚本小子的炫耀或某机构的警告
这显然是一次后门尝试,否则代码说不通。但这个手法太粗糙、太不精确,不像 NSA 这类机构的手笔——收益太低,本地提权漏洞当时遍地都是。更糟的是,NSA 这类机构有攻防双重使命:植入后门有利于进攻,却损害防御,所以只有后门足够隐蔽才划算。一个明显的后门对美国弊大于利,这个太明显了。一些猜测:1) 某个脚本小子入侵并修改了 CVS,本想拿来炫耀,但被发现得太早,不值得一提;2) 这是某个西方机构的警告,意思是'把安全做扎实点'。
yyyk查看英文原文
This is an obvious backdoor attempt, as the code doesn't make sense otherwise. Yet, the attempt was far too unsubtle and underspecific for agencies such as the NSA. The payoff was low compared to the possibilities - local privilege escalations were a dime-a-dozen. Worse, agencies such as the NSA have two missions: offence and defence. Adding in backdoors helps the offensive mission, but hurts the defensive mission, so it only makes sense if the backdoor isn't so easy to find. An obvious backdoor hurts the US far more than it helps the US. This one was too obvious. Some ideas: 1) A script kiddie found some way to break-in and edit CVS. The entire idea being to have something to brag about. This was caught too early to be brag-worthy (breaking ancient CVS isn't something to brag about). 2) It was a warning shot from some Western agency meaning "tighten up your security".
从逻辑上分析,这个改动不可能是无心之失,而是刻意设计的后门
(引自文章评论区)这不是失误。假设写代码的人本意是 == 0,那他想强制的是什么?如果 _WCLONE 和 _WALL 这两个标志位被设置且你是 root,这个调用就无效。这个位组合本身无害(设置 WALL 就隐含 WCLONE),而且为什么只对 root 禁止它?
WhiteSage查看英文原文
From the article comment section: > this is not a mistake. > Assume that the coder meant == 0 what is he trying to enforce. If these 2 bits (_WCLONE and _WALL) are set and your are root then the call is invalid. The bit combination is harmless (setting WALL implies WCLONE [...]), and why would you forbid it for root only.
质疑攻击者为何选择如此粗糙的手法,而非更隐蔽的植入方式
'Underhanded C 大赛'表明,往 C 代码里塞后门可以容易到即使有人盯着代码看一阵子也发现不了的程度。那为什么这个攻击者选择如此明显的'笔误',而不是在大量补丁中埋一个隐蔽的缺陷?
londons_explore查看英文原文
The underhanded C contest shows it is so easy to insert backdoors into C code that even someone staring at the code for a while wouldn't find. So why did this attacker choose such an obvious 'typo' rather than a subtle flaw in a large patch set?
连读者都会看漏这个错误,说明内核代码中应有更多防护机制
我承认我读了代码却完全没注意到那个单等号。这让我疑惑为什么修改 userid 会这么容易——难道不应该有一些防护机制,阻止 userid 从不安全的地方被更新吗?
hmottestad查看英文原文
I admit that I read the code and completely overlooked the single equals sign. Makes me wonder why it would be so easy to change the userid. Shouldn’t there be some safeguards in place to stop the userid from being updated from unsafe places.
历次讨论
同类还值得读
非法素数
Illegal prime
维基百科条目,介绍“非法素数”:某些素数之所以被称为“非法”,是因为它们经特定编码后,恰好对应一段被法律禁止传播的数据——最著名的是 DVD 解密程序 DeCSS 的代码,有人把…
安全与隐私上首页 5 次 · 2010–2021en.wikipedia.org编辑精选关于 /dev/urandom 的常见误区
Myths about /dev/urandom
(Thomas Hühn 撰写,2014 年首发并持续更新)逐条反驳关于 /dev/urandom 的常见误解:它与 /dev/random 使用的是同一个 CSPRNG,一旦完…
安全与隐私上首页 5 次 · 2014–20202uo.de编辑精选AES 高级加密标准火柴人图解
A Stick Figure Guide to the Advanced Encryption Standard (AES)
一篇用火柴人漫画形式讲解 AES(高级加密标准)算法的经典科普文章。
安全与隐私上首页 5 次 · 2009–2022moserware.com编辑精选指纹是用户名,不是密码
Fingerprints are Usernames, not Passwords
作者(eCryptfs 维护者、Ubuntu 安全工程师)认为指纹等生物特征是公开、不可更改的标识,应视作用户名而非密码,不能当作秘密凭据用于认证。
安全与隐私上首页 4 次 · 2013–2017blog.dustinkirkland.comHTTPS 连接的最初几毫秒(2009)
The First Few Milliseconds of an HTTPS Connection (2009)
逐毫秒拆解一次 HTTPS 连接建立时发生了什么,重点讲 TLS 握手、证书验证、RSA 签名与密钥协商等机制,面向不熟悉该领域的读者。
安全与隐私上首页 4 次 · 2009–2020moserware.com编辑精选