Live data from Hacker News

Two malicious Python libraries caught stealing SSH and GPG keys

zdnet.com

81–90 of 323 posts

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#81

I don't know what the solution is but it feels like this is a much bigger issue and we need some rethinking of how OSes work by default. Apple has taken some steps it seems the last 2 MacOS updates where they block access to certain folders for lots of executables until the user specifically gives that permission. Unfortunately for things like python the permission is granted to the Terminal app so once given, all pr…

Maintainers Matter: http://kmkeen.com/maintainers-matter/

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#82
post #76
post #4

> The first is "python3-dateutil," which imitated the popular "dateutil" library. The second is "jeIlyfish" (the first L is an I), which mimicked the "jellyfish" library.

I don't get it. Who would type "pip install jeilyfish" by mistake?

Regrettably some people use fonts in their terminals and IDEs which do not make the difference between uppercase I and lowercase l obvious.

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#83

I don't know what the solution is but it feels like this is a much bigger issue and we need some rethinking of how OSes work by default. Apple has taken some steps it seems the last 2 MacOS updates where they block access to certain folders for lots of executables until the user specifically gives that permission. Unfortunately for things like python the permission is granted to the Terminal app so once given, all pr…

> Unfortunately for things like python the permission is granted to the Terminal app so once given, all programs running under the terminal inherit the permissions.

Would Python permissions even be enough though? All it takes is one legitimate Python application wanting your Photos (lets say some Python photo manager app you wrote) and now all Python libraries get access.

Unfortunately, I think Apple's direction may be correct. It feels hugely inconvenient, but an end goal of all processes being signed and explicitly allowed certain things seems useful.

At the very least, Python should perhaps never get access to anything beyond the devving folder. Then any real use of Python applications would have to be properly baked out into processes where the OS can manage permissions for. This goes for all languages, Python was just an example here.

This is all off the top of my head, so I could be way off base. But it seems logical to me in the moment.

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#84

I don't know what the solution is but it feels like this is a much bigger issue and we need some rethinking of how OSes work by default. Apple has taken some steps it seems the last 2 MacOS updates where they block access to certain folders for lots of executables until the user specifically gives that permission. Unfortunately for things like python the permission is granted to the Terminal app so once given, all pr…

Use SELinux

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#85
post #8

I get the python3-dateutil because you might think it's an updated version of the standard library. But how does jellyfish with a different char for L work? Someone would need to copy and paste it. But if they go to pypi, it won't have many installs. Unless they started writing tutorials with: "okay now just pip install X"

Copy and pasting, even via word of mouth (rather than, say, a blog post or highly-google-ranked tutorial) is a surprisingly viral propagation vector.

And god help us if a malicious install command was posted, even if only for a few minutes before being edited, to a help or forum site like StackOverflow or Reddit.

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#86
post #10

These two have been caught. How many haven't yet been caught? Traditional Unix file permissions are pretty much a joke for the way developer computers get used (one user - does everything). Real process sandboxing is needed.

Not everything needs to run as root.

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#87
post #37
post #23

Earlier quoted context omitted.

Maybe the future is in fully sandboxed/containerized apps, where each action outside of sandbox/container is confirmed by the user.

Alert fatigue -> user accepts everything

Is there a better solution though? I agree that's a super real thing, but having no security at all (as is the case now, basically) is infinitely worse.

We would need to change some things, but I'd love to know if some random lib I'm using is trying to do things my application shouldn't. Or if something I installed, say Docker, is trying to access my photos or ssh keys.

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#88

Earlier quoted context omitted.

Is the code public? I'd love to use something like that.

It isn't. I'll make it public and announce it here by Friday.

Cool. Feel free to ping me by replying to this when you do.

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#89
post #37
post #23

Earlier quoted context omitted.

Maybe the future is in fully sandboxed/containerized apps, where each action outside of sandbox/container is confirmed by the user.

Alert fatigue -> user accepts everything

See Windows Vista for reference.

Re: Two malicious Python libraries caught stealing SSH and GPG keys

#90

I don't know what the solution is but it feels like this is a much bigger issue and we need some rethinking of how OSes work by default. Apple has taken some steps it seems the last 2 MacOS updates where they block access to certain folders for lots of executables until the user specifically gives that permission. Unfortunately for things like python the permission is granted to the Terminal app so once given, all pr…

https://hacks.mozilla.org/2019/11/announcing-the-bytecode-al... is a step in the right direction.
Post reply on HN