Source: FT7 (#308 / PR #311) — F-5。
Severity: high / Kind: feature-gap / Decision: fix-in-framework。
現状
`class/xion/ControllerBase.php:431-435` の `verifyCsrfFromPost(): bool` は単に bool を返す。controller 側で if 忘れがあると、bad CSRF token でも 200 + 通常 HTML が返り silent CSRF bypass になる。REST 側は `ControllerBase::run():206-208` の `requiresCsrfProtection()` が自動で 403 + JSON envelope を出すので非対称。
やること
- 新 helper `requireCsrfFromPost(string $field = 'csrf_token'): void` を追加し、失敗時は 403 (HTML 側は `template/error/csrf.tpl` を render) で terminate
- 既存 `verifyCsrfFromPost()` は低レベル API として残す (advanced 用途で fail recovery したい時)
- HTML tutorial (`docs/tutorials/html-login-form.md` 等) を新 helper に書き換える
- 既存 controller / sample で `verifyCsrfFromPost` を呼んでいる箇所を新 helper へ swap
受け入れ条件
Source: FT7 (#308 / PR #311) — F-5。
Severity: high / Kind: feature-gap / Decision: fix-in-framework。
現状
`class/xion/ControllerBase.php:431-435` の `verifyCsrfFromPost(): bool` は単に bool を返す。controller 側で if 忘れがあると、bad CSRF token でも 200 + 通常 HTML が返り silent CSRF bypass になる。REST 側は `ControllerBase::run():206-208` の `requiresCsrfProtection()` が自動で 403 + JSON envelope を出すので非対称。
やること
受け入れ条件