paragonie/csp-builder
Build and send Content-Security-Policy headers in PHP from JSON files, JSON strings, or arrays. CSP Builder makes it easy to define directives programmatically and integrate CSP into web apps to improve security.
Full Changelog: https://github.com/paragonie/csp-builder/compare/v3.0.1...v3.0.2
CSPBuilder::fromHeader) by @fritzmg in https://github.com/paragonie/csp-builder/pull/74frame-src by @fritzmg in https://github.com/paragonie/csp-builder/pull/76default-src policy is applied by @fritzmg in https://github.com/paragonie/csp-builder/pull/65Full Changelog: https://github.com/paragonie/csp-builder/compare/v2.9.0...v3.0.0
psr/http-message v2 by @internalsystemerror in https://github.com/paragonie/csp-builder/pull/73Full Changelog: https://github.com/paragonie/csp-builder/compare/v2.8.1...v2.9.0
plugin-types generation by @fritzmg in https://github.com/paragonie/csp-builder/pull/69Full Changelog: https://github.com/paragonie/csp-builder/compare/v2.8.0...v2.8.1
Prevent semicolon or CLRF injection. See https://github.com/paragonie/csp-builder/commit/1a1a85fcf115400d7753af842403ec6e846319de for details.
CSP-Builder is a developer tool. It is not meant to be used with user input.
However, the ability to inject CSP directives or additional headers violates the principle of least astonishment.
This was reported via user demonia on HackerOne.
report-to does not work. Specifically, you cannot pass a URL as a report-to directive or Chrome will never send CSP reports, even if there is also a report-uri fallback. @iangcarroll provided a pull request that fixes this behavior.always clause to nginx header. Thanks @alainwolfblob:, filesystem:, and data: URIs.CSPBuilder::fromArray() because its absence seemed confusing if you're not familiar with the constructor.report-to/report-uri directives.'strict-dynamic' and 'unsafe-hashed-attributes'Contains a year of bugfixes and tweaks from the v2 branch, backported for PHP 5 support.
setDataAllowed() and setSelfAllowed(), for programatically allowing self and data: URIs for a specific directive.Allow CSPBuilder instances to be instantiated from a JSON string. Thanks [@renanmpimentel](https://github.com/renanmpimentel)
Version 1.3.2 broke somewhere in the git chain, so v1.3.3 it is.
Version 2.0.0 requires PHP 7.
This allows us to use strict typing and drop random_compat as a dependency.
unsafe-eval directivesFull list here: https://github.com/paragonie/csp-builder/compare/v1.3.0...v1.3.1
A lot of bugfixes since 1.2.0.
BC break: Changed our erroneous connect-uri and font-uri directives to connect-src and font-src respectively.
Before version 1.4, I'd like to improve the documentation and unit test coverage. Feel free to open any issues for bugs you encounter or feature requests you might have.
Use normal Base64 encoding for CSP hashes.
It turns out that the hash directive just needs to be sha256-blah not hash-sha256-blah.
Add preHash(), which allows users to precalculate a hash of a resource and store it directly in the CSP. (Mostly useful for locally caching the hashes of remote resources.)
hash()report-uri.iorandom_compat instead of openssl for generating a nonceplugin-types directive (see #4)Thanks @Ocramius and @Lewiscowles1986 for their feedback and assistance. (If it weren't for the possibly BC-breaking changes, this would have simply been 1.1.1.)
General improvements, especially with older Webkit browsers.
Thanks to @timoh6 and @ScottHelme for their feedback.
Initial release.
How can I help you explore Laravel packages today?