Up to [cvs.NetBSD.org] / pkgsrc / textproc / py-lxml-html-clean
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
py-lxml-html-clean: updated to 0.4.6 0.4.6 (2026-10-26) Bugs fixed * Fixed a ReDoS (regular expression denial of service) vulnerability in the CSS ``expression()`` sanitizer. The pattern ``expression\s*\(.*?\)`` with ``re.S`` was quadratic when input contained many ``expression(`` tokens without a closing parenthesis. The body is now bounded to 1024 characters; longer bodies are handled fail-closed by ``_has_sneaky_javascript()``, which drops the entire style. Reported by Brian Willows. * Fixed a ReDoS vulnerability in the conditional comment detector used when ``comments=False``. The pattern ``\[if\s+.*?]\s*>`` with ``re.S`` was quadratic when comment text contained many ``[if`` tokens without a closing ``]>``. Replaced with a linear two-pass search. Reported by Brian Willows. * Fixed a ReDoS vulnerability in the CSS comment stripper. The pattern ``/\*.*?\*/`` with ``re.S`` was quadratic when style content contained many ``/*`` tokens without a closing ``*/``. Replaced with a linear ``str.find()``-based scan. Reachable under default configuration via ``<style>`` element content. * Fixed a ReDoS vulnerability in the image data-URL scanner. The pattern ``data:image/(.+?);base64,`` was quadratic when input contained many ``data:image/`` tokens without a following ``;base64,``. The MIME subtype body is now bounded to 255 characters. Reachable under default configuration via link attributes and ``<style>`` element content.
Forget Python 3.10
*: limit Python versions due to py-numpy dropping Python 3.11 support
py-lxml-html-clean: updated to 0.4.5 0.4.5 Bugs fixed * Fixed a security vulnerability where ``javascript:`` URLs in ``xlink:href`` attributes were not sanitized when``safe_attrs_only=False``, allowing cross-site scripting (XSS) attacks. The fix requires ``lxml>=6.1.1``, which adds ``xlink:href`` to the set of link attributes iterated by ``rewrite_links()``. Reported by Guillem Lefait (@glefait).
py-lxml-html-clean: updated to 0.4.4 0.4.4 (2026-02-26) Bugs fixed * Fixed a bug where Unicode escapes in CSS were not properly decoded before security checks. This prevents attackers from bypassing filters using escape sequences. * Fixed a security issue where ``<base>`` tags could be used for URL hijacking attacks. The ``<base>`` tag is now automatically removed whenever the ``<head>`` tag is removed (via ``page_structure=True`` or manual configuration), as ``<base>`` must be inside ``<head>`` according to HTML specifications.
*: remove reference to (removed) Python 3.9
py-lxml-html-clean: updated to 0.4.3 0.4.3 (2025-10-02) Maintenance * Tests updated to work correctly with new lxml and libxml2 releases. * Python 3.6 and 3.7 are no longer tested. * Improved documentation about CSS removal behavior.
*: some more recursive Python restrictions on Python 3.11+ Reported in SmartOS bulk build
py-lxml-html-clean: updated to 0.4.2 0.4.2 (2025-04-09) Bugs fixed * `lxml_html_clean` now correctly handles HTML input as bytes as it did before the 0.2.0 release.
py-lxml-html-clean: updated to 0.4.1 0.4.1 (2024-11-15) Bugs fixed * Removed superfluous debug prints.
py-lxml-html-clean: updated to 0.4.0 0.4.0 (2024-11-12) Bugs fixed * The ``Cleaner()`` now scans for hidden JavaScript code embedded within CSS comments. In certain contexts, such as within ``<svg>`` or ``<math>`` tags, ``<style>`` tags may lose their intended function, allowing comments like ``/* foo */`` to potentially be executed by the browser. If a suspicious content is detected, only the comment is removed.
py-*: remove unused tool dependency py-setuptools includes the py-wheel functionality nowadays
py-lxml-html-clean: updated to 0.3.1 0.3.1 (2024-10-09) Features added * Do not parse URL addresses when it is not necessary. 0.3.0 (2024-10-09) Features added * Parsing of URL addresses has been enhanced and Cleaner removes ambiguous URLs.
py-lxml-html-clean: updated to 0.2.2 0.2.2 (2024-08-30) Bugs fixed * sdist now includes all test files and changelog.
py-lxml-html-clean: updated to 0.2.1 0.2.1 Bugs fixed Memory efficiency is now much better for HTML pages where cleaner removes a lot of elements.
py-lxml-html-clean: updated to 0.2.0 0.2.0 (2024-07-29) Features added ASCII control characters (except HT, VT, CR and LF) are now removed from string inputs before they're parsed by lxml/libxml2.
py-lxml-html-clean: added version 0.1.1 This project was initially a part of lxml. Because HTML cleaner is designed as blocklist-based, many reports about possible security vulnerabilities were filed for lxml and that make the project problematic for security-sensitive environments. Therefore we decided to extract the problematic part to a separate project.