tools/vigil/skills/owasp-assessment/SKILL.md
# OWASP Assessment — 詳細仕様 2つの OWASP 標準に基づく網羅的セキュリティ検査。 - **OWASP Top 10:2021** — Web アプリケーション向け(A01〜A10) - **OWASP API Security Top 10:2023** — API 向け(API1〜API10) 各カテゴリに対して: 検査項目、CWE マッピング、grep パターン、判定基準、Opus 4.6 による深掘りポイントを定義する。 --- # Part 1: OWASP Top 10:2021(Web アプリケーション) 公式: https://owasp.org/Top10/ ## A01:2021 — Broken Access Control **概要:** アクセス制御の不備。ユーザーが許可された範囲を超えて操作できる。2021年版で1位に上昇。テスト対象の94%で検出。 **主要 CWE:** - CWE-200: 機密情報の未認可アクターへの露出 - CWE-201: 送信データへの機密情報の挿入 - CWE-352: CSRF -
npx skillsauth add nwiizo/workspace_2026 tools/vigil/skills/owasp-assessmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
2つの OWASP 標準に基づく網羅的セキュリティ検査。
各カテゴリに対して: 検査項目、CWE マッピング、grep パターン、判定基準、Opus 4.6 による深掘りポイントを定義する。
公式: https://owasp.org/Top10/
概要: アクセス制御の不備。ユーザーが許可された範囲を超えて操作できる。2021年版で1位に上昇。テスト対象の94%で検出。
主要 CWE:
検査項目:
Access-Control-Allow-Origin: * や不適切なオリジン許可../ でファイルシステムを横断可能かgrep パターン:
# IDOR 候補
Grep("\\$_(GET|POST|REQUEST)\\[.*(id|user_id|account|uid|pid)")
Grep("params\\[:(id|user_id|account_id)\\]")
Grep("req\\.(params|query|body)\\.(id|userId|accountId)")
# 認可チェック関数の特定
Grep("is_admin|isAdmin|check_role|checkRole|authorize|can\\(|ability|permit")
# CORS
Grep("Access-Control-Allow-Origin.*\\*")
Grep("Access-Control-Allow-Credentials.*true")
# パストラバーサル
Grep("\\.\\./|\\.\\.\\\\/|\\.\\.%2[fF]")
# 強制ブラウジング
Grep("admin|dashboard|manage|internal")
Opus 4.6 深掘り:
概要: 暗号化の不備。以前の「機密データの露出」から焦点を絞り、暗号化そのものの失敗に特化。
主要 CWE:
検査項目:
rand(), mt_rand(), Math.random() をセキュリティ用途に使っていないかgrep パターン:
# 弱いハッシュ
Grep("\\bmd5\\s*\\(|\\bsha1\\s*\\(")
Grep("hashlib\\.(md5|sha1)")
Grep("MessageDigest\\.getInstance\\(['\"]MD5|SHA-1")
# ハードコードされた秘密
Grep("password\\s*=\\s*['\"](?!\\s*$)|secret\\s*=\\s*['\"]|api_key\\s*=\\s*['\"]")
Grep("ENCRYPTION_KEY|SECRET_KEY|JWT_SECRET|PRIVATE_KEY")
# 弱い乱数
Grep("\\brand\\s*\\(|\\bmt_rand\\s*\\(|Math\\.random\\(|random\\.random\\(")
# 平文通信
Grep("http://(?!localhost|127\\.0\\.0\\.1)")
# 非推奨暗号
Grep("DES|RC4|RC2|Blowfish|ECB")
Grep("SSLv[23]|TLSv1[^.]|TLSv1\\.0")
Opus 4.6 深掘り:
概要: インジェクション攻撃。SQLi, XSS, OS コマンドインジェクション等。テスト対象の94%で何らかのインジェクション脆弱性が検出。
主要 CWE:
検査項目:
grep パターン:
# SQLi
Grep("(mysql_query|mysqli_query|pg_query|sqlite_query).*\\$")
Grep("SELECT.*FROM.*WHERE.*\\$|INSERT.*INTO.*VALUES.*\\$")
Grep("sprintf.*SELECT|sprintf.*INSERT|sprintf.*UPDATE|sprintf.*DELETE")
Grep("\\.execute\\(.*%s|\\.execute\\(.*\\+|\\.execute\\(.*\\$")
Grep("\\.raw\\(|Arel\\.sql\\(")
# XSS
Grep("echo\\s+\\$_(GET|POST|REQUEST)|print\\s+\\$_(GET|POST|REQUEST)")
Grep("innerHTML\\s*=|document\\.write\\(|\\$\\(.*\\.html\\(")
Grep("dangerouslySetInnerHTML|v-html=|\\|safe|\\|raw|\\{!!.*!!\\}")
Grep("res\\.send\\(.*req\\.|res\\.write\\(.*req\\.")
# コマンドインジェクション
Grep("(system|exec|passthru|shell_exec|popen|proc_open)\\s*\\(.*\\$")
Grep("os\\.system\\(.*request|subprocess\\.(call|run|Popen).*request")
Grep("Runtime\\.getRuntime\\(\\)\\.exec.*request|ProcessBuilder.*request")
# SSTI
Grep("render_template_string|Template\\(.*request|Jinja2.*request")
Grep("\\{\\{.*request|\\$\\{.*request")
Opus 4.6 深掘り:
概要: 安全でない設計。実装の欠陥ではなくアーキテクチャ・設計レベルの欠陥。2021年版で新規追加。「安全な設計でも実装の欠陥により脆弱性が生じるが、安全でない設計は完璧な実装でも修正できない」。
主要 CWE:
検査項目:
grep パターン:
# レート制限
Grep("rate_limit|throttle|RateLimit|slowDown|express-rate-limit")
# ビジネスロジック
Grep("price|amount|quantity|total|discount|coupon")
Grep("step|wizard|stage|phase|checkout")
# 再認証
Grep("confirm_password|current_password|re_authenticate|verify_password")
# リソース制限
Grep("max_size|maxFileSize|upload_max|MAX_UPLOAD|limit")
Opus 4.6 深掘り:
概要: セキュリティ設定の不備。テスト対象の90%で検出。XXE(旧 A04:2017)がこのカテゴリに統合。
主要 CWE:
検査項目:
grep パターン:
# デバッグ
Grep("debug\\s*=\\s*[Tt]rue|DEBUG\\s*=\\s*1|display_errors\\s*=\\s*[Oo]n")
Grep("APP_DEBUG|FLASK_DEBUG|DJANGO_DEBUG|NODE_ENV.*development")
# デフォルト認証情報
Grep("admin.*admin|root.*root|test.*test|default.*password")
# XXE
Grep("simplexml_load|DOMDocument|XMLReader|SAXParser|DocumentBuilder")
Grep("LIBXML_NOENT|FEATURE_EXTERNAL_ENTITIES")
# 情報漏洩
Grep("phpinfo\\s*\\(|server_info|ServerInfo")
Grep("stack_trace|stacktrace|backtrace|traceback")
Grep("error_reporting\\(.*E_ALL")
# セキュリティヘッダー(不在を確認)
Grep("X-Frame-Options|Content-Security-Policy|Strict-Transport-Security")
Grep("X-Content-Type-Options|X-XSS-Protection|Referrer-Policy")
概要: 既知脆弱性のあるコンポーネントの使用。
主要 CWE:
検査項目:
grep パターン:
# パッケージマニフェスト
Glob("**/composer.json", "**/package.json", "**/requirements.txt")
Glob("**/Gemfile", "**/go.mod", "**/Cargo.toml", "**/pom.xml")
Glob("**/package-lock.json", "**/yarn.lock", "**/Pipfile.lock")
# バージョン定数
Grep("version|VERSION|Version")
# PHP 非推奨関数
Grep("mysql_connect|mysql_query|ereg\\(|split\\(|session_register")
# Node.js 非推奨
Grep("new Buffer\\(|require\\(['\"]crypto['\"]\\)\\.createCipher\\b")
# Python 非推奨
Grep("cgi\\.escape|commands\\.getoutput|os\\.popen")
概要: 認証の不備。2017年版では2位だったが7位に下降(フレームワークの認証サポート向上による)。
主要 CWE:
検査項目:
Password1, admin/admin が許可されるかgrep パターン:
# セッション管理
Grep("session_regenerate_id|session_destroy|session_start")
Grep("req\\.session\\.destroy|req\\.session\\.regenerate")
Grep("session\\.gc_maxlifetime|SESSION_TIMEOUT|session_timeout|maxAge")
# パスワードハッシュ
Grep("password_hash|password_verify|bcrypt|argon2|scrypt")
Grep("pbkdf2|PBKDF2")
# パスワードリセット
Grep("password_reset|forgot_password|reset_token|recovery")
# ログイン試行制限
Grep("login_attempts|failed_login|lockout|account_lock|max_attempts")
概要: ソフトウェアとデータの完全性の不備。安全でないデシリアライゼーション(旧 A08:2017)を含む。CI/CD パイプライン、自動更新の整合性検証も対象。
主要 CWE:
検査項目:
grep パターン:
# デシリアライゼーション
Grep("\\bunserialize\\s*\\(")
Grep("pickle\\.loads|yaml\\.load\\((?!.*Loader)|yaml\\.unsafe_load")
Grep("ObjectInputStream|readObject|XMLDecoder|XStream")
Grep("JSON\\.parse.*eval|jsonpickle|marshal\\.loads")
# 外部リソースの整合性
Grep("integrity=|SRI|subresource")
Grep("<script.*src=.*http|<link.*href=.*http")
# CI/CD
Glob("**/.github/workflows/*.yml", "**/.gitlab-ci.yml", "**/Jenkinsfile")
Glob("**/Dockerfile", "**/docker-compose*.yml")
概要: セキュリティログと監視の不備。コミュニティ調査で3位。侵害の検出には平均287日かかる。
主要 CWE:
検査項目:
grep パターン:
# ログの存在確認
Grep("\\blog\\(|logger\\.|logging\\.|error_log|syslog|console\\.(log|error|warn)")
Grep("Log\\.(info|warn|error|debug)|log\\.(info|warn|error|debug)")
Grep("audit|audit_log|access_log")
# ログへの機密データ混入
Grep("log.*(password|secret|token|api_key|credit_card|ssn)")
Grep("console\\.log.*(password|secret|token)")
# ログインジェクション対策
Grep("log.*sanitize|log.*escape|log.*encode")
概要: SSRF。コミュニティ調査で1位として2021年版に新規追加。クラウド環境の普及で深刻度が上昇。
主要 CWE:
検査項目:
169.254.169.254 等のメタデータエンドポイントへのアクセスが防止されているかgrep パターン:
# URL をパラメータで受け取る機能
Grep("file_get_contents\\(.*\\$|curl_setopt.*CURLOPT_URL.*\\$")
Grep("requests\\.(get|post|put|delete)\\(.*request\\.")
Grep("urllib\\.request\\.urlopen.*request|httplib.*request")
Grep("fetch\\(.*req\\.|axios\\.(get|post).*req\\.")
Grep("HttpClient.*request|WebClient.*request")
Grep("RestTemplate.*request|OkHttp.*request")
# 内部 IP チェック
Grep("127\\.0\\.0\\.1|localhost|0\\.0\\.0\\.0|169\\.254\\.|10\\.|172\\.(1[6-9]|2|3[01])\\.|192\\.168\\.")
# URL スキーム
Grep("file://|gopher://|dict://|ftp://|ldap://")
Opus 4.6 深掘り:
公式: https://owasp.org/API-Security/editions/2023/en/0x11-t10/
概要: API がオブジェクト ID に基づくアクセス制御を適切に行わない。エンドポイントはオブジェクト識別子を処理するため、オブジェクトレベルのアクセス制御問題の広い攻撃面を形成する。
悪用容易性: Easy | 普及度: Widespread | 検出容易性: Easy
検査項目:
grep パターン:
# パスパラメータの ID
Grep("/:id|/<int:id>|/\\{id\\}|/\\{[a-z_]*_id\\}")
Grep("params\\[:id\\]|params\\['id'\\]|req\\.params\\.id")
# DB クエリでの ID 使用(認可チェックなし)
Grep("find\\(.*params|findById\\(.*params|where\\(.*id.*params")
Grep("SELECT.*WHERE.*id\\s*=.*params|SELECT.*WHERE.*id\\s*=.*req\\.")
# 認可関数
Grep("authorize|can\\?|has_permission|check_ownership|belongs_to")
Opus 4.6 深掘り:
概要: 認証メカニズムの実装不備。認証はすべてのユーザーにアクセス可能であるため、主要な攻撃面となる。
悪用容易性: Easy | 普及度: Common | 検出容易性: Easy
検査項目:
grep パターン:
# JWT
Grep("jwt\\.decode|jwt\\.verify|jsonwebtoken|jose|JWT")
Grep("algorithm.*none|alg.*none") # none アルゴリズム攻撃
Grep("JWT_SECRET|jwt_secret|token_secret")
# 認証エンドポイント
Grep("/login|/auth|/token|/signin|/signup|/register|/oauth")
Grep("/reset-password|/forgot-password|/verify-email")
# レート制限
Grep("rate.?limit|throttle|express-rate-limit|django-ratelimit|rack-attack")
# トークン in URL
Grep("token=|api_key=|access_token=|auth=")
概要: オブジェクトプロパティレベルの認可不備。旧 API3:2019(過剰なデータ露出)と旧 API6:2019(Mass Assignment)を統合。
悪用容易性: Easy | 普及度: Common | 検出容易性: Easy
検査項目:
grep パターン:
# 全プロパティ返却
Grep("to_json|to_dict|as_json|serialize|toJSON\\(\\)|JSON\\.stringify")
Grep("select\\s*\\*|SELECT\\s*\\*")
# Mass Assignment
Grep("update_attributes|assign_attributes|fill\\(|mass_assignment")
Grep("req\\.body\\)|Object\\.assign.*req\\.body|\\{.*\\.\\.\\.req\\.body")
# ホワイトリスト/ブラックリスト
Grep("attr_accessible|attr_protected|fillable|guarded")
Grep("permit\\(|strong_parameters|allowed_params")
Opus 4.6 深掘り:
is_admin, role, balance 等の権限昇格可能性概要: リソース消費の制限なし。旧「Lack of Resources & Rate Limiting」から改名。API リクエスト処理に必要なリソース(帯域、CPU、メモリ、ストレージ)の制限不足。
悪用容易性: Average | 普及度: Widespread | 検出容易性: Easy
検査項目:
grep パターン:
# ページネーション
Grep("per_page|page_size|pageSize|limit|offset|cursor")
Grep("LIMIT\\s+\\$|LIMIT.*request|LIMIT.*params")
# ファイルアップロード制限
Grep("max_size|maxFileSize|upload_max|MAX_UPLOAD|multer.*limits")
# GraphQL 深度制限
Grep("depthLimit|queryComplexity|maxDepth|maxComplexity")
# タイムアウト
Grep("timeout|TIMEOUT|requestTimeout|connectTimeout")
# レート制限(API 固有)
Grep("X-RateLimit|x-rate-limit|retry-after|429")
概要: 関数レベルの認可不備。複雑なアクセス制御ポリシー(階層、グループ、ロール)が認可の欠陥を招く。
悪用容易性: Easy | 普及度: Common | 検出容易性: Easy
検査項目:
/api/v1/users/export_all のような管理者機能を URL 推測でアクセスできないかgrep パターン:
# 管理者エンドポイント
Grep("/admin|/manage|/internal|/debug|/export|/import|/bulk")
Grep("admin_only|is_admin|require_admin|@admin_required")
# ロールチェック
Grep("role\\s*==|role\\s*===|has_role|check_role|@roles\\(|@authorize")
Grep("canActivate|AuthGuard|RolesGuard|PermissionGuard")
# HTTP メソッド制限
Grep("app\\.(get|post|put|delete|patch)\\(|router\\.(get|post|put|delete)")
Grep("@(Get|Post|Put|Delete|Patch)Mapping|RequestMethod\\.")
Opus 4.6 深掘り:
概要: 機密ビジネスフローへの無制限アクセス。API の自動化により、在庫の買い占め、チケット転売、スパム等のビジネス上の害を引き起こす。
悪用容易性: Easy | 普及度: Widespread | 検出容易性: Average
検査項目:
grep パターン:
# CAPTCHA
Grep("captcha|recaptcha|hcaptcha|turnstile")
# フィンガープリント
Grep("fingerprint|device_id|deviceId|browser_id")
# ビジネスクリティカルなフロー
Grep("purchase|checkout|reserve|book|transfer|withdraw|claim|redeem")
Grep("vote|review|comment|register|invite|referral")
Opus 4.6 深掘り:
概要: API がユーザー提供の URI を検証せずにリモートリソースを取得する。ファイアウォール/VPN を迂回可能。
悪用容易性: Easy | 普及度: Common | 検出容易性: Easy
検査項目:
file://, gopher:// 等の危険なスキームが制限されているかgrep パターン:
# Webhook
Grep("webhook|callback_url|notify_url|redirect_uri")
# URL パラメータ
Grep("url=|uri=|target=|dest=|redirect=|return_url=|next=")
Grep("fetch\\(.*params|requests\\.get\\(.*params|curl.*params")
# ファイルインポート
Grep("import_url|source_url|image_url|avatar_url|icon_url|feed_url")
Opus 4.6 深掘り:
概要: API スタック全体にわたるセキュリティ設定の不備。自動化ツールで検出・悪用可能。
悪用容易性: Easy | 普及度: Widespread | 検出容易性: Easy
検査項目:
* でないか)grep パターン:
# CORS(API 固有)
Grep("cors|CORS|Access-Control")
Grep("origin.*\\*|allow_origins.*\\*|allowedOrigins.*\\*")
# Content-Type 制限
Grep("Content-Type|content_type|consumes|produces")
Grep("application/json|application/xml|multipart/form-data")
# API エラーハンドリング
Grep("stack.*trace|stackTrace|internal.*error.*detail")
Grep("res\\.status\\(500\\)\\.json|InternalServerError")
# API ドキュメント(本番で露出していないか)
Grep("swagger|openapi|api-docs|graphql.*playground|graphiql")
概要: API インベントリの不適切な管理。古い API バージョン、パッチ未適用のエンドポイント、弱いセキュリティ要件の非本番エンドポイントが残存。
悪用容易性: Easy | 普及度: Widespread | 検出容易性: Average
検査項目:
grep パターン:
# API バージョニング
Grep("/v[0-9]+/|/api/v[0-9]+|version.*[0-9]+\\.[0-9]+")
# 非推奨/テスト用エンドポイント
Grep("deprecated|legacy|old_|_old|beta|alpha|test_|_test|staging")
Grep("/debug|/test|/demo|/sandbox|/dev/")
# API ドキュメント
Glob("**/swagger.*", "**/openapi.*", "**/api-docs*", "**/*.raml")
Opus 4.6 深掘り:
概要: API の安全でない利用。開発者はサードパーティ API からのデータをユーザー入力より信頼しがちで、弱いセキュリティ基準を適用する。
悪用容易性: Easy | 普及度: Common | 検出容易性: Average
検査項目:
grep パターン:
# サードパーティ API 呼び出し
Grep("requests\\.(get|post)|axios\\.(get|post)|fetch\\(|HttpClient|RestTemplate")
Grep("curl_exec|file_get_contents\\(.*http")
Grep("WebClient|OkHttp|Retrofit|Feign")
# レスポンスの直接使用(検証なし)
Grep("response\\.json\\(\\)|response\\.data|response\\.body")
Grep("json_decode\\(.*curl|JSON\\.parse\\(.*response")
# タイムアウト設定
Grep("timeout|connectTimeout|readTimeout|CURLOPT_TIMEOUT")
Opus 4.6 深掘り:
# OWASP Assessment Report
## 対象標準
- OWASP Top 10:2021(Web アプリケーション)
- OWASP API Security Top 10:2023(API)
## サマリー
### OWASP Top 10:2021
| カテゴリ | 検出数 | Critical | High | Medium | Low |
|---------|--------|----------|------|--------|-----|
| A01: Broken Access Control | N | n | n | n | n |
| A02: Cryptographic Failures | N | n | n | n | n |
| A03: Injection | N | n | n | n | n |
| A04: Insecure Design | N | n | n | n | n |
| A05: Security Misconfiguration | N | n | n | n | n |
| A06: Vulnerable and Outdated Components | N | n | n | n | n |
| A07: Identification and Authentication Failures | N | n | n | n | n |
| A08: Software and Data Integrity Failures | N | n | n | n | n |
| A09: Security Logging and Monitoring Failures | N | n | n | n | n |
| A10: Server-Side Request Forgery | N | n | n | n | n |
### OWASP API Security Top 10:2023
| カテゴリ | 検出数 | Critical | High | Medium | Low |
|---------|--------|----------|------|--------|-----|
| API1: Broken Object Level Authorization | N | n | n | n | n |
| API2: Broken Authentication | N | n | n | n | n |
| API3: Broken Object Property Level Authorization | N | n | n | n | n |
| API4: Unrestricted Resource Consumption | N | n | n | n | n |
| API5: Broken Function Level Authorization | N | n | n | n | n |
| API6: Unrestricted Access to Sensitive Business Flows | N | n | n | n | n |
| API7: Server Side Request Forgery | N | n | n | n | n |
| API8: Security Misconfiguration | N | n | n | n | n |
| API9: Improper Inventory Management | N | n | n | n | n |
| API10: Unsafe Consumption of APIs | N | n | n | n | n |
## 詳細
### [ID] 脆弱性タイトル
- **深刻度:** Critical / High / Medium / Low
- **ファイル:** `path:line`
- **OWASP:** A03:2021 / API1:2023(該当する両方を記載)
- **CWE:** CWE-89
- **コード:**
\```
// コード + 日本語コメント(// ← なぜ危険か)
\```
- **攻撃シナリオ:** ...
- **推奨修正:** ...
{カテゴリ}-{サブカテゴリ}-{連番}
A01-IDOR-01, A03-SQL-01, A03-XSS-01, A07-SESS-01{カテゴリ}-{サブカテゴリ}-{連番}
API1-BOLA-01, API2-AUTH-01, API3-MASS-01, API5-BFLA-01両方の ID を併記: A01-IDOR-01 / API1-BOLA-01
tools
Use when the user provides an arbitrary line of text and you must echo it back verbatim, prefixed with "ECHO:".
development
Turn OWASP ZAP JSON reports into code-level remediation work for any authorized web application without launching unscoped scans.
tools
# Playwright Attack Patterns Juice Shop を Playwright MCP で攻撃するパターン集。 ## SQLi ログイン ``` 1. browser_navigate → http://localhost:3000/#/login 2. browser_snapshot → ref確認 3. browser_type → email: "' OR 1=1--" 4. browser_type → password: "a" 5. browser_click → Loginボタン ``` ## XSS 攻撃 ``` browser_navigate → http://localhost:3000/#/search?q=<iframe src="javascript:alert('xss')"> ``` ## API 操作 (fetch) ```javascript browser_evaluate → function: () => fetch('/api/Users', { method: 'POST', headers
development
Refactors CLAUDE.md into minimal startup context by extracting path-specific rules, skills, commands, and agents. Use when CLAUDE.md exceeds 50 lines, startup feels slow, memory needs restructuring, or splitting monolithic project instructions.