Repository navigation
Bump HtmlSanitizer from 8.0.718 to 11.0.26 - #30
Open
dependabot[bot] wants to merge 1 commit into
Open
dependabot[bot] wants to merge 1 commit into
dependabot[bot] wants to merge 1 commit into
Conversation
--- updated-dependencies: - dependency-name: HtmlSanitizer dependency-version: 11.0.26 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated HtmlSanitizer from 8.0.718 to 11.0.26.
Release notes
Sourced from HtmlSanitizer's releases.
11.0.26
Fix strong-name signing
11.0.16
Breaking changes
New
IHtmlSanitizer.NamedPropertyTagsmemberClasses that implement
IHtmlSanitizerdirectly, such as wrappers and decorators, must add the newNamedPropertyTagsmember. Mocks created with Moq, NSubstitute, and similar libraries are unaffected.Security hardening
nameis removed from certain elementsThe
nameattribute is now removed fromembed,form,iframe,img, andobjectelements by default.Browsers expose the names of these elements as properties of
documentandwindow. For example,<img name="getElementById">could replacedocument.getElementByIdon the page displaying the sanitized output and break its scripts. This is known as DOM clobbering.The
nameattribute is still retained on other elements, including<a name>anchors,<map name>image maps, and form fields.You can configure the affected elements through the new
NamedPropertyTagsset onHtmlSanitizer,HtmlSanitizerOptions, andHtmlSanitizerDefaults. To restore the previous behavior:You can also cancel individual removals in the
RemovingAttributeevent. If you allowiframeelements and use their names as link targets, removeiframefrom the set.contenteditableis no longer allowed by defaultAn editable region gives an attacker a paste target on the host page. In Firefox, pasted
<style>elements are retained, allowing CSS that the sanitizer would otherwise strip to affect the whole page.To allow the attribute again:
Dependencies
Credits for finding the
nameandcontenteditableissuesGareth Heyes (PortSwigger Research)
See also:
https://portswigger.net/research/css-the-bomb-inside-your-inbox
https://portswigger.net/research/smashing-the-token-limit
10.0.1120
HtmlSanitizerDefaults, matching the parameterless HtmlSanitizer() constructor. See #570
HtmlSanitizer.AllowedClasses.
instance instead.
10.0.1037-beta
First beta of a major version. Please test against your usage before GA — see Breaking changes below, especially if you have a custom
IHtmlSanitizerimplementation or constructHtmlSanitizerOptionsyourself.Breaking changes
IHtmlSanitizergained new members. Anything implementing the interface directly (not just consumingHtmlSanitizer) needs updating:StyleFormatter,EncodeComment,EncodeLiteralTextElementContent,UriListAttributes,AllowCssCustomProperties, theFilterCssRuleevent, bothSanitizeFragmentoverloads, andSanitizeDocument(Stream, ...).HtmlSanitizerOptionscollections are now pre-populated by default.new HtmlSanitizerOptions()now seeds every collection fromHtmlSanitizerDefaults— the same defaultsnew HtmlSanitizer()uses — instead of starting empty (#570). If you buildHtmlSanitizerOptionsyourself, audit it: code that relied on the old emptiness to build a minimal allowlist (e.g. setting onlyAllowedTagsand expecting everything else to stay locked down) now gets the full default attribute/scheme/URI-attribute set for anything it doesn't explicitly reassign. Use the newHtmlSanitizerOptions.Empty()for the old blank-slate behavior.HtmlSanitizerOptions.AllowedCssClassesrenamed toAllowedClasses, matchingHtmlSanitizer.AllowedClasses/IHtmlSanitizer.AllowedClasses. It's also now case-insensitive by default like every other collection on the class (it wasn't before — a latent bug).SanitizeDom(string)no longer preserves attributes on the synthetic<html>/<head>/<body>wrapper elements it creates. Fixes an attribute-injection bypass (e.g.<body onload=alert(1)>) for callers that serialize more of the returned document thandom.Body.ChildNodes.AssemblyVersionbumped to10.0.0.0. Update any binding redirects pinned to9.0.0.0.New
SanitizeFragment(html, context, ...)— sanitize a fragment as if inserted into a given element/tag context (e.g.tr,ul) instead of always parsing under<body>, so context-dependent markup like a lone<th>survives.SanitizeDocument(Stream, ...)overload.UriListAttributes— screens attributes holding a list of URLs (srcset,ping) entry-by-entry, rather than as one URL.AllowCssCustomProperties— opt in to allowing CSS custom properties (--*).StyleFormatter,EncodeComment,EncodeLiteralTextElementContent— now configurable on the sanitizer/interface.FilterCssRuleevent, raised per CSS rule during sanitization.HtmlSanitizerOptions.Empty()for building an allowlist from scratch.Security / stricter sanitization
Output for some previously-passing input is now more restrictive:
citeandlongdescare now screened as URL attributes.@font-faceand@importat-rule declarations are now sanitized.srcdoccontent is now recursively sanitized, and URI-list attributes (srcset,ping) are screened per-entry.<style type="">content is now sanitized (previously an emptytypecould skip CSS filtering).SanitizeFragmentrather than silently mis-parsed under HTML rules.Dependencies
9.2.1039
Fix attribute bypass in SanitizeDom(string) wrapper elements
9.2.995
citeandlongdescattributes to URL sanitization (e47862e)srcdoccontent and attributes holding URI lists (edb2633)type=""attribute (0592f1e)@font-faceand@importat-rules (1d33413)9.1.982
Fix multiple enumeration of URLs (fixes #625)
9.1.981
Update NuGet packages
9.1.974
Add FilterCssRule event (fixes #622)
9.1.973
Update to AngleSharp 1.6.0 and AngleSharp.Css 1.0.0
9.0.892
Sanitize contents of template tag
9.0.889
Update NuGet packages
9.0.886
Target net47 (fixes #580)
9.0.884
#574
9.0.881
#572
#573
9.0.876
#565
9.0.873
Add FilterUrl to IHtmlSanitizer (fixes #565)
8.1.870
#556
8.0.865
#542
8.0.843
Add package README file
8.0.838
Create customizable comment encoding method (fixes #525)
8.0.811
Merge pull request #516 from jerriep/allow-overriding-literal-text-element-encoding
8.0.795
See #494
8.0.746
Fix #483
8.0.744
Fix #483
8.0.723
Fix for GHSA-43cp-6p3q-2pc4
Commits viewable in compare view.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)