Bump github.com/microcosm-cc/bluemonday from 1.0.15 to 1.0.20
Bumps github.com/microcosm-cc/bluemonday from 1.0.15 to 1.0.20.
Release notes
Sourced from github.com/microcosm-cc/bluemonday's releases.
Updated x/net/html
This is an update of dependencies, specifically it updates the HTML parser within go/net/html.
The update removes a capability, Microsoft style comments that allow browser conditionals no longer works. This is due to a fix on the part of the Go team to prevent XSS within HTML comments, and the commit in question is here https://github.com/golang/net/commit/06994584 . There is no easy to see safe way to restore that functionality without adding more risk to those who
.AllowComments()and so I am accepting that this non-standard use of HTML comments is no longer supported.As part of this version, the older release of v1.0.19 is retracted.
Add SVG inline images, improve RGB color and length matching, fix bug
What's Changed
- css: improve RGB hex color and length matching by
@hochhausin microcosm-cc/bluemonday#142- css: add support for
image/svg+xmlfor data-uri inline images- html: fix double-escaping of content within HTML attributes
- tests: added more tests to provide examples of proofs of some open issues
New Contributors
@hochhausmade their first contribution in microcosm-cc/bluemonday#142Full Changelog: https://github.com/microcosm-cc/bluemonday/compare/v1.0.18...v1.0.19
Fix bug in iframe sandboxvalues
What's Changed
- Fix incorrect handling of iframe SandboxValues by
@kiwizin microcosm-cc/bluemonday#138Full Changelog: https://github.com/microcosm-cc/bluemonday/compare/v1.0.17...v1.0.18
Add support for the "sandbox" attribute on the "iframe" element
As per microcosm-cc/bluemonday#135
@kiwizhas added support to bluemonday that allows theiframeelement to correctly declare the security attributesandbox.You can read about that attribute here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
No other change is in this release.
Prevent a HTML sanitization vulnerability
CVE-2021-42576
A vulnerability was discovered by https://github.com/TomAnthony https://www.tomanthony.co.uk/ which allowed the contents of a
styletag to be leaked unsanitized by bluemonday into the HTML output. Further it was demonstrated that if the form elementsselectandoptionwere allowed by the policy that this could result in a successful XSS.You would only be vulnerable to if if you allowed
style,selectandoptionin your HTML sanitization policy:p := bluemonday.NewPolicy() p.AllowElements("style","select") html := p.Sanitize(`<select><option><style><script>alert(1)</script>`) fmt.Println(html)bluemonday very strongly recommends not allowing the
styleelement in a policy. It is fundamentally unsafe as we do not have a CSS sanitizer and the content is passed through unmodified.bluemonday has been updated to explicitly suppress
styleandscriptelements by default even if you do allow them by policy as these are considered unsafe. If you have a use-case for using bluemonday whilst trusting the input then you can assert this viap.AllowUnsafe(true)which will letstyleandscriptthrough if the policy also allows them.
... (truncated)
Commits
705c34aUpdated x/net/html to ensure latest version from the Go team, retracted v1.0....84409ddOnly test n-1 Go versions8fc9802Merge branch 'main' of github.com:microcosm-cc/bluemonday into mainc66f9ffUpdated Go version, retract old versions of this package which are always con...a232bacRemoved outdated build badge97a5b1fTest recent Go versions9ec48cfTest recent Go versionsd4b11cbAdded funding file9ef01f7Closes #134 add tests to show all sanitize methods are roughly equal in timeed50dccCloses #139 by demonstrating in a test that it still works- Additional 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 mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@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) -
@dependabot use these labelswill set the current labels as the default for future PRs for this repo and language -
@dependabot use these reviewerswill set the current reviewers as the default for future PRs for this repo and language -
@dependabot use these assigneeswill set the current assignees as the default for future PRs for this repo and language -
@dependabot use this milestonewill set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the Security Alerts page.