Skip to content

SSZcreate/Pentab_server / .agents/skills/cybersecurity/skills/conducting-api-security-testing

conducting-api-security-testing

Verified

Conducts security testing of REST, GraphQL, and gRPC APIs to identify vulnerabilities in authentication, authorization, rate limiting, input validation, and business logic. The tester uses the OWASP API Security Top 10 as the testing framework, combining Burp Suite interception with Postman collections and custom scripts to test endpoint security at every privilege level. Activates for requests involving API security testing, REST API pentest, GraphQL security assessment, or API vulnerability testing.

FileKindSize
LICENSEother11.0 KB
SKILL.mdskill md11.6 KB
references/api-reference.mdmarkdown2.5 KB
scripts/agent.pyscript8.2 KB

references/api-reference.md

View on GitHub
# API Reference: API Security Testing Agent

## Overview

Tests REST and GraphQL APIs for OWASP API Security Top 10 vulnerabilities including BOLA, BFLA, mass assignment, rate limiting, JWT bypass, and GraphQL introspection disclosure. For authorized penetration testing only.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| requests | >=2.28 | HTTP requests to target APIs |

## CLI Usage

```bash
python agent.py --base-url https://api.target.com --token <jwt> \
  --low-priv-token <jwt> --graphql --output report.json
```

## Arguments

| Argument | Required | Description |
|----------|----------|-------------|
| `--base-url` | Yes | Target API base URL |
| `--token` | No | Auth bearer token for authenticated testing |
| `--low-priv-token` | No | Low-privilege token for BFLA testing |
| `--login-endpoint` | No | Login endpoint for rate limiting test (default: `/api/auth/login`) |
| `--graphql` | No | Test GraphQL introspection disclosure |
| `--output` | No | Output file (default: `api_security_report.json`) |

## Key Functions

### `test_bola(base_url, endpoint_template, id_field, valid_id, other_id, auth_token)`
Tests Broken Object Level Authorization by accessing another user's resource with own credentials.

### `test_bfla(base_url, admin_endpoints, low_priv_token)`
Tests admin endpoints with low-privilege tokens using GET, POST, DELETE methods.

### `test_mass_assignment(base_url, endpoint, auth_token, extra_fields)`
Sends undocumented fields (role, isAdmin) to update endpoints and verifies if they persist.

### `test_rate_limiting(base_url, endpoint, num_requests)`
Sends rapid requests to detect absence of rate limiting on authentication endpoints.

### `test_jwt_none_algorithm(base_url, endpoint, jwt_token)`
Forges JWT with `alg: none` to test for algorithm confusion vulnerabilities.

### `test_graphql_introspection(base_url, graphql_endpoint)`
Sends introspection query to check if full schema disclosure is enabled.

### `test_excessive_data_exposure(base_url, endpoint, auth_token, expected_fields)`
Compares API response fields against expected fields to identify over-exposure.

## OWASP API Top 10 Coverage

| OWASP ID | Vulnerability | Function |
|----------|--------------|----------|
| API1:2023 | Broken Object Level Authorization | `test_bola` |
| API3:2023 | Excessive Data Exposure | `test_excessive_data_exposure` |
| API4:2023 | Unrestricted Resource Consumption | `test_rate_limiting` |
| API5:2023 | Broken Function Level Authorization | `test_bfla` |
| API6:2023 | Mass Assignment | `test_mass_assignment` |
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 192kUpdated Claude CodeCodexVerifiedInstall