When normalizing tags to check whether they are contained in the set
of allowable tags, we must not strip slashes, unless they come
immediately after the opening `<`, or immediately before the closing
`>`.
. Fixed bug #78759 (array_search in $GLOBALS). (Nikita)
. Fixed bug #78833 (Integer overflow in pack causes out-of-bound access).
(cmb)
+ . Fixed bug #78814 (strip_tags allows / in tag name => whitelist bypass).
+ (cmb)
21 Nov 2019, PHP 7.2.25
if (state == 0) {
state=1;
}
- if (c != '/') {
+ if (c != '/' || (*(t-1) != '<' && *(t+1) != '>')) {
*(n++) = c;
}
} else {
--- /dev/null
+--TEST--
+Bug #78814 (strip_tags allows / in tag name => whitelist bypass)
+--FILE--
+<?php
+echo strip_tags("<s/trong>b</strong>", "<strong>");
+?>
+--EXPECT--
+b</strong>