SKS Keyserver Network Under Attack
I have maintained keyserver in the pool for many years[1], and attacks like this are, in theory, able to be easily mitigated. I mean, we&#x27;re only talking about appending spam to public keys. It&#x27;s not like the attackers found some flaw in OpenPGP that breaks public keys or valid signatures. In theory, all these attacks to do is cause bloat on keyservers.<p>So why can&#x27;t we deal with these types of attacks? IMO, the main reason is the the server code.<p>The author mentions that the sks keyserver is &quot;written in an unusual programming language called OCaml&quot;, but IMO the language isn&#x27;t the main issue. Here&#x27;s a rundown of what I think the main issues are:<p>* Non-scalable database - SKS keyserver uses Berkeley DB as the database for storing keys, and bdb can&#x27;t handle more than one connection at time. So, when huge keys with lots of spam signatures are being written to the database, it blocks all other transactions, including serving web requests (see issue #61[2]). The server needs to be re-written to use a database that can handle multiple connections (e.g. Postgres) so spam writes won&#x27;t affect the web responses for unrelated keys. Unfortunately, the server is currently single-threaded and synchronous so it would have to be heavily re-written to add this kind of async scalability.<p>* Undocumented gossip protocol - The gossip protocol used is a very efficiency syncing algorithm that lets servers fill in the gaps for their databases from other servers. Unfortunately, the only documentation I can find on the gossip protocol is an academic paper[3]. This is a huge barrier for someone wanting to write a sks-compatible keyserver. You basically have to read the OCaml code (which doesn&#x27;t have comments) to figure out how it works. For years I have wanted to try to write an alternative sks-compatible keyserver that could handle attacks like these better, but as it stands now, I&#x27;d have to spend a huge amount of time learning OCaml and reverse engineering the code just to understand how to write a compatible gossip implementation. Every once in a while I ask the mailing list for a mentor in helping teach me the gossip protocol[4], but so far either no one knows it or wants to teach it to me.<p>* Few validation and revocation features - OpenPGP is very flexible for how you can build public keys and signatures. I think there&#x27;s a lot of creative things you can do with signature packets to let keyservers and public key owners clean spam out of their signatures. For example, OpenPGP signatures let you specify a &quot;Signature Target&quot;[5] in a signature, which could be used to let public key owners denote other signatures on their public key they wish to revoke, which the keyserver could then stop serving up to public requests. However, since the current server code is largely unmaintained, we can&#x27;t implement some of these cleanup options.<p>Overall, I really love the idea of having a public, open, decentralized keyserver pool. Unfortunately, sks-keyserver wasn&#x27;t written with much ability to scale (which was totally appropriate at the time), so it&#x27;s in desperate need of being re-written. I&#x27;d love to do it, but simply haven&#x27;t found the time to reverse engineer the gossip protocol. If someone out there wants to mentor me through it, I&#x27;d happily write an sks-compatible keyserver that could operate in the pool and also deal with these types of attacks.<p>[1]: <a href="https:&#x2F;&#x2F;sks.daylightpirates.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sks.daylightpirates.org&#x2F;</a> (currently down)<p>[2]: <a href="https:&#x2F;&#x2F;bitbucket.org&#x2F;skskeyserver&#x2F;sks-keyserver&#x2F;issues&#x2F;61&#x2F;key-addition-failed-blocks-web-interface" rel="nofollow">https:&#x2F;&#x2F;bitbucket.org&#x2F;skskeyserver&#x2F;sks-keyserver&#x2F;issues&#x2F;61&#x2F;k...</a><p>[3]: <a href="http:&#x2F;&#x2F;ipsit.bu.edu&#x2F;documents&#x2F;ieee-it3-web.pdf" rel="nofollow">http:&#x2F;&#x2F;ipsit.bu.edu&#x2F;documents&#x2F;ieee-it3-web.pdf</a><p>[4]: <a href="https:&#x2F;&#x2F;lists.nongnu.org&#x2F;archive&#x2F;html&#x2F;sks-devel&#x2F;2016-08&#x2F;msg00072.html" rel="nofollow">https:&#x2F;&#x2F;lists.nongnu.org&#x2F;archive&#x2F;html&#x2F;sks-devel&#x2F;2016-08&#x2F;msg0...</a><p>[5]: <a href="https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc4880#section-5.2.3.25" rel="nofollow">https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc4880#section-5.2.3.25</a>