<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -61,6 +61,23 @@ if ( $path_info[$#path_info] =~ /(.+)\.(.+)$/ ) {
   $flavour = param('flav') || $default_flavour;
 }
 
+# Fix XSS in flavour name (CVE-2008-2236)
+$flavour = blosxom_html_escape($flavour);
+
+sub blosxom_html_escape {
+  my $string = shift;
+  my %escape = (
+    '&lt;' =&gt; '&amp;lt;',
+    '&gt;' =&gt; '&amp;gt;',
+    '&amp;' =&gt; '&amp;amp;',
+    '&quot;' =&gt; '&amp;quot;',
+    &quot;'&quot; =&gt; '&amp;apos;'
+  );
+  my $escape_re = join '|' =&gt; keys %escape;
+  $string =~ s/($escape_re)/$escape{$1}/g;
+  $string;
+}
+
 # Strip spurious slashes
 $path_info =~ s!(^/*)|(/*$)!!g;
 </diff>
      <filename>blosxom.cgi</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ee9f162c909a8c240f39e2ebbbc1e42477818c45</id>
    </parent>
  </parents>
  <author>
    <name>Kyo Nagashima</name>
    <email>kyo@hail2u.net</email>
  </author>
  <url>http://github.com/hail2u/blosxom-starter-kit/commit/8828dfc2b69eaa5d5384c3cc25690c8a33352342</url>
  <id>8828dfc2b69eaa5d5384c3cc25690c8a33352342</id>
  <committed-date>2009-03-31T08:11:40-07:00</committed-date>
  <authored-date>2009-03-31T08:11:40-07:00</authored-date>
  <message>fix reported vulnerability (CVE-2008-2236)</message>
  <tree>e5284aa6966333998bb1df374944e7090edd7807</tree>
  <committer>
    <name>Kyo Nagashima</name>
    <email>kyo@hail2u.net</email>
  </committer>
</commit>
