voku/anti-xss
anti xss-library
4.1.44
19M downloads/mo
#1211 most downloaded on Packagist
voku/anti-xss
What this package is like to depend on
Last release 1 months ago
10 Jul 2026
Ships unpredictably
gaps range from 9 days to 2.8 years
Some releases are documented
notes for 52 of 107 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
107 releases · first in 2015
2 releases in the last 12 months
see the full history below
Release timeline
107 releases · Mar 2015 to Jul 2026Releases
latest 60 of 107-
4.1.4410 Jul 2026Release notes
Open source →- add more modern DOM event handlers to the blacklist (e.g. "onAppInstalled", "onBeforeInstallPrompt", "onFormData", "onGamepadConnected/Disconnected", "onMessageError", "onScrollEnd", "onSecurityPolicyViolation", "onSlotChange", "onVRDisplay*", ...)
- harden detection of hyphen-/colon-suffixed event-handler lookalikes (e.g. "onmessageerror-foo") so the whole attribute is removed instead of leaving a broken attribute with leftover payload text
- fix regression: the lookalike-hardening above could also strip the value of unrelated, legitimate compound attributes that merely contain an event name after a hyphen (e.g. "data-onchange-debounce="300""); only real handler-lookalikes are removed now
- harden CSS "expression(...)" detection, incl. escaped and uppercase variants, and fix a regex backtracking risk
- add a hard cap on internal sanitization retry-loops (throws "RuntimeException" instead of looping forever if a loop can't converge)
- preserve custom / removed "_never_allowed_regex" entries across "setReplacement()" calls
- fix: several tag/attribute-stripping steps silently wiped the whole string to "" when "preg_replace()"/"preg_replace_callback()" hit "pcre.backtrack_limit" (or its fallback also failed); they now fail closed via a bounded, non-regex removal of the specific dangerous tag/attribute instead of discarding unrelated content or falling back to the still-dangerous raw input
- add regression test for issue #201 (template + slot "onslotchange" XSS)
- add mutation testing (Infection) to CI with a diff MSI gate
-
4.1.4322 Apr 2026Release notes
Open source →- 10-50% better performance
- add "addNaughtyJavascriptPatterns()"
- add "setKeepPreAndCodeTagContent()" to preserve content inside "pre" and "code" tags
- fix regression when sanitizing text inside "pre" / "code" tags
- fix false-positives for valid "href" / "src" URLs and plain text such as "system (...)", "behavior:", "< abc" and "< 35kg"
- improve detection of obfuscated style / attribute payloads and JSON-escaped HTML attributes
- keep valid base64 payloads ending with "==" and avoid blank output if "preg_replace()" returns "null"
- update "portable-utf8" to "~6.1.0"
- improve CI / test compatibility (incl. PHP 8.5 + PHPUnit 12)
-
4.1.4203 Jul 2023 -
4.1.4112 Feb 2023 -
4.1.4011 Feb 2023Release notes
Open source →- fix xss bypass (issue 115 | thx @thanosgn [Thanos Giannopoulos])
- add more blacklisted js calls (thx @peter-mw [Peter Ivanov])
- fix false positive on self-close tags (issue 111 | thx @genetus [Maxim Antonov])
-
4.1.3908 Mar 2022Release notes
Open source →- "To people of Russia": There is a war in Ukraine right now. The forces of the Russian Federation are attacking civilians.
-
4.1.3807 Mar 2022Release notes
Open source →- optimize "_sanitize_naughty_javascript" (issue 99 | thx @Fahl-Design)
- optimize "_do_never_allowed_afterwards", at least for strings in tags
-
4.1.3715 Feb 2022Release notes
Open source →- move more static data into the object
- allow to modify the "_never_allowed_call_strings"-data"
- allow to modify the "_never_allowed_js_callback_regex"-data"
- move more static data into the object
-
4.1.3627 Jan 2022 -
4.1.3508 Dec 2021 -
4.1.3429 Nov 2021Release notes
Open source →- allow e.g. "< 1 year" (issue 83)
- fix false-positive issue (issue 85 | thx @gharlan)
-
4.1.3303 Oct 2021Release notes
Open source →- fix errors in large strings
- fix "_xss_found" if xss string was found in array value
-
4.1.3229 Mar 2021 -
4.1.3102 Dec 2020 -
4.1.3012 Nov 2020 -
4.1.2908 Nov 2020Release notes
Open source →- allow e.g. "<35%" (issue #62)
- allow to skip some html tags from auto closing (issue #63)
- run tests with PHP 8.0 rc3
-
4.1.2827 Aug 2020Release notes
Open source →- fix allow base64 encoded images in <img>-tags (issue #61)
- fix performance issue of regex with "preg_match_all"
-
4.1.2723 Aug 2020Release notes
Open source →- allow e.g. "< $2.20" (issue #60)
- optimize protection against HTML "script" tag stripping evasion
- auto-generate the api documentation into the README
-
4.1.2608 Aug 2020 -
4.1.2512 Jun 2020 -
4.1.2408 Mar 2020Release notes
Open source →- allow to change the "_never_allowed_str_afterwards" (issue #56)
- fix false-positive (issue #55)
-
4.1.2305 Mar 2020Release notes
Open source →- use some more bad strings from "https://github.com/s0md3v/AwesomeXSS"
- optimize some regex (use strpos before the regex)
-
4.1.2206 Feb 2020 -
4.1.2130 Dec 2019Release notes
Open source →- fix false-positive (issue #53)
- fix for "server-sent events"
- optimize regex for encoded script-tags (%3C && %3E)
-
4.1.2007 Dec 2019Release notes
Open source →- fix additional false positives in string (issue #52)
- remove support for "Netscape 4 JS entities"
-
4.1.1911 Nov 2019 -
4.1.1810 Nov 2019 -
4.1.1708 Nov 2019 -
4.1.1603 Nov 2019 -
4.1.1525 Sep 2019 -
4.1.1427 Jun 2019Release notes
Open source →- add "removeNeverAllowedOnEventsAfterwards()" && "addNeverAllowedOnEventsAfterwards()"
- update "_never_allowed_on_events_afterwards" -> add "onTouchend" + "onTouchLeave" + "onTouchMove" (thx @DmytroChymyrys)
- optimize phpdoc for array => string[]
-
4.1.1307 Jun 2019Release notes
Open source →- fix replacing of false-positive xss words e.g. "[email protected]" (issue #44)
-
4.1.1231 May 2019Release notes
Open source →- fix replacing of false-positive xss words e.g. "[email protected]" (issue #44)
-
4.1.1125 Apr 2019Release notes
Open source →- fix replacing of false-positive xss words e.g. "[email protected]" (issue #44)
-
4.1.1023 Apr 2019Release notes
Open source →- fix replacing of false-positive xss words e.g. "ANAMNESI E VAL!DEFINITE BREVI ORTO" (issue #43)
-
4.1.919 Apr 2019 -
4.1.819 Apr 2019 -
4.1.719 Apr 2019Release notes
Open source →- fix replacing of false-positive xss words e.g. "DE VAL HERNANDEZ" (issue #43)
-
4.1.613 Apr 2019 -
4.1.513 Feb 2019 -
4.1.422 Jan 2019 -
4.1.327 Oct 2018 -
4.1.204 Sep 2018Release notes
Open source →- use new version of "Portable UTF8"
- add some more event listener
- use PHPStan
-
4.1.126 Apr 2018 -
4.1.017 Apr 2018 -
4.0.312 Apr 2018 -
4.0.214 Feb 2018 -
4.0.107 Jan 2018 -
4.0.023 Dec 2017Release notes
Open source →-
update "Portable UTF8" from v4 -> v5
-> this is a breaking change without API-changes - but the requirement from "Portable UTF8" has been changed (it no longer requires all polyfills from Symfony)
-
-
3.1.021 Nov 2017 -
3.0.119 Nov 2017 -
3.0.019 Nov 2017 -
2.3.126 Apr 2018Nothing published for this version
-
2.3.017 Apr 2018Nothing published for this version
-
2.2.212 Apr 2018Nothing published for this version
-
2.2.114 Feb 2018Nothing published for this version
-
2.2.022 Nov 2017Nothing published for this version
-
2.1.708 May 2017Nothing published for this version
-
2.1.608 May 2017Nothing published for this version
-
2.1.507 May 2017Nothing published for this version