DKIM 的推出时机不凑巧;或者说,CVE-2008-0166 二十周年快乐
DKIM was introduced at a unlucky time; or, happy 20 years of CVE-2008-0166

原始链接: https://dreamstation.systems/personal/dkimdebian.html

CVE-2008-0166 是 2006 年至 2008 年间 Debian/OpenSSL 的随机数生成器缺陷,去除了大部分熵,只留下 PID 作为变量,导致每种架构和密钥类型仅产生 32,768 个可能的密钥。披露后,所有密钥都被枚举出来,使暴力破解变得轻而易举。许多早期 DKIM 密钥是在受影响的 Debian 系统上生成的,而 DKIM 密钥通常不会轮换,因此问题持续存在。最近对 Tranco 排名前百万域名的 DKIM DNS 记录进行扫描发现,仍有 96 个域名在使用易受攻击的密钥,在通知后已从 101 个降至 96 个。攻击者可以为这些域名伪造签名有效的电子邮件,其中包括一些知名组织,但作者没有点名。使用 badkeys 扫描还发现,一个密钥与已泄露的私钥相关联,18 个私钥被发布在 DNS 中,386 个密钥低于 768 位,2,122 个密钥为 768–1023 位,以及 124 个格式错误的密钥。

黑客新闻 最新 | 历史 | 评论 | 提问 | 展示 | 招聘 | 投稿 登录 DKIM 引入得不是时候;或者说,CVE-2008-0166 二十周年快乐 (dreamstation.systems) 41 分,作者 robinpie,46 分钟前 | 历史 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

CVE-2008-0166

From 2006 to 2008, the Debian package (and downstream packages like Ubuntu’s) of the cryptography library OpenSSL had a very bad bug where most of the entropy that was powering the random number generator was not being fed into the pool. After the patch, the only varying input into the RNG was the PID, for which there are only 32,768 possible values. As a result, Debian OpenSSL could only generate 32,768 possible keys per architecture per key type.

(This isn’t solely Debian’s fault — the change was seemingly, unclearly OKed by an OpenSSL maintainer in a way that people still argue about.)

Shortly after it became public, every possible key was quickly enumerated, and the space was small enough that attackers could simply try every key on suspected vulnerable systems.

DKIM

Separately, DomainKeys Identified Mail, which is a standard for cryptographically signing outgoing e‐mail to prove that that mail was authorized to come from that domain, was emerging around this time. In 2007, the first DKIM standard compatible with the modern one was introduced as an IETF Proposed Standard, and some early adopters implemented it on their mail servers.

Naturally, many of these keys were generated, in 2007, on the popular server OS Debian, using the well‐respected cryptography library OpenSSL.

Did I mention that DKIM doesn’t require key rotation?

96 of the top million domains still use CVE-2008-0166 keys

A few weeks ago, I scraped the DKIM DNS records for the Tranco top million domains. Without even narrowing it down to domains that send e‐mail, 96 of them still ship CVE-2008-0166 keys. (I e‐mailed most of them to alert them of this, and that number is down from 101.) This means that anyone can forge mail validly signed for their domain.

This includes a major standards organization, the healthcare department of a government, and several relatively small‐time IT companies.

I’m not going to name them here, but they’re really trivial to find with the process I’ve described.

Other bad keys

As part of this, I ran everything I scraped through badkeys, which also caught these other issues with DKIM keys (today’s numbers, down ~5% from when I e‐mailed most of the affected domains):

  • 1 public key corresponding to a private key leaked in an unrelated incident
  • 18 private keys published in DNS
  • 386 keys under 768 bits
  • 2,122 keys 768–1023 bits
  • 124 malformed keys
联系我们 contact @ memedata.com