High-Tech Bridge SA has discovered multiple vulnerabilities in zenphoto, which can be exploited by malicious users to conduct SQL injection attacks and by malicious people to conduct cross-site scripting attacks and compromise a vulnerable system.
1) Input passed via the "viewer_size_image_saved" cookie value when viewing uploaded images is not properly sanitised before being used in an "eval()" call. This can be exploited to execute arbitrary PHP code.
Successful exploitation requires that the "viewer_size_image" plugin is enabled.
2) Input passed via the "sortableList" POST parameter to zp-core/admin-albumsort.php (when "XSRFToken" is valid) is not properly sanitised before being used in a SQL query. This can be exploited to manipulate SQL queries by injecting arbitrary SQL code.
Successful exploitation requires "Manage all albums" permissions or that at least one album is selected in the "Managed albums" list.
3) Input passed to the "msg" parameter in zp-core/admin.php (when "action" is set to "external") and "album" parameter in zp-core/admin-edit.php (when "tab" is set to "imageinfo") is not properly sanitised before being returned to the user. This can be exploited to execute arbitrary HTML and script code in a user's browser session in context of an affected site.
4) Input passed via the URL to e.g. zp-core/admin.php is not properly sanitised before being returned to the user. This can be exploited to execute arbitrary HTML and script code in a user's browser session in context of an affected site.
The vulnerabilities are confirmed in version 1.4.2. Prior versions may also be affected.