We’ve talked before on this blog about how APIs have grown and changed over their lifespan.
But as they’ve become more favoured by businesses big and small, API security has risen to become one of the top issues people face.
Security is an important part of API software, but one that’s easy to neglect in the excitement of getting it up and running. In this article, you’ll learn why you shouldn’t skimp on API security, some common API security vulnerabilities, and how the best APIs have security baked in from the beginning.
What is API Security?
API security includes anything that prevents attacks on APIs and any resulting damage to the data they transfer.
Common Vulnerabilities in APIs
With APIs being as complex as they are, it’s not surprising that there are multiple ways for their security to be compromised.
Unauthorised access – According to the Open Web Application Security Project (OWASP), poorly controlled access controls can lead to Broken Object Level Authorisation. This means that unauthorised users can manipulate object identifiers, getting access to sensitive data in the process.
Unrestricted resource consumption – When we consume too much, we’re often worse for wear. APIs are the same in that respect, especially when the people who created them don’t proactively limit things like the size of files, number of processes, or operations that can be performed at once. This can allow attackers to take advantage – overloading your API, taking it offline, and causing you to lose business.
Why is API Security Important?
Research by Cloudentity found that APIs account for 83% of web traffic. You don’t need to be a tech expert to see the issue here. If an API is compromised, that means a lot of data at risk and a lot of companies losing money as a result.
This could be an even bigger issue when we’re specifically talking about APIs for software like Sage. Cybercriminals see the sensitive financial data within it as ripe pickings – more than enough reason to protect it.
A secure API is also key to ensuring a company’s compliance and maintaining the integrity of its data as it’s transmitted across different systems.
Best Practices for API Security
When it comes to making sure your API is as secure as it can be, try to follow these practices:
Authentication and Authorisation
If APIs were humans, they would probably be door attendants at your local pub or club. Just like they check IDs and verify guests, an API authenticates requests to ensure only legitimate users access the system.
To give your virtual door attendant the best chance of a successful night, you need to use authentication and authorisation methods that are up to scratch. These two methods work best when they’re together, for added layers of API protection. Industry standards include OAuth – you’ll have used this when logging into a site using your Facebook or Google account details.
You can also use an API key – a specific identifier assigned to an API client, usually an alphanumeric string. As each client has its own key, you can easily track API usage and block unwanted requests.
Other best practices include:
- Using strong passwords as well as multi-factor authentication
- Limiting session durations
Encryption
Almost every website uses HTTPS nowadays – and there’s a reason for that. Those letters signify encryption – making sure data you send to sites, like passwords and credit card information, can’t be intercepted. However, it’s also important that data is encrypted while it’s at rest as well as in transit. This gives the data full protection, and the API user peace of mind.
Input Validation
Injections are usually good for humans, but not for APIs – they’re one of the key ways an API can be attacked. Often this is through the API input validation. Vulnerabilities allow attackers to inject data – like codes or commands – into APIs, changing their behaviour or extracting sensitive information.
You can stop this from happening by keeping inputs clean through validating and sanitising them. First, we need to validate that user input matches the expected format and type. For example, an email would usually have an @ symbol. Sanitising user input means keeping an eye out for things like <script> tags or user-submitted markup code which can be harbingers of attacks-in-waiting.
Rate Limiting
This practice specifically deals with the unauthorised resource consumption we mentioned earlier. Ensuring you set limits at the start for things, like requests, eliminates this type of attack entirely, allowing only a certain number of processes to run at once.
Regular Security Audits
Now, we shouldn’t really have to say this one, but in the interest of covering all bases…
Routine security checks should be your bedrock no matter what it is you’re bringing in, and APIs are no exception. Doing regular manual security testing lets you work through each of the potential vulnerabilities systematically. This makes it more likely that you’ll find them before an attack happens.
What’s more, this also helps determine what counts as a ‘normal’ service for your API. Any unexpected responses can be the first sign of trouble, pinpointing where you may need to fine-tune your API.
If you take anything from reading this article, it should be that an API without security is worse than no API at all. An API with robust security, on the other hand, has all the gaps plugged – from authentication to input validation and beyond. Security measures won’t necessarily make your API invincible, but they will make it far less likely to be attacked – the equivalent of having your spare key in a safe, versus under the front doormat.
Looking for an API solution? PKF Smith Cooper Systems has two – MRGE and WIRE.
Find out more about them here, or call us on 01332 959008.

Interested to know more about our Sage solutions?
Call 01332 959008 or enquire online today
"*" indicates required fields