Broken function level auth

From zakirkun/ice-tea · View interactive version

Broken function level auth is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects API endpoints that perform privileged operations without verifying the caller has the required role or permission.

How to use this skill

Skill file

Broken Function Level Authorization

Overview

BFLA (API Security Top 10 #5) occurs when an API does not properly enforce which users can access which functions. Common manifestations:

Detection Strategy

Remediation

Apply role-based access control at every sensitive endpoint.

Vulnerable:

app.delete('/api/admin/users/:id', authenticate, async (req, res) => {
    // No admin role check!
    await User.findByIdAndDelete(req.params.id);
});

Safe:

app.delete('/api/admin/users/:id', authenticate, requireRole('admin'), async (req, res) => {
    await User.findByIdAndDelete(req.params.id);
});
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.