<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #1180: Links in markdown can be badly formed</title>
    <link>http://localhost/ticket/1180</link>
    <description>&lt;p&gt;
User can insert bad anchor tags into the User-About and Package-Notes fields and when you view them (web interface) it causes a 500 error.
&lt;/p&gt;
&lt;p&gt;
Need to improve filtering for anchors in markdown.
&lt;/p&gt;
&lt;pre class="wiki"&gt;&amp;lt;a href="http://xxxsex.com&amp;gt;nasty/website
&lt;/pre&gt;&lt;p&gt;
Also check this related exception:
&lt;/p&gt;
&lt;pre class="wiki"&gt;Module ckan.controllers.user:59 in read
&amp;lt;&amp;lt;          c.is_myself = user.name == c.user
               c.api_key = user.apikey
               c.about_formatted = self._format_about(user.about)
               revisions_q = model.Session.query(model.Revision
                       ).filter_by(author=user.name)
&amp;gt;&amp;gt;  c.about_formatted = self._format_about(user.about)
Module ckan.controllers.user:167 in _format_about
&amp;lt;&amp;lt;      def _format_about(self, about):
               about_formatted = ckan.misc.MarkdownFormat().to_html(about)
               return genshi.HTML(about_formatted)
           def _get_form_password(self):
&amp;gt;&amp;gt;  return genshi.HTML(about_formatted)
WebApp Error: &amp;lt;class 'genshi.input.ParseError'&amp;gt;: junk characters in start tag: u'\u201dhttp://www.settingu': line 1, column 3
&lt;/pre&gt;</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/1180</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Tue, 07 Jun 2011 19:31:07 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/1180#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/1180#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/1180?action=diff&amp;amp;version=1"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Wed, 08 Jun 2011 14:43:43 GMT</pubDate>
      <title>status, description, summary changed; resolution set</title>
      <link>http://localhost/ticket/1180#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/1180#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/1180?action=diff&amp;amp;version=2"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;summary&lt;/strong&gt;
                changed from &lt;em&gt;User 'about' field put in HTML unsafely&lt;/em&gt; to &lt;em&gt;Links in markdown can be badly formed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Both issues solved using a whitelist on anchor tags.
&lt;/p&gt;
&lt;p&gt;
Second issue was a link with unicode expression of the quote. e.g. &amp;lt;a href=\u201dsomelink\u201d&amp;gt;somelink&amp;lt;/a&amp;gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>