Gallery 1.4.4-pl5 Security Release
Several days ago, Rafel Ivgi informed us of a possible cross site scripting (definition) problem in current versions of Gallery. The problem and some similar problems discovered by our team has been addressed in Gallery 2 CVS as well as in this release of 1.4.4-pl5.
As with most other cross site scripting problems, No risk is posed to the webserver itself or any non-Gallery data, but a Gallery install could be compromised using appropriate code.
In addition to the security fix, Gallery 1.4.4-pl5 uses the proper parameters for new versions of ImageMagick and fixes some small issues with PHP 5.
All Gallery users are strongly urged to upgrade to 1.4.4-pl5 immediately, which fixes this problem and will secure your system.
Gallery 1.4.4-pl5 can be downloaded from the Gallery Download Page.
As with most other cross site scripting problems, No risk is posed to the webserver itself or any non-Gallery data, but a Gallery install could be compromised using appropriate code.
In addition to the security fix, Gallery 1.4.4-pl5 uses the proper parameters for new versions of ImageMagick and fixes some small issues with PHP 5.
All Gallery users are strongly urged to upgrade to 1.4.4-pl5 immediately, which fixes this problem and will secure your system.
Gallery 1.4.4-pl5 can be downloaded from the Gallery Download Page.

Is there a 1.4.4-pl4 -> 1.4.4-pl5 patchfile ?<br />
Version 1.4.4-pl5-1 of the Debian gallery package was uploaded on Wednesday, January 26, 2005 and should be available in Debian unstable after the archive run completes in the afternoon (EST) of Wednesday, January 26, 2005.
I read that ImageMagick parameters were updated, so is this version going to work with older version of ImageMagick? My server runs Debian stable and it's using 5.4.4.5. thanks!
Gallery now works properly with both older and newer versions of ImageMagick
hi,<br />
<br />
i just installed the new version. now when i upload pics (via the form upload or the iphoto plugin) they don't display. the verison that was avaialble January 24th worked just fine - whats up?
For now, use this...<br />
<a href="http://www.shokk.com/gallery1.4.4-pl4_1.4.4-pl5.patch">http://www.shokk.com/gallery1.4.4-pl4_1.4.4-pl5.patch</a>
I'm running FreeBSD and am fairly new to things.<br />
I've tried updating my ports collection and it can only see 'gallery-1.4.4.4'. Who can I contact to update the ports collection? Or is there another way I can install this new secuity update?
How do you apply this?<br />
<br />
I tried patch -p1 -i gallery1.4.4-pl4_1.4.4-pl5.patch and that didn't work...<br />
Hmm... Looks like a normal diff to me...<br />
can't find file to patch at input line 2<br />
Perhaps you used the wrong -p or --strip option?<br />
<br />
<br />
I tried a bunch of different values for -p, and I was doing this from within the Gallery directory.
Please use one of our support channels to resolve this, preferably the forums avaliable in the "Support" section on the left of this website.
<br />
</pre><p><br />
- </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.c.37"></a><a name="id2586070"></a><b>C.37.</b></td><td align="left" valign="top"><p><br />
+ </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.c.37"></a><a name="id2516632"></a><b>C.37.</b></td><td align="left" valign="top"><p><br />
I've forgotten my admin password! How can I reset it?<br />
</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p><br />
Resetting your admin password is easy; just rerun the <a href="gallery1-install.config-wizard.html" title="The Configuration Wizard"><br />
configuration wizard</a> and specify a new password on step 2.<br />
- </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.c.38"></a><a name="id2586232"></a><b>C.38.</b></td><td align="left" valign="top"><p><br />
+ </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.c.38"></a><a name="id2516664"></a><b>C.38.</b></td><td align="left" valign="top"><p><br />
Why are my picture frames screwed up?<br />
</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p><br />
If you have a file called gallery/css/embedded_style.css (ie<br />
diff -ru gallery-1.4.4-pl4/docs/g1package/gallery1-install.faq.d.html gallery-1.4.4-pl5/docs/g1package/gallery1-install.faq.d.html<br />
--- gallery-1.4.4-pl4/docs/g1package/gallery1-install.faq.d.html 2004-11-03 14:32:16.000000000 -0500<br />
+++ gallery-1.4.4-pl5/docs/g1package/gallery1-install.faq.d.html 2005-01-26 06:44:37.000000000 -0500<br />
@@ -8,7 +8,7 @@<br />
(comment, images, etc..)?<br />
</a></dt><dt>D.4. <a href="gallery1-install.faq.d.html#gallery1-install.faq.d.4"><br />
Something went wrong, it's not working! What do I do?<br />
- </a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.d.1"></a><a name="id2586422"></a><b>D.1.</b></td><td align="left" valign="top"><p><br />
+ </a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.d.1"></a><a name="id2516743"></a><b>D.1.</b></td><td align="left" valign="top"><p><br />
How can I migrate my Gallery from one host to another?<br />
</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><div class="warning" ><h3 class="title">Warning</h3><p><br />
If you are moving between a Windows and non-Windows host, please<br />
@@ -52,14 +52,14 @@<br />
the albums directory you just uploaded, not a blank directory, as you<br />
would on a clean install of Gallery. After you secure Gallery, all your<br />
data should show up intact!<br />
- </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.d.2"></a><a name="id2586556"></a><b>D.2.</b></td><td align="left" valign="top"><p><br />
+ </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.d.2"></a><a name="id2516860"></a><b>D.2.</b></td><td align="left" valign="top"><p><br />
Why do I get this error after migration: <tt class="literal">Warning: fopen<br />
('.../albums/foo/album.dat.lock', 'a+')</tt>?<br />
</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p><br />
This is caused by not recursively chmodding the new albums directory 0777.<br />
See FAQ <a href="gallery1-install.faq.c.html#gallery1-install.faq.c.15">C.15</a> for information<br />
on how to fix this.<br />
- </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.d.3"></a><a name="id2586588"></a><b>D.3.</b></td><td align="left" valign="top"><p><br />
+ </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.d.3"></a><a name="id2516898"></a><b>D.3.</b></td><td align="left" valign="top"><p><br />
Will moving my Gallery to another host cause me to lose data<br />
(comment, images, etc..)?<br />
</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p><br />
@@ -67,7 +67,7 @@<br />
</a>, there should be no lose of data whatsoever. However, because of Murphy's<br />
law, it's a good idea not to delete your albums directory on your old host before<br />
you know everything is working on the new host.<br />
- </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.d.4"></a><a name="id2586613"></a><b>D.4.</b></td><td align="left" valign="top"><p><br />
+ </p></td></tr><tr class="question"><td align="left" valign="top"><a name="gallery1-install.faq.d.4"></a><a name="id2516933"></a><b>D.4.</b></td><td align="left" valign="top"><p><br />
Something went wrong, it's not working! What do I do?<br />
</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p><br />
First, try again. Make sure you follow all the instructions in<br />
diff -ru gallery-1.4.4-pl4/docs/g1package/index.html gallery-1.4.4-pl5/docs/g1package/index.html<br />
--- gallery-1.4.4-pl4/docs/g1package/index.html 2004-11-03 14:32:19.000000000 -0500<br />
+++ gallery-1.4.4-pl5/docs/g1package/index.html 2005-01-26 06:44:41.000000000 -0500<br />
@@ -2,5 +2,5 @@<br />
This guide is distributed under the terms of the <a href="http://www.gnu.org/licenses/gpl.txt" target="_top"><br />
GNU General Public License</a>.<br />
</p></div></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="preface.html">Preface</a></span></dt><dt><span class="chapter"><a href="gallery1-install.html">1. Gallery 1.x Installation Guide</a></span></dt><dd><dl><dt><span class="sect1"><a href="gallery1-install.overview.html">Overview</a></span></dt><dt><span class="sect1"><a href="gallery1-install.features.html">Features</a></span></dt><dt><span class="sect1"><a href="gallery1-install.credits.html">Credits</a></span></dt><dt><span class="sect1"><a href="gallery1-install.requirements.html">Installation Requirements</a></span></dt><dt><span class="sect1"><a href="gallery1-install.unix-ftp.html">Installing on a Unix/Linux Server with FTP</a></span></dt><dt><span class="sect1"><a href="gallery1-install.unix-shell.html">Installing on a Unix/Linux Server with Shell Access</a></span></dt><dt><span class="sect1"><a href="gallery1-install.windows.html">Installing on a Windows Server (Apache)</a></span></dt><dt><span class="sect1"><a href="gallery1-install.windows-iis.html">Installing on a Windows Server (IIS)</a></span></dt><dt><span class="sect1"><a href="gallery1-install.upgrade.html">Upgrading a Previous Gallery Installation</a></span></dt><dt><span class="sect1"><a href="gallery1-install.help.html">Getting Additional Help</a></span></dt><dt><span class="sect1"><a href="gallery1-install.required-programs.html">Installing Required Programs</a></span></dt><dt><span class="sect1"><a href="gallery1-install.remote-applets.html">Installing (or updating) Gallery Remote Applets</a></span></dt><dt><span class="sect1"><a href="gallery1-install.language-packs.html">Installing Language Packs</a></span></dt><dt><span class="sect1"><a href="gallery1-install.config-wizard.html">The Configuration Wizard</a></span></dt><dt><span class="sect1"><a href="gallery1-install.faq.html">Frequently Asked Questions</a></span></dt></dl></dd><dt><span class="chapter"><a href="gallery1-admin.html">2. Gallery 1.x Administration Guide</a></span></dt><dd><dl><dt><span class="sect1"><a href="gallery1-admin.basics.html">Basics</a></span></dt><dt><span class="sect1"><a href="gallery1-admin.users.html">Users and Permissions</a></span></dt><dt><span class="sect1"><a href="gallery1-admin.embedding.html">Embedding Gallery</a></span></dt><dt><span class="sect1"><a href="gallery1-admin.securing.html">Securing Gallery</a></span></dt><dt><span class="sect1"><a href="gallery1-admin.backup.html">Backup and Restore</a></span></dt><dt><span class="sect1"><a href="gallery1-admin.offline.html">Creating an Offline Copy</a></span></dt><dt><span class="sect1"><a href="gallery1-admin.patching.html">Patching your Gallery</a></span></dt><dt><span class="sect1"><a href="gallery1-admin.mirroring.html">Mirroring Gallery</a></span></dt></dl></dd><dt><span class="chapter"><a href="gallery1-user.html">3. Gallery 1.x User's Guide</a></span></dt><dd><dl><dt><span class="sect1"><a href="gallery1-user.import.html">Importing into gallery</a></span></dt><dt><span class="sect1"><a href="gallery1-user.watermark.html">Watermarking</a></span></dt></dl></dd></dl></div><p><br />
- Documentation last generated on: Wed Nov 3 11:32:08 PST 2004<br />
+ Documentation last generated on: Wed Jan 26 06:44:25 EST 2005<br />
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html><br />
diff -ru gallery-1.4.4-pl4/login.php gallery-1.4.4-pl5/login.php<br />
--- gallery-1.4.4-pl4/login.php 2004-05-20 18:06:03.000000000 -0400<br />
+++ gallery-1.4.4-pl5/login.php 2005-01-25 00:40:50.000000000 -0500<br />
@@ -17,7 +17,7 @@<br />
* along with this program; if not, write to the Free Software<br />
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.<br />
*<br />
- * $Id: login.php,v 1.51 2004/05/20 22:06:03 cryptographite Exp $<br />
+ * $Id: login.php,v 1.51.2.1 2005/01/25 05:40:50 cryptographite Exp $<br />
*/<br />
?><br />
<?php<br />
@@ -27,8 +27,11 @@<br />
// Security check.<br />
if (!isset($username)) {<br />
$username="";<br />
+} else {<br />
+ /* decode user data, remove tags, and then re-encode using html entities for safe page display */<br />
+ $username = htmlspecialchars(removeTags(urldecode($username)));<br />
}<br />
-$username = removeTags($username);<br />
+<br />
doctype();<br />
?><br />
<br />
diff -ru gallery-1.4.4-pl4/search.php gallery-1.4.4-pl5/search.php<br />
--- gallery-1.4.4-pl4/search.php 2004-07-10 00:04:03.000000000 -0400<br />
+++ gallery-1.4.4-pl5/search.php 2005-01-25 00:40:50.000000000 -0500<br />
@@ -17,7 +17,7 @@<br />
* along with this program; if not, write to the Free Software<br />
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.<br />
*<br />
- * $Id: search.php,v 1.61 2004/07/10 04:04:03 cryptographite Exp $<br />
+ * $Id: search.php,v 1.61.2.1 2005/01/25 05:40:50 cryptographite Exp $<br />
*/<br />
?><br />
<?php<br />
@@ -47,8 +47,11 @@<br />
<br />
if (!isset($searchstring)) {<br />
$searchstring="";<br />
+} else {<br />
+ /* urldecode, remove tags, and then encode htmlspecial chars to make string display-safe */<br />
+ $searchstring = htmlspecialchars(removeTags(urldecode($searchstring)));<br />
}<br />
-$searchstring = removeTags($searchstring);<br />
+<br />
if ($searchstring) {<br />
echo makeFormIntro("search.php");<br />
?><br />
diff -ru gallery-1.4.4-pl4/setup/.htaccess gallery-1.4.4-pl5/setup/.htaccess<br />
--- gallery-1.4.4-pl4/setup/.htaccess 2003-10-12 16:57:27.000000000 -0400<br />
+++ gallery-1.4.4-pl5/setup/.htaccess 2005-01-25 14:54:40.000000000 -0500<br />
@@ -1,4 +1,4 @@<br />
-# $Id: .htaccess,v 1.16 2003/10/12 20:57:27 bharat Exp $<br />
+# $Id: .htaccess,v 1.16.10.1 2005/01/25 19:54:40 cryptographite Exp $<br />
<IfModule sapi_apache2.c><br />
php_value auto_prepend_file ./php_value_ok.php<br />
php_value magic_quotes_gpc off<br />
@@ -9,6 +9,11 @@<br />
php_value magic_quotes_gpc off<br />
</IfModule><br />
<br />
+<IfModule mod_php5.c><br />
+php_value auto_prepend_file ./php_value_ok.php<br />
+php_value magic_quotes_gpc off<br />
+</IfModule><br />
+<br />
Options +FollowSymLinks<br />
<IfModule mod_rewrite.c><br />
RewriteEngine On<br />
diff -ru gallery-1.4.4-pl4/util.php gallery-1.4.4-pl5/util.php<br />
--- gallery-1.4.4-pl4/util.php 2004-08-22 20:41:43.000000000 -0400<br />
+++ gallery-1.4.4-pl5/util.php 2005-01-25 01:07:15.000000000 -0500<br />
@@ -17,7 +17,7 @@<br />
* along with this program; if not, write to the Free Software<br />
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.<br />
*<br />
- * $Id: util.php,v 1.410.2.9 2004/08/23 00:41:43 cryptographite Exp $<br />
+ * $Id: util.php,v 1.410.2.10 2005/01/25 06:07:15 cryptographite Exp $<br />
*/<br />
?><br />
<?php<br />
@@ -2354,6 +2354,18 @@<br />
return NULL;<br />
}<br />
<br />
+function getImVersion() {<br />
+ global $gallery;<br />
+ $version = array();<br />
+<br />
+ exec($gallery->app->ImPath .'/convert -version', $results);<br />
+<br />
+ $pieces = explode(' ', $results[0]);<br />
+ $version = $pieces[2];<br />
+<br />
+ return $version;<br />
+}<br />
+<br />
function compress_image($src, $out, $target, $quality, $keepProfiles=false) {<br />
global $gallery;<br />
<br />
@@ -2379,15 +2391,30 @@<br />
}<br />
}<br />
break;<br />
+<br />
case "ImageMagick":<br />
+ /* we just need the first digit = major version */<br />
+ $ImVersion = floor(getImVersion());<br />
+ // Set the keepProfiles parameter based on the version<br />
+ // of ImageMagick being used. 6.0.0 changed the<br />
+ // parameters again.<br />
+ if ($ImVersion == '5' && $keepProfiles) {<br />
+ $keepProfiles = ' +profile \'*\' ';<br />
+ } elseif ($ImVersion == '6' && $keepProfiles) {<br />
+ $keepProfiles = ' -strip ';<br />
+ } else {<br />
+ $keepProfiles = '';<br />
+ }<br />
+<br />
/* Preserve comment, EXIF data if a JPEG if $keepProfiles is set. */<br />
$err = exec_wrapper(ImCmd('convert', "-quality $quality "<br />
. ($target ? "-size ${target}x${target} " : '')<br />
- . ($keepProfiles ? ' ' : ' +profile \'*\' ') <br />
+ . $keepProfiles<br />
. $srcFile<br />
. ($target ? " -geometry ${target}x${target} " : ' ')<br />
. $outFile));<br />
break;<br />
+<br />
default:<br />
if (isDebugging())<br />
echo "<br>" . _("You have no graphics package configured for use!")."<br>";<br />
diff -ru gallery-1.4.4-pl4/Version.php gallery-1.4.4-pl5/Version.php<br />
--- gallery-1.4.4-pl4/Version.php 2004-11-03 14:10:51.000000000 -0500<br />
+++ gallery-1.4.4-pl5/Version.php 2005-01-25 18:03:54.000000000 -0500<br />
@@ -17,7 +17,7 @@<br />
* along with this program; if not, write to the Free Software<br />
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.<br />
*<br />
- * $Id: Version.php,v 1.972.2.74 2004/11/03 19:10:51 cryptographite Exp $<br />
+ * $Id: Version.php,v 1.972.2.79 2005/01/25 23:03:54 ckdake Exp $<br />
*/<br />
?><br />
<?php<br />
@@ -31,14 +31,14 @@<br />
$gallery = new stdClass();<br />
}<br />
<br />
-$gallery->version = '1.4.4-pl4';<br />
+$gallery->version = '1.4.4-pl5';<br />
$gallery->config_version = 82;<br />
$gallery->album_version = 31;<br />
$gallery->user_version = 5;<br />
$gallery->url = "http://gallery.sourceforge.net";<br />
<br />
/* do not edit the date!! modified by CVS */<br />
-$gallery->last_change=strtotime(substr('$Date: 2004/11/03 19:10:51 $', 7, -1));<br />
+$gallery->last_change=strtotime(substr('$Date: 2005/01/25 23:03:54 $', 7, -1));<br />
/*<br />
* PostNuke version info<br />
*/<br />
can we not get a change log list of changed files.<br />
<br />
i have some mods on my forum and need to know which files have been updated.<br />
<br />
cheers
i meet the same questiong as mandebooks ...