Filter more potentially malicious tags in SVG uploads

This commit is contained in:
Kijin Sung 2023-04-10 22:51:07 +09:00
parent b88fe65d6e
commit 901bdab6a9

View file

@ -93,7 +93,7 @@ class FileContentFilter
*/
protected static function _checkSVG($fp, $from, $to)
{
if (self::_matchStream('/<script|<handler\b|xlink:href\s*=\s*"(?!data:)/i', $fp, $from, $to))
if (self::_matchStream('/(?:<|&lt;)(?:script|iframe|foreignObject|object|embed|handler)|javascript:|xlink:href\s*=\s*"(?!data:)/i', $fp, $from, $to))
{
return false;
}