Live data from Hacker News

Harvesting credit card numbers and passwords from websites

medium.com

31–40 of 128 posts

Re: Harvesting credit card numbers and passwords from websites

#31
post #16

Couldn't one circumvent CSP by sending the data to a legitimate analytics service that everyone uses like Google Analytics?

How would you exfiltrate that data?

Google Analytics has a query parameter that can be used to extract arbitrary data. So make a request to that with an ID that you control I guess? GitHub mentions it in their CSP post: https://githubengineering.com/githubs-post-csp-journey/

Re: Harvesting credit card numbers and passwords from websites

#32
post #23

If this prompts you to action, and you need a quick and efficient way to build a CSP policy for the various services you use: https://www.npmjs.com/package/csp-by-api

A bit ironic, given the article is about all the ways you could get screwed by NPM packages if you don't have a CSP.

Re: Harvesting credit card numbers and passwords from websites

#33
post #9
post #4

So it seems developers are in fact responsible for dependencies that they use... Who would've thought...

I was going to say the following: Except that being responsible for your dependencies (and the dependencies of your dependencies...) is impossibly hard. You would need to build everything yourself after auditing the code. But then I thought about it some more and its likely that you don’t need to audit the code, since the malware probably isn’t in the public git repo. Yes, its still a risk, but the probability of mal…

It's only impossibly hard to audit this kind of thing if you have an insanely large and deep tree of transitive dependencies in the first place. This seems to be a particularly bad problem in the JS world, for this and many other reasons, but most programming languages and their communities don't work that way. Auditing a small number of larger dependencies, when most of them are probably widely used and from reasonably trustworthy sources, is much more achievable.

Re: Harvesting credit card numbers and passwords from websites

#34

The author mentions that Chrome Extensions are a bad distribution method. I think he is wrong. First, there are more users of Chrome Extensions than the users of npm, second, most of them don't care what those extensions send over the network. And I guess CSP doesn't apply to browser extensions. So if you want to steal passwords, make some extension like "Mp3 Youtube Downloader" or "Ad Blocker" and get access to mill…

I think you misunderstand the role of NPM in this concept. Using NPM ensures that web sites distribute the code to their users. So it doesn't matter if there's only a few hits using NPM, if they are good hits. As the article mentions, neither Amazon nor eBay are protecting against this. If they somehow added the package to their app, that provides access to every credit card added to those sites. That is much broader than user's installing Chrome extensions.

Re: Harvesting credit card numbers and passwords from websites

#35
There is this trade-off between usability and security. For example being able to load data from other domains, now with origin policy we have do fetch the data server side. One nice thing about web apps is that they do not require a server to work. But due to xxs injections we cant have nice things.

Re: Harvesting credit card numbers and passwords from websites

#36
post #28

What if the author snuck his code into frontend modules, and also snuck his code into backend modules? If CSP is enabled, the frontend checks to see if the backend code has opened up the particular port or route on the backend. The back-end code could sniff through require.cache to see if he could hook into the existing server instance ( same port ), or open a new port ( depending on CSP ). I suppose the CSP equivale…

He'd have to somehow make outbound requests from the server. IIRC, the default AWS VPC config would prevent this. Not sure about other cloud environments. Where I work, outbound requests must be made through proxy servers which have a whitelisted set of allowed domains, which is only allowed after a security review.

You can exfiltrate data a number of ways though. DNS requests might be one obvious method.

Re: Harvesting credit card numbers and passwords from websites

#37
post #36
post #28

Earlier quoted context omitted.

He'd have to somehow make outbound requests from the server. IIRC, the default AWS VPC config would prevent this. Not sure about other cloud environments. Where I work, outbound requests must be made through proxy servers which have a whitelisted set of allowed domains, which is only allowed after a security review.

You can exfiltrate data a number of ways though. DNS requests might be one obvious method.

AWS has GuardDuty now which can monitor for this type of traffic for pretty cheap.

Re: Harvesting credit card numbers and passwords from websites

#38
post #9

Earlier quoted context omitted.

I was going to say the following: Except that being responsible for your dependencies (and the dependencies of your dependencies...) is impossibly hard. You would need to build everything yourself after auditing the code. But then I thought about it some more and its likely that you don’t need to audit the code, since the malware probably isn’t in the public git repo. Yes, its still a risk, but the probability of mal…

It's only impossibly hard to audit this kind of thing if you have an insanely large and deep tree of transitive dependencies in the first place. This seems to be a particularly bad problem in the JS world, for this and many other reasons, but most programming languages and their communities don't work that way. Auditing a small number of larger dependencies, when most of them are probably widely used and from reasona…

Ha, what an excellent timing with another related story on top of the HN: https://news.ycombinator.com/item?id=16087024

Re: Harvesting credit card numbers and passwords from websites

#39
I'm more of a back-end dev who doesn't know all the ins and outs of the actual software used - can someone explain to me why this is an npm problem, and not an excessive dependencies problem?

I thought npm was simply a package manager - I don't see anything in the article that is specific to npm, except he happens to say that word.

Re: Harvesting credit card numbers and passwords from websites

#40
post #35

There is this trade-off between usability and security. For example being able to load data from other domains, now with origin policy we have do fetch the data server side. One nice thing about web apps is that they do not require a server to work. But due to xxs injections we cant have nice things.

I know it's just trendy to hate on node/npm, but these are really turning into bad products and services. You need usability before there's a trade-off. Reputation is still important.
Post reply on HN