nelmio/security-bundle
Extra security-related features for Symfony: signed/encrypted cookies, HTTPS/SSL/HSTS handling, cookie session storage, ...
v3.9.0
14M downloads/mo
#1276 most downloaded on Packagist
nelmio/NelmioSecurityBundle
What this package is like to depend on
Last release 6 months ago
23 Feb 2026
Ships unpredictably
gaps range from 2 weeks to 1.7 years
Nearly every release is documented
notes for 53 of 53 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
54 releases · first in 2013
4 releases in the last 12 months
see the full history below
Release timeline
54 releases · Jan 2013 to Feb 2026Releases
latest 54-
v3.9.023 Feb 2026 -
v3.8.014 Jan 2026 -
v3.7.030 Dec 2025Release notes
Open source →What's Changed
- Added support for Symfony 8 #386
- Update development dependencies to latest versions #388
- Fixed many docs issues (#376 #375 #383 #382 #384)
Full Changelog: v3.6.0...v3.7.0
-
v3.6.019 Sep 2025Release notes
Open source →What's Changed
- fix: Make PHPStan green by @silasjoisten in #378
- chore: Manual CS fix by @silasjoisten in #379
- feat(security): Add
Permissions-Policyheader support by @silasjoisten in #373 - feat(permissions-policy): Change header behaviour by @silasjoisten in #381
New Contributors
- @silasjoisten made their first contribution in #378
Full Changelog: v3.5.1...v3.6.0
-
v3.5.113 Mar 2025 -
v3.5.011 Mar 2025Release notes
Open source →What's Changed
- Added support for the
report-todirective by @martijnc in #357 - Added
DirectiveSetBuilderInterfaceto allow runtime modification of CSP rules by @martijnc in #348 - Fixed ExternalRedirectListener issue parsing some invalid URLs by @Seldaek in #364
Full Changelog: v3.4.2...v3.5.0
- Added support for the
-
v3.4.210 Sep 2024Release notes
Open source →What's Changed
- Fix Twig version check to not depend on changing VERSION_ID constant by @glaubinix in #361
New Contributors
- @glaubinix made their first contribution in #361
Full Changelog: v3.4.1...v3.4.2
-
v3.4.103 Sep 2024 -
v3.4.005 Jul 2024Release notes
Open source →What's Changed
- Deprecated X-Xss-Protection by @maxhelias in #342
- Deprecated the default signed cookie algorithm by @martijnc in #355
- Added
legacy_hash_algoto support backward-compatiblehash_algochanges in signed cookies by @martijnc in #351 - Added ability to set a custom CSP request matcher to define exactly which requests should receive CSP headers by @ihmels in #241
- Fixed DI Extension class deprecation with Symfony 7.1 by @norkunas in #350
- Fixed compatibility with twig 3.9 and yielding by @jderusse in #344 & #353
Full Changelog: v3.3.0...v3.4.0
-
v3.3.010 Apr 2024 -
v3.2.008 Mar 2024 -
v3.1.117 Jan 2024 -
v3.1.003 Dec 2023Release notes
Open source →- Fixed overriding CSP header
- Dropped support for Symfony < 5.4
- Added support for Symfony 7
-
v3.0.017 Mar 2022Release notes
Open source →- Bump minimal PHP version to 7.4
- Dropped support for Symfony < 4.4
- Dropped support for Twig 1
- Removed
DoctrineCacheUAFamilyParser(usePsrCacheUAFamilyParserinstead) - All classes have been marked as
final - Renamed
WhitelistBasedTargetValidatorclass toAllowListBasedTargetValidator - Removed
CookieSessionHandler - Allowed to define host restriction for clickjacking protection
-
v3.0.0-alpha.123 Feb 2022 pre-releaseNothing published for this version
-
v2.12.023 Feb 2022Release notes
Open source →- Filter moz-extension reports
- Log user agent along with CSP report
- Deprecated external_redirects.whitelist option in favor of external_redirects.allow_list
- Deprecated forced_ssl.whitelist option in favor of forced_ssl.allow_list
- Deprecated
Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Eventclass in favor ofNelmio\SecurityBundle\ContentSecurityPolicy\Violation\ReportEvent.
-
v2.11.018 Jan 2022Release notes
Open source →- Added support for CSP "prefetch-src" directive
- Added support for CSP "wasm-unsafe-eval" keyword
- Added support for Symfony 6
- Fixed deprecations warnings using PHP 8.1
- Added support for CSP "prefetch-src" directive
-
v2.10.316 Mar 2021 -
v2.10.217 Feb 2021Release notes
Open source →- Fix dependencies (allow installing on PHP 8 and explicitly require symfony/yaml)
-
v2.10.118 Jun 2020 -
v2.10.018 Jun 2020 -
v2.9.111 May 2020Release notes
Open source →- Ensure passing the correct type to UAParser::parse
- Use Symfony DI Reference instead of Definition
- Optimize regular expressions in the sha computer
- Show non-deprecated usage of the csp_nonce Twig function
- Ensure passing the correct type to UAParser::parse
-
v2.9.002 Mar 2020 -
v2.8.002 Mar 2020Release notes
Open source →- Fixed deprecated/invalid method usage on logger interface
- Drop tests for PHP 5.4
- Fixed deprecated/invalid method usage on logger interface
-
2.7.003 Apr 2019Release notes
Open source →- Use base64 for encoding nonces
- Support more CSP level 3 keywords
- Allow configuring a report URI for XSS
- Use base64 for encoding nonces
-
2.6.003 Apr 2019Release notes
Open source →- Support random_compat v9.99.99
- Don't ship unneeded files for composer installs
- Change controller action reference
- Add worker-src directive
- Fix deprecation for symfony/config 4.2+
- Support random_compat v9.99.99
-
2.5.121 Mar 2018 -
2.5.026 Feb 2018Release notes
Open source →- Allows matching the query parameter for clickjacking protection
- Cleanup content type restrictable listener
- Added Symfony 4 support
- Added support for 'worker-src' CSP directive
- Removed PHP 5.3 support guarantees
- Fix CSP noise filter compiler pass registration
- Allows matching the query parameter for clickjacking protection
-
2.4.022 Jun 2017Release notes
Open source →- Deprecate calling ContentSecurityPolicyListener::getNonce without usage ('script' or 'style')
- Added
forced_ssl > redirect_status_codeoption to allow switching to permanent redirect (301) responses - Fixed HSTS header being sent even in non-secure responses unnecessarily
- Fixed URLs with whitespace prefix not being seen as external redirects
- Added
- Deprecate calling ContentSecurityPolicyListener::getNonce without usage ('script' or 'style')
-
2.3.117 Mar 2017 -
2.3.017 Mar 2017Release notes
Open source →- Add support for script-src 'strict-dynamic' (see https://w3c.github.io/webappsec-csp/#strict-dynamic-usage)
- Improve CSP filtering
- Remove Twig extension compiler pass in favor of tag
- Use symfony/phpunit-bridge for testing on IC
- Add support for script-src 'strict-dynamic' (see https://w3c.github.io/webappsec-csp/#strict-dynamic-usage)
-
2.2.413 Feb 2017 -
2.2.313 Feb 2017 -
2.2.207 Feb 2017 -
2.2.107 Feb 2017 -
2.2.006 Feb 2017 -
2.1.026 Jan 2017Release notes
Open source →- Add support for Referrer Policy
- Content-Security-Policy header can now be disabled
- Fix encrypter deprecation
- Run the test suite on PHP 7.1
- Run the test suite with lowest dependencies
- Add support for Referrer Policy
-
2.0.419 Oct 2016 -
2.0.313 Oct 2016 -
2.0.224 Aug 2016Release notes
Open source →- Fix typo in the ALLOW-FROM implementation
- Update browser_adaptive configuration. Allow custom adapters
- Add Doctrine Cache and Psr Cache adapters for caching UA family parser
- Fix typo in the ALLOW-FROM implementation
-
2.0.103 Jun 2016Release notes
Open source →- Fix CookieSessionHandler::open that should return true unless there's an error
-
2.0.017 May 2016Release notes
Open source →- Add support for Content-Security-Policy Level 2 directives
- Add support for Content-Security-Policy Level 2 signatures (nonce and message digest)
- Add browser adaptive directives - do not send directives not supported by browser - via browser_adaptive parameter
- Allow report-uri to be defined as a scalar
- Deprecate encrypted cookie support du to high coupling to mcrypt deprecated extension
- Drop backward-compatibility with first deprecated CSP configuration
- Add support for Content-Security-Policy Level 2 directives
-
1.10.023 Feb 2016Release notes
Open source →- Added ability to restrict forced_ssl capability to some hostnames only
- Fixed Symfony 3 compatibility
- Added ability to restrict forced_ssl capability to some hostnames only
-
1.9.117 Jan 2016Release notes
Open source →- BugFix: Fix LoggerInterface type hints to support PSR-3 loggers and not only Symfony 2.0 loggers
-
1.9.004 Jan 2016Release notes
Open source →- Add Symfony 3 compatibility
- external_redirects definition can now contains full URL
- Allow dynamic CSP configuration
- BugFix: Fix clickjacking URL normalization when containing dash and no underscore
- Add Symfony 3 compatibility
-
1.8.012 Sep 2015Release notes
Open source →- Added HTTP response's content-type restriction for Clickjacking and CSP headers.
- Added Microsoft's XSS-Protection support
- Disabled Clickjacking, CSP and NoSniff headers in the context of HTTP redirects
- Fixed bug in handling of the external_redirects.log being disabled
- Added HTTP response's content-type restriction for Clickjacking and CSP headers.
-
1.7.010 May 2015Release notes
Open source →- Added a
Nelmio\SecurityBundle\ExternalRedirect\TargetValidatorinterface to implement custom rules for the external_redirects feature. You can override thenelmio_security.external_redirect.target_validatorservice to change the default.- Added a
hostskey in the CSP configuration to restrict CSP-checks to some host names - Fixed a bug in
flexible_sslwhere the auth cookie was updated with a wrong expiration time the second time the visitor comes to the site. - Removed X-Webkit-CSP header as none of the webkits using it are still current.
- Added a
- Added a
-
1.6.001 Feb 2015Release notes
Open source →- Added a
forced_ssl.hsts_preloadflag to allow adding the preload attribute on HSTS headers
- Added a
-
1.5.001 Jan 2015Release notes
Open source →- Added ability to have different configs for both reported and enforced CSP rules
- Added support for ALLOW and ALLOW-FROM syntaxes in the Clickjacking Protection
- Added support for HHVM and PHP 5.6
- Fixed enabling of cookie signing when the cookie list is empty
- Added ability to have different configs for both reported and enforced CSP rules
-
1.4.013 Feb 2014Release notes
Open source →- Added default controller to log CSP violations
- Added a flag to remove outdated non-standard CSP headers and only send the
Content-Security-Policyone
- Added a flag to remove outdated non-standard CSP headers and only send the
- Added default controller to log CSP violations
-
1.3.007 Jan 2014 -
1.2.029 Jul 2013Release notes
Open source →- Added Content-Security-Policy (CSP) 1.0 support
- Added forced_ssl.whitelist property to define URLs that do not need to be force-redirected
- Fixed session loss bug on 404 URLs in the CookieSessionHandler
- Added Content-Security-Policy (CSP) 1.0 support
-
1.1.027 Mar 2013Release notes
Open source →- Added a cookie session storage (use only if really needed, and combine it with
encrypted_cookie)- Fixed error reporting if mcrypt is not enabled and you try to use encryption
- Added a cookie session storage (use only if really needed, and combine it with
-
1.0.008 Jan 2013