1 Returning Full DB Objects
Excessive data exposure (OWASP API3) occurs when an API returns more data than necessary, relying on the client to filter what it displays. The sensitive data is still accessible in the raw API response.
Vulnerable pattern:
// Returns ALL user fields including password hash, MFA secret, admin flag
app.get("/api/users/:id", async (req, res) => {
const user = await User.findById(req.params.id);
res.json(user); // Sends: { id, email, passwordHash, mfaSecret, isAdmin, creditCard, ssn, ... }
});
// Frontend "hides" sensitive fields:
if (!currentUser.isAdmin) {
delete userObject.isAdmin; // Too late — already sent over the wire!
}An attacker simply inspects the raw API response in browser dev tools or Burp Suite to see all fields, regardless of what the UI displays.
Real-world impact: This pattern has led to mass exposure of password hashes, internal admin flags, credit card numbers, and personal data in APIs across major platforms.