VDB
Sign up
—

GO-2022-0588

Cross-site scripting via leaked style elements in github.com/microcosm-cc/bluemonday

Quick fix

GO-2022-0588 — github.com/microcosm-cc/bluemonday: upgrade to the fixed version with the command below.

go get github.com/microcosm-cc/bluemonday@v1.0.16

Details

The bluemonday HTML sanitizer can leak the contents of a "style" element into HTML output, potentially causing XSS vulnerabilities.

The default bluemonday sanitization policies are not vulnerable. Only user-defined policies allowing "select", "style", and "option" elements are affected.

Permitting the "style" element in policies is hazardous, because bluemonday does not contain a CSS sanitizer. Newer versions of bluemonday suppress "style" and "script" elements even when allowed by a policy unless the policy explicitly requests unsafe processing.

Are you affected?

Enter the version of the package you're using.

Affected packages

Go/github.com/microcosm-cc/bluemonday
Introduced in: 0Fixed in: 1.0.16
Fixgo get github.com/microcosm-cc/bluemonday@v1.0.16

References