Custom Formatters
The formatter engine runs a function to execute user provided PHP code and allows arbitrary PHP execution on the site. An administrator account could view any private data on the site and alter any data on the site, including the underlying code.
- Who could do thisOnly someone with an administrator login.
- Does it apply to youAny site using this module.
- Has it been used in attacksNo sign of it.
- How urgentDrupal rates this critical. Cyber Essentials expects a fix within 14 days. Do it this week.
Tell your developerUpdate Custom Formatters to 4.2.1.
For developers: what the fix changed
The fix introduces granular permissions for custom formatters, adding restricted permissions for creating and editing PHP and Twig formatters in custom_formatters.permissions.yml and enforcing them via FormatterAccessControlHandler.php. It also updates the routing requirements and plugin definitions to use these new permissions.
Also in this release The release branch was updated to 4.2.x in CI and documentation files, and the changelog was updated.
CHANGELOG.md+28 −0README.md+8 −5codecov.yml+1 −1custom_formatters.module+2 −2 fixcustom_formatters.permissions.yml+29 −1 fixcustom_formatters.routing.yml+3 −3 fixsrc/Annotation/FormatterType.php+13 −0 fixsrc/Attribute/FormatterType.php+7 −0 fixsrc/Controller/CustomFormattersController.php+8 −3 fixsrc/FormatterAccessControlHandler.php+92 −3 fixsrc/Plugin/CustomFormatters/FormatterType/Php.php+7 −5 fixsrc/Plugin/CustomFormatters/FormatterType/Twig.php+9 −0 fix