Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-9365 now.

X_FORWARDED_FOR is not filtered (fix completed in vcs)

X_FORWARDED_FOR is not filtered through htmlspecialchars here:

Code: Select all
$this->browser= (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : '';
$this->forwarded_for=(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : '';


So, it will be possible to use this vulnerability, if some mod use these lines and x_forwarded_for here.

Taken from PhpBB 3 Vulnerability and Forscripts.Net On-Line Test 1/2008

Comments / History

Posted by Kellanved (Former Team Member) on Feb 2nd 2008, 18:00

Thanks, we are aware of the article.

Forwarded for is matched against the IP regexp if used; a MOD doing any less would be vulnerable.
We will add a htmlspeciachars call, but I don't see a pressing issue.


~H

Posted by Acyd Burn (Server Manager) on Feb 2nd 2008, 18:45

I am moving this to the bug tracker - it is not a security issue within our product. To protect against those mod-authors not knowing what they do we will change the call.

Moved ticket from project "phpBB 3.0.x" (Security tracker) to "phpBB 3.0.x" (Bug tracker)

Action performed by Acyd Burn (Server Manager) on Feb 2nd 2008, 18:45

Posted by Acyd Burn (Server Manager) on Feb 2nd 2008, 18:45

Oh, and thanks for submitting this to the security tracker first (better moving a report than being sorry)

Posted by Alex007 on Feb 2nd 2008, 20:39

Not at all.

It will be very good, if it is the first and the last security submitting))

Posted by Alex007 on Feb 2nd 2008, 20:42

//But I didn't see any x_forwarded_for regchecks, as you wrote...

Posted by A_Jelly_Doughnut (MOD Team Member) on Feb 2nd 2008, 21:57

That would be line 174 of session.php.

Code: Select all
            if (!empty($ip) && !preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip))


In fact, the MOD team has denied at least one MOD which used HTTP_X_FORWARDED_FOR straight from $_SERVER.

Linked ticket with changeset: r8375

Action performed by Kellanved (Former Team Member) on Feb 4th 2008, 12:10

Linked ticket with changeset: r8376

Action performed by Kellanved (Former Team Member) on Feb 4th 2008, 12:14

Changed ticket status from "New" to "Fix completed in SVN"

Action performed by Kellanved (Former Team Member) on Feb 4th 2008, 12:14

Ticket details

Related SVN changesets