July 28, 2026
OWASP API Security Top 10 (Part 2): 5 API Vulnerabilities Every Developer Should Understand
APIs power almost every modern application we use today — from mobile banking and e-commerce platforms to healthcare systems and social…
By Christine Osama
4 min read
APIs power almost every modern application we use today — from mobile banking and e-commerce platforms to healthcare systems and social media. As APIs continue to exchange sensitive data between services, they have also become one of the primary targets for attackers.
In Part 1, we explored the first five vulnerabilities in the OWASP API Security Top 10. In this article, we'll continue with the remaining five and understand how attackers exploit them, why they are dangerous, and how to prevent them.
The biggest lesson you'll notice throughout this article is simple:
Never trust client input. Always enforce security on the server side.
API6: Mass Assignment
Imagine a user updating their profile. They should only be able to change their name and email address. However, before sending the request, an attacker intercepts it and secretly adds another field:
{
"name": "Christine",
"email": "christine@email.com",
"role": "admin"
}{
"name": "Christine",
"email": "christine@email.com",
"role": "admin"
}If the backend automatically maps every incoming field to the database without checking what is actually allowed, the application may unintentionally grant administrative privileges.
This vulnerability is known as Mass Assignment.
The problem isn't that the client sent extra data — clients can always modify requests. The real problem is that the server blindly trusted every field it received.
Why is it dangerous?
A successful Mass Assignment attack can allow attackers to:
- Escalate privileges.
- Modify sensitive business data.
- Bypass application logic.
- Manipulate values that should only be controlled by the server.
How to prevent it
- Allow only expected fields (Allowlist).
- Never bind all client input automatically.
- Validate every field on the server.
- Use framework protections such as Laravel's fillable and guarded properties.
Key Takeaway
The client decides what to send. The server decides what is allowed.
API7: Security Misconfiguration
Not every security issue is caused by vulnerable code.
Sometimes the application is perfectly written, but the environment itself exposes unnecessary information.
Imagine opening an API endpoint and receiving a complete stack trace containing:
- File paths
- Framework version
- Controller names
- Database errors
Or discovering that the application's Swagger documentation is publicly accessible without authentication.
These small configuration mistakes give attackers valuable information about the system before they even launch an attack.
This is known as Security Misconfiguration.
Common examples
- Debug mode enabled in production.
- Public API documentation.
- Default usernames and passwords.
- Incorrect CORS configuration.
- Directory listing enabled.
- Verbose error messages.
Why is it dangerous?
Security misconfigurations make reconnaissance significantly easier.
The more an attacker learns about your infrastructure, frameworks, and application architecture, the easier it becomes to identify exploitable weaknesses.
How to prevent it
- Disable debugging in production.
- Return generic error messages.
- Secure administrative interfaces.
- Regularly review security configurations.
- Remove unnecessary services and default credentials.
Key Takeaway
A secure application can still become vulnerable because of insecure configuration.
API8: Injection
Injection attacks have existed for decades, yet they continue to appear in modern applications.
Imagine a login page where the backend directly inserts user input into an SQL query.
Instead of entering a password, an attacker submits:
' OR 1=1--' OR 1=1--If the application builds SQL queries using string concatenation, the database interprets that input as SQL code instead of plain text.
The result?
The attacker may bypass authentication without ever knowing the real password.
Although SQL Injection is the most common example, injection vulnerabilities can also affect operating system commands, XML parsers, NoSQL databases, and other interpreters.
Why is it dangerous?
Injection attacks may lead to:
- Authentication bypass.
- Data leakage.
- Data modification.
- Complete database compromise.
- Remote Code Execution in some cases.
How to prevent it
- Use parameterized queries (Prepared Statements).
- Validate and sanitize user input.
- Never concatenate user input into queries.
- Deploy a Web Application Firewall (WAF) as an additional layer of defense.
Key Takeaway
User input should always be treated as data — not as executable code.
API9: Improper Asset Management
Many organizations continuously release new API versions.
For example:
/api/v1/api/v1becomes
/api/v2/api/v2Everyone migrates to the new version…
but the old API remains active on the server.
Months later, an attacker discovers the forgotten endpoint.
Unlike the new version, the old API may still expose additional information, lack authentication improvements, or contain vulnerabilities that have already been fixed.
This is exactly what Improper Asset Management looks like.
Why is it dangerous?
Attackers actively search for:
- Old API versions.
- Development environments.
- Test endpoints.
- Deprecated services.
- Forgotten documentation.
Any forgotten asset may become the weakest entry point into an otherwise secure application.
How to prevent it
- Maintain a complete API inventory.
- Remove deprecated endpoints.
- Separate Development, QA, and Production environments.
- Keep API documentation updated.
- Periodically review exposed endpoints.
Key Takeaway
You can't secure an API that you forgot still exists.
API10: Insufficient Logging & Monitoring
Imagine your organization discovers a data breach.
The first questions everyone asks are:
- Who accessed the system?
- Which endpoint was abused?
- What data was affected?
- When did the attack start?
Without proper logs, there are no answers.
Without monitoring, the attack may continue for hours — or even days — without anyone noticing.
Logging doesn't stop attacks.
Monitoring doesn't prevent attacks.
But together, they enable security teams to detect incidents quickly, investigate them, and respond before more damage occurs.
What should be logged?
- Authentication attempts.
- Failed logins.
- Access denied events.
- API endpoints accessed.
- IP addresses.
- Timestamps.
- Input validation failures.
Modern organizations typically forward these logs to a SIEM platform for correlation, alerting, and incident response.
How to prevent it
- Enable detailed API logging.
- Monitor security events continuously.
- Forward logs to a SIEM solution.
- Protect log integrity and confidentiality.
- Configure alerts for suspicious activities.
Key Takeaway
If you can't see an attack, you can't respond to it.
Final Thoughts
The last five vulnerabilities in the OWASP API Security Top 10 highlight an important reality:
Not every security issue is caused by sophisticated exploits.
Sometimes the biggest risks come from trusting client input, leaving old APIs online, exposing unnecessary information, or failing to detect attacks altogether.
Secure APIs require more than authentication and authorization — they require secure design, proper configuration, continuous monitoring, and disciplined lifecycle management.
Whether you're a developer, security engineer, or penetration tester, understanding these vulnerabilities is the first step toward building APIs that are resilient against modern attacks.