Repository navigation
fix(security): admin UI refuses to compile without form CSRF protection - #28
Merged
Merged
Conversation
Purge, delete and export (AbstractHttpLogActionType declares its own CSRF options) rely on Symfony's form CSRF extension. Without security.csrf.token_manager / form.type_extension.csrf, or with framework.form.csrf_protection: false, they accepted tokenless cross-site POSTs. CsrfProtectionPass now fails the container compile when web_ui.enabled is true.
|
@coderabbitai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (cross-bundle pattern P2)
Admin purge / delete / export (
HttpLogAdminController::validateActionForm()onAbstractHttpLogActionType, which declares its own CSRF options) rely solely on Symfony's form CSRF extension. Without it (framework.csrf_protection: false/framework.form.csrf_protection: false) those forms validate without a token → cross-site POSTs could purge or delete logs.Fix
src/DependencyInjection/Compiler/CsrfProtectionPass.php(modelled on UptimeMonitorBundle): whenweb_ui.enabledis true the container refuses to compile withoutsecurity.csrf.token_manager+form.type_extension.csrf, or withform.type_extension.csrf.enabled = false. Registered inNowoHttpLogBundle::build().symfony/security-csrfalready inrequire.Evidence
tests/Unit/DependencyInjection/Compiler/CsrfProtectionPassTest.php(3 fail-closed configs, pass, skips) + integration test asserts registration; both fail on old code.Host impact
Admin UI disabled or standard Flex CSRF config: none. Admin UI + disabled form CSRF now fails at compile (intended). Suggested release: minor.
🤖 Generated with Claude Code