Files
affaan-m--everything-claude…/docs/ja-JP/rules/php/security.md
T
wehub-resource-sync d48cda4081
CI / Test (ubuntu-latest, Node 18.x, bun) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, npm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, pnpm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, yarn) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 20.x, bun) (push) Failing after 17m13s
CI / Test (ubuntu-latest, Node 20.x, npm) (push) Failing after 18m42s
CI / Test (ubuntu-latest, Node 20.x, pnpm) (push) Failing after 15m0s
CI / Test (ubuntu-latest, Node 20.x, yarn) (push) Failing after 49m44s
CI / Test (ubuntu-latest, Node 22.x, bun) (push) Failing after 51m55s
CI / Test (ubuntu-latest, Node 22.x, pnpm) (push) Failing after 21m57s
CI / Test (ubuntu-latest, Node 22.x, npm) (push) Failing after 37m39s
CI / Test (ubuntu-latest, Node 22.x, yarn) (push) Failing after 34m7s
CI / Validate Components (push) Failing after 37m15s
CI / Python Tests (push) Failing after 10m1s
CI / Security Scan (push) Failing after 10m1s
CI / Lint (push) Failing after 17m12s
CI / Coverage (push) Failing after 20m19s
CI / Test (macos-latest, Node 18.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, yarn) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:55 +08:00

1.9 KiB

paths
paths
**/*.php
**/composer.lock
**/composer.json

PHP セキュリティ

このファイルは common/security.md を PHP 固有のコンテンツで拡張します。

入力と出力

  • フレームワーク境界でリクエスト入力を検証する(FormRequest、Symfony Validator、または明示的な DTO バリデーション)。
  • テンプレートではデフォルトで出力をエスケープする; 生の HTML レンダリングは正当化が必要な例外として扱う。
  • バリデーションなしにクエリパラメータ、Cookie、ヘッダー、アップロードされたファイルのメタデータを信頼しない。

データベースの安全性

  • すべての動的クエリにプリペアドステートメント(PDO、Doctrine、Eloquent クエリビルダ)を使用する。
  • コントローラ/ビューでの文字列構築 SQL を避ける。
  • ORM のマスアサインメントを慎重にスコープし、書き込み可能なフィールドをホワイトリストにする。

シークレットと依存関係

  • 環境変数またはシークレットマネージャからシークレットをロードする、コミットされた設定ファイルからは読み込まない。
  • CI で composer audit を実行し、依存関係追加前に新しいパッケージメンテナーの信頼性を確認する。
  • メジャーバージョンは意図的に固定し、放棄されたパッケージは速やかに削除する。

認証とセッションの安全性

  • パスワード保存には password_hash() / password_verify() を使用する。
  • 認証と権限変更後にセッション識別子を再生成する。
  • 状態変更を伴う Web リクエストに CSRF 保護を強制する。

リファレンス

スキル: laravel-security で Laravel 固有のセキュリティガイダンスを参照してください。