LWN: Comments on "Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet)" https://lwn.net/Articles/806266/ This is a special feed containing comments posted to the individual LWN article titled "Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet)". en-us Thu, 23 Oct 2025 07:50:11 +0000 Thu, 23 Oct 2025 07:50:11 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/808285/ https://lwn.net/Articles/808285/ pabs <div class="FormattedComment"> IIRC ASan is not meant for production use. In 2016 compiling setuid binaries using it could result in local root exploits:<br> <p> <a href="https://www.openwall.com/lists/oss-security/2016/02/17/9">https://www.openwall.com/lists/oss-security/2016/02/17/9</a><br> </div> Tue, 31 Dec 2019 01:40:24 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/808279/ https://lwn.net/Articles/808279/ HelloWorld <div class="FormattedComment"> <font class="QuotedText">&gt; There are many programmers who would use bounds checking in C if it could be as simple as adding -fbounds-checking to the command line.</font><br> <p> Well you pretty much can do that with -fsanitize=address, and yet not many people seem to be doing it. <br> </div> Mon, 30 Dec 2019 23:36:43 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/807262/ https://lwn.net/Articles/807262/ dvdeug <div class="FormattedComment"> Something that you're implying is that Python programmers are more concerned about security than C programmers, who prefer to dodge any responsibility.<br> <p> <font class="QuotedText">&gt; It's just the C implementations don't do that because "enable a user to implement his own memory management" is a C feature.</font><br> <p> C implementations don't do bounds checking because C doesn't make it feasible to do that. There are many programmers who would use bounds checking in C if it could be as simple as adding -fbounds-checking to the command line.<br> </div> Fri, 13 Dec 2019 14:25:32 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806867/ https://lwn.net/Articles/806867/ dfsmith <div class="FormattedComment"> New thing I learned: the term "typesquatting" now incorporates "copy-and-paste-squatting". Good to know!<br> </div> Mon, 09 Dec 2019 22:43:18 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806731/ https://lwn.net/Articles/806731/ Cyberax <div class="FormattedComment"> <font class="QuotedText">&gt; That was supposed to be the point: There are a lot of way to cause damage via software and focussing on programming language implementations[*] will not necessarily avoid "damage".</font><br> Except that C is pretty much THE worst possible language. It allows vulnerabilities that are by far the most severe compared to other languages.<br> <p> With Java or Python you really have to work hard to allow remote code execution, with C it's just a misplaced bounds check.<br> </div> Sun, 08 Dec 2019 21:10:28 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806730/ https://lwn.net/Articles/806730/ rweikusat2 <div class="FormattedComment"> <font class="QuotedText">&gt;&gt; The notion that it must be safe to use code written in a language with a more restrictive runtime environment than what a typical &gt;&gt; C implementation provide is wrong.</font><br> &gt;<br> <font class="QuotedText">&gt; This statement is true but the claim that it denies is a straw man. I don't think reasonable people would postulate that code written &gt; in a language like Python is automatically “safe”.</font><br> <p> Not explicitly, obviously. But implied every time this comes up. It's usually claimed that the problem is the programming language *and* *not* certain code written in it.<br> <p> <font class="QuotedText">&gt; the example at hand illustrates that deliberately introducing malicious functionality to an otherwise innocuous software package </font><br> <font class="QuotedText">&gt; works regardless of the programming language used. IOW, if you want to be secure against this type of attack, “a more restrictive </font><br> <font class="QuotedText">&gt; runtime environment than what a typical C implementation provides” </font><br> <p> That was supposed to be the point: There are a lot of way to cause damage via software and focussing on programming language implementations[*] will not necessarily avoid "damage".<br> <p> [*] There's actually nothing which would stop a conforming C implementation from doing array bounds checking, at least not theoretically: The C standard leaves the behaviour of out-of-bounds accesses undefined, hence, terminating a program via some signal in case of one would be perfectly acceptable. It's just the C implementations don't do that because "enable a user to implement his own memory management" is a C feature. The obvjous drawback of that is that users have to care more about memory management than when using a more restrictive language (in this respect), which probably isn't worth it on 'current' hardware in a lot of cases.<br> </div> Sun, 08 Dec 2019 20:08:49 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806459/ https://lwn.net/Articles/806459/ anselm <blockquote><em>The notion that it must be safe to use code written in a language with a more restrictive runtime environment than what a typical C implementation provide is wrong.</em></blockquote> <p> This statement is true but the claim that it denies is a straw man. I don't think reasonable people would postulate that code written in a language like Python is automatically “safe”. It may avoid some of the more obvious traps and pitfalls of languages like C, but if anything, the example at hand illustrates that deliberately introducing malicious functionality to an otherwise innocuous software package works regardless of the programming language used. IOW, if you want to be secure against this type of attack, “a more restrictive runtime environment than what a typical C implementation provides” by itself isn't going to be sufficient, but we don't see anyone arguing that it is. </p> Thu, 05 Dec 2019 21:43:29 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806429/ https://lwn.net/Articles/806429/ Cyberax <div class="FormattedComment"> So far C's track record has been abysmal - all large codebases have had multiple memory unsafety vulns. <br> </div> Thu, 05 Dec 2019 18:42:06 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806427/ https://lwn.net/Articles/806427/ kushal <div class="FormattedComment"> My talk in this year's PyCon US was related to this kind of attacks and mitigation, the things we do in SecureDrop project.<br> <p> <a href="https://www.youtube.com/watch?v=wRHi8Ui5vWA">https://www.youtube.com/watch?v=wRHi8Ui5vWA</a><br> </div> Thu, 05 Dec 2019 18:37:14 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806406/ https://lwn.net/Articles/806406/ rweikusat2 <div class="FormattedComment"> It is possible to write "C code without security issues" and there's also no confusion here: The notion that it must be safe to use code written in a language with a more restrictive runtime environment than what a typical C implementation provide is wrong. Even when code wasn't deliberately written to harm its users, the same bad habits (such a "lack of input validation") will cause different kinds of security problems, eg, SQL injection.<br> <p> </div> Thu, 05 Dec 2019 17:33:48 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806405/ https://lwn.net/Articles/806405/ micka <div class="FormattedComment"> There's a small logical confusion here.<br> "It's not possible to write C code with no security issue" is not the same as "only C code has security issues". <br> </div> Thu, 05 Dec 2019 16:58:05 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806397/ https://lwn.net/Articles/806397/ rweikusat2 <div class="FormattedComment"> Considering that this code wasn't written in C, it's clearly impossible for it to cause any "security issues".<br> <p> </div> Thu, 05 Dec 2019 15:57:59 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806348/ https://lwn.net/Articles/806348/ smurf <div class="FormattedComment"> There are a few lists of similar-looking glyphs out there. A simple-but-effective canonicalization algorithm could just use them (plus Unicode normalization: throw away all spaces and zero-width parts) to map all package names.<br> </div> Thu, 05 Dec 2019 08:00:41 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806343/ https://lwn.net/Articles/806343/ marcH <div class="FormattedComment"> <font class="QuotedText">&gt; I know some people like to complain about vendoring and static linking around here</font><br> <p> 4 days old: <a href="https://lwn.net/Articles/805840/">https://lwn.net/Articles/805840/</a><br> <p> <font class="QuotedText">&gt; "vendoring" which is the newfangled way to say "compiling statically".</font><br> <p> Newfangled "vendoring" means hard coding the version of a possibly forked dependency. Linking statically is the obvious way to do it but it's not required. It doesn't even need to involve a copy.<br> <p> </div> Thu, 05 Dec 2019 05:04:01 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806333/ https://lwn.net/Articles/806333/ cpitrat <div class="FormattedComment"> Vendoring is irrelevant to this problem. The best illustration of that being this news being about Python and PIP where vendoring is not used.<br> <p> I know some people like to complain about vendoring and static linking around here but please try to keep it for when it's actually on-topic ...<br> </div> Wed, 04 Dec 2019 21:26:56 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806319/ https://lwn.net/Articles/806319/ hkario <div class="FormattedComment"> for go and rust the go-to way of solving dependencies is "vendoring" which is the newfangled way to say "compiling statically". So there's not much even distributions can do about.<br> <p> But I guess if one doesn't break API in every release, it means the code is not moving fast enough... /s<br> </div> Wed, 04 Dec 2019 19:42:19 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806318/ https://lwn.net/Articles/806318/ JoeBuck <div class="FormattedComment"> If I understand correctly, jellyfish is trying to solve a different problem than typosquatting: identifying strings that sound the same, not strings that look the same. Is there any free code that tries to solve the latter problem? The idea would be that a repo would refuse to register a new project if its name is too close in appearance to an existing project.<br> <p> </div> Wed, 04 Dec 2019 19:33:24 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806312/ https://lwn.net/Articles/806312/ mageta <div class="FormattedComment"> Well, why would it only happen to npm and rubygems... I am surprised it only happens on such a scarce pace, the effort necessary doesn't seem terribly high.<br> <p> This seems to be an ambivalent thing about development models like npm, gems, or pypi. For one its good practice to reuse functionality instead of reinventing the wheel all the time, and doing all the mistakes again; on the other side the current class of package manager doesn't do a good job at preventing this sort of thing, and I admit it's not clear to me how they could, without adding a kind of government like in app-stores or such.<br> The current Linux-distribution model is probably a good filter, or has been so far, but it seems they also struggle with these new language-environments, and the pace at which components turn over. Python maybe less so, but definitely javascript, go, or rust.<br> </div> Wed, 04 Dec 2019 18:57:58 +0000 Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet) https://lwn.net/Articles/806267/ https://lwn.net/Articles/806267/ bangert <div class="FormattedComment"> Jellyfish "a python library for doing approximate and phonetic matching of strings" becomes a victim of typosquatting.<br> Oh irony...<br> </div> Wed, 04 Dec 2019 14:19:09 +0000