ZenphotoCMS Forum
SQL injection in /rss.php - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: SQL injection in /rss.php (/thread-6838.html)



SQL injection in /rss.php - weweje - 2010-03-28

Hi, rss.php is vulnerable to sql injection via albumtitle=whatever&albumname=whatever'"




SQL injection in /rss.php - acrylian - 2010-03-28

I actually don't think as these query parameter values are sanitized via our sanitize() function before they are used.




SQL injection in /rss.php - weweje - 2010-03-28

zenphoto version 1.2.9 [5088]

/rss.php?albumtitle=blah&albumname=zob'"

`
SELECT images.albumid, images.filename AS filename, images.mtime as mtime, images.title AS title, albums.folder AS folder, images.show, albums.show, albums.password FROM [code]zp_images[/code] AS images, [code]zp_albums[/code] AS albums WHERE albums.folder = 'zob'"' AND images.albumid = albums.id AND images.show=1 AND albums.folder != '' AND albums.show=1 AND albums.folder != '' ORDER BY images.id DESC LIMIT 10


You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"' AND images.albumid = albums.id AND images.show=1 AND albums.folder != '' AND' at line 1
`




SQL injection in /rss.php - acrylian - 2010-03-28

But that does no harm if the values make no sense to Zenphoto and just throws that error.




SQL injection in /rss.php - acrylian - 2010-03-28

We double checked that and you are actually right. So fix will be in tonight's nightly.