API Security
APIs expose business logic and data directly. We test whether every request is authenticated, authorized for the specific resource, validated, and limited.
OWASP API Security Top 10
The OWASP API Security Project lists the most critical risks specific to APIs. The 2023 edition is summarized below; see the official site for full details.
| ID | Risk | In short |
|---|---|---|
| API1 | Broken Object Level Authorization | Accessing another user's object by changing its ID. |
| API2 | Broken Authentication | Weak login, token, or credential handling. |
| API3 | Broken Object Property Level Authorization | Reading or writing fields the user should not see or change. |
| API4 | Unrestricted Resource Consumption | No limits on requests, payload size, or expensive operations. |
| API5 | Broken Function Level Authorization | Calling admin or privileged operations as a regular user. |
| API6 | Unrestricted Access to Sensitive Business Flows | Automated abuse of flows such as sign-up or checkout. |
| API7 | Server Side Request Forgery | Making the server fetch an attacker-chosen URL. |
| API8 | Security Misconfiguration | Insecure defaults, verbose errors, or missing hardening. |
| API9 | Improper Inventory Management | Forgotten, undocumented, or old API versions left exposed. |
| API10 | Unsafe Consumption of APIs | Trusting data from third-party APIs without validation. |
Authentication Is Not Authorization
Authentication confirms who the caller is. Authorization decides whether that caller may perform this action on this specific resource. A valid token proves identity; it does not prove the caller owns the record they are requesting.
- API ClientSends a request with a token.
- API EndpointReceives and parses the request.
- AuthenticationIs the token valid? Who is the caller?Fail → 401 Unauthorized
- AuthorizationMay this caller access this resource and action?Fail → 403 Forbidden (or 404)
- Backend ResourceReturns only the data the caller is allowed to see.
Key API Risks and Mitigations
Broken Function Level Authorization
A regular user calls an administrative endpoint, for example one that deletes or exports user accounts.
MitigationDeny by default; check role permissions on the server for every endpoint and HTTP method.
Input & Schema Validation
Unexpected fields, types, or sizes cause errors or unintended changes — such as a "role" field accepted in a profile update.
MitigationValidate requests against a schema; allow-list writable fields and reject unknown ones.
Sensitive Data Exposure
APIs often return full database objects and rely on the client to hide fields.
MitigationReturn only the fields each role needs; mask identifiers such as account or card numbers.
Rate Limiting & Resource Consumption
Unlimited requests enable brute force, scraping, and denial of service through expensive queries.
MitigationRate limits per client and endpoint, maximum page sizes, request size limits, and timeouts; return 429 when exceeded.
Secure Error Handling
Stack traces and database errors reveal internal structure and help attackers refine requests.
MitigationConsistent, generic error responses with a correlation ID; full details only in server logs.
Authentication Weaknesses
Endpoints that skip token checks, accept expired tokens, or allow unlimited login attempts.
MitigationEnforce authentication centrally, validate tokens fully, and throttle login and OTP attempts.
Practical Experience
FEGO's development team has worked through findings from third-party VAPT assessments of fintech mobile apps, web portals, and APIs: analyzing each report, planning fixes, and implementing them. The examples below are generalized and describe the kinds of issues we have worked on. They are not a statement about the current security of any application.
Role-based endpoint restrictions
Making sure an operation intended for one user role cannot be called by another, by enforcing role checks on the server for every endpoint.
Rate limiting
Limiting how often a form or API operation can be submitted, after testers showed that repeated automated submissions were accepted. This has been implemented in response to a reported finding.
Sensitive data in API responses
Removing or masking personal information in API responses so each caller receives only the data it needs.
CORS configuration
Restricting cross-origin access to trusted origins instead of permissive policies.
Server-side input validation
Validating every request on the server, regardless of client-side checks. This has been implemented in response to reported findings.
Safe error responses
Returning consistent, generic error messages instead of internal details.
Remediation and Validation
Remediation approach
- Review each finding and reproduce it safely in a test environment
- Prioritize by severity and business impact
- Agree the fix using standard references such as CWE and OWASP
- Plan the frontend, backend, and testing work for each fix
- Fix the root cause on the server, not only in the client
Validation and reporting
- Verify each fix in internal testing before release
- Track the status of every finding, from open to fixed
- Flag fixes that need a business decision or further checks
- Support retesting by the assessor or client; a finding is closed only when retesting confirms the fix
- Document what changed and any remaining risk
Official References
Explore Security Services
Strengthen Your Application Security
Let's discuss your security requirements and identify the right approach for your applications and APIs.