-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request from GHSA-59jf-3q9v-rh6g
* [SECURITY] Properly encode noscript child nodes The `<noscript>` element has a special behavior when being evaluated in browsers, which depends on whether script-parsing is enabled or disabled. As a consequence this change will * encode comment inner data, e.g. `<!-- <"comment"> -->` as `<!-- <"comment"> -->` * always encode tag attributes, e.g. `<p id="<value>">` as `<p id="<value>">` * extend `Comment` and `CdataSection` to have a constructor (which triggers encoding per default) and to implement the `Behavior\HandlerInterface` * add a new serializer option `encode_attributes`, which might basically be extracted to `Masterminds\HTML5` * [TASK] Ensure attribute serialization preserves values as is We don't want so called double-encoding – which is a valid usecase when HTML describes how HTML is to be written – to be automagically transformed to single encoded values, as otherwise a valid input like <a title="Insert &amp; to write an &"></a> (Browser would show "Insert & to write an &") …would be changed to: <a title="Insert & to write an &"></a> (Browser would show "Insert & to write an &") Also add tests for the attribute encoding we want: * Encode quotes, tags and stuff that might cause security issues * do not encode unnecessarily encode slashes or colons (like htmlentitites would do) --------- Co-authored-by: Benjamin Franzke <ben@bnf.dev>
- Loading branch information
Showing
10 changed files
with
302 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.