Install

Works with Drupal: ^10 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 147.67 KB
MD5: 7be638709f2565ff3284a49fd8e46297
SHA-1: 7a5252eef1be591ea6b50a0768e03ec95d3fcc66
SHA-256: 3635242b5c61e6c888a9985ef17d096a88845ac684b5ea3fadd7b54f832d5613
Download zip 212.19 KB
MD5: 04f83b56275da7671f6a3f87babf8ee0
SHA-1: 843c59f971286298830aa0891739f6c749ee9ace
SHA-256: f5b07eea0b6f43f85597370be98ad99a567224bd595b316256f0e708ebc517bb

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

Created by: darkdim
Created on: 21 Nov 2026 at 08:22 UTC
Last updated: 21 Nov 2026 at 08:22 UTC
Bug fixes

Other releases