How to defend against Account Takeovers
Learn about account takeover threats, protection strategies, and detection methods to secure your digital accounts and prevent unauthorised access.
The Open Web Application Security Project (OWASP) is a non-profit foundation dedicated to improving software security. Their API Security Top 10 is a critical resource for developers, security professionals, and architects, highlighting the most critical security risks to APIs. This guide provides a detailed breakdown of each risk and how to mitigate it.
What it is: BOLA occurs when an application doesn't correctly validate that a user has permission to access a specific object (e.g., a record, file, or resource). An attacker can exploit this by manipulating the ID of an object sent in an API request to access data they shouldn't be able to see.
Example: An e-commerce API endpoint GET /api/v1/orders/{orderId}
retrieves order details. A user is authenticated, but the application fails to check if the orderId
belongs to that user. An attacker could cycle through orderId
values to view other customers' orders.
Mitigation:
What it is: This vulnerability involves weaknesses in authentication mechanisms. Flaws can include weak password policies, insecure password recovery, exposing session IDs in URLs, or not validating tokens correctly.
Example: An API uses JWTs for authentication but fails to validate the token's signature. An attacker could forge a token with a different user ID (e.g., an admin) and gain unauthorized access.
Mitigation:
What it is: APIs often expose more data than the client application requires. Even if the sensitive data isn't displayed in the UI, it's still present in the API response and can be intercepted by an attacker.
Example: A user profile endpoint /api/v1/users/me
returns a JSON object containing the user's name, email, address, and credit card number, even though the mobile app only displays the name and email.
Mitigation:
What it is: APIs without proper rate limiting or resource controls are vulnerable to denial-of-service (DoS) attacks or brute-force attacks. Attackers can overwhelm the API with requests, degrading performance or causing an outage.
Example: A login endpoint has no limit on the number of attempts. An attacker can use an automated script to try millions of password combinations (credential stuffing).
Mitigation:
What it is: This flaw occurs when an application fails to restrict access to certain functions or administrative endpoints. Regular users might be able to access functionality reserved for administrators.
Example: An admin endpoint POST /api/v1/admin/users/delete
is exposed. While not linked in the UI for regular users, an attacker who discovers the endpoint can send a request to it and delete users.
Mitigation:
What it is: Mass assignment happens when a framework automatically binds incoming request parameters to object properties. An attacker can exploit this by passing unexpected parameters to modify object properties they shouldn't have access to.
Example: A user profile update endpoint allows a user to change their username
. The underlying code automatically maps all request parameters to the user object. An attacker adds an isAdmin: true
field to the JSON payload, which the framework assigns to the user object, elevating their privileges.
Mitigation:
What it is: This is a broad category covering insecure default configurations, verbose error messages containing sensitive information, unnecessary HTTP methods being enabled, or missing security headers.
Example: An API server sends back detailed stack traces in error messages, revealing underlying frameworks, library versions, and internal file paths that an attacker can use for reconnaissance.
Mitigation:
Content-Security-Policy
).What it is: Injection flaws, such as SQL, NoSQL, or Command Injection, occur when untrusted data is sent to an interpreter as part of a command or query. The attacker's malicious data can trick the interpreter into executing unintended commands.
Example: An API endpoint that searches for products uses raw user input to construct a SQL query: SELECT * FROM products WHERE name = '
+ userInput + '
. An attacker can provide input like ' OR 1=1; --
to retrieve all products.
Mitigation:
What it is: This risk relates to issues with API versioning and inventory. Older, unpatched API versions might remain active and exposed, or development/staging environments might be accessible from the public internet.
Example: api.example.com/v1
is deprecated and vulnerable, but it was never taken offline. Attackers discover it and exploit its known flaws, even though api.example.com/v2
is secure.
Mitigation:
What it is: Without adequate logging and monitoring, it's difficult to detect and respond to attacks. Attackers rely on the lack of monitoring to operate undetected.
Example: An attacker performs a slow, low-volume credential stuffing attack over several days. Without proper logging and alerting on failed login attempts, the attack goes unnoticed.
Mitigation:
Learn about account takeover threats, protection strategies, and detection methods to secure your digital accounts and prevent unauthorised access.
An overview of Account Takeover Attacks
A step-by-step breakdown of how credential stuffing attacks are carried out, from obtaining stolen credentials to bypassing defenses and taking over accounts.
An introduction to Anycast DNS
A quick description about what an Apex Domain is.
Learn the essential best practices for managing and rotating API keys to enhance security, prevent unauthorized access, and minimize the impact of key compromise.
© PEAKHOUR.IO PTY LTD 2025 ABN 76 619 930 826 All rights reserved.