소스 정보
- 저장소
- tools-only/X-Skills
- 최근 소스 활동
- 2026년 2월 9일 04:32
- 감지된 SKILL.md 언어
- 영어
- 스타
- 7
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tools-only/X-Skills --skill api-security-audit명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | api-security-audit |
| description | Comprehensive security audit for REST and GraphQL APIs |
| shortcut | asa |
| category | security |
| difficulty | intermediate |
| estimated_time | 15-30 minutes |
Performs comprehensive security audit of REST and GraphQL APIs, checking for OWASP API Security Top 10 vulnerabilities, authentication/authorization flaws, injection risks, and business logic issues.
Complete API Security Assessment:
Output: Detailed security audit report with exploitability ratings and remediation guidance
Time: 15-30 minutes per API
Perfect For:
Use This When:
# Audit REST API
/api-security-audit https://api.example.com
# Audit GraphQL API
/api-security-audit https://api.example.com/graphql --type graphql
# Audit with authentication
/api-security-audit https://api.example.com --auth "Bearer TOKEN"
# Audit specific endpoints
/api-security-audit https://api.example.com/users --endpoints /users,/orders
# Generate detailed report
/api-security-audit https://api.example.com --output api-security-report.md
Shortcut:
/asa https://api.example.com # Quick audit
Vulnerability: Users can access objects belonging to other users
Example Attack:
# User 123 accesses their own order
GET /api/orders/456
Authorization: Bearer USER_123_TOKEN
# Attack: Change order ID to access other user's order
GET /api/orders/789 # ← Belongs to User 456!
Authorization: Bearer USER_123_TOKEN
# If API doesn't validate ownership, User 123 can see User 456's order
Detection Method:
# Test IDOR vulnerability
1. Create two test users (User A, User B)
2. User A creates resource (e.g., order ID 100)
3. User B tries to access: GET /api/orders/100
4. If successful → IDOR vulnerability exists
Remediation:
// VULNERABLE: No authorization check
app.get('/api/orders/:id', authenticate, async (req, res) => {
const order = await Order.findById(req.params.id)
res.json(order) // Returns ANY order if it exists!
})
// SECURE: Verify ownership
app.get('/api/orders/:id', authenticate, async (req, res) => {
const order = await Order.findById(req.params.id)
if (!order) {
return res.status(404).json({ error: 'Order not found' })
}
if (order.userId !== req.user.id && !req.user.isAdmin) {
return res.status(403).json({ error: 'Forbidden' })
}
res.json(order)
})
Vulnerability: Weak authentication allowing unauthorized access
Common Issues:
Example Attack:
# Brute force login (no rate limiting)
for password in $(cat passwords.txt); do
curl -X POST https://api.example.com/login \
-d "username=admin&password=$password"
done
Remediation:
// SECURE: Rate limiting on login
const rateLimit = require('express-rate-limit')
const loginLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 5, // 5 attempts
message: 'Too many login attempts, please try again later'
})
app.post('/login', loginLimiter, async (req, res) => {
// Login logic with strong password requirements
// - Minimum 12 characters
// - Require uppercase, lowercase, numbers, symbols
// - Check against common password list
})
Vulnerability: Users can modify properties they shouldn't access
Example Attack (Mass Assignment):
# Normal user update
PATCH /api/users/123
{
"name": "John Doe",
"email": "[email protected]"
}
# Attack: Add admin flag
PATCH /api/users/123
{
"name": "John Doe",
"email": "[email protected]",
"isAdmin": true # ← Attacker tries to elevate privileges!
}
Remediation:
// VULNERABLE: Mass assignment
app.patch('/api/users/:id', async (req, res) => {
await User.update(req.params.id, req.body) // Updates ALL fields!
})
// SECURE: Allowlist specific fields
app.patch('/api/users/:id', async (req, res) => {
const allowedFields = ['name', 'email', 'phone']
const updates = {}
allowedFields.forEach(field => {
if (req.body[field] !== undefined) {
updates[field] = req.body[field]
}
})
await User.update(req.params.id, updates)
})
Vulnerability: No limits on API usage, leading to DoS or cost overruns
Example Attack:
# Exhaust API resources
while true; do
curl https://api.example.com/expensive-operation &
done
# Launch thousands of requests, exhaust server resources
Remediation:
// SECURE: Rate limiting + pagination + timeouts
const rateLimit = require('express-rate-limit')
// Global rate limit
app.use(rateLimit({
windowMs: 1 * 60 * 1000, // 1 minute
max: 100 // 100 requests per minute
}))
// Pagination enforcement
app.get('/api/users', (req, res) => {
const page = parseInt(req.query.page) || 1
const limit = Math.min(parseInt(req.query.limit) || 10, 100) // Max 100
// Return paginated results with limit
})
// Request timeout
app.use((req, res, next) => {
req.setTimeout(30000, () => { // 30 second timeout
res.status(408).send('Request timeout')
})
next()
})
Vulnerability: Regular users can access admin functions
Example Attack:
# Regular user token
curl -H "Authorization: Bearer USER_TOKEN" \
https://api.example.com/admin/delete-user/456
# Should return 403 Forbidden, but if vulnerable, executes!
Remediation:
// VULNERABLE: No role check
app.delete('/admin/delete-user/:id', authenticate, async (req, res) => {
await User.delete(req.params.id)
// Any authenticated user can delete users!
})
// SECURE: Role-based access control
function requireAdmin(req, res, next) {
if (!req.user.isAdmin) {
return res.status(403).json({ error: 'Admin access required' })
}
next()
}
app.delete('/admin/delete-user/:id', authenticate, requireAdmin, async (req, res) => {
await User.delete(req.params.id)
})
Vulnerability: No rate limiting on critical business operations
Example Attack:
# Purchase limited item repeatedly (no rate limit)
for i in {1..1000}; do
curl -X POST https://api.example.com/purchase \
-d "item_id=limited_edition_sneakers&quantity=1" &
done
# Buys entire stock, legitimate customers can't purchase
Remediation:
// SECURE: Business logic rate limiting
const Redis = require('ioredis')
const redis = new Redis()
app.post('/purchase', authenticate, async (req, res) => {
const userId = req.user.id
const key = `purchase:${userId}`
// Allow 1 purchase per 10 minutes for this item
const exists = await redis.get(key)
if (exists) {
return res.status(429).json({
error: 'Purchase limit exceeded. Try again in 10 minutes.'
})
}
// Process purchase
await processPurchase(req.body)
// Set rate limit
await redis.set(key, '1', 'EX', 600) // 10 minutes
res.json({ success: true })
})
Vulnerability: API fetches user-supplied URLs, exposing internal resources
Example Attack:
# Intended use: Fetch profile picture from URL
POST /api/upload-from-url
{
"url": "https://example.com/profile.jpg"
}
# Attack: Access internal resources
POST /api/upload-from-url
{
"url": "http://169.254.169.254/latest/meta-data/iam/security-credentials/"
}
# Exposes AWS credentials!
Remediation:
// SECURE: URL validation and allowlist
const validator = require('validator')
app.post('/api/upload-from-url', async (req, res) => {
const { url } = req.body
// Validate URL format
if (!validator.isURL(url, { protocols: ['https'] })) {
return res.status(400).json({ error: 'Invalid URL' })
}
// Parse URL
const parsed = new URL(url)
// Blocklist internal IPs
const blocklist = [
'127.0.0.1', 'localhost',
'10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16',
'169.254.169.254' // AWS metadata endpoint
]
if (blocklist.some(ip => parsed.hostname.includes(ip))) {
return res.status(403).json({ error: 'Forbidden URL' })
}
// Allowlist domains
const allowedDomains = ['cdn.example.com', 'images.example.com']
(!allowedDomains.(parsed.)) {
res.().({ : })
}
response = (url, { : })
})
Common Issues:
Remediation:
// SECURE: Security headers and configuration
const helmet = require('helmet')
const cors = require('cors')
// Security headers
app.use(helmet())
// Strict CORS
app.use(cors({
origin: process.env.ALLOWED_ORIGINS.split(','),
credentials: true
}))
// Disable debug mode
app.set('env', 'production')
// Generic error messages
app.use((err, req, res, next) => {
console.error(err.stack) // Log internally only
res.status(500).json({
error: 'Internal server error' // Generic message to client
})
})
Issues:
Remediation:
/api/v1/, /api/v2/)Vulnerability: Blindly trusting third-party API responses
Example Attack:
// VULNERABLE: Trust external API response
app.get('/user-profile', async (req, res) => {
const externalData = await fetch('https://third-party.com/api/user')
const userData = await externalData.json()
// Directly insert into database without validation
await db.users.insert(userData) // SQL injection possible!
})
// SECURE: Validate external API responses
app.get('/user-profile', async (req, res) => {
const externalData = await fetch('https://third-party.com/api/user')
const userData = await externalData.json()
// Validate structure and types
const schema = {
name: 'string',
email: 'string',
age: 'number'
}
const validated = validateAgainstSchema(userData, schema)
// Sanitize before database insertion
await db.users.insert(validated)
})
Attack:
# Malicious deep query
query {
user(id: 1) {
friends {
friends {
friends {
friends {
friends {
# 100 levels deep!
}
}
}
}
}
}
}
Remediation:
// Limit query depth
const depthLimit = require('graphql-depth-limit')
const server = new ApolloServer({
schema,
validationRules: [depthLimit(5)] // Max 5 levels
})
Risk: Attackers can discover full API schema
Remediation:
// Disable introspection in production
const server = new ApolloServer({
schema,
introspection: process.env.NODE_ENV !== 'production'
})
Attack: Expensive queries exhaust resources
Remediation:
const { createComplexityLimitRule } = require('graphql-validation-complexity')
const server = new ApolloServer({
schema,
validationRules: [
createComplexityLimitRule(1000) // Max complexity score
]
})
$ /api-security-audit https://api.example.com
API Security Audit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
API: https://api.example.com
Type: REST API
Audit Date: 2025-10-10
⏱️ Duration: 18 minutes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CRITICAL VULNERABILITIES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Broken Object Level Authorization (BOLA)
Severity: Critical
Endpoint: GET /api/orders/:id
️ Issue: Users can access other users' orders by changing ID
Test:
- User A ID: 123, Created order ID: 456
- User B ID: 789, Accessed order ID: 456 successfully!
Fix:
if (order.userId !== req.user.id && !req.user.isAdmin) {
return res.status(403).json({ error: 'Forbidden' })
}
2. No Rate Limiting on Login
Severity: Critical
Endpoint: POST /api/login
️ Issue: Brute force attacks possible (tested 10,000 requests/min)
Fix:
const loginLimiter = rateLimit({
windowMs: 15 * 60 * 1000,
max: 5
})
app.post('/login', loginLimiter, loginHandler)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
️ HIGH SEVERITY VULNERABILITIES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3. Mass Assignment Vulnerability
Severity: High
Endpoint: PATCH /api/users/:id
️ Issue: Can modify isAdmin field
Test Payload:
PATCH /api/users/123
{ "isAdmin": true }
Result: Regular user elevated to admin!
Fix: Implement field allowlist
4. SQL Injection
Severity: High
Endpoint: GET /api/search?q=
️ Issue: Unsanitized search parameter
Test Payload:
GET /api/search?q=' OR '1'='1
Result: Returns all records!
Fix: Use parameterized queries
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
MEDIUM SEVERITY ISSUES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5. Verbose Error Messages
Severity: Medium
Error Response:
{
"error": "Error: Connection refused at Database.connect (db.js:45)"
}
️ Exposes: Internal paths, technology stack
Fix: Return generic error messages
6. No Pagination Limits
Severity: Medium
Endpoint: GET /api/users
️ Issue: Can request unlimited records
Fix: Enforce max limit (100 records)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
AUDIT SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OWASP API Security Top 10 Coverage:
API1: Broken Object Level Authorization - VULNERABLE
API2: Broken Authentication - VULNERABLE
API3: Broken Object Property Level Authorization - VULNERABLE
API4: Unrestricted Resource Consumption - PARTIAL
API5: Broken Function Level Authorization - SECURE
API6: Unrestricted Access to Sensitive Business Flows - NOT TESTED
API7: Server Side Request Forgery - NOT APPLICABLE
API8: Security Misconfiguration - VULNERABLE
API9: Improper Inventory Management - PARTIAL
API10: Unsafe Consumption of APIs - NOT TESTED
Total Findings: 15
Critical: 2
High: 4
Medium: 6
Low: 3
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REMEDIATION ROADMAP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Week 1 (Critical):
Fix BOLA vulnerability (4 hours)
Add login rate limiting (2 hours)
Week 2 (High):
Fix mass assignment (3 hours)
Fix SQL injection (4 hours)
Week 3 (Medium):
Generic error messages (2 hours)
Add pagination limits (2 hours)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Audit completed!
Report saved to: api-security-audit-2025-10-10.md
/security-scan-quick - Fast application security scan/penetration-tester - Full penetration testing (agent)/security-auditor-expert - OWASP Top 10 analysis (agent)Found API vulnerabilities?
/api-security-audit after changesTime Investment: 15-30 minutes per audit Value: Prevent data breaches, unauthorized access, and API abuse
Audit APIs thoroughly. Fix vulnerabilities early. Deploy securely.