Yireo_CspUtilities

PHP 8.2 - 8.5
Magento 2.4.6 - 2.4.9
CSP Yes
PHPStan 3
Magento PHPCS 7
License OSL-3.0
Latest Release 1.0.1

This Magento 2 module offers CSP utilities for other modules, including various Yireo extensions.

Installation

Installation is usually done via other modules, but if you wanted to separately install this, here you go:

composer require yireo/magento2-csp-utilities
bin/magento module:enable Yireo_CspUtilities

Configuration

  • Inline Script Mode
    • nonce: Generate CSP nonces for Yireo extensions. This is the default, but it is currently not as secure in Magento, if the HTML is cached;
    • hash: Generate CSP hashes for Yireo extensions. This is more secure. However, with this option, your HTTP headers could grow, which could lead into webserver limits;

Current status

Magento 2 Static Tests success
Playwright test success
Magento 2 Integration Tests success
Magento 2 DI compilation success
Magento 2 Unit Tests success

Support

For getting support, create an Issue under the following project URL:

https://github.com/yireo/Yireo_CspUtilities

Composer details
Magento module name
Yireo_CspUtilities
Composer name
yireo/magento2-csp-utilities
Composer version
No release yet
Default branch
master
Requirements
ext-pcre: *
magento/framework: ^102.0 || ^103.0
magento/module-backend: ^100.0 || ^101.0 || ^102.0
magento/module-config: ^101.0
magento/module-store: ^100.0 || ^101.0
php: >=8.2 <8.6
Releases
1.0.1 06 November 2026
Changelog

[1.0.1] - 10 March 2025

Fixed

  • Potential regex fail could cause PHP notice

[1.0.0] - 23 August 2024

  • Initial release

Last modified: October 17, 2026