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?
Harvesting credit card numbers and passwords from websites
31–40 of 128 posts
Re: Harvesting credit card numbers and passwords from websites
#32If 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
Re: Harvesting credit card numbers and passwords from websites
#33So 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…
Re: Harvesting credit card numbers and passwords from websites
#34The 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…
Re: Harvesting credit card numbers and passwords from websites
#35Re: Harvesting credit card numbers and passwords from websites
#36What 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.
Re: Harvesting credit card numbers and passwords from websites
#37Earlier 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.
Re: Harvesting credit card numbers and passwords from websites
#38Earlier 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…
Re: Harvesting credit card numbers and passwords from websites
#39I 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
#40There 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.