- Affected version
- 2.2.12
A small corner case touching threads/XXXX/post-YYY with a valid thread id but invalid post id can cause XF to issue a redirect to the thread without checking if this thread is visible. This will then leak a url-normalized copy of the thread name.
The fix is fairly simple, it should check the thread visibility before redirecting.
Also, for consistency with
PHP:
public function actionPost(ParameterBag $params)
{
...
/** @var \XF\Entity\Post $post */
$post = $this->em()->find('XF:post', $postId, $with);
if (!$post)
{
$thread = $this->em()->find('XF:Thread', $params->thread_id);
if ($thread)
{
return $this->redirect($this->buildLink('threads', $thread)); // <- issue
}
else
{
return $this->notFound();
}
}
...
Also, for consistency with
assertViewableThread
, the notFound()
call should be $this->notFound(\XF::phrase('requested_thread_not_found'))
.