<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-4374</id>
	<title>Nabble - squirrelmail-devel</title>
	<updated>2008-09-03T02:00:11Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/squirrelmail-devel-f4374.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/squirrelmail-devel-f4374.html" />
	<subtitle type="html">Mailing list archive for squirrelmail-devel</subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-19285424</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-09-03T02:00:11Z</published>
	<updated>2008-09-03T02:00:11Z</updated>
	<author>
		<name>Fredrik Jervfors-4</name>
	</author>
	<content type="html">&lt;div class='shrinkable-quote'&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - IE interprets JavaScript when served within an &amp;quot;image&amp;quot; (that
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is, something linked from &amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;. - Apparently (?) it
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; doesn't do this when the file has a regular image extension, it
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; then processes it as an image. A typical Windows way of working
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I guess.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hmm. &amp;nbsp;Can anyone confirm this? &amp;nbsp;Are there any sample URIs that we
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; can see for this?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I tried this in IE6:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img src='javascript:alert(&amp;quot;hello&amp;quot;)' /&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The linked image file should contain the JavaScript. E.g.:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img src='&lt;a href=&quot;http://example.com/example.html'&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/example.html'&lt;/a&gt;&amp;nbsp;/&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and then example.html contains javascript instead of an image. IE
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; will allegedly interpret the javascript in the file even though it
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; has no business doing that as it is an image.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I see. &amp;nbsp;IE interprets any JavaScript loaded in a remote file unless
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the extension is .png, .gif, etc....? &amp;nbsp;That's a bit much, now, isn't
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; it?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The only thing I can find is this:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; but it's limited to the src attribute in a script tag. &amp;nbsp;I created some
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;hacked&amp;quot; gif files with JavaScript in them and IE 6 (I think this
&lt;br&gt;&amp;gt;&amp;gt; might be fixed in IE 7 too) only executes the JavaScript when it's
&lt;br&gt;&amp;gt;&amp;gt; included in a script tag. &amp;nbsp;When you put that into an email, SM sanitizes
&lt;br&gt;&amp;gt;&amp;gt; the script tag before the code in question here ever sees it.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; If this is what we are fighting, then the extension list by
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; definition of the way IE works seems like the ONLY way to prevent the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; problem, that is unless we were to pre-fetch the content and scan it
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ourselves and judge if the content was really an image file or not.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So, although I'm still not convinced that there should be any
&lt;br&gt;&amp;gt;&amp;gt; restriction here at all, I created some code that does just this - it
&lt;br&gt;&amp;gt;&amp;gt; keeps the file extension check since that's not resource intensive, but
&lt;br&gt;&amp;gt;&amp;gt; if that test fails, it tries to fetch the resource (fopen, fread) and
&lt;br&gt;&amp;gt;&amp;gt; then run the content through mime_content_type() to detect the content
&lt;br&gt;&amp;gt;&amp;gt; type. &amp;nbsp;The file is only then blocked if not an image file.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Patch is attached (for STABLE, but should be the same or very similar
&lt;br&gt;&amp;gt;&amp;gt; for DEVEL), but again, I'm not sure we need to make any restrictions here
&lt;br&gt;&amp;gt;&amp;gt; whatsoever -- ??
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Anyone have any feedback on this? &amp;nbsp;If no one does, what I'm thinking
&lt;br&gt;&amp;gt; I'll do is commit this patch, BUT comment it out. &amp;nbsp;So some code will
&lt;br&gt;&amp;gt; be there to use if a vulnerability is found, but for now, the
&lt;br&gt;&amp;gt; functionality will be to allow all image src URIs, since I can't find any
&lt;br&gt;&amp;gt; evidence that it can be exploited.
&lt;/div&gt;&lt;br&gt;I don't have an opinion about this. Do what you feel is best.
&lt;br&gt;&lt;br&gt;Sincerely,
&lt;br&gt;Fredrik
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19285424&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19285424.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19281546</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-09-02T18:43:49Z</published>
	<updated>2008-09-02T18:43:49Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">Barbara,
&lt;br&gt;&lt;br&gt;&amp;nbsp; You should not be subscribed to this mailing list. &amp;nbsp;This list is for
&lt;br&gt;SquirrelMail *software developers* only. &amp;nbsp;You apparently have an issue
&lt;br&gt;with *using* the SquirrelMail software. &amp;nbsp;You should contact your
&lt;br&gt;service provider and ask them to install the &amp;quot;HTML Mail&amp;quot; plugin.
&lt;br&gt;Please don't reply on this mailing list. &amp;nbsp;See:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://squirrelmail.org/support/enduser.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/support/enduser.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; Good luck,
&lt;br&gt;&lt;br&gt;Paul
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Tue, Sep 2, 2008 at 6:12 PM, &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281546&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;BarbaraInMemphis@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Paul,
&lt;br&gt;&amp;gt; I don't think this was supposed to come to me. I have NO idea what you are
&lt;br&gt;&amp;gt; talking about &amp;nbsp;-- &amp;nbsp;lol. I did submit a question asking about the ability to
&lt;br&gt;&amp;gt; change the font when writing an email. My host is LunarPages &amp; I use
&lt;br&gt;&amp;gt; SquirrelMail.
&lt;br&gt;&amp;gt; Barbara
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In a message dated 9/2/2008 7:51:14 P.M. Central Daylight Time,
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281546&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt; writes:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Sun, Aug 24, 2008 at 12:23 AM, Paul Lesniewski &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281546&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - IE interprets JavaScript when served within an &amp;quot;image&amp;quot; (that is,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; something linked from &amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;. - Apparently (?) it doesn't do
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; this
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; when the file has a regular image extension, it then processes it as
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; an
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; image. A typical Windows way of working I guess.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hmm. &amp;nbsp;Can anyone confirm this? &amp;nbsp;Are there any sample URIs that we can
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; see for this?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I tried this in IE6:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img src='javascript:alert(&amp;quot;hello&amp;quot;)' /&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The linked image file should contain the JavaScript. E.g.:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img src='&lt;a href=&quot;http://example.com/example.html'&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/example.html'&lt;/a&gt;&amp;nbsp;/&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and then example.html contains javascript instead of an image. IE will
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; allegedly interpret the javascript in the file even though it has no
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; business doing that as it is an image.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I see. &amp;nbsp;IE interprets any JavaScript loaded in a remote file unless
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the extension is .png, .gif, etc....? &amp;nbsp;That's a bit much, now, isn't
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; it?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The only thing I can find is this:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; but it's limited to the src attribute in a script tag. &amp;nbsp;I created some
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;hacked&amp;quot; gif files with JavaScript in them and IE 6 (I think this
&lt;br&gt;&amp;gt;&amp;gt; might be fixed in IE 7 too) only executes the JavaScript when it's
&lt;br&gt;&amp;gt;&amp;gt; included in a script tag. &amp;nbsp;When you put that into an email, SM
&lt;br&gt;&amp;gt;&amp;gt; sanitizes the script tag before the code in question here ever sees
&lt;br&gt;&amp;gt;&amp;gt; it.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp;If this is what we are fighting, then the extension list by
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; definition of the way IE works seems like the ONLY way to prevent the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; problem, that is unless we were to pre-fetch the content and scan it
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ourselves and judge if the content was really an image file or not.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So, although I'm still not convinced that there should be any
&lt;br&gt;&amp;gt;&amp;gt; restriction here at all, I created some code that does just this - it
&lt;br&gt;&amp;gt;&amp;gt; keeps the file extension check since that's not resource intensive,
&lt;br&gt;&amp;gt;&amp;gt; but if that test fails, it tries to fetch the resource (fopen, fread)
&lt;br&gt;&amp;gt;&amp;gt; and then run the content through mime_content_type() to detect the
&lt;br&gt;&amp;gt;&amp;gt; content type. &amp;nbsp;The file is only then blocked if not an image file.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Patch is attached (for STABLE, but should be the same or very similar
&lt;br&gt;&amp;gt;&amp;gt; for DEVEL), but again, I'm not sure we need to make any restrictions
&lt;br&gt;&amp;gt;&amp;gt; here whatsoever -- ??
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Anyone have any feedback on this? &amp;nbsp;If no one does, what I'm thinking
&lt;br&gt;&amp;gt; I'll do is commit this patch, BUT comment it out. &amp;nbsp;So some code will
&lt;br&gt;&amp;gt; be there to use if a vulnerability is found, but for now, the
&lt;br&gt;&amp;gt; functionality will be to allow all image src URIs, since I can't find
&lt;br&gt;&amp;gt; any evidence that it can be exploited.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt; This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;&amp;gt; Build the coolest Linux based applications with Moblin SDK &amp; win great
&lt;br&gt;&amp;gt; prizes
&lt;br&gt;&amp;gt; Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;&amp;gt; -----
&lt;br&gt;&amp;gt; squirrelmail-devel mailing list
&lt;br&gt;&amp;gt; Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;&amp;gt; List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281546&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;&amp;gt; List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;&amp;gt; List info (subscribe/unsubscribe/change options):
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ________________________________
&lt;br&gt;&amp;gt; It's only a deal if it's where you want to go. Find your travel deal here.
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt; This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;&amp;gt; Build the coolest Linux based applications with Moblin SDK &amp; win great
&lt;br&gt;&amp;gt; prizes
&lt;br&gt;&amp;gt; Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;&amp;gt; -----
&lt;br&gt;&amp;gt; squirrelmail-devel mailing list
&lt;br&gt;&amp;gt; Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;&amp;gt; List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281546&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;&amp;gt; List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;&amp;gt; List info (subscribe/unsubscribe/change options):
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281546&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Re%3A-Image-extension-issue-in-mime.php-tp19281346p19281546.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19281346</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-09-02T18:12:25Z</published>
	<updated>2008-09-02T18:12:25Z</updated>
	<author>
		<name>BarbaraInMemphis</name>
	</author>
	<content type="html">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
&lt;HTML&gt;&lt;HEAD&gt;
&lt;META http-equiv=Content-Type content=&quot;text/html; charset=US-ASCII&quot;&gt;
&lt;META content=&quot;MSHTML 6.00.6000.16705&quot; name=GENERATOR&gt;&lt;/HEAD&gt;
&lt;BODY id=role_body style=&quot;FONT-SIZE: 10pt; COLOR: #7a83bf; FONT-FAMILY: Comic Sans MS&quot; bottomMargin=7 leftMargin=7 topMargin=7 rightMargin=7&gt;&lt;FONT id=role_document face=&quot;Comic Sans MS&quot; color=#7a83bf size=2&gt;
&lt;DIV&gt;Hi Paul,&lt;/DIV&gt;
&lt;DIV&gt;I don't think this was supposed to come to me. I have NO idea what you are 
talking about&amp;nbsp; --&amp;nbsp; lol. I did submit a question asking about the 
ability to change the font when writing an email. My host is LunarPages &amp;amp; I 
use SquirrelMail.&lt;/DIV&gt;
&lt;DIV&gt;Barbara&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;In a message dated 9/2/2008 7:51:14 P.M. Central Daylight Time, 
&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281346&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt; writes:&lt;/DIV&gt;
&lt;BLOCKQUOTE style=&quot;PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: blue 2px solid&quot;&gt;&lt;FONT style=&quot;BACKGROUND-COLOR: transparent&quot; face=Arial color=#000000 size=2&gt;On Sun, 
  Aug 24, 2008 at 12:23 AM, Paul Lesniewski &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281346&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt;&amp;gt; 
  wrote:&lt;div class='shrinkable-quote'&gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - IE interprets JavaScript when served within 
  an &quot;image&quot; (that is,&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; something linked from &amp;lt;img 
  src=&quot;&quot;&amp;gt;. - Apparently (?) it doesn't do this&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; when 
  the file has a regular image extension, it then processes it as 
  an&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; image. A typical Windows way of working I 
  guess.&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
  Hmm.&amp;nbsp; Can anyone confirm this?&amp;nbsp; Are there any sample URIs that we 
  can&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; see for this?&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
  I tried this in IE6:&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img 
  src='javascript:alert(&quot;hello&quot;)' /&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt; The 
  linked image file should contain the JavaScript. E.g.:&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img 
  src='http://example.com/example.html' /&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt; and then 
  example.html contains javascript instead of an image. IE will&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt; 
  allegedly interpret the javascript in the file even though it has 
  no&lt;BR&gt;&amp;gt;&amp;gt;&amp;gt; business doing that as it is an 
  image.&lt;BR&gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt; I see.&amp;nbsp; IE interprets any JavaScript 
  loaded in a remote file unless&lt;BR&gt;&amp;gt;&amp;gt; the extension is .png, .gif, 
  etc....?&amp;nbsp; That's a bit much, now, isn't&lt;BR&gt;&amp;gt;&amp;gt; it?&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; 
  The only thing I can find is this:&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; 
  http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; 
  but it's limited to the src attribute in a script tag.&amp;nbsp; I created 
  some&lt;BR&gt;&amp;gt; &quot;hacked&quot; gif files with JavaScript in them and IE 6 (I think 
  this&lt;BR&gt;&amp;gt; might be fixed in IE 7 too) only executes the JavaScript when 
  it's&lt;BR&gt;&amp;gt; included in a script tag.&amp;nbsp; When you put that into an email, 
  SM&lt;BR&gt;&amp;gt; sanitizes the script tag before the code in question here ever 
  sees&lt;BR&gt;&amp;gt; it.&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&amp;nbsp; If this is what we are fighting, 
  then the extension list by&lt;BR&gt;&amp;gt;&amp;gt; definition of the way IE works seems 
  like the ONLY way to prevent the&lt;BR&gt;&amp;gt;&amp;gt; problem, that is unless we were 
  to pre-fetch the content and scan it&lt;BR&gt;&amp;gt;&amp;gt; ourselves and judge if the 
  content was really an image file or not.&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; So, although I'm 
  still not convinced that there should be any&lt;BR&gt;&amp;gt; restriction here at all, 
  I created some code that does just this - it&lt;BR&gt;&amp;gt; keeps the file extension 
  check since that's not resource intensive,&lt;BR&gt;&amp;gt; but if that test fails, it 
  tries to fetch the resource (fopen, fread)&lt;BR&gt;&amp;gt; and then run the content 
  through mime_content_type() to detect the&lt;BR&gt;&amp;gt; content type.&amp;nbsp; The file 
  is only then blocked if not an image file.&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; Patch is attached 
  (for STABLE, but should be the same or very similar&lt;BR&gt;&amp;gt; for DEVEL), but 
  again, I'm not sure we need to make any restrictions&lt;BR&gt;&amp;gt; here whatsoever 
  -- ??&lt;/div&gt;&lt;BR&gt;Anyone have any feedback on this?&amp;nbsp; If no one does, what I'm 
  thinking&lt;BR&gt;I'll do is commit this patch, BUT comment it out.&amp;nbsp; So some 
  code will&lt;BR&gt;be there to use if a vulnerability is found, but for now, 
  the&lt;BR&gt;functionality will be to allow all image src URIs, since I can't 
  find&lt;BR&gt;any evidence that it can be 
  exploited.&lt;BR&gt;&lt;BR&gt;-------------------------------------------------------------------------&lt;BR&gt;This 
  SF.Net email is sponsored by the Moblin Your Move Developer's 
  challenge&lt;BR&gt;Build the coolest Linux based applications with Moblin SDK &amp;amp; 
  win great prizes&lt;BR&gt;Grand prize is a trip for two to an Open Source event 
  anywhere in the 
  world&lt;BR&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;amp;url=/&lt;BR&gt;-----&lt;BR&gt;squirrelmail-devel 
  mailing list&lt;BR&gt;Posting guidelines: 
  http://squirrelmail.org/postingguidelines&lt;BR&gt;List address: 
  &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281346&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;&lt;BR&gt;List archives: 
  http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;BR&gt;List info 
  (subscribe/unsubscribe/change options): 
  https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;BR&gt;&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;DIV&gt;&lt;FONT style=&quot;color: black; font: normal 10pt ARIAL, SAN-SERIF;&quot;&gt;&lt;HR style=&quot;MARGIN-TOP: 10px&quot;&gt;It's only a deal if it's where &lt;I&gt;you&lt;/I&gt; want to go. Find your travel deal &lt;A title=&quot;http://information.travel.aol.com/deals?ncid=aoltrv00050000000047&quot; href=&quot;http://information.travel.aol.com/deals?ncid=aoltrv00050000000047&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;B&gt;here&lt;/B&gt;&lt;/A&gt;.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;
&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281346&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Re%3A-Image-extension-issue-in-mime.php-tp19281346p19281346.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19281176</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-09-02T17:50:45Z</published>
	<updated>2008-09-02T17:50:45Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Sun, Aug 24, 2008 at 12:23 AM, Paul Lesniewski &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281176&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - IE interprets JavaScript when served within an &amp;quot;image&amp;quot; (that is,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; something linked from &amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;. - Apparently (?) it doesn't do this
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; when the file has a regular image extension, it then processes it as an
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; image. A typical Windows way of working I guess.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hmm. &amp;nbsp;Can anyone confirm this? &amp;nbsp;Are there any sample URIs that we can
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; see for this?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I tried this in IE6:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img src='javascript:alert(&amp;quot;hello&amp;quot;)' /&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The linked image file should contain the JavaScript. E.g.:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img src='&lt;a href=&quot;http://example.com/example.html'&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/example.html'&lt;/a&gt;&amp;nbsp;/&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; and then example.html contains javascript instead of an image. IE will
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; allegedly interpret the javascript in the file even though it has no
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; business doing that as it is an image.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I see. &amp;nbsp;IE interprets any JavaScript loaded in a remote file unless
&lt;br&gt;&amp;gt;&amp;gt; the extension is .png, .gif, etc....? &amp;nbsp;That's a bit much, now, isn't
&lt;br&gt;&amp;gt;&amp;gt; it?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The only thing I can find is this:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; but it's limited to the src attribute in a script tag. &amp;nbsp;I created some
&lt;br&gt;&amp;gt; &amp;quot;hacked&amp;quot; gif files with JavaScript in them and IE 6 (I think this
&lt;br&gt;&amp;gt; might be fixed in IE 7 too) only executes the JavaScript when it's
&lt;br&gt;&amp;gt; included in a script tag. &amp;nbsp;When you put that into an email, SM
&lt;br&gt;&amp;gt; sanitizes the script tag before the code in question here ever sees
&lt;br&gt;&amp;gt; it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;If this is what we are fighting, then the extension list by
&lt;br&gt;&amp;gt;&amp;gt; definition of the way IE works seems like the ONLY way to prevent the
&lt;br&gt;&amp;gt;&amp;gt; problem, that is unless we were to pre-fetch the content and scan it
&lt;br&gt;&amp;gt;&amp;gt; ourselves and judge if the content was really an image file or not.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So, although I'm still not convinced that there should be any
&lt;br&gt;&amp;gt; restriction here at all, I created some code that does just this - it
&lt;br&gt;&amp;gt; keeps the file extension check since that's not resource intensive,
&lt;br&gt;&amp;gt; but if that test fails, it tries to fetch the resource (fopen, fread)
&lt;br&gt;&amp;gt; and then run the content through mime_content_type() to detect the
&lt;br&gt;&amp;gt; content type. &amp;nbsp;The file is only then blocked if not an image file.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Patch is attached (for STABLE, but should be the same or very similar
&lt;br&gt;&amp;gt; for DEVEL), but again, I'm not sure we need to make any restrictions
&lt;br&gt;&amp;gt; here whatsoever -- ??
&lt;/div&gt;&lt;br&gt;Anyone have any feedback on this? &amp;nbsp;If no one does, what I'm thinking
&lt;br&gt;I'll do is commit this patch, BUT comment it out. &amp;nbsp;So some code will
&lt;br&gt;be there to use if a vulnerability is found, but for now, the
&lt;br&gt;functionality will be to allow all image src URIs, since I can't find
&lt;br&gt;any evidence that it can be exploited.
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19281176&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19281176.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19128330</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-08-24T00:23:21Z</published>
	<updated>2008-08-24T00:23:21Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">&lt;div class='shrinkable-quote'&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - IE interprets JavaScript when served within an &amp;quot;image&amp;quot; (that is,
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; something linked from &amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;. - Apparently (?) it doesn't do this
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; when the file has a regular image extension, it then processes it as an
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; image. A typical Windows way of working I guess.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hmm. &amp;nbsp;Can anyone confirm this? &amp;nbsp;Are there any sample URIs that we can
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; see for this?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I tried this in IE6:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;img src='javascript:alert(&amp;quot;hello&amp;quot;)' /&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The linked image file should contain the JavaScript. E.g.:
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;img src='&lt;a href=&quot;http://example.com/example.html'&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/example.html'&lt;/a&gt;&amp;nbsp;/&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; and then example.html contains javascript instead of an image. IE will
&lt;br&gt;&amp;gt;&amp;gt; allegedly interpret the javascript in the file even though it has no
&lt;br&gt;&amp;gt;&amp;gt; business doing that as it is an image.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I see. &amp;nbsp;IE interprets any JavaScript loaded in a remote file unless
&lt;br&gt;&amp;gt; the extension is .png, .gif, etc....? &amp;nbsp;That's a bit much, now, isn't
&lt;br&gt;&amp;gt; it?
&lt;/div&gt;&lt;/div&gt;The only thing I can find is this:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://ha.ckers.org/blog/20070623/hiding-js-in-valid-images/&lt;/a&gt;&lt;br&gt;&lt;br&gt;but it's limited to the src attribute in a script tag. &amp;nbsp;I created some
&lt;br&gt;&amp;quot;hacked&amp;quot; gif files with JavaScript in them and IE 6 (I think this
&lt;br&gt;might be fixed in IE 7 too) only executes the JavaScript when it's
&lt;br&gt;included in a script tag. &amp;nbsp;When you put that into an email, SM
&lt;br&gt;sanitizes the script tag before the code in question here ever sees
&lt;br&gt;it.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;If this is what we are fighting, then the extension list by
&lt;br&gt;&amp;gt; definition of the way IE works seems like the ONLY way to prevent the
&lt;br&gt;&amp;gt; problem, that is unless we were to pre-fetch the content and scan it
&lt;br&gt;&amp;gt; ourselves and judge if the content was really an image file or not.
&lt;br&gt;&lt;br&gt;So, although I'm still not convinced that there should be any
&lt;br&gt;restriction here at all, I created some code that does just this - it
&lt;br&gt;keeps the file extension check since that's not resource intensive,
&lt;br&gt;but if that test fails, it tries to fetch the resource (fopen, fread)
&lt;br&gt;and then run the content through mime_content_type() to detect the
&lt;br&gt;content type. &amp;nbsp;The file is only then blocked if not an image file.
&lt;br&gt;&lt;br&gt;Patch is attached (for STABLE, but should be the same or very similar
&lt;br&gt;for DEVEL), but again, I'm not sure we need to make any restrictions
&lt;br&gt;here whatsoever -- ??
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19128330&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://www.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;check_image_content.diff&lt;/strong&gt; (5K) &lt;a href=&quot;http://www.nabble.com/attachment/19128330/0/check_image_content.diff&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19128330.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19114158</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-08-22T12:32:59Z</published>
	<updated>2008-08-22T12:32:59Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Fri, Aug 22, 2008 at 2:13 AM, Thijs Kinkhorst &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19114158&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kink@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Fri, August 22, 2008 10:03, Paul Lesniewski wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; - IE interprets JavaScript when served within an &amp;quot;image&amp;quot; (that is,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; something linked from &amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;. - Apparently (?) it doesn't do this
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; when the file has a regular image extension, it then processes it as an
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; image. A typical Windows way of working I guess.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hmm. &amp;nbsp;Can anyone confirm this? &amp;nbsp;Are there any sample URIs that we can
&lt;br&gt;&amp;gt;&amp;gt; see for this?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I tried this in IE6:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;img src='javascript:alert(&amp;quot;hello&amp;quot;)' /&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The linked image file should contain the JavaScript. E.g.:
&lt;br&gt;&amp;gt; &amp;lt;img src='&lt;a href=&quot;http://example.com/example.html'&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/example.html'&lt;/a&gt;&amp;nbsp;/&amp;gt;
&lt;br&gt;&amp;gt; and then example.html contains javascript instead of an image. IE will
&lt;br&gt;&amp;gt; allegedly interpret the javascript in the file even though it has no
&lt;br&gt;&amp;gt; business doing that as it is an image.
&lt;/div&gt;&lt;br&gt;I see. &amp;nbsp;IE interprets any JavaScript loaded in a remote file unless
&lt;br&gt;the extension is .png, .gif, etc....? &amp;nbsp;That's a bit much, now, isn't
&lt;br&gt;it? &amp;nbsp;If this is what we are fighting, then the extension list by
&lt;br&gt;definition of the way IE works seems like the ONLY way to prevent the
&lt;br&gt;problem, that is unless we were to pre-fetch the content and scan it
&lt;br&gt;ourselves and judge if the content was really an image file or not.
&lt;br&gt;&lt;br&gt;There may be a PHP algorithm out there already written to do that, so
&lt;br&gt;*maybe* that is possible, but short of that, it looks like we are
&lt;br&gt;stuck: have some HTML mails with blanks where images should really be
&lt;br&gt;shown or open IE users up to possible attacks via this mechanism.
&lt;br&gt;&lt;br&gt;I am going to run a test to try to reproduce the actual IE issue you
&lt;br&gt;described, and I am going to look around to see if there is a way we
&lt;br&gt;can do a pre-fetch and make a content judgment. &amp;nbsp;Short of any other
&lt;br&gt;ideas, though, it looks to me like the only thing we can do is let the
&lt;br&gt;admin decide to open themselves up to this, or to build some 2nd level
&lt;br&gt;of unsafe image viewing, where the user could click a *second* time to
&lt;br&gt;show such images - but that may not be smart, since most users may not
&lt;br&gt;understand the risk.
&lt;br&gt;&lt;br&gt;Oh, would it be safe to open SM up to any image URI as long as the
&lt;br&gt;user agent is not IE?
&lt;br&gt;&lt;br&gt;Update - I just tried to use an image URI that loaded a php page that
&lt;br&gt;serves this:
&lt;br&gt;&lt;br&gt;&amp;lt;script language=&amp;quot;JavaScript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;
&lt;br&gt;alert(&amp;quot;HELLO&amp;quot;);
&lt;br&gt;&amp;lt;/script&amp;gt;
&lt;br&gt;&lt;br&gt;And in IE 6 it just gives a broken image (does NOT appear to interpret
&lt;br&gt;the JavaScript!), as does FF.
&lt;br&gt;&lt;br&gt;Can anyone shed light on the actual vulnerability?
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19114158&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19114158.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19103904</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-08-22T02:13:02Z</published>
	<updated>2008-08-22T02:13:02Z</updated>
	<author>
		<name>Thijs Kinkhorst</name>
	</author>
	<content type="html">On Fri, August 22, 2008 10:03, Paul Lesniewski wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; - IE interprets JavaScript when served within an &amp;quot;image&amp;quot; (that is,
&lt;br&gt;&amp;gt;&amp;gt; something linked from &amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;. - Apparently (?) it doesn't do this
&lt;br&gt;&amp;gt;&amp;gt; when the file has a regular image extension, it then processes it as an
&lt;br&gt;&amp;gt;&amp;gt; image. A typical Windows way of working I guess.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hmm. &amp;nbsp;Can anyone confirm this? &amp;nbsp;Are there any sample URIs that we can
&lt;br&gt;&amp;gt; see for this?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I tried this in IE6:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;img src='javascript:alert(&amp;quot;hello&amp;quot;)' /&amp;gt;
&lt;/div&gt;&lt;br&gt;The linked image file should contain the JavaScript. E.g.:
&lt;br&gt;&amp;lt;img src='&lt;a href=&quot;http://example.com/example.html'&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/example.html'&lt;/a&gt;&amp;nbsp;/&amp;gt;
&lt;br&gt;and then example.html contains javascript instead of an image. IE will
&lt;br&gt;allegedly interpret the javascript in the file even though it has no
&lt;br&gt;business doing that as it is an image.
&lt;br&gt;&lt;br&gt;Something like that, all from the top of my head though.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Thijs
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19103904&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19103904.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19103127</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-08-22T01:03:34Z</published>
	<updated>2008-08-22T01:03:34Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Fri, Aug 22, 2008 at 12:44 AM, Thijs Kinkhorst &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19103127&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kink@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Friday 22 August 2008 09:17, Paul Lesniewski wrote:
&lt;br&gt;&amp;gt;&amp;gt; It's your commit, so maybe you can help.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;-STABLE/squirrelmail/functions/mime.php?view=log#rev12370
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If this code is meant to stop &amp;quot;request forgeries through included
&lt;br&gt;&amp;gt;&amp;gt; images&amp;quot;, I'd like to know more about what this means, since, as I
&lt;br&gt;&amp;gt;&amp;gt; noted, it wouldn't be hard for an attacker to substitute a dynamically
&lt;br&gt;&amp;gt;&amp;gt; executed script for an &amp;quot;image&amp;quot; file on the target server. &amp;nbsp;Or perhaps
&lt;br&gt;&amp;gt;&amp;gt; the file extension code is not specifically what fixed that actual
&lt;br&gt;&amp;gt;&amp;gt; issue and is only a side effect?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The patch is actually by Marc. He had some discussion about it with Tomas that
&lt;br&gt;&amp;gt; I could find. As far as I can distill from the mails, but it's a bit of
&lt;br&gt;&amp;gt; guesswork:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; - IE interprets JavaScript when served within an &amp;quot;image&amp;quot; (that is, something
&lt;br&gt;&amp;gt; linked from &amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;.
&lt;br&gt;&amp;gt; - Apparently (?) it doesn't do this when the file has a regular image
&lt;br&gt;&amp;gt; extension, it then processes it as an image. A typical Windows way of working
&lt;br&gt;&amp;gt; I guess.
&lt;/div&gt;&lt;br&gt;Hmm. &amp;nbsp;Can anyone confirm this? &amp;nbsp;Are there any sample URIs that we can
&lt;br&gt;see for this?
&lt;br&gt;&lt;br&gt;I tried this in IE6:
&lt;br&gt;&lt;br&gt;&amp;lt;img src='javascript:alert(&amp;quot;hello&amp;quot;)' /&amp;gt;
&lt;br&gt;&lt;br&gt;Even when viewing unsafe images (and the file extension list
&lt;br&gt;disabled), this is replaced with the &amp;quot;This image has been removed for
&lt;br&gt;security reasons&amp;quot; image replacement, presumably because the text
&lt;br&gt;&amp;quot;javascript&amp;quot; is found and removed. &amp;nbsp;So, is the actual fix for the
&lt;br&gt;javascript issue fixed elsewhere and the image file extension list
&lt;br&gt;only intended to avoid showing the &amp;quot;image has been removed&amp;quot; thing when
&lt;br&gt;the user does not expect it (because they already clicked to view
&lt;br&gt;unsafe images)?
&lt;br&gt;&lt;br&gt;Or is there some other URI type that is the real problem here?
&lt;br&gt;&lt;br&gt;I'm still not convinced that the list can't be removed, but am hoping
&lt;br&gt;anyone with more details or knowledge about the issue can voice their
&lt;br&gt;opinion.
&lt;br&gt;&lt;br&gt;&amp;gt; I'm not sure that that is what it's supposed to fix as the mails aren't too
&lt;br&gt;&amp;gt; clear on that. I also don't use IE so can't easily verify this theory.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You could argue that pressing View Unsafe Images leaves you on your own which
&lt;br&gt;&amp;gt; is sort of true, however, my perception of the function was to prevent remote
&lt;br&gt;&amp;gt; tracking, and enabling it would not directly open you up to xss.
&lt;br&gt;&lt;br&gt;My thoughts exactly.
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19103127&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19103127.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19102911</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-08-22T00:44:30Z</published>
	<updated>2008-08-22T00:44:30Z</updated>
	<author>
		<name>Thijs Kinkhorst</name>
	</author>
	<content type="html">On Friday 22 August 2008 09:17, Paul Lesniewski wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; It's your commit, so maybe you can help.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4&lt;/a&gt;&lt;br&gt;&amp;gt;-STABLE/squirrelmail/functions/mime.php?view=log#rev12370
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If this code is meant to stop &amp;quot;request forgeries through included
&lt;br&gt;&amp;gt; images&amp;quot;, I'd like to know more about what this means, since, as I
&lt;br&gt;&amp;gt; noted, it wouldn't be hard for an attacker to substitute a dynamically
&lt;br&gt;&amp;gt; executed script for an &amp;quot;image&amp;quot; file on the target server.  Or perhaps
&lt;br&gt;&amp;gt; the file extension code is not specifically what fixed that actual
&lt;br&gt;&amp;gt; issue and is only a side effect?
&lt;/div&gt;&lt;br&gt;The patch is actually by Marc. He had some discussion about it with Tomas that 
&lt;br&gt;I could find. As far as I can distill from the mails, but it's a bit of 
&lt;br&gt;guesswork:
&lt;br&gt;&lt;br&gt;- IE interprets JavaScript when served within an &amp;quot;image&amp;quot; (that is, something 
&lt;br&gt;linked from &amp;lt;img src=&amp;quot;&amp;quot;&amp;gt;.
&lt;br&gt;- Apparently (?) it doesn't do this when the file has a regular image 
&lt;br&gt;extension, it then processes it as an image. A typical Windows way of working 
&lt;br&gt;I guess.
&lt;br&gt;&lt;br&gt;I'm not sure that that is what it's supposed to fix as the mails aren't too 
&lt;br&gt;clear on that. I also don't use IE so can't easily verify this theory.
&lt;br&gt;&lt;br&gt;You could argue that pressing View Unsafe Images leaves you on your own which 
&lt;br&gt;is sort of true, however, my perception of the function was to prevent remote 
&lt;br&gt;tracking, and enabling it would not directly open you up to xss.
&lt;br&gt;&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Thijs
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19102911&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19102911.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19102755</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-08-22T00:31:55Z</published>
	<updated>2008-08-22T00:31:55Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Fri, Aug 22, 2008 at 12:17 AM, Paul Lesniewski &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19102755&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Thu, Aug 21, 2008 at 2:58 AM, Thijs Kinkhorst &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19102755&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kink@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Thu, August 21, 2008 03:30, Paul Lesniewski wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; My feeling is that this should be addressed by either removing the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; restriction list completely,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I would say &amp;quot;yes&amp;quot; to this, but would be curious where the original idea
&lt;br&gt;&amp;gt;&amp;gt; comes from. Isn't that tracable in the commit log?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It's your commit, so maybe you can help.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4-STABLE/squirrelmail/functions/mime.php?view=log#rev12370&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4-STABLE/squirrelmail/functions/mime.php?view=log#rev12370&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If this code is meant to stop &amp;quot;request forgeries through included
&lt;br&gt;&amp;gt; images&amp;quot;, I'd like to know more about what this means, since, as I
&lt;br&gt;&amp;gt; noted, it wouldn't be hard for an attacker to substitute a dynamically
&lt;br&gt;&amp;gt; executed script for an &amp;quot;image&amp;quot; file on the target server. &amp;nbsp;Or perhaps
&lt;br&gt;&amp;gt; the file extension code is not specifically what fixed that actual
&lt;br&gt;&amp;gt; issue and is only a side effect?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So if the extension limitation on image files is removed, does this
&lt;br&gt;&amp;gt; expose SM to some XSS or something that it's not already exposed to
&lt;br&gt;&amp;gt; now?
&lt;/div&gt;&lt;br&gt;According to:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.squirrelmail.org/security/issue/2007-05-09&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.squirrelmail.org/security/issue/2007-05-09&lt;/a&gt;&lt;br&gt;&lt;br&gt;'Request forgery through images. It was possible to include &amp;quot;images&amp;quot;
&lt;br&gt;in HTML mails which were in fact GET requests for the compose.php page
&lt;br&gt;sending mail. These images are now properly detected, and the compose
&lt;br&gt;form will only send mail through a POST request.'
&lt;br&gt;&lt;br&gt;If this is the issue, then the fact that src/compose.php only accepts
&lt;br&gt;the &amp;quot;send&amp;quot; variable submission *only* in POSTs, then the image
&lt;br&gt;extension restriction is not necessary that I can see.
&lt;br&gt;&lt;br&gt;Can someone tell me what I might be missing? &amp;nbsp;Otherwise, I am going to
&lt;br&gt;look at removing that restriction list.
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19102755&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19102755.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19102581</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-08-22T00:17:08Z</published>
	<updated>2008-08-22T00:17:08Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Thu, Aug 21, 2008 at 2:58 AM, Thijs Kinkhorst &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19102581&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kink@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; On Thu, August 21, 2008 03:30, Paul Lesniewski wrote:
&lt;br&gt;&amp;gt;&amp;gt; My feeling is that this should be addressed by either removing the
&lt;br&gt;&amp;gt;&amp;gt; restriction list completely,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I would say &amp;quot;yes&amp;quot; to this, but would be curious where the original idea
&lt;br&gt;&amp;gt; comes from. Isn't that tracable in the commit log?
&lt;br&gt;&lt;br&gt;It's your commit, so maybe you can help.
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4-STABLE/squirrelmail/functions/mime.php?view=log#rev12370&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4-STABLE/squirrelmail/functions/mime.php?view=log#rev12370&lt;/a&gt;&lt;br&gt;&lt;br&gt;If this code is meant to stop &amp;quot;request forgeries through included
&lt;br&gt;images&amp;quot;, I'd like to know more about what this means, since, as I
&lt;br&gt;noted, it wouldn't be hard for an attacker to substitute a dynamically
&lt;br&gt;executed script for an &amp;quot;image&amp;quot; file on the target server. &amp;nbsp;Or perhaps
&lt;br&gt;the file extension code is not specifically what fixed that actual
&lt;br&gt;issue and is only a side effect?
&lt;br&gt;&lt;br&gt;So if the extension limitation on image files is removed, does this
&lt;br&gt;expose SM to some XSS or something that it's not already exposed to
&lt;br&gt;now?
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19102581&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19102581.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19086819</id>
	<title>Re: reviewing random seeding</title>
	<published>2008-08-21T04:27:45Z</published>
	<updated>2008-08-21T04:27:45Z</updated>
	<author>
		<name>Thijs Kinkhorst</name>
	</author>
	<content type="html">On Thu, August 21, 2008 13:18, Paul Lesniewski wrote:
&lt;br&gt;&amp;gt; OTOH, as long as admins know it is weak, then we've done our part, and
&lt;br&gt;&amp;gt; having the weak algorithm does discourage amateur hackers. &amp;nbsp;What about
&lt;br&gt;&amp;gt; replacing with a known better algorithm? &amp;nbsp;Isn't there somewhere we are
&lt;br&gt;&amp;gt; using something better?
&lt;br&gt;&lt;br&gt;The problem is dat the encrypted password is stored in someone's pref file
&lt;br&gt;and there's no real way to store that individual's encryption key other
&lt;br&gt;than also in pref files or things similarly readable for those reading the
&lt;br&gt;pref files.
&lt;br&gt;&lt;br&gt;As said defence against such amateur hackers that they can't decrypt
&lt;br&gt;something given the ciphertext, key and algorithm is not useful and only
&lt;br&gt;distracts from the fact that the store is actually unprotected.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; 2) php_combined_lcg() in global.php seeds the random number generator
&lt;br&gt;&amp;gt;&amp;gt; in a not so secure fashion.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I believe we should just rip out this seeding and replace it with a
&lt;br&gt;&amp;gt;&amp;gt; call to sq_mt_randomize() instead so we have this code only in one
&lt;br&gt;&amp;gt;&amp;gt; place.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Sure, seems OK. &amp;nbsp;It was probably put there because that section is a
&lt;br&gt;&amp;gt; direct rip (apparently) from Gallery.
&lt;br&gt;&lt;br&gt;Ok.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Thijs
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19086819&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/reviewing-random-seeding-tp19085886p19086819.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19086680</id>
	<title>Re: reviewing random seeding</title>
	<published>2008-08-21T04:18:07Z</published>
	<updated>2008-08-21T04:18:07Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Thu, Aug 21, 2008 at 3:12 AM, Thijs Kinkhorst &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19086680&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kink@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hey all,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've reviewed the seeding of the random number generator we do within
&lt;br&gt;&amp;gt; SquirrelMail and have found the following points:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1) The mail_fetch function uses not so secure seeding of srand().
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However, the encryption used there is advertised as insecure anyway. I
&lt;br&gt;&amp;gt; wonder whether we should not just remove that feature altogether.
&lt;br&gt;&amp;gt; Trivially cracked encryption can be worse than no encryption because the
&lt;br&gt;&amp;gt; effect is the same for an attacker but it may create some sense of
&lt;br&gt;&amp;gt; security. What value does the function add if it's trivially cracked?
&lt;/div&gt;&lt;br&gt;OTOH, as long as admins know it is weak, then we've done our part, and
&lt;br&gt;having the weak algorithm does discourage amateur hackers. &amp;nbsp;What about
&lt;br&gt;replacing with a known better algorithm? &amp;nbsp;Isn't there somewhere we are
&lt;br&gt;using something better?
&lt;br&gt;&lt;br&gt;&amp;gt; 2) php_combined_lcg() in global.php seeds the random number generator in a
&lt;br&gt;&amp;gt; not so secure fashion.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I believe we should just rip out this seeding and replace it with a call
&lt;br&gt;&amp;gt; to sq_mt_randomize() instead so we have this code only in one place.
&lt;br&gt;&lt;br&gt;Sure, seems OK. &amp;nbsp;It was probably put there because that section is a
&lt;br&gt;direct rip (apparently) from Gallery.
&lt;br&gt;&lt;br&gt;&amp;gt; 3) The behaviour of sq_mt_randomize() itself needs to be reviewed.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; We currently re-seed it with several unpredictable values. We need to find
&lt;br&gt;&amp;gt; out whether re-seeding it actually adds randomness or just 'resets' the
&lt;br&gt;&amp;gt; thing so only the last one is useful.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP doesn't require seeding for versions 4.2 and up, but the PHP
&lt;br&gt;&amp;gt; implementation is reportedly limited in randomness unfortunately. The
&lt;br&gt;&amp;gt; newest suhosin patch is supposed to address that.
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19086680&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/reviewing-random-seeding-tp19085886p19086680.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19085886</id>
	<title>reviewing random seeding</title>
	<published>2008-08-21T03:12:12Z</published>
	<updated>2008-08-21T03:12:12Z</updated>
	<author>
		<name>Thijs Kinkhorst</name>
	</author>
	<content type="html">Hey all,
&lt;br&gt;&lt;br&gt;I've reviewed the seeding of the random number generator we do within
&lt;br&gt;SquirrelMail and have found the following points:
&lt;br&gt;&lt;br&gt;1) The mail_fetch function uses not so secure seeding of srand().
&lt;br&gt;&lt;br&gt;However, the encryption used there is advertised as insecure anyway. I
&lt;br&gt;wonder whether we should not just remove that feature altogether.
&lt;br&gt;Trivially cracked encryption can be worse than no encryption because the
&lt;br&gt;effect is the same for an attacker but it may create some sense of
&lt;br&gt;security. What value does the function add if it's trivially cracked?
&lt;br&gt;&lt;br&gt;2) php_combined_lcg() in global.php seeds the random number generator in a
&lt;br&gt;not so secure fashion.
&lt;br&gt;&lt;br&gt;I believe we should just rip out this seeding and replace it with a call
&lt;br&gt;to sq_mt_randomize() instead so we have this code only in one place.
&lt;br&gt;&lt;br&gt;3) The behaviour of sq_mt_randomize() itself needs to be reviewed.
&lt;br&gt;&lt;br&gt;We currently re-seed it with several unpredictable values. We need to find
&lt;br&gt;out whether re-seeding it actually adds randomness or just 'resets' the
&lt;br&gt;thing so only the last one is useful.
&lt;br&gt;&lt;br&gt;PHP doesn't require seeding for versions 4.2 and up, but the PHP
&lt;br&gt;implementation is reportedly limited in randomness unfortunately. The
&lt;br&gt;newest suhosin patch is supposed to address that.
&lt;br&gt;&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Thijs
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19085886&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/reviewing-random-seeding-tp19085886p19085886.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19085702</id>
	<title>Re: Image extension issue in mime.php</title>
	<published>2008-08-21T02:58:06Z</published>
	<updated>2008-08-21T02:58:06Z</updated>
	<author>
		<name>Thijs Kinkhorst</name>
	</author>
	<content type="html">On Thu, August 21, 2008 03:30, Paul Lesniewski wrote:
&lt;br&gt;&amp;gt; My feeling is that this should be addressed by either removing the
&lt;br&gt;&amp;gt; restriction list completely,
&lt;br&gt;&lt;br&gt;I would say &amp;quot;yes&amp;quot; to this, but would be curious where the original idea
&lt;br&gt;comes from. Isn't that tracable in the commit log?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Thijs
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19085702&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19085702.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19081065</id>
	<title>Image extension issue in mime.php</title>
	<published>2008-08-20T18:30:26Z</published>
	<updated>2008-08-20T18:30:26Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">All,
&lt;br&gt;&lt;br&gt;&amp;nbsp; I was looking at an HTML email today that had an image URI that was
&lt;br&gt;an .asp file. &amp;nbsp;SM blocked it, even when I clicked to view unsafe
&lt;br&gt;images.... and that's because of the .asp file extension. &amp;nbsp;SM replaces
&lt;br&gt;all images in HTML view with a blank image unless they are simple
&lt;br&gt;image files with .jpg, .gif, .jpeg, .xjpeg, .jpe, .bmp, .png, or .xbm
&lt;br&gt;extensions. &amp;nbsp;In today's world, I think there are probably a lot of
&lt;br&gt;images being served dynamically, with URIs that have PHP, JSP, ASP or
&lt;br&gt;some other file extension. &amp;nbsp;So, in a lot of cases, these should be
&lt;br&gt;allowed and are not necessarily threatening or ill-intentioned.
&lt;br&gt;&lt;br&gt;&amp;nbsp; Can someone explain the rationale of keeping the list more
&lt;br&gt;restricted? &amp;nbsp;What can a malicious image URI do if we open the list up
&lt;br&gt;to such file extensions? &amp;nbsp;Really, if an attacker wanted to do
&lt;br&gt;something here, they could easily circumvent this restriction by
&lt;br&gt;putting a URI with a &amp;quot;valid&amp;quot; (say .png) extension that was really a
&lt;br&gt;php file that is dynamically executed on the target server. &amp;nbsp;So what
&lt;br&gt;does SM *GAIN* by keeping this list of known image extensions? &amp;nbsp;(What
&lt;br&gt;we *LOSE* is proper display of many valid HTML mails for our users.)
&lt;br&gt;&lt;br&gt;&amp;nbsp; My feeling is that this should be addressed by either removing the
&lt;br&gt;restriction list completely, adding .asp, .php, .jsp, and any other
&lt;br&gt;common types, or putting a new configuration value in the config file
&lt;br&gt;for admins who would like to do this themselves.
&lt;br&gt;&lt;br&gt;Thoughts please?
&lt;br&gt;&lt;br&gt;&amp;nbsp;- Paul
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19081065&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Image-extension-issue-in-mime.php-tp19081065p19081065.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19028470</id>
	<title>Re: Updates in the plugin development documentation</title>
	<published>2008-08-18T02:46:39Z</published>
	<updated>2008-08-18T02:46:39Z</updated>
	<author>
		<name>Fredrik Jervfors-4</name>
	</author>
	<content type="html">&lt;div class='shrinkable-quote'&gt;&amp;gt;&amp;gt; Commit 13252[1] introduced the following paragraphs:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;A plugin can try to be smart about where to find the needed
&lt;br&gt;&amp;gt;&amp;gt; configuration file by doing something such as this:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; if (!@include_once(SM_PATH . 'config/config_demo.php')) if
&lt;br&gt;&amp;gt;&amp;gt; (!@include_once(SM_PATH . 'plugins/demo/config.php'))
&lt;br&gt;&amp;gt;&amp;gt; @include_once(SM_PATH . 'plugins/demo/config.sample.php');
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This assumes that the plugin has some sensible defaults in the sample
&lt;br&gt;&amp;gt;&amp;gt; configuration file - if the plugin must be configured specifically for
&lt;br&gt;&amp;gt;&amp;gt; the system upon which it is installed, remove the third line in this
&lt;br&gt;&amp;gt;&amp;gt; example.&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If a plugin has a general configuration that can make it work out of
&lt;br&gt;&amp;gt;&amp;gt; the box in the most cases, I prefer to have that configuration coded
&lt;br&gt;&amp;gt;&amp;gt; into the plugin itself.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; OK, then you should do that in your plugins. &amp;nbsp;;-) &amp;nbsp;I think this has to
&lt;br&gt;&amp;gt; be the choice of the author. &amp;nbsp;For some plugins, it's just not sensible
&lt;br&gt;&amp;gt; from a design or coding point of view to hard-code defaults. It makes
&lt;br&gt;&amp;gt; more sense to me to use a default configuration file, which could be
&lt;br&gt;&amp;gt; called config_default.php.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If a valid configuration file exists, the plugin will allow
&lt;br&gt;&amp;gt;&amp;gt; this to overrule the pre-set configuration.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cascading configuration sets vs. just one should be the author's choice
&lt;br&gt;&amp;gt; IMO.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I don't like to have the plugin read configuration from a configuration
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;file with the word &amp;quot;sample&amp;quot; in the filename, even if such a file
&lt;br&gt;&amp;gt;&amp;gt; exists. One reason is that it encourages administrators to modify
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;config.sample.php&amp;quot; instead of &amp;quot;config.php&amp;quot; which might cause them
&lt;br&gt;&amp;gt;&amp;gt; trouble later.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On one hand, they deserve it if they can't read the installation
&lt;br&gt;&amp;gt; instructions. &amp;nbsp;On the other hand, I understand the desire to make it easy
&lt;br&gt;&amp;gt; to use for clueless admins too. &amp;nbsp;Personally, at this juncture, I am not
&lt;br&gt;&amp;gt; interested in going quite that far. &amp;nbsp;What I can do, however, is use a
&lt;br&gt;&amp;gt; config_default.php instead of config_sample.php. &amp;nbsp;I will still include an
&lt;br&gt;&amp;gt; example configuration file, though, named as you suggest below.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Another is that some distributions might want to have
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;config.sample.php&amp;quot; in a documentation directory (and not a code
&lt;br&gt;&amp;gt;&amp;gt; directory) when re-distributing.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; For these reasons I'd like to have the code and the describing text in
&lt;br&gt;&amp;gt;&amp;gt; the documentation rewritten so that it doesn't suggest actual use of the
&lt;br&gt;&amp;gt;&amp;gt; file &amp;quot;config.sample.php&amp;quot;.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; And correct me if I'm wrong, but &amp;quot;sample&amp;quot; should really be &amp;quot;example&amp;quot;,
&lt;br&gt;&amp;gt;&amp;gt; since that's what's it all about. A &amp;quot;sample&amp;quot; is a small part of anything
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;or one of a number, intended to show the quality, style, or nature of
&lt;br&gt;&amp;gt;&amp;gt; the whole. An &amp;quot;example&amp;quot; is a pattern or model, as of something to be
&lt;br&gt;&amp;gt;&amp;gt; imitated or avoided. Could the documentation be updated with &amp;quot;sample&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt; replaced by &amp;quot;example&amp;quot;, or is the old naming convention too much rooted?
&lt;/div&gt;&lt;br&gt;I read through the changes in commit 13263[1]. Fair enough. Thanks.
&lt;br&gt;&lt;br&gt;Sincerely,
&lt;br&gt;Fredrik
&lt;br&gt;&lt;br&gt;[1]
&lt;br&gt;&lt;a href=&quot;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/trunk/documentation/devel/devel.sgml?r1=13263&amp;r2=13262&amp;pathrev=13263&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/trunk/documentation/devel/devel.sgml?r1=13263&amp;r2=13262&amp;pathrev=13263&lt;/a&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19028470&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Updates-in-the-plugin-development-documentation-tp18790699p19028470.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19017456</id>
	<title>Re: Bug in digest_md5_parse_challenge</title>
	<published>2008-08-16T21:31:59Z</published>
	<updated>2008-08-16T21:31:59Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Sat, Aug 16, 2008 at 9:08 PM, Pablo Álvarez de Sotomayor Posadillo
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017456&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;i02sopop@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; Additionally, if base64_decode() returns FALSE, we need to
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; add one more line ABOVE the while statement so that the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; return value is initialized (otherwise, it should generate a
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; PHP notice):
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; $parsed = array();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You are right once again, I'm just thinking about it. I attach the patch.
&lt;br&gt;&lt;br&gt;This is in our SVN now. &amp;nbsp;Thanks again!
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017456&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Bug-in-digest_md5_parse_challenge-tp19008281p19017456.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19017385</id>
	<title>Re: Bug in digest_md5_parse_challenge</title>
	<published>2008-08-16T21:08:01Z</published>
	<updated>2008-08-16T21:08:01Z</updated>
	<author>
		<name>Pablo Alvarez de Sotomayor Posadillo</name>
	</author>
	<content type="html">&amp;nbsp; &amp;nbsp; Paul&amp;gt; Additionally, if base64_decode() returns FALSE, we need to
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; add one more line ABOVE the while statement so that the
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; return value is initialized (otherwise, it should generate a
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; PHP notice):
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; $parsed = array();
&lt;br&gt;&lt;br&gt;You are right once again, I'm just thinking about it. I attach the patch.
&lt;br&gt;&lt;br&gt;Regards
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; Pablo Álvarez de Sotomayor Posadillo
&lt;br&gt;Ingeniero Técnico en Informática de Sistemas
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://ritho.net&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://ritho.net&lt;/a&gt;&lt;br&gt;&amp;nbsp;&amp;quot;De todas las cosas que he perdido la que 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;mas hecho de menos es mi cerebro&amp;quot;
&lt;br&gt;&lt;br&gt;===File ~/auth_digest_md5_warning.patch=====================
&lt;br&gt;Index: functions/auth.php
&lt;br&gt;===================================================================
&lt;br&gt;--- functions/auth.php	(revision 13262)
&lt;br&gt;+++ functions/auth.php	(working copy)
&lt;br&gt;@@ -199,7 +199,8 @@
&lt;br&gt;&amp;nbsp; */
&lt;br&gt;&amp;nbsp;function digest_md5_parse_challenge($challenge) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$challenge=base64_decode($challenge);
&lt;br&gt;- &amp;nbsp; &amp;nbsp;while (isset($challenge) &amp;&amp; $challenge !== FALSE) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;$parsed = array();
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;while (!empty($challenge)) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($challenge{0} == ',') { // First char is a comma, must not be 1st time through loop
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$challenge=substr($challenge,1);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;============================================================
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017385&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Bug-in-digest_md5_parse_challenge-tp19008281p19017385.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19017359</id>
	<title>Re: Bug in digest_md5_parse_challenge</title>
	<published>2008-08-16T21:01:38Z</published>
	<updated>2008-08-16T21:01:38Z</updated>
	<author>
		<name>Pablo Alvarez de Sotomayor Posadillo</name>
	</author>
	<content type="html">&amp;nbsp; &amp;nbsp; Paul&amp;gt; The reason I chose !== was because with stable code, we need
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; to treat the rest of the code as a black box and touch as
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; little as we can with any changes, and the !== means it will
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; only test for a single condition (the one initially
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; identified, where base64_decode() returns specifically
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; FALSE), whereas != can catch any other value that can be
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; evaluated as FALSE such as 0, &amp;quot;&amp;quot;, array(), and &amp;quot;0&amp;quot;. &amp;nbsp;It is
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; not good to make assumptions about the meaning of those
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; other possible values.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; So, if we continue on that track, we'd have to add another
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; type-specific check, but I'm now going to step away from the
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; black box approach and look inside the loop, where we can
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; see that it is clear that any of the other types that can be
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; cast as boolean FALSE are not expected therein. &amp;nbsp;Therefore,
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; the better solution is (and please, if you don't mind, test
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; this and let us know if it works OK):
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; &amp;nbsp; &amp;nbsp; while (!empty($challenge)) {
&lt;br&gt;&lt;br&gt;Yes, it's work ok. I'm agree with you in the reasoning, and clearly the
&lt;br&gt;best solution is that.
&lt;br&gt;&lt;br&gt;Regards
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; Pablo Álvarez de Sotomayor Posadillo
&lt;br&gt;Ingeniero Técnico en Informática de Sistemas
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://ritho.net&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://ritho.net&lt;/a&gt;&lt;br&gt;&amp;nbsp;&amp;quot;De todas las cosas que he perdido la que 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;mas hecho de menos es mi cerebro&amp;quot;
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017359&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Bug-in-digest_md5_parse_challenge-tp19008281p19017359.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19017284</id>
	<title>Re: Bug in digest_md5_parse_challenge</title>
	<published>2008-08-16T20:45:31Z</published>
	<updated>2008-08-16T20:45:31Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Sat, Aug 16, 2008 at 8:42 PM, Paul Lesniewski &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017284&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Sat, Aug 16, 2008 at 8:38 PM, Paul Lesniewski &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017284&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Sat, Aug 16, 2008 at 8:00 PM, Pablo Álvarez de Sotomayor Posadillo
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017284&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;i02sopop@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; If base64_decode() returns FALSE, then !== should catch it.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; Can you explain why !== does not work?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Well, you are right, that solve the bug, but it still remain another
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; bug, and I discovered it now, when I've check why with the !=
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; condition turn off the warnings and with !== still remain. The new bug
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; is produced because the while loops once more than the neccesary, that
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; is, in each while loop the function substract one part of the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; $challenge string, so when the string is empty it shows a message
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; warning about that (the exact message is &amp;quot; Uninitialized string
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; offset: 0&amp;quot;). The program pass the !== condition if the variables are
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; not equals or not of the same type, so, in the case described, a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; boolean type is diferent from a string type, passing the condition. In
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the other hand, with the != condition your are doing an underlying
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; cast and the while stops at the correct loop. Remember that an empty
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; string (&amp;quot;&amp;quot;) is considered as FALSE in a cast conversion. So, finally,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; or you put one != condition or you put two !== condition (one with the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; boolean comparision and another one with the string comparision), but
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; in the first case it's recommended a comment explaining that
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; comparision.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The reason I chose !== was because with stable code, we need to treat
&lt;br&gt;&amp;gt;&amp;gt; the rest of the code as a black box and touch as little as we can with
&lt;br&gt;&amp;gt;&amp;gt; any changes, and the !== means it will only test for a single
&lt;br&gt;&amp;gt;&amp;gt; condition (the one initially identified, where base64_decode() returns
&lt;br&gt;&amp;gt;&amp;gt; specifically FALSE), whereas != can catch any other value that can be
&lt;br&gt;&amp;gt;&amp;gt; evaluated as FALSE such as 0, &amp;quot;&amp;quot;, array(), and &amp;quot;0&amp;quot;. &amp;nbsp;It is not good to
&lt;br&gt;&amp;gt;&amp;gt; make assumptions about the meaning of those other possible values.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So, if we continue on that track, we'd have to add another
&lt;br&gt;&amp;gt;&amp;gt; type-specific check, but I'm now going to step away from the black box
&lt;br&gt;&amp;gt;&amp;gt; approach and look inside the loop, where we can see that it is clear
&lt;br&gt;&amp;gt;&amp;gt; that any of the other types that can be cast as boolean FALSE are not
&lt;br&gt;&amp;gt;&amp;gt; expected therein. &amp;nbsp;Therefore, the better solution is (and please, if
&lt;br&gt;&amp;gt;&amp;gt; you don't mind, test this and let us know if it works OK):
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;while (!empty($challenge)) {
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Additionally, if base64_decode() returns FALSE, we need to add one
&lt;br&gt;&amp;gt; more line ABOVE the while statement so that the return value is
&lt;br&gt;&amp;gt; initialized (otherwise, it should generate a PHP notice):
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $parsed = array();
&lt;/div&gt;&lt;br&gt;Although that would also be expected to generate more notices in
&lt;br&gt;digest_md5_response(), and although technically there should be some
&lt;br&gt;more robust error checking here, I think the overall assumption is
&lt;br&gt;that if you get that far, you have bigger problems (this functionality
&lt;br&gt;not configured correctly on the server).
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017284&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Bug-in-digest_md5_parse_challenge-tp19008281p19017284.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19017272</id>
	<title>Re: Bug in digest_md5_parse_challenge</title>
	<published>2008-08-16T20:42:57Z</published>
	<updated>2008-08-16T20:42:57Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Sat, Aug 16, 2008 at 8:38 PM, Paul Lesniewski &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017272&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Sat, Aug 16, 2008 at 8:00 PM, Pablo Álvarez de Sotomayor Posadillo
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017272&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;i02sopop@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; If base64_decode() returns FALSE, then !== should catch it.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; Can you explain why !== does not work?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Well, you are right, that solve the bug, but it still remain another
&lt;br&gt;&amp;gt;&amp;gt; bug, and I discovered it now, when I've check why with the !=
&lt;br&gt;&amp;gt;&amp;gt; condition turn off the warnings and with !== still remain. The new bug
&lt;br&gt;&amp;gt;&amp;gt; is produced because the while loops once more than the neccesary, that
&lt;br&gt;&amp;gt;&amp;gt; is, in each while loop the function substract one part of the
&lt;br&gt;&amp;gt;&amp;gt; $challenge string, so when the string is empty it shows a message
&lt;br&gt;&amp;gt;&amp;gt; warning about that (the exact message is &amp;quot; Uninitialized string
&lt;br&gt;&amp;gt;&amp;gt; offset: 0&amp;quot;). The program pass the !== condition if the variables are
&lt;br&gt;&amp;gt;&amp;gt; not equals or not of the same type, so, in the case described, a
&lt;br&gt;&amp;gt;&amp;gt; boolean type is diferent from a string type, passing the condition. In
&lt;br&gt;&amp;gt;&amp;gt; the other hand, with the != condition your are doing an underlying
&lt;br&gt;&amp;gt;&amp;gt; cast and the while stops at the correct loop. Remember that an empty
&lt;br&gt;&amp;gt;&amp;gt; string (&amp;quot;&amp;quot;) is considered as FALSE in a cast conversion. So, finally,
&lt;br&gt;&amp;gt;&amp;gt; or you put one != condition or you put two !== condition (one with the
&lt;br&gt;&amp;gt;&amp;gt; boolean comparision and another one with the string comparision), but
&lt;br&gt;&amp;gt;&amp;gt; in the first case it's recommended a comment explaining that
&lt;br&gt;&amp;gt;&amp;gt; comparision.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The reason I chose !== was because with stable code, we need to treat
&lt;br&gt;&amp;gt; the rest of the code as a black box and touch as little as we can with
&lt;br&gt;&amp;gt; any changes, and the !== means it will only test for a single
&lt;br&gt;&amp;gt; condition (the one initially identified, where base64_decode() returns
&lt;br&gt;&amp;gt; specifically FALSE), whereas != can catch any other value that can be
&lt;br&gt;&amp;gt; evaluated as FALSE such as 0, &amp;quot;&amp;quot;, array(), and &amp;quot;0&amp;quot;. &amp;nbsp;It is not good to
&lt;br&gt;&amp;gt; make assumptions about the meaning of those other possible values.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So, if we continue on that track, we'd have to add another
&lt;br&gt;&amp;gt; type-specific check, but I'm now going to step away from the black box
&lt;br&gt;&amp;gt; approach and look inside the loop, where we can see that it is clear
&lt;br&gt;&amp;gt; that any of the other types that can be cast as boolean FALSE are not
&lt;br&gt;&amp;gt; expected therein. &amp;nbsp;Therefore, the better solution is (and please, if
&lt;br&gt;&amp;gt; you don't mind, test this and let us know if it works OK):
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;while (!empty($challenge)) {
&lt;/div&gt;&lt;br&gt;Additionally, if base64_decode() returns FALSE, we need to add one
&lt;br&gt;more line ABOVE the while statement so that the return value is
&lt;br&gt;initialized (otherwise, it should generate a PHP notice):
&lt;br&gt;&lt;br&gt;$parsed = array();
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;&amp;nbsp;Paul
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017272&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Bug-in-digest_md5_parse_challenge-tp19008281p19017272.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19017245</id>
	<title>Re: Bug in digest_md5_parse_challenge</title>
	<published>2008-08-16T20:38:09Z</published>
	<updated>2008-08-16T20:38:09Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Sat, Aug 16, 2008 at 8:00 PM, Pablo Álvarez de Sotomayor Posadillo
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017245&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;i02sopop@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; If base64_decode() returns FALSE, then !== should catch it.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; Can you explain why !== does not work?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Well, you are right, that solve the bug, but it still remain another
&lt;br&gt;&amp;gt; bug, and I discovered it now, when I've check why with the !=
&lt;br&gt;&amp;gt; condition turn off the warnings and with !== still remain. The new bug
&lt;br&gt;&amp;gt; is produced because the while loops once more than the neccesary, that
&lt;br&gt;&amp;gt; is, in each while loop the function substract one part of the
&lt;br&gt;&amp;gt; $challenge string, so when the string is empty it shows a message
&lt;br&gt;&amp;gt; warning about that (the exact message is &amp;quot; Uninitialized string
&lt;br&gt;&amp;gt; offset: 0&amp;quot;). The program pass the !== condition if the variables are
&lt;br&gt;&amp;gt; not equals or not of the same type, so, in the case described, a
&lt;br&gt;&amp;gt; boolean type is diferent from a string type, passing the condition. In
&lt;br&gt;&amp;gt; the other hand, with the != condition your are doing an underlying
&lt;br&gt;&amp;gt; cast and the while stops at the correct loop. Remember that an empty
&lt;br&gt;&amp;gt; string (&amp;quot;&amp;quot;) is considered as FALSE in a cast conversion. So, finally,
&lt;br&gt;&amp;gt; or you put one != condition or you put two !== condition (one with the
&lt;br&gt;&amp;gt; boolean comparision and another one with the string comparision), but
&lt;br&gt;&amp;gt; in the first case it's recommended a comment explaining that
&lt;br&gt;&amp;gt; comparision.
&lt;/div&gt;&lt;br&gt;The reason I chose !== was because with stable code, we need to treat
&lt;br&gt;the rest of the code as a black box and touch as little as we can with
&lt;br&gt;any changes, and the !== means it will only test for a single
&lt;br&gt;condition (the one initially identified, where base64_decode() returns
&lt;br&gt;specifically FALSE), whereas != can catch any other value that can be
&lt;br&gt;evaluated as FALSE such as 0, &amp;quot;&amp;quot;, array(), and &amp;quot;0&amp;quot;. &amp;nbsp;It is not good to
&lt;br&gt;make assumptions about the meaning of those other possible values.
&lt;br&gt;&lt;br&gt;So, if we continue on that track, we'd have to add another
&lt;br&gt;type-specific check, but I'm now going to step away from the black box
&lt;br&gt;approach and look inside the loop, where we can see that it is clear
&lt;br&gt;that any of the other types that can be cast as boolean FALSE are not
&lt;br&gt;expected therein. &amp;nbsp;Therefore, the better solution is (and please, if
&lt;br&gt;you don't mind, test this and let us know if it works OK):
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; while (!empty($challenge)) {
&lt;br&gt;&lt;br&gt;Thanks again for your help.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;&amp;nbsp; Paul
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017245&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Bug-in-digest_md5_parse_challenge-tp19008281p19017245.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19017108</id>
	<title>Re: Bug in digest_md5_parse_challenge</title>
	<published>2008-08-16T20:00:58Z</published>
	<updated>2008-08-16T20:00:58Z</updated>
	<author>
		<name>Pablo Alvarez de Sotomayor Posadillo</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; If base64_decode() returns FALSE, then !== should catch it.
&lt;br&gt;&amp;nbsp; &amp;nbsp; Paul&amp;gt; Can you explain why !== does not work?
&lt;br&gt;&lt;br&gt;Well, you are right, that solve the bug, but it still remain another
&lt;br&gt;bug, and I discovered it now, when I've check why with the !=
&lt;br&gt;condition turn off the warnings and with !== still remain. The new bug
&lt;br&gt;is produced because the while loops once more than the neccesary, that
&lt;br&gt;is, in each while loop the function substract one part of the
&lt;br&gt;$challenge string, so when the string is empty it shows a message
&lt;br&gt;warning about that (the exact message is &amp;quot; Uninitialized string
&lt;br&gt;offset: 0&amp;quot;). The program pass the !== condition if the variables are
&lt;br&gt;not equals or not of the same type, so, in the case described, a
&lt;br&gt;boolean type is diferent from a string type, passing the condition. In
&lt;br&gt;the other hand, with the != condition your are doing an underlying
&lt;br&gt;cast and the while stops at the correct loop. Remember that an empty
&lt;br&gt;string (&amp;quot;&amp;quot;) is considered as FALSE in a cast conversion. So, finally,
&lt;br&gt;or you put one != condition or you put two !== condition (one with the
&lt;br&gt;boolean comparision and another one with the string comparision), but
&lt;br&gt;in the first case it's recommended a comment explaining that
&lt;br&gt;comparision.
&lt;br&gt;&lt;br&gt;regards
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; Pablo Álvarez de Sotomayor Posadillo
&lt;br&gt;Ingeniero Técnico en Informática de Sistemas
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://ritho.net&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://ritho.net&lt;/a&gt;&lt;br&gt;&amp;nbsp;&amp;quot;De todas las cosas que he perdido la que 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;mas hecho de menos es mi cerebro&amp;quot;
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;-----
&lt;br&gt;squirrelmail-devel mailing list
&lt;br&gt;Posting guidelines: &lt;a href=&quot;http://squirrelmail.org/postingguidelines&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://squirrelmail.org/postingguidelines&lt;/a&gt;&lt;br&gt;List address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19017108&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;squirrelmail-devel@...&lt;/a&gt;
&lt;br&gt;List archives: &lt;a href=&quot;http://news.gmane.org/gmane.mail.squirrelmail.devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://news.gmane.org/gmane.mail.squirrelmail.devel&lt;/a&gt;&lt;br&gt;List info (subscribe/unsubscribe/change options): &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Bug-in-digest_md5_parse_challenge-tp19008281p19017108.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19016364</id>
	<title>Re: Bug in digest_md5_parse_challenge</title>
	<published>2008-08-16T17:16:44Z</published>
	<updated>2008-08-16T17:16:44Z</updated>
	<author>
		<name>Paul Lesniewski</name>
	</author>
	<content type="html">On Sat, Aug 16, 2008 at 4:51 PM, &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19016364&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;i02sopop@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; Please make sure to state the version you are using. &amp;nbsp;Looks
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; like you are using 1.5.2SVN
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yes, it's that version.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; also used in our stable branch, so..... can you please
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; replace that line with the following and confirm no notices
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; occur?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Well, it's solved with !=, not with !==. I attach the little patch to
&lt;br&gt;&amp;gt; this mail.
&lt;/div&gt;&lt;br&gt;If base64_decode() returns FALSE, then !== should catch it. &amp;nbsp;Can you
&lt;br&gt;explain why !== does not work?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; Unified diffs are best, sent to this list or submitted to
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Paul&amp;gt; our sf.net tracker.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've