News for hackers. Stuff that matters.
Re:British Airways faces record £183M fine for data breach by K0nserv on Monday July 08, 2019 @04:40AM (#20380974)
> At the time, BA said hackers had carried out a "sophisticated, malicious criminal attack" on its website.

Compromising a single JS resource that was being carelessly loaded on a payment page doesn’t qualify as sophisticated in my mind. It might not be uncommon in the industry, but tools like SRI and CSP stop these attacks dead in their tracks.

I believe we are about one huge attack[0] of this kind away from realising how dire the situation truly is.

As a victim of the earlier Ticketmaster attack I’m curious as to if the ICO is investigating that too.

0: https://hugotunius.se/2018/11/29/how-to-hack-half-the-web.ht...

Re:British Airways faces record £183M fine for data breach by pjc50 on Monday July 08, 2019 @08:04AM (#20381987)
So: now what?

This is an absolutely vast fine. There have to be companies around the world that are all of a sudden going to take the security of Javascript seriously, who already have a big web app that pulls in hundreds of scripts compiled from tens of thousands of NPM modules. Is security band-aiding going to be applied, or are we going to have to see a radical re-architecting that acknowledges that every dependency is a liability as well as a benefit?

Re:British Airways faces record £183M fine for data breach by 7373737373 on Monday July 08, 2019 @08:31AM (#20382128)
It would be reasonable to expect an increased interest in security architectures. Unfortunately security has not been a main focus of businesses - research, development and actual use of secure systems is mostly limited to academic, financial, defense and intelligence circles.

Current programming languages provide no effective means of applying the principle of least authority to third party dependencies.

Examples: restricting I/O of an imported library, in many cases down to pure computation, as well as accounting for and limiting their resource use.

People, take a look at (object) capability security: https://en.wikipedia.org/wiki/Capability-based_security

Systems implementing this let you handle permissions like other objects, transferring them by simply including them as a function parameter.

There is no ambient authority, meaning a string of a file path is not sufficient to open a file. The function needs to have access to a capability object, which combines authority (the right to do something, say read a file) with designation (the path to a specific file).

When you create a new process, it starts without any capabilities, in which case it is restricted to pure computation.

Unlike current systems, this passing of permissions allows you to reason about what your code actually can do, it effectively limits its behavior, it creates reliable boundaries, because the program can't just construct permissions out of thin air.

Re:British Airways faces record £183M fine for data breach by ickyforce on Monday July 08, 2019 @09:39PM (#20388311)
Java has a SecurityManager[1] which does exactly that. Is there anything similar in other mainstream languages?

[1]: https://docs.oracle.com/javase/8/docs/api/java/lang/Security...

Re:British Airways faces record £183M fine for data breach by black_knight on Tuesday July 09, 2019 @04:24AM (#20389871)
As far as I understand SecurityManager, it is vastly different from capability based security.

In a system based on capabilities you would explicitly have to pass capabilities to any code which needs them (either as arguments to the call, or when loading the library – depending on what is natural). This means that priviledge is naturally minimised and transparent.

Compare that to SecurityManager where you have make a separate policy and checking process, separated from the actual calling of functions.

There was some work done to try to define a capability safe subset of Java (Joe-E was the name [0]). But it is sad that this is not the default security behaviour in Java, and thus no libraries use this.

[0]:https://en.wikipedia.org/wiki/Joe-E

Re:British Airways faces record £183M fine for data breach by 7373737373 on Tuesday July 09, 2019 @03:11AM (#20389610)
Stackless Python allows you to run tasks for a certain number of instructions: https://stackless.readthedocs.io/en/latest/library/stackless...

Unfortunately, the Python VM is impossible to sandbox much further as it is. You have (internal) resource security, but can't limit access to the network, or say a specific file in the filesystem. Mutable globals everywhere.

The https://en.wikipedia.org/wiki/E_programming_language has capability security, but no resource exhaustion protection.

The only systems were both where integrated were a series of 1980s operating systems (GNOSIS, KEYKOS, https://en.wikipedia.org/wiki/KeyKOS) that were designed to allow secure and accountable multi-user timesharing on mainframes. They are predecessors of the formally verified sel4 operating system.

There has never been a similar system on an OS/Processor independent virtual machine level. For fun, I created this little VM: https://esolangs.org/wiki/RarVM

Re:British Airways faces record £183M fine for data breach by K0nserv on Monday July 08, 2019 @09:37AM (#20382572)
That's a different, but related concern. Yes deep dependency graphs have a big trust problem, but at the very least in that case you can use CSP and SRI to verify the integrity after the asset has been built. A compromised node module also has the mitagting fator that it slowly propagates as people update which doesn't make the attack as immediate and it gives people an opportunity to review the code as they update.

For remote third party JS that's included on many websites you have an immediate and direct remote code exec vector. For something central like Google Analytics this would be devestating.

Re:British Airways faces record £183M fine for data breach by 1337biz on Monday July 08, 2019 @08:20AM (#20382069)
Unfortunately I expect just some insurances to pop up that cover data security fines. Unless the fees are getting really in-insurable, the cost of an insurance is probably just cheaper than actuary improving security.
Re:British Airways faces record £183M fine for data breach by gcthomas on Monday July 08, 2019 @09:02AM (#20382334)
It may well be that the insurance companies are less likely to get their minimum security demands for agreeing cover ignored than the internal managers looking to spend more money on security.
Re:British Airways faces record £183M fine for data breach by zemnmez on Monday July 08, 2019 @09:38AM (#20382576)
> but tools like SRI and CSP stop these attacks dead in their tracks.

this isn't... usually true. in the case of this attack, the Javascript was appended directly to a 'known good' library resource[1]. Typically CSP whitelists based on origin, which would make CSP ineffectual in this case. Also, websites like BA have advertising, and it's nearly impossible to run CSP with ads unless you use the `strict-dynamic` directive, which whitelists any javascript loaded by your javascript recursively... including this javascript[2].

There are other, more uncommon modes for CSP which you might be referring to:

1. Nonce, which provides protection by ensuring each script has a server-calculated one-time-use token. This would not have any effect, as the script is part of one naturally loaded by the server.

2. Hash[2], which provides protection by checking the script's content against a predetermined hash. This possibly could be effective, but in practice rarely is. If the attackers could edit this script, there's absolutely no reason to believe either (1) this just updates the generated hash or (2) the attackers cant just update the hash. (this is essentially the same as SRI). Hash is potentially effective where taking advantage of a third-party CDN with known content that should not change, but by the look of the url: http://www.britishairways.com/cms/global/scripts/lib/moderni... the resource was not on a CDN.

[1]: https://medium.com/asecuritysite-when-bob-met-alice/the-brit... [2]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Co...

Re:British Airways faces record £183M fine for data breach by chopin on Monday July 08, 2019 @09:57AM (#20382728)
>Also, websites like BA have advertising

Third-party advertising is a strict no-go on ecommerce sites imho. Anybody who does this should face the full 4% fine on the first offense.

I hate sites where I am willing to purchase and which serve me ads with a passion.

Re:British Airways faces record £183M fine for data breach by K0nserv on Monday July 08, 2019 @09:41AM (#20382599)
From the reporting I've read, primarily by RiskIQ, in both the Ticketmaster and BA case it was not the origin servers that were compromised in which case SRI would have been effective in so far that it would have required the attackers to compromise the origin servers too at which point it's all game over anyway.

So I would assert that SRI would have stopped both these attacks.

Re:British Airways faces record £183M fine for data breach by zemnmez on Monday July 08, 2019 @09:51AM (#20382681)
i cant find any hits for "origin" or "CDN" on the original RiskIQ article: https://www.riskiq.com/blog/labs/magecart-british-airways-br...

the RiskIQ article identifies the location of the script as "the main website"

additionally, I'm not sure how this would solve the problem. If BA went to all the effort of putting their frontend assets on a CDN, why wouldn't their HTML, with the hashes also be on the CDN? and if the hashes are not generated by the CDN, how does the server generate the hashes without being affected by changes on the CDN? regardless of outcome, if the process is automated, does a human being need to read a diff every time any file on any CDN changes? Can't an attacker then just wait until the hashes are automatically updated?

Re:British Airways faces record £183M fine for data breach by K0nserv on Monday July 08, 2019 @11:28AM (#20383560)
Sorry I should have been clearer here. RiskIQ doesn't distinguish between the CDN and origin in their write up. That's an assumption on my part, I believe it be the case that the CMS that serves the JS file is different from the origin server that would be serving the checkout pages and other parts of the BA website. From a quick Google it looks like the CMS path on BA is just a file storage server of some kind.

Most likely the origin server had a hardcoded reference to the CMS path(https://www.britishairways.com/cms/global/scripts/lib/modern...) and if that had been done as

    <script type="text/javascript" src="https://www.britishairways.com/cms/global/scripts/lib/modernizr-2.6.2.min.js" integrity="sha384-5XrDTQbmmgpJKmfKW8outDDdYpRCnIf+nxX2nVR10NyWby6pPcujAELgWVmCu2P/"></script>

I speculate the attack would not have been successful. For an extremely static resource like this it wouldn't have been complex to adopt SRI.
Re:British Airways faces record £183M fine for data breach by sitkack on Monday July 08, 2019 @10:21AM (#20382929)
Running ads was totally worth it.
Re:British Airways faces record £183M fine for data breach by xtomus on Monday July 08, 2019 @05:52PM (#20387128)
There is absolutely no reason to be loading third party ad scripts on the payment gateway.
Re:British Airways faces record £183M fine for data breach by CuriousSkeptic on Monday July 08, 2019 @05:20AM (#20381161)
How would SRI and CSP help in this case? Wasn’t the compromised script served from their own infrastructure? And if hackers had access to that, why wouldn’t they they be able to change the SRI and CSP too?
Re:British Airways faces record £183M fine for data breach by K0nserv on Monday July 08, 2019 @05:28AM (#20381200)
In this specific case the attackers seems to have compromised a CMS which for some reason was used to serve javascript libraries. It’s likely that they did not compromise the origin itself, only the CMS. Thus using SRI on the origin would have prevented or at least drastically complicated the attack. As a general pattern CSP and SRI are very effective protection against CDN compromises and XSS. With CSP and SRI the stack surface is reduced significantly.
Re:British Airways faces record £183M fine for data breach by zemnmez on Monday July 08, 2019 @09:41AM (#20382602)
Re:British Airways faces record £183M fine for data breach by K0nserv on Monday July 08, 2019 @09:43AM (#20382623)
It looks like a CMS that is being repurposed as a CDN. I would bet the path https://www.britishairways.com/cms/ resolves via a gateway to a different set of servers than the main BA site. So for all intents and purposes it’s a CDN
Re:British Airways faces record £183M fine for data breach by elf337 on Wednesday July 10, 2019 @05:27AM (#20400406)
Whilst CSP wouldn't have stopped the modified script from loading it would have stopped the AJAX call to the attacker-controlled domain and thus would have been rendered impotent. Whilst it is very worrying that a bad actor was able to get their malicious script served up by a BA server, even if it was only acting as a proxy for a CDN, I suspect that the reality is (or at least should be) that this is much easier than changing the headers sent by that server (and hence the CSP) and that access to one does not imply access to the other
Re:British Airways faces record £183M fine for data breach by throw0101a on Monday July 08, 2019 @09:49AM (#20382659)
Depending on one's paranoia level, you could have a monitoring script on independent (third-party?) infrastructure that fetches pages and goes through them checking resource hashes. If the SRI hash listed in the origin, or the actual hash of the resource, changes, you get an alert.

If an update was not pushed, then you know something hinky is going on.

Some folks regularly check the signature of their SSL certs, and monitor certificate transparency logs. It just depends on how vigilant one wants to be.

Re:British Airways faces record £183M fine for data breach by planetjones on Monday July 08, 2019 @04:45AM (#20381007)
Exactly it was a crude and unsophisticated attack. I am pleased the ICO looked at the facts, not the spin and recognised the negligence of BA.
Re:British Airways faces record £183M fine for data breach by barking on Monday July 08, 2019 @07:36AM (#20381821)
It seems the ICO website, itself was infected in a similar way last year with a crypto miner.

https://scotthelme.co.uk/protect-site-from-cryptojacking-csp...

Re:British Airways faces record £183M fine for data breach by robocat on Monday July 08, 2019 @08:40AM (#20382187)
But they most they can fine themselves is 4% of their turnover.
Re:British Airways faces record £183M fine for data breach by davegardner on Monday July 08, 2019 @09:30AM (#20382521)
I suspect your comment is at least partly a joke, however the actual maximum fine possible is 4% or €20 million, whichever is higher.
Re:British Airways faces record £183M fine for data breach by Silhouette on Monday July 08, 2019 @09:42AM (#20382606)
It might not be uncommon in the industry, but tools like SRI and CSP stop these attacks dead in their tracks.

It depends on what you're using them for.

If you're talking about static resources loaded from something like a CDN -- in other words, a situation where you also control the intended content to be downloaded -- then SRI is potentially useful. But how could that sort of system work if you rely on a payment service to supply the client-side scripting that runs behind the credit card form on your site and turns the user-provided card details into a token of some sort?

For example, if you use a service like Stripe, you're almost certainly loading a script from their servers that they control to run the card details form on your site. Between PCI-DSS rules and the obvious need for Stripe to be able to deploy changes quickly in the event of discovering a vulnerability, you can neither self-host the equivalent script nor provide any useful checksum or similar that is guaranteed to remain correct.

I suppose in theory Stripe could provide an API that you can access from your servers to fetch the current checksum for the current version of a resource like https://js.stripe.com/v3/, and then you could render your link to that script with the integrity attribute included when you serve your page with the card details form, and as long as no-one breaks anything with a cache or the like then that might work. I'm not quite sure what attack vector it would be guarding against though, since any scripts like this will surely already be served over HTTPS and therefore trigger warnings if anyone without Stripe's cert tries to serve them via some sort of MITM attack.

So SRI and the like take care of some aspects of this problem, but given you might be relying on a lot more external services than just (presumably relatively careful) ones like Stripe, it doesn't solve the whole problem.

Re:British Airways faces record £183M fine for data breach by philjohn on Monday July 08, 2019 @09:03AM (#20382341)
Similar way that TicketMaster were attacked ... that wasn't fun.