Update dependency sanitize-html to v2#7
Open
dev-mend-for-github-com[bot] wants to merge 1 commit intomasterfrom
Open
Update dependency sanitize-html to v2#7dev-mend-for-github-com[bot] wants to merge 1 commit intomasterfrom
dev-mend-for-github-com[bot] wants to merge 1 commit intomasterfrom
Conversation
3e9f896 to
b0407dd
Compare
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.
This PR contains the following updates:
1.4.2→2.7.1By merging this PR, the below vulnerabilities will be automatically resolved:
Release Notes
apostrophecms/sanitize-html (sanitize-html)
v2.7.1Compare Source
v2.7.0Compare Source
<img />tags. Thanks to Zade Viggers.v2.6.1Compare Source
!importantwhen used.transformTagsoptions that was reported on issue #506. Thanks to Alex Rantos.v2.6.0Compare Source
allowedClassesoption. Thanks to Alex Rantos.v2.5.3Compare Source
v2.5.2Compare Source
null,undefinedor implicitundefinedwhen value is not provided. Thanks to Artem Kostiuk for the contribution.v2.5.1Compare Source
allowedScriptHostnamesandallowedScriptDomainsoptions now implicitly purge the inline content of all script tags, not just those withsrcattributes. This behavior was already strongly implied by the fact that they purged it in the case where asrcattribute was actually present, and is necessary for the feature to provide any real security. Thanks to Grigorii Duca for pointing out the issue.v2.5.0Compare Source
allowedScriptHostnamesoption, it enables you to specify which hostnames are allowed in a script tag.allowedScriptDomainsoption, it enables you to specify which domains are allowed in a script tag. Thank you to Yorick Girard for this and theallowedScriptHostnamescontribution.v2.4.0Compare Source
allowedClasses. Thanks to zhangbenber for the contribution.v2.3.3Compare Source
allowedSchemesand related options did not properly block schemes containing a hyphen, plus sign, period or digit, such asms-calculator:. Thanks to Lukas Euler for pointing out the issue.parseroption, especiallydecodeEntities: false. See the documentation.v2.3.2Compare Source
yarn addsyntax. Thanks to Tagir Khadshiev for the contribution.v2.3.1Compare Source
v2.3.0Compare Source
htmlparser2to new major version^6.0.0. Thanks to Bogdan Chadkin for the contribution.v2.2.0Compare Source
telto the defaultallowedSchemes. Thanks to Arne Herbots for this contribution.v2.1.2Compare Source
v2.1.1Compare Source
allowedClasseswith an'*'wildcard selector. Thanks to Clemens Damke for this contribution.v2.1.0Compare Source
supadded to the default allowed tags list. Thanks to Julian Lam for the contribution.allowedTagsREADME documentation. Thanks to Marco Arduini for the contribution.v2.0.0Compare Source
nestingLimitoption added.is-plain-objectpackage with named export. Thanks to Bogdan Chadkin for the contribution.postcsspackage and drop Node 11 and Node 13 support (enforced by postcss).Backwards compatibility breaks:
allowedTagsarray was updated significantly. This mostly added HTML tags to be more comprehensive by default. You should review your projects and consider theallowedTagsdefaults if you are not already overriding them.v1.27.5Compare Source
v1.27.4Compare Source
Array.prototype.includes, replacing it withArray.prototype.indexOf.v1.27.3Compare Source
transformTagswith outtextFilter. Thanks to Andrzej Porebski for the help with a failing test.v1.27.2Compare Source
srcsetwithparse-srcset. Thanks to Massimiliano Mirra for the contribution.v1.27.1Compare Source
xtendpackage with nativeObject.assign.v1.27.0Compare Source
allowedIframeDomainsoption. This works similar toallowedIframeHostnames, where you would set it to an array of web domains. It would then permit any hostname on those domains to be used in iframesrcattributes. Thanks to Stanislav Kravchenko for the contribution.v1.26.0Compare Source
optionelement to the defaultnonTextTagsArrayof tags with contents that aren't meant to be displayed visually as text. This can be overridden with thenonTextTagsoption.v1.25.0Compare Source
enforceHtmlBoundaryoption to process code bounded by thehtmltag, discarding any code outside of those tags.styleandscripttags are allowed, as they are inherently vulnerable to being used in XSS attacks. That warning can be disabled by including the optionallowVulnerableTags: trueso this choice is knowing and explicit.v1.24.0Compare Source
disallowedTagsMode: 'escape'set. Thanks to Thiago Negri for the contribution.abbrto the defaultallowedTagsfor better accessibility support. Thanks to Will Farrell for the contribution.mediaChildrenproperty to theframeobject in custom filters. This allows you to check for links or other parent tags that contain self-contained media to prevent collapse, regardless of whether there is also text inside. Thanks to axdg for the initial implementation and Marco Arduini for a failing test contribution.v1.23.0Compare Source
sideEffects: falseon package.json to allow module bundlers like webpack tree-shake this module and all the dependencies from client build. Thanks to Egor Voronov for the contribution.tagName(HTML element name) as a second parameter passed totextFilter. Thanks to Slava for the contribution.v1.22.1Compare Source
ncreases the patch version of
lodash.mergewithto enforce an audit fix.v1.22.0Compare Source
bumped
htmlparser2dependency to the 4.x series. This fixes longstanding bugs and should cause no bc breaks for this module, since the only bc breaks upstream are in regard to features we don't expose in this module.v1.21.1Compare Source
fixed issue with bad
mainsetting in package.json that broke 1.21.0.v1.21.0Compare Source
new
disallowedTagsModeoption can be set toescapeto escape disallowed tags rather than discarding them. Any subtags are handled as usual. If you want to recursively escape them too, you can setdisallowedTagsModetorecursiveEscape. Thanks to Yehonatan Zecharia for this contribution.v1.20.1Compare Source
Fix failing tests, add CircleCI config
v1.20.0Compare Source
reduced size of npm package via the
fileskey; we only need to publish what's indist. Thanks to Steven. There should be zero impact on behavior, minor version bump is precautionary.v1.19.3Compare Source
reverted to
postcssdue to a reported issue withcss-treethat might or might not have XSS implications.v1.19.2Compare Source
postcssdependency for the lightweightcss-treemodule. No API changes. Thanks to Justin Braithwaite.v1.19.1Compare Source
"characters are now entity-escaped only when they appear in attribute values, reducing the verbosity of the resulting markup.Fixed a regression introduced in version 1.18.5 in the handling of markup that looks similar to a valid entity, but isn't. The bogus entity was passed through intact, i.e.
&0;did not become&0;as it should have. This fix has been made for the default parser settings only. There is no fix yet for those who wish to enabledecodeEntities: false. That will require improving the alternative encoder in theescapeHtmlfunction to only pass 100% valid entities.For those using the default
parsersettings this bug is fixed. Read on if you are using alternativeparsersettings.When
decodeEntities: trueis in effect (the default), this is not a problem because we only have to encode& < > "and we always encode those things.There is currently a commented-out test which verifies one example of the problem when
decodeEntitiesis false. However a correct implementation would need to not only pass that simple example but correctly escape all invalid entities, and not escape those that are valid.v1.19.0Compare Source
allowIframeRelativeUrlsoption. It defaults totrueunlessallowedIframeHostnamesis present, in which case it defaults to false, for backwards compatibility with existing behavior in both cases; however you can now set the option explicitly to allow both certain hostnames and relative URLs. Thanks to Rick Martin.v1.18.5Compare Source
v1.18.4Compare Source
browserkey, restoring frontend build. Thanks to Felix Becker.v1.18.3Compare Source
iframeis an allowed tag by default, to better facilitate typical use cases and the use of theallowedIframeHostnamesoption.v1.18.2Compare Source
v1.18.1Compare Source
v1.18.0Compare Source
allowedSchemesAppliedToAttributesoption. This determines which attributes are validated as URLs, replacing the old hardcoded list ofsrcandhrefonly. The default list now includescite. Thanks to ml-dublin for this contribution.allowedAttributes, rather than listing an attribute name, simply list an object with an attributenameproperty and an allowedvaluesarray property. You can also addmultiple: trueto allow multiple space-separated allowed values in the attribute, otherwise the attribute must match one and only one of the allowed values. Thanks again to ml-dublin for this contribution.v1.17.0Compare Source
The new
allowedIframeHostnamesoption. If present, this must be an array, and only iframesrcURLs hostnames (complete hostnames; domain name matches are not enough) that appear on this list are allowed. You must also configurehostnameas an allowed attribute foriframe. Thanks to Ryan Verys for this contribution.v1.16.3Compare Source
Don't throw away the browserified versions before publishing them.
prepareis not a good place tomake clean, it runs afterprepublish.v1.16.2Compare Source
sanitize-htmlis now compiled withbabel. An npmprepublishscript takes care of this atnpm publishtime, so the latest code should always be compiled to operate all the way back to ES5 browsers and earlier versions of Node. Thanks to Ayushya Jaiswal.Please note that running
sanitize-htmlin the browser is usually a security hole. Are you trusting the browser? Anyone could bypass that using the network panel. Sanitization is almost always best done on servers and that is the primary use case for this module.v1.16.1Compare Source
changelog formatting only.
v1.16.0Compare Source
support for sanitizing inline CSS styles, by specifying the allowed attributes and a regular expression for each. Thanks to Cameron Will and Michael Loschiavo.
v1.15.0Compare Source
if configured as an allowed attribute (not the default), check for naughty URLs in
srcsetattributes. Thanks to Mike Samuel for the nudge to do this and to Sindre Sorhus for thesrcsetmodule.v1.14.3Compare Source
inadvertent removal of lodash regexp quote dependency in 1.14.2 has been corrected.
v1.14.2Compare Source
protocol-relative URL detection must spot URLs starting with
\\rather than//due to ages-old tolerance features of web browsers, intended for sleepy Windows developers. Thanks to Martin Bajanik.v1.14.1Compare Source
documented
allowProtocolRelativeoption. No code changes from 1.14.0, released a few moments ago.v1.14.0Compare Source
the new
allowProtocolRelativeoption, which is set totrueby default, allows you to decline to accept URLs that start with//and thus point to a different host using the current protocol. If you do not want to permit this, set this option tofalse. This is fully backwards compatible because the default behavior is to allow them. Thanks to Luke Bernard.v1.13.0Compare Source
transformTagscan now add text to an element that initially had none. Thanks to Dushyant Singh.v1.12.0Compare Source
option to build for browser-side use. Thanks to Michael Blum.
v1.11.4Compare Source
fixed crash when
__proto__is a tag name. Now using a safe check for the existence of properties in all cases. Thanks to Andrew Krasichkov.Fixed XSS attack vector via
textareatags (when explicitly allowed). Decided thatscript(obviously) andstyle(due to its own XSS vectors) cannot realistically be afforded any XSS protection if allowed, unless we add a full CSS parser. Thanks again to Andrew Krasichkov.v1.11.3Compare Source
bumped
htmlparser2version to address crashing bug in older version. Thanks to e-jigsaw.v1.11.2Compare Source
fixed README typo that interfered with readability due to markdown issues. No code changes. Thanks to Mikael Korpela. Also improved code block highlighting in README. Thanks to Alex Siman.
v1.11.1Compare Source
fixed a regression introduced in 1.11.0 which caused the closing tag of the parent of a
textareatag to be lost. Thanks to Stefano Sala, who contributed the missing test.v1.11.0Compare Source
added the
nonTextTagsoption, with tests.v1.10.1Compare Source
documentation cleanup. No code changes. Thanks to Rex Schrader.
v1.10.0Compare Source
allowedAttributesnow allows you to allow attributes for all tags by specifying*as the tag name. Thanks to Zdravko Georgiev.v1.9.0Compare Source
parseroption allows options to be passed directly tohtmlparser. Thanks to Danny Scott.v1.8.0Compare Source
transformTagsnow accepts the*wildcard to transform all tags. Thanks to Jamy Timmermans.Text that has been modified by
transformTagsis then passed throughtextFilter. Thanks to Pavlo Yurichuk.Content inside
textareais discarded iftextareais not allowed. I don't know why it took me this long to see that this is just common sense. Thanks to David Frank.v1.7.2Compare Source
removed
array-includesdependency in favor ofindexOf, which is a little more verbose but slightly faster and doesn't require a shim. Thanks again to Joseph Dykstra.v1.7.1Compare Source
removed lodash dependency, adding lighter dependencies and polyfills in its place. Thanks to Joseph Dykstra.
v1.7.0Compare Source
introduced
allowedSchemesByTagoption. Thanks to Cameron Will.v1.6.1Compare Source
the string
'undefined'(as opposed toundefined) is perfectly valid text and shouldn't be expressly converted to the empty string.v1.6.0Compare Source
added
textFilteroption. Thanks to Csaba Palfi.v1.5.3Compare Source
do not escape special characters inside a script or style element, if they are allowed. This is consistent with the way browsers parse them; nothing closes them except the appropriate closing tag for the entire element. Of course, this only comes into play if you actually choose to allow those tags. Thanks to aletorrado.
v1.5.2Compare Source
guard checks for allowed attributes correctly to avoid an undefined property error. Thanks to Zeke.
v1.5.1Compare Source
updated to htmlparser2 1.8.x. Started using the
decodeEntitiesoption, which allows us to pass our filter evasion tests without the need to recursively invoke the filter.v1.5.0Compare Source
support for
*wildcards in allowedAttributes. With tests. Thanks to Calvin Montgomery.v1.4.3invokes itself recursively until the markup stops changing to guard against this issue. Bump to htmlparser2 version 3.7.x.