<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>IMG SRC</title>
        <description>Hello,
i have problem with Htmlpurifier settings. If my input is for example (its URL for logging out):



&amp;lt;img src=&quot;http://www.example.com/app/public/user/login/logout&quot;&amp;gt;


Htmlpurifier is not able to purify this input. Only add &quot;ALT&quot; but the code is processed and user is logged out. Is any possibility to handle this?

My htmlpurifier settings is:



require_once('htmlpurifier/library/HTMLPurifier.auto.php');
    $config = HTMLPurifier_Config::createDefault();
    $config-&amp;gt;set('Core.Encoding', 'UTF-8');
    $config-&amp;gt;set('HTML.Doctype', 'HTML 4.01 Transitional');
    $config-&amp;gt;set('Core.RemoveInvalidImg',true);
    $purifier = new HTMLPurifier($config);

$clean = $purifier-&amp;gt;purify($dirty);

Thanks for any advice</description>
        <link>http://htmlpurifier.org/phorum/read.php?3,6194,6194#msg-6194</link>
        <lastBuildDate>Thu, 23 May 2013 04:22:38 -0400</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6813#msg-6813</guid>
            <title>Re: IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6813#msg-6813</link>
            <description><![CDATA[<p>OK, it looks like there are some changes that need to be made:</p>

<ul><li>It is special-cased for CSS URI tags, but there is not really a good reason why normal links couldn't also have CID handling. So the 'CID-ified' URI handler should be a decorator around the normal URI handler. Which leads to the next point:
</li><li>CID should be given a URIScheme. With this, the decorator can parse the URI first, and then check if it's a CID.
</li><li>Similarly, it probably isn't necessary to have an attr transform on top of everything else; the AttrDef can handle the translation itself.
</li></ul>

<p>I think those are the biggies.</p>

<p><a href="http://htmlpurifier.org/">HTML Purifier</a>, Standards-Compliant HTML Filtering</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Sun, 17 Feb 2013 19:00:19 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6793#msg-6793</guid>
            <title>Re: IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6793#msg-6793</link>
            <description><![CDATA[<blockquote cite="Ambush%20Commander">
<p>Whooops it looks like I never got around to actually reviewing the CID patch (two years late, rawr!) -_- Probably should go look at that now...</p>
</blockquote>

<p>It's been that long? ...time flies when you're having fun. :D I hope it's usable. If not, let me know, I'd be happy to tweak it so it fits.</p>]]></description>
            <dc:creator>pinkgothic</dc:creator>
            <category>Support</category>
            <pubDate>Thu, 07 Feb 2013 18:02:23 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6791#msg-6791</guid>
            <title>Re: IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6791#msg-6791</link>
            <description><![CDATA[<p>Whooops it looks like I never got around to actually reviewing the CID patch (two years late, rawr!) -_- Probably should go look at that now...</p>

<p><a href="http://htmlpurifier.org/">HTML Purifier</a>, Standards-Compliant HTML Filtering</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 06 Feb 2013 18:29:04 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6789#msg-6789</guid>
            <title>Re: IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6789#msg-6789</link>
            <description><![CDATA[<p><strong>@Pankaj Garg</strong>: <tt>cid</tt> is not a supported URL 'schema'. You should use the HTML Purifier <em>after</em> <tt>cid</tt> references have been changed to URL references. :) If that's not possible, you may have to look into providing a URL schema handling class. (Note: You <em>can</em> use the HTML Purifier to pretransform the img-src to change <tt>cid</tt> into img-src, I've done this before in a project I used to work in. I think Edward may even have some code from me on that subject... dunno if he's still considering making it a feature, though. :) )</p>

<p><strong>@vaughan</strong>: The reported problem is that HTML Purifier <em>isn't</em> removing it, though. And that is its expected/designed behaviour, too - it can't guess what a link is going to do and if the HTML is going to exploit an issue on the src-named server, it can only prevent exploits it knows about (those that would strike client-side, basically, or those that would strike the Purifier itself (e.g. by trying to get the parser to tie itself into a knot), <em>not</em> those of external applications... and this <em>is</em> a vulnerability in the external application, it's a CSRF issue).</p>]]></description>
            <dc:creator>pinkgothic</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 06 Feb 2013 16:54:46 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6788#msg-6788</guid>
            <title>Re: IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6788#msg-6788</link>
            <description><![CDATA[<blockquote cite="mk">
<p>Hello,
i have problem with Htmlpurifier settings. If my input is for example (its URL for logging out):
</p>

<pre>
&lt;img src="<a href="http://www.example.com/app/public/user/login/logout">http://www.example.com/app/public/user/login/logout</a>"&gt;
</pre>

<p>Htmlpurifier is not able to purify this input. Only add "ALT" but the code is processed and user is logged out. Is any possibility to handle this?</p>

<p>My htmlpurifier settings is:
</p>

<pre>
require_once('htmlpurifier/library/HTMLPurifier.auto.php');
    $config = HTMLPurifier_Config::createDefault();
    $config-&gt;set('Core.Encoding', 'UTF-8');
    $config-&gt;set('HTML.Doctype', 'HTML 4.01 Transitional');
    $config-&gt;set('Core.RemoveInvalidImg',true);
    $purifier = new HTMLPurifier($config);

$clean = $purifier-&gt;purify($dirty);
</pre><p>
Thanks for any advice</p>
</blockquote>

<p>I'm pretty sure that the link in the img src is not a valid image file. it should be pointing to a gif, jpg, png file etc. which is why purifier is removing it.</p>

<p><a href="http://www.impresscms.org">ImpressCMS: Make A Lasting Impression</a></p>]]></description>
            <dc:creator>vaughan</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 06 Feb 2013 09:14:47 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6787#msg-6787</guid>
            <title>Re: IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6787#msg-6787</link>
            <description><![CDATA[<p>Hi,</p>

<p>Below is the code for Image, </p>

<pre>
&lt;img src="cid:ii_13caf061fab44f94" alt="Inline image 1"&gt;
</pre>

<p>HTML Purifier removes this image's src, I have tried  HTML.Allowed as img[alt|src]  and also set  <b>Core.RemoveInvalidImg </b> to false.</p>

<p>but still not receiving the src as it is.</p>

<p>Please assist. Thanks in anticipation.</p>

<p>Regards
Pankaj Garg</p>]]></description>
            <dc:creator>Pankaj Garg</dc:creator>
            <category>Support</category>
            <pubDate>Wed, 06 Feb 2013 07:41:55 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6210#msg-6210</guid>
            <title>Re: IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6210#msg-6210</link>
            <description><![CDATA[<blockquote cite="mk">
<p>Htmlpurifier is not able to purify this input. Only add "ALT" but the code is processed and user is logged out. Is any possibility to handle this?</p>
</blockquote>

<p>There's no (sane) way to handle this, because HTML Purifier doesn't know what a link may or may not cause. HTML Purifier is not your problem here, though, you generally have a CSRF vulnerability you need to take care of - so what you're looking for are <a href="http://en.wikipedia.org/w/index.php?title=Cross-site_request_forgery&amp;oldid=472059855#Prevention">solutions to prevent cross-site request forgery</a>, e.g. securing your logout with a CSRF token.</p>

<p>If all you want to do is prevent a website to have the word 'logout' in them, you can write an <a href="http://stackoverflow.com/questions/2638640/html-purifier-removing-an-element-conditionally-based-on-its-attributes">attribute transformation</a> that strips <tt>'href'</tt> if its value contains <tt>'logout'</tt>.</p>

<p>(Edit: Fixed formatting after an HTML escaping issue ravaged the forum.)</p>

<p>Edited 1 time(s). Last edit at 07/30/2012 01:57PM by pinkgothic.</p>]]></description>
            <dc:creator>pinkgothic</dc:creator>
            <category>Support</category>
            <pubDate>Fri, 17 Feb 2012 04:31:14 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6195#msg-6195</guid>
            <title>Re: IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6195#msg-6195</link>
            <description><![CDATA[<p>Don't have your logout page be triggered by a GET request. That's silly, and no one does it anymore.</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Sun, 12 Feb 2012 20:58:55 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6194,6194#msg-6194</guid>
            <title>IMG SRC</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6194,6194#msg-6194</link>
            <description><![CDATA[<p>Hello,
i have problem with Htmlpurifier settings. If my input is for example (its URL for logging out):
</p>

<pre>
&lt;img src="<a href="http://www.example.com/app/public/user/login/logout">http://www.example.com/app/public/user/login/logout</a>"&gt;
</pre>

<p>Htmlpurifier is not able to purify this input. Only add "ALT" but the code is processed and user is logged out. Is any possibility to handle this?</p>

<p>My htmlpurifier settings is:
</p>

<pre>
require_once('htmlpurifier/library/HTMLPurifier.auto.php');
    $config = HTMLPurifier_Config::createDefault();
    $config-&gt;set('Core.Encoding', 'UTF-8');
    $config-&gt;set('HTML.Doctype', 'HTML 4.01 Transitional');
    $config-&gt;set('Core.RemoveInvalidImg',true);
    $purifier = new HTMLPurifier($config);

$clean = $purifier-&gt;purify($dirty);
</pre><p>
Thanks for any advice</p>]]></description>
            <dc:creator>mk</dc:creator>
            <category>Support</category>
            <pubDate>Sun, 12 Feb 2012 16:03:28 -0500</pubDate>
        </item>
    </channel>
</rss>
