Install
Works with Drupal: ^10 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Version 1.0.3 is a security release addressing a CSRF (Cross-Site Request Forgery) vulnerability in the membership plan enable and disable operations.
## Security Fix
### Plan enable/disable CSRF vulnerability (P0)
The plan enable and disable routes were handled by a direct controller action accepting any HTTP method, including GET, without CSRF token protection. Clicking an administrative link immediately changed the plan status.
Replaced the controller with Drupal EntityConfirmFormBase confirmation forms using _entity_form routing. GET requests now display a confirmation form without changing plan status. POST submissions are validated by Drupal's Form API CSRF mechanism — requests without a valid token are rejected. Permission enforcement via 'administer membership plans' is checked before form access.
## Regression Tests
12 functional security regression tests were added, verified in Drupal 11.4.12 (PHP 8.4.22):
- GET requests display confirmation forms without changing plan status
- POST without CSRF token is rejected
- POST with tampered CSRF token is rejected
- Authorized submissions succeed
- Unauthorized and anonymous access returns 403
- Idempotent enable/disable behavior
- Admin list operation links render correctly
## Upgrade Instructions
No database updates or configuration changes required. Route paths are unchanged. Clear cache after updating: drush cr. No breaking changes.
## Known Limitations
- Drupal 10 runtime compatibility not tested (APIs are stable across Drupal 10/11)
- Membership lifecycle list links (activate/cancel/renew/suspend/resume) return HTTP 405 — pre-existing issue, routes are CSRF-protected
## Files Changed
- membership_manager.routing.yml (routes use _entity_form)
- src/Form/MembershipPlanEnableConfirmForm.php (new confirmation form)
- src/Form/MembershipPlanDisableConfirmForm.php (new confirmation form)
- src/Entity/MembershipPlan.php (added enable/disable form handlers)
- src/Controller/MembershipPlanController.php (deleted)
- tests/src/Functional/MembershipPlanSecurityTest.php (12 security tests)
- membership_manager.info.yml (version 1.0.3)
- CHANGELOG.md