{"id":"UBUNTU-CVE-2021-28957","details":"An XSS vulnerability was discovered in python-lxml's clean module versions before 4.6.3. When disabling the safe_attrs_only and forms arguments, the Cleaner class does not remove the formaction attribute allowing for JS to bypass the sanitizer. A remote attacker could exploit this flaw to run arbitrary JS code on users who interact with incorrectly sanitized HTML. This issue is patched in lxml 4.6.3.","modified":"2026-01-30T01:07:07.220275Z","published":"2021-03-21T05:15:00Z","related":["USN-4896-1","USN-4896-2"],"upstream":["CVE-2021-28957"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2021-28957"},{"type":"REPORT","url":"https://bugs.launchpad.net/lxml/+bug/1888153"},{"type":"REPORT","url":"https://github.com/lxml/lxml/pull/316"},{"type":"REPORT","url":"https://github.com/lxml/lxml/pull/316/commits/10ec1b4e9f93713513a3264ed6158af22492f270"},{"type":"REPORT","url":"https://lists.debian.org/debian-lts-announce/2021/03/msg00031.html"},{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-4896-1"},{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-4896-2"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2021-28957"}],"affected":[{"package":{"name":"lxml","ecosystem":"Ubuntu:Pro:14.04:LTS","purl":"pkg:deb/ubuntu/lxml@3.3.3-1ubuntu0.2+esm3?arch=source&distro=trusty/esm"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.3-1ubuntu0.2+esm3"}]}],"versions":["3.2.0-1","3.3.0~beta2-1","3.3.0~beta4-1","3.3.1-1","3.3.2-1","3.3.2-1build1","3.3.3-1","3.3.3-1ubuntu0.1","3.3.3-1ubuntu0.2","3.3.3-1ubuntu0.2+esm1","3.3.3-1ubuntu0.2+esm2"],"ecosystem_specific":{"availability":"Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro","binaries":[{"binary_name":"python-lxml","binary_version":"3.3.3-1ubuntu0.2+esm3"},{"binary_name":"python3-lxml","binary_version":"3.3.3-1ubuntu0.2+esm3"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-28957.json"}},{"package":{"name":"lxml","ecosystem":"Ubuntu:16.04:LTS","purl":"pkg:deb/ubuntu/lxml@3.5.0-1ubuntu0.4?arch=source&distro=xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.5.0-1ubuntu0.4"}]}],"versions":["3.4.4-1","3.5.0-1","3.5.0-1build1","3.5.0-1ubuntu0.1","3.5.0-1ubuntu0.2","3.5.0-1ubuntu0.3"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"python-lxml","binary_version":"3.5.0-1ubuntu0.4"},{"binary_name":"python3-lxml","binary_version":"3.5.0-1ubuntu0.4"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-28957.json"}},{"package":{"name":"lxml","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/lxml@4.2.1-1ubuntu0.4?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.2.1-1ubuntu0.4"}]}],"versions":["4.0.0-1","4.1.0-1","4.2.0-1","4.2.1-1","4.2.1-1ubuntu0.1","4.2.1-1ubuntu0.2","4.2.1-1ubuntu0.3"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_version":"4.2.1-1ubuntu0.4","binary_name":"python-lxml"},{"binary_name":"python3-lxml","binary_version":"4.2.1-1ubuntu0.4"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-28957.json"}},{"package":{"name":"lxml","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/lxml@4.5.0-1ubuntu0.3?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.5.0-1ubuntu0.3"}]}],"versions":["4.4.1-1","4.4.1-1build1","4.4.2-1","4.5.0-1","4.5.0-1ubuntu0.1","4.5.0-1ubuntu0.2"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"python-lxml","binary_version":"4.5.0-1ubuntu0.3"},{"binary_name":"python3-lxml","binary_version":"4.5.0-1ubuntu0.3"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-28957.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"},{"type":"Ubuntu","score":"medium"}]}