Key Points
When our Product Lead, Andy Hornegold, was asked to dive into API security at Infosecurity Europe, he showed how several recent high-profile breaches were caused by simple failings – which didn’t need sophisticated security to prevent. Here’s what he had to say…
You can also hear more from Andy by catching up on our API security webinar - watch the recording here.
APIs are everywhere. They underpin the internet and adoption is going through the roof. Why? Because they increase automation and boost efficiency by enabling integration between systems. As a result, almost every business is now an API business. Take Twilio, who are now worth $3.8 billion by making SMS, voice, and video more accessible with their API integrations.
But as API adoption increases and the businesses scale up, bad actors are starting to take notice and poke around at those APIs as well and we're seeing more and more security incidents related to APIs. In Postman’s 2022 State of the API report, of the 37,000 developers surveyed, 48% said they’d suffered at least one security breach in the last year; 4% of them said they had one a day… that’s quite terrifying.
So, let’s look at some of these breaches. We’re not pointing fingers or playing the blame game, because the more we talk about this, the more we all learn from the mistakes that have been made, so we can try and stop them from happening again. Some of these people have responded well; some of them have had a much more difficult time. Let’s dive in.
This breach saw lots of posts on the dark web from people saying they’ve scraped loads of Twitter accounts. The numbers were shocking – one claimed to have 400 million unique users – but they all came from one vulnerability from two years ago. The info included sensitive information like email, email name, username, phone number, all which can be used for phishing or even de-anonymizing people if they’ve signed up to Twitter using their own identifiable email address.
Twitter responded by saying the bug results from an update to their code in June 2021 – but it wasn’t until 2022 and early 2023 when we saw people exploiting the initial vulnerability and dumping all of the data, before correlating and cleaning it up and dumping it in different posts and different databases. Twitter said they had no evidence to suggest that somebody had taken advantage of the vulnerability, but they were going through some tumultuous times and their monitoring might not have been as good as it could have been.
So, what was the vulnerability? It was discovered by a bug bounty hunter who reported the vulnerability through HackerOne. Long story short: the functionality that lets people find your Twitter account by searching for your phone number or email address could be used by anyone, even if you had explicitly disabled it for your account. So, malicious users can automate sending multiple requests to this exposed endpoint, they send one request and then just increment the user ID number and send it again, and again, and again. You can use this approach to get full info about a whole lot of Twitter accounts and start to hoover up as much data as possible. This shows how enumeration and scraping are a recurring theme with API breaches.
Optus
This breach involved 30% of the Australian population and got very political, very quickly. It was a nasty situation for any business to be in, which was not what anybody wants to see. The hacker got the details of 11.2 million users and asked for $1 million to delete them. Considering the amount of information compared to the size of the ransom, there’s a question mark over the criminal maturity of the individual who carried out the exploit. The way everything was wrapped up with this breach, with the leaker apologizing and saying they’d deleted the data, we’re all left wondering whether the ASD knocked on the perpetrator's mother's door and said "your son's been a very naughty boy…".
Optus’ initial response was that it was the victim of a sophisticated attack, but following an investigation by a security journalist, the attacker seemingly got access with simple, off-the-shelf tooling. Optus aren't the bad guys here, but there were some mistakes – Clare O’Neil, Australian Cyber Security Minister said: “What is of concern is quite a basic hack was undertaken. We should not have a telco provider in this country which has effectively left the window open for data of this nature to be stolen.” The API wasn’t hosted on some part of a legacy environment either – it was hosted on Google Cloud/Apigee. The reason Optus detected the attack was because a lot of data was being pulled from the vulnerable API endpoint, but by that time it’s too late – the data has already left the network. You should have monitoring to detect and respond to attacks, but having authentication for all of your sensitive endpoints is also necessary. Finding that balance is important.
Odin Intelligence
Odin Intelligence works for law enforcement including producing a policing app called SweepWizard that was used to co-ordinate raids. Wired got a tip off to say they’d managed to dump a whole load of data about live LAPD operations including sensitive information about over 5,000 suspects. When they started investigating, Wired found that the API endpoints using the app were returning data regardless of authentication. At the very least, suspects who were about to be raided or arrested had access to their data and could see the GPS co-ordinates of any officers. Odin announced that they couldn’t reproduce the security compromise themselves, but they took down the app and it remains unavailable.
T-Mobile
T-Mobile had a breach in January 2023 affecting 37 million accounts that it announced in a very unusual way – in their SEC filing. They didn’t give much information about this particular breach – this is the eighth time they’ve been hacked since 2018 – except for the fact it was API based and “without authorization”. We can’t be sure if they actually meant authentication though, which is where you leave everything open to the internet for everybody to hoover up at any point. As long as they send a well-formed request, they'll get a response. Authorization can mean lots of different things, but usually it’s when someone with an active account can see information from other accounts that they shouldn't have access to.
Toyota
This one isn’t a breach it was a security researcher doing their thing. The researcher reported their findings to Toyota who reacted quickly and went through the remediation process. The researcher was able to find the development version of CRM that Toyota was using. The CRM had an Angular-based single page application which could be accessed by visiting an internet-exposed development URL. The researcher reverse-engineering the development application was able to identify the API endpoints used by the application. The researcher simply updated the API endpoints that the single page application was using, and pointed the application at the Production APIs, rather than the development URLs. When the requests were sent to the Production API there was no authentication requirement which allowed the researcher to enumerate the information for all Toyota owners in Mexico: names, addresses, emails, registrations, ownership. Toyota responded promptly by taking the sites offline and updating the APIs to require an authentication token.
What can you do to avoid API breaches?
Our advice is to start with the basics. You don't need to jump straight to AI-driven XDR. Start your cyber security program with the basics and scale up when it's right for your business. And the first thing to focus on is visibility because you can’t secure things that you don't know about, so you need to find where those APIs are. You can do it the way attackers do, which is scanning the attack surface using monitoring tools. There's plenty of them out there and Intruder is one of them.
When we ran asset discovery across 3,000 organizations, we found that only 21% of their internet-facing assets were tracked as part of a vulnerability management program. And that means for every hundred, there are 79 things that attackers can go and find. So I can't really state it enough – visibility is super important.
Secondly, don’t rely on a single solution and put all your eggs in one basket. Defense in depth is key – monitoring your network traffic is great; but put something in place earlier to find any vulnerabilities before they’re exploited.
Next you need to look at the big picture. You don't have to aim for perfect right away. You can cover 90% of your attack surface immediately. Don't just focus on APIs either. Take a step back, review your attack surface, which also includes your cloud accounts. If somebody compromises those, they've got access to the API data as well.
If it's not written down, it didn't happen. Document all your APIs, make sure that you are using those schemas because when it comes to vulnerability scanning, you really can't be informed. When you give a scanner your API schema it'll be able to enumerate every single endpoint and give you much better coverage.
And finally, the goalposts are always moving. You could have a pen test once, get the report and fix things. That's great. Everybody should be having pen tests. But between those pen tests, the entire threat landscape has changed. It changes daily. Every day we see new vulnerabilities, new attack techniques. So don't just settle for a one off. Start to implement ongoing vulnerability management and API scanning. Monitor those APIs continuously so when you do start to see large spikes, at least you can have some level of cover or confidence that you can cut off an attack.
You don't have to be a security expert to use Intruder. It’s easy to use, simple to understand, and always on so you can fix vulnerabilities faster. It keeps track of your attack surface, showing where and how your company may be vulnerable, prioritizing issues and filtering noise so you can fix the problems that matter most. Try it for free and see for yourself.
Dive deeper into API security by watching the recording of our webinar here.