vecty
vecty copied to clipboard
build(deps): bump github.com/microcosm-cc/bluemonday from 1.0.2 to 1.0.16 in /example
Bumps github.com/microcosm-cc/bluemonday from 1.0.2 to 1.0.16.
Release notes
Sourced from github.com/microcosm-cc/bluemonday's releases.
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.Note: the policies shipped with bluemonday are not vulnerable to this.
Fix XSS vulnerability in HTML attribute parsing
A well crafted HTML attribute had the potential to evade sanitization due to incorrect escaping of the attribute whilst serializing it.
This version resolves that issue. In doing so it will also correctly use
&to separate query string values in URLs within HTML attributes (href, src, ...).Add SanitizeReaderToWriter(r io.Reader, w io.Writer)
No release notes provided.
Policies that accept regexps for matching are now additive
Thanks to
@KN4CK3Rfor the contribution of a PR that results in multiple Matching() policies on the same attr and element no longer clobber the previous regexps.Improve data-uri base64 handling, and improve docs structure
No release notes provided.
Improve support for links on all elements
Originally I had only concentrated the link validation on the elements that were safe to link. However people do want to allow some unsafe elements and yet still have the benefits of link validation and sanitization, i.e. allow
iframebut still have thesrcsafely validated... these changes allow that.Additionally I have added tests showing how
AllowSchemesWithCustomPolicycan be used to globally allow only links to certain domains, and a test that shows how to apply theAllowAttributes().Matching().OnElementsto only allow a given domain on specific elements (i.e. only allow aniframeif is is a YouTube embed).AllowComments
Adds a new func to allow HTML comments to be allowed. But does not allow CDATA comments which will be treated as plain HTML comments.
Also updates the readme, and the versions of the dependencies that have also updated.
Update x/net to latest version
As per https://nvd.nist.gov/vuln/detail/CVE-2020-28852
Restore support for go < 1.10
No release notes provided.
... (truncated)
Commits
c788a2aPrevent a HTML sanitization vulnerability13d1799go fmt with go 1.17cada0f0Merge pull request #128 from 6543-forks/ci-enforce-code-format7e9370aCI.restart()be04ac9enforce "lf" line ending9926455Add "Check Code Formation" step to CI1b5510cadd "fmt-check" make target1a86fcdgo mod tidy && go fmtf0057e2Fix escaping of HTML attributesc0a6f20Spelling mistakes and whitespace are OK- 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.