diff options
author | Ruslan Uzdenov <rxu@mail.ru> | 2010-11-15 23:27:57 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2010-11-18 13:37:56 +0100 |
commit | 291a1fff1f8db54a0d2c59faa689f23f3e35f4fe (patch) | |
tree | c6d5d290a0727d33e1a8db0e2af01867dd2b3c52 /phpBB | |
parent | 7b4cdc94a850c95582557d22ea7fd97e716734c7 (diff) | |
download | forums-291a1fff1f8db54a0d2c59faa689f23f3e35f4fe.tar forums-291a1fff1f8db54a0d2c59faa689f23f3e35f4fe.tar.gz forums-291a1fff1f8db54a0d2c59faa689f23f3e35f4fe.tar.bz2 forums-291a1fff1f8db54a0d2c59faa689f23f3e35f4fe.tar.xz forums-291a1fff1f8db54a0d2c59faa689f23f3e35f4fe.zip |
[ticket/9903] Fix XSS in BBcode-parser's Flash-BBcode.
Fix XSS in Flash-BBcode by validating that the supplied argument is a URL.
PHPBB3-9903
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/message_parser.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 952b55cc8c..b2d0b6c566 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -352,6 +352,15 @@ class bbcode_firstpass extends bbcode return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]'; } + $in = str_replace(' ', '%20', $in); + + // Make sure $in is a URL. + if (!preg_match('#^' . get_preg_expression('url') . '$#i', $in) && + !preg_match('#^' . get_preg_expression('www_url') . '$#i', $in)) + { + return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]'; + } + // Apply the same size checks on flash files as on images if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) { |