{"id":"CVE-2020-6816","aliases":["CVE-2020-6816","GHSA-m6xf-fq7q-8743","PYSEC-2020-28"],"related":[],"kind":"vulnerability","state":"published","title":"Bleach vulnerable to mutation XSS via whitelisted math or svg and raw tag","summary":"In Mozilla Bleach before 3.12, a mutation XSS in bleach.clean when RCDATA and either svg or math tags are whitelisted and the keyword argument strip=False.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In Mozilla Bleach before 3.12, a mutation XSS in bleach.clean when RCDATA and either svg or math tags are whitelisted and the keyword argument strip=False.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nA [mutation XSS](https://cure53.de/fp170.pdf) affects users calling `bleach.clean` with all of:\n\n* the `svg` or `math` in the allowed/whitelisted tags\n* an RCDATA tag (see below) in the allowed/whitelisted tags\n* the keyword argument `strip=False`\n\n### Patches\n\nUsers are encouraged to upgrade to bleach v3.1.2 or greater.\n\n### Workarounds\n\n* modify `bleach.clean` calls to use `strip=True`, or not whitelist `math` or `svg` tags and one or more of the following tags:\n\n```\nscript\nnoscript\nstyle\nnoframes\nxmp\nnoembed\niframe\n```\n\n* A strong [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) without `unsafe-inline` and `unsafe-eval` [`script-src`s](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src)) will also help mitigate the risk.\n\n### References\n\n* https://bugzilla.mozilla.org/show_bug.cgi?id=1621692\n* https://cure53.de/fp170.pdf\n* https://nvd.nist.gov/vuln/detail/CVE-2020-6816\n* https://www.checkmarx.com/blog/vulnerabilities-discovered-in-mozilla-bleach\n\n### Credits\n\n* Reported by [Yaniv Nizry](https://twitter.com/ynizry) from the CxSCA AppSec group at Checkmarx\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue at [https://github.com/mozilla/bleach/issues](https://github.com/mozilla/bleach/issues)\n* Email us at [security@mozilla.org](mailto:security@mozilla.org)","format":"markdown","source":"ghsa"},{"lang":"es","text":"En Mozilla Bleach versiones anteriores a 3.12, una mutación de XSS en bleach.clean cuando RCDATA y las etiquetas svg o math están en la lista blanca y el argumento de la palabra clave strip=False.","source":"nvd"}],"published":"2020-03-24T15:06:32.000Z","modified":"2026-07-08T06:00:46.400Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"<=3.11","status":"affected"}],"product":"Mozilla Bleach","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.2"}],"ecosystem":"PyPI","package":"bleach","purl":"pkg:pypi/bleach","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.2"}],"vendor":"mozilla","product":"bleach","cpe":"cpe:2.3:a:mozilla:bleach:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"33"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.2"}],"ecosystem":"PyPI","package":"bleach","purl":"pkg:pypi/bleach","source":"pysec"}],"references":[{"url":"https://github.com/mozilla/bleach/security/advisories/GHSA-m6xf-fq7q-8743","tags":["advisory","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.checkmarx.com/blog/vulnerabilities-discovered-in-mozilla-bleach","tags":["article","exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/EDQU2SZLZMSSACCBUBJ6NOSRNNBDYFW5/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://advisory.checkmarx.net/advisory/CX-2020-4277","tags":["advisory","exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-6816","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/mozilla/bleach","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/mozilla/bleach/releases/tag/v3.1.2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/bleach/PYSEC-2020-28.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/EDQU2SZLZMSSACCBUBJ6NOSRNNBDYFW5","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/EDQU2SZLZMSSACCBUBJ6NOSRNNBDYFW5/","tags":["web"],"sources":["pysec"]}],"credits":[],"assigner":"mozilla","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-6816","url":"https://www.cve.org/CVERecord?id=CVE-2020-6816","licence":"CVE Terms of Use","modified":"2024-08-04T09:11:05.111Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m6xf-fq7q-8743","url":"https://github.com/advisories/GHSA-m6xf-fq7q-8743","licence":"CC-BY-4.0","modified":"2026-07-08T06:00:46.400Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-6816","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-6816","licence":"Public domain","modified":"2026-06-17T03:23:51.570Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-28","url":"https://osv.dev/vulnerability/PYSEC-2020-28","licence":"CC-BY-4.0","modified":"2023-11-08T04:03:57.116Z"}],"updatedAt":"2026-11-25T22:57:51.649Z","epss":{"score":0.0134,"percentile":0.72118,"date":"2026-12-01T12:00:22.000Z"}}