<?xml version="1.0" encoding="UTF-8"?>
<commits type="array">
  <commit>
    <parents type="array">
      <parent>
        <id>c05e9ee1c3e6580b0bff72051c294cc955581001</id>
      </parent>
    </parents>
    <author>
      <name>Spyridon Vasileiadis</name>
      <email>spyridon.vasileiadis@googlemail.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/0535b5ff99d45c94e6cb5d54d8ddaf24081840bd</url>
    <id>0535b5ff99d45c94e6cb5d54d8ddaf24081840bd</id>
    <committed-date>2009-03-15T06:56:38-07:00</committed-date>
    <authored-date>2009-03-15T06:53:26-07:00</authored-date>
    <message>multisite: Fix broken article versions

[This is an edited version of the author's blog post at
http://inormalized.com/2009/2/19/how-to-fix-broken-article-versions-in-emk-mephisto-edge-post-0-8-1. -Eric]

Currently in mephisto edge, article versions are broken. More precisely,
the bug comes up ONLY when the installation operates in multisite mode
(or even more precisely, when there are at least two articles belonging
to two different sites).

The problem is how acts_as_versioned is being used. An acts_as_versioned
record has among others an &#8220;id&#8221; column (the default id that ActiveRecord
requires) and a &#8220;version&#8221; column.

Currently Mephisto falsely does the following inside
\app\controllers\admin\articles_controller.rb on line 38 (edit
action)...

  @version = params[:version] ? @article.versions.find(params[:version]) : @article or raise(ActiveRecord::RecordNotFound)

the whole problem is the find(params[:version]) . What happens here is,
that we lookup an article&#8217;s version by searching for its id instead of
for its version column (even though we do use the correct :version
parameter.)

So this has to change to find_by_version(params[:version]) and thus
become..

  @version = params[:version] ? @article.versions.find_by_version(params[:version]) : @article or raise(ActiveRecord::RecordNotFound)

Notice though that this doesn&#8217;t break in a single-site installation,
because in this case id and version bot get the same (concurrent)
increment. That is because all articles belong the same one and only
Site instance.</message>
    <tree>a89976f39245db9125dfb1dc3f21c0430d87953a</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>9a7251f4b1e8e7147935b1cad8d6f126196bf051</id>
      </parent>
    </parents>
    <author>
      <name>David Cato</name>
      <email>git@crunchyfrog.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/c05e9ee1c3e6580b0bff72051c294cc955581001</url>
    <id>c05e9ee1c3e6580b0bff72051c294cc955581001</id>
    <committed-date>2009-03-15T06:35:02-07:00</committed-date>
    <authored-date>2009-03-06T14:53:16-08:00</authored-date>
    <message>Fix tainted string error when updating comment

When updating a comment, a tainted string error was being thrown due to
the lack of a h() escape on the article title in the comment partial.
A deprecation warning from truncate() in the comment partial has also
been resolved.

A functional test (test_should_update_comment) for the admin comments
controller is also included.</message>
    <tree>ca2ae99ace7993d04f809ae7eab6870a6250ca7f</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>b68e9b2e3a14f33660bf39f3e557a9938c7b0e38</id>
      </parent>
    </parents>
    <author>
      <name>David Cato</name>
      <email>git@crunchyfrog.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/9a7251f4b1e8e7147935b1cad8d6f126196bf051</url>
    <id>9a7251f4b1e8e7147935b1cad8d6f126196bf051</id>
    <committed-date>2009-03-15T06:34:25-07:00</committed-date>
    <authored-date>2009-03-02T22:54:14-08:00</authored-date>
    <message>Expire cache on theme change from admin/settings

Force cache expiration when changing the theme from the Admin::Settings
controller as is done when changing the theme from the Admin::Themes
controller so that the behavior after a change of theme is consistent,
regardless of where the change is made.</message>
    <tree>06eb36f2d66ab6ec1465f19842fea6518d9ff33e</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>bb6c3a33fdbab9b4a65e157d54f7f6c52e413ee9</id>
      </parent>
    </parents>
    <author>
      <name>David Cato</name>
      <email>git@crunchyfrog.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/29e8c41bd7dcdb514c8eee87278cd36e9f97011b</url>
    <id>29e8c41bd7dcdb514c8eee87278cd36e9f97011b</id>
    <committed-date>2009-03-15T06:27:55-07:00</committed-date>
    <authored-date>2009-02-27T14:30:28-08:00</authored-date>
    <message>Pass comment approval status to the template

By passing the comment's approval setting to the __thanks_for_comment
template, the template can provide additional feedback such as &quot;Your
comment is awaiting moderator approval&quot;, &quot;Sorry, we threw your comment
away&quot;, or similar if the comment was not automatically approved.  For
example, __thanks_for_comment.liquid could look like the following:

  Thanks for the comment.
  {% unless approved %}It is awaiting moderation.{% endunless %}</message>
    <tree>18b0922930a31c8ab961e7435c5e6e5a3fb42fdf</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>dd86ad9c22a3e6cc5eb97591997472d6b348b443</id>
      </parent>
    </parents>
    <author>
      <name>David Cato</name>
      <email>git@crunchyfrog.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/bb6c3a33fdbab9b4a65e157d54f7f6c52e413ee9</url>
    <id>bb6c3a33fdbab9b4a65e157d54f7f6c52e413ee9</id>
    <committed-date>2009-03-15T06:25:59-07:00</committed-date>
    <authored-date>2009-02-26T18:03:11-08:00</authored-date>
    <message>Force consistent ordering of dates containing NULLs

Because database servers differ on how they sort NULL values, the sort
order for articles was changed, via COALESCE, so that a NULL date will
be treated as being less than (i.e., older than) any non-NULL date.
This fixes test_should_search_article_by_section so that it passes with
MySQL, SQLite, and PostgreSQL.

[I'm merging this patch because I'm quite fond of PostgreSQL, and
because it has been tested with most of the other databases we support.
If this breaks your database, please let me know. -Eric]</message>
    <tree>bdb33940bce48271283629d3945ff464fc7660cc</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>73c5e891d5a0fada73d6c4161f12821608900d82</id>
      </parent>
    </parents>
    <author>
      <name>Mathieu Martin</name>
      <email>webmat@gmail.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/8d73a2a5ff64954ffb230dd7561a17e6fc1781af</url>
    <id>8d73a2a5ff64954ffb230dd7561a17e6fc1781af</id>
    <committed-date>2009-03-15T06:17:33-07:00</committed-date>
    <authored-date>2009-03-11T20:54:52-07:00</authored-date>
    <message>Fix the parameter logging filtering...

Call filter_parameter_logging only once with all sensitive field names, rather than once per field to protect.</message>
    <tree>2de226078c3dc9194d5bf8234dca1b886619c042</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>5c568b5587cd3df6021e80e021485db75d3b9e44</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/1473acf8307ec21d2002acab94691841d8003580</url>
    <id>1473acf8307ec21d2002acab94691841d8003580</id>
    <committed-date>2009-02-01T18:14:10-08:00</committed-date>
    <authored-date>2009-02-01T18:14:10-08:00</authored-date>
    <message>Fix display of theme homepage links

Many thanks to Gustavo Sales (aka vatsu) for pointing out this bug and
proposing a fix:

http://github.com/vatsu/mephisto/commit/e7b0ecaaca4457dd7d542ac218baf979e1b7a190
http://github.com/vatsu/mephisto/commit/fbe32e923ad6dfb963a8311053214b3395aeb37b

In order to minimize code duplication in the *.erb files, I've rewritten
this code as a helper method.</message>
    <tree>33323a79d12d193b35a3b1ea4cc1dc8bfbc9d40f</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>985782461c010f13e0d3af6f152d0b1280cd1faf</id>
      </parent>
      <parent>
        <id>9b7cbbb116d8d353f3132d5a59f79b67e9dab698</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/7ee79816ffc0f2433df412e87024061e794736e3</url>
    <id>7ee79816ffc0f2433df412e87024061e794736e3</id>
    <committed-date>2009-02-01T16:45:55-08:00</committed-date>
    <authored-date>2009-02-01T16:45:55-08:00</authored-date>
    <message>Merge branch 'master' of git://github.com/technoweenie/mephisto</message>
    <tree>9d0dbbbb12894eafbcaf25895480de8ee32958a6</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>e229865d6e63a6b6c0e6cb7aac21992ca303f94a</id>
      </parent>
    </parents>
    <author>
      <name>Sean O'Brien</name>
      <email>sean.obrien56@yahoo.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/9b7cbbb116d8d353f3132d5a59f79b67e9dab698</url>
    <id>9b7cbbb116d8d353f3132d5a59f79b67e9dab698</id>
    <committed-date>2009-01-29T23:41:07-08:00</committed-date>
    <authored-date>2009-01-29T23:41:07-08:00</authored-date>
    <message>missing tainted string in cache listing</message>
    <tree>5fc6c3dbb07419ab0ef0975eebe230224745db5b</tree>
    <committer>
      <name>Sean O'Brien</name>
      <email>sean.obrien56@yahoo.com</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>e6ef40f48b4d37f18381e8a0ed2dd5a551a7d82b</id>
      </parent>
    </parents>
    <author>
      <name>James McCarthy</name>
      <email>james2mccarthy@gmail.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/b2ead2f1617fcd3f5141f8c7b2082d57c47c8f85</url>
    <id>b2ead2f1617fcd3f5141f8c7b2082d57c47c8f85</id>
    <committed-date>2009-01-13T05:07:27-08:00</committed-date>
    <authored-date>2009-01-11T18:36:47-08:00</authored-date>
    <message>escaped link in _page.html.erb

Signed-off-by: James McCarthy &lt;james2mccarthy@gmail.com&gt;</message>
    <tree>f8437b7daf1349cf75fb3a352e1f6f6090699155</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>3700f8d9e7aeefaf5d175d2ea4e412c2927ec229</id>
      </parent>
    </parents>
    <author>
      <name>Chris Cummer</name>
      <email>chris@postal-code.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/e6ef40f48b4d37f18381e8a0ed2dd5a551a7d82b</url>
    <id>e6ef40f48b4d37f18381e8a0ed2dd5a551a7d82b</id>
    <committed-date>2009-01-09T04:28:52-08:00</committed-date>
    <authored-date>2009-01-04T12:36:51-08:00</authored-date>
    <message>Changed user login to send user to admin section on succesful login instead of the blog homepage since users have the ability to post to the blog</message>
    <tree>f48310c10b955f3eacf2eea4017212f38fd66984</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>ec67cdcf11399edd442749b9799c4dbe2059c39a</id>
      </parent>
    </parents>
    <author>
      <name>Chris Cummer</name>
      <email>chris@postal-code.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/a3c0a7d80f75c5560a3fffa2c2f96831399ffd3c</url>
    <id>a3c0a7d80f75c5560a3fffa2c2f96831399ffd3c</id>
    <committed-date>2008-12-31T05:57:43-08:00</committed-date>
    <authored-date>2008-12-30T13:20:00-08:00</authored-date>
    <message>Fixes 'attempted to output tainted string' error when rendering email address for mailto</message>
    <tree>b56cc71c6397c67df9f05e1af6d0f0af4a36f3cd</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>1ea714e42637e08faa76d7c988cf85125207c23f</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/5f488ccb504cd103258f7a8af7ad87c219254b6c</url>
    <id>5f488ccb504cd103258f7a8af7ad87c219254b6c</id>
    <committed-date>2008-12-26T08:26:27-08:00</committed-date>
    <authored-date>2008-12-26T08:26:27-08:00</authored-date>
    <message>JavaScript: Rename admin/assets/*.js -&gt; *.js.rjs</message>
    <tree>d0cf09ffb2ff0014888219770df4ba4ed2ebc375</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>be52beb86d2228cc2f5b0b95a5669e4ce58904f4</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/975d51bcf58d92922fd18cef9d2837fd6bc72907</url>
    <id>975d51bcf58d92922fd18cef9d2837fd6bc72907</id>
    <committed-date>2008-12-23T21:06:59-08:00</committed-date>
    <authored-date>2008-12-23T21:06:59-08:00</authored-date>
    <message>Modernize rjs: admin/articles

I'm going to try to rename all the *.rjs files to *.js.rjs.  This is
trickier than the other renamings, because our unit test coverage isn't
perfect, and I'm trying to test everything by hand when possible.  So
I'm going to do this one directory at a time.

Other changes:
  - The live_preview and _preview stuff wasn't being used.
  - We didn't have a test case for the 'label' action.</message>
    <tree>14448796ede7ff813e4e7f758139087822190ff9</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>19d3422c313410e7f64ba51a991a1ea1491cc663</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/be52beb86d2228cc2f5b0b95a5669e4ce58904f4</url>
    <id>be52beb86d2228cc2f5b0b95a5669e4ce58904f4</id>
    <committed-date>2008-12-23T18:06:15-08:00</committed-date>
    <authored-date>2008-12-23T18:06:15-08:00</authored-date>
    <message>Rename *.rxml files to *.xml.builder

This also requires adding respond_to blocks to some of our actions.</message>
    <tree>92c1271652cedf439437f7bd3edc39189e4aa419</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>b24d0b198cde9fbcbe87f802b12ee61743a6d380</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/19d3422c313410e7f64ba51a991a1ea1491cc663</url>
    <id>19d3422c313410e7f64ba51a991a1ea1491cc663</id>
    <committed-date>2008-12-23T17:49:20-08:00</committed-date>
    <authored-date>2008-12-23T17:49:20-08:00</authored-date>
    <message>Rename *.rhtml files to *.html.erb

Let's go for the new-school approach here.</message>
    <tree>7d7a2f9566d2d09b448fc2398610017d9a87e2b4</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>6677a2c0f490a7cdaa1671482db3f714d45cf8d3</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/8f3656b21398306fed78ccd13097eca8ebb55238</url>
    <id>8f3656b21398306fed78ccd13097eca8ebb55238</id>
    <committed-date>2008-12-22T05:57:08-08:00</committed-date>
    <authored-date>2008-12-22T05:28:15-08:00</authored-date>
    <message>Fix theme controller bugs

J.C. Zhu reported an InvalidAuthenticityToken error when trying to
change themes.  This was one of several bugs in the theme switching
code left over from the Rails 2.2 porting process and the security
audit.

We needed to convince Ajax.Request to use a GET request when displaying
the theme tools, and we needed to properly escape some text in the
_tools template.

I've also added a test case to make sure we actually render the _tools
view successfully.</message>
    <tree>638431d73fd1a8a299cca19e90f23d133d958930</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>4aae70e165bd63602fb51ef44d516f9f67c3737a</id>
      </parent>
    </parents>
    <author>
      <name>rick</name>
      <email>technoweenie@gmail.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/e229865d6e63a6b6c0e6cb7aac21992ca303f94a</url>
    <id>e229865d6e63a6b6c0e6cb7aac21992ca303f94a</id>
    <committed-date>2008-12-20T10:48:38-08:00</committed-date>
    <authored-date>2008-12-20T10:48:38-08:00</authored-date>
    <message>catch tainted string in overview</message>
    <tree>7a580309ed604bf6eb679546848711d3a6202804</tree>
    <committer>
      <name>rick</name>
      <email>technoweenie@gmail.com</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>9c612f8c90ca2921086c123d5e574005d00a16b0</id>
      </parent>
    </parents>
    <author>
      <name>rick</name>
      <email>technoweenie@gmail.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/8681b6419d3bbe53929dea28ede3d32553944832</url>
    <id>8681b6419d3bbe53929dea28ede3d32553944832</id>
    <committed-date>2008-12-20T10:45:38-08:00</committed-date>
    <authored-date>2008-12-20T10:45:38-08:00</authored-date>
    <message>extract event mode logic to Event.mode_from</message>
    <tree>826d503b1227bb79877842b1811603ae5dc9ff7d</tree>
    <committer>
      <name>rick</name>
      <email>technoweenie@gmail.com</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>64eff7f46ab8191d1dd766f7746f3a52d31fd7b3</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/38348fb9236859143d79acba02388af617731204</url>
    <id>38348fb9236859143d79acba02388af617731204</id>
    <committed-date>2008-12-20T07:45:14-08:00</committed-date>
    <authored-date>2008-12-20T07:45:14-08:00</authored-date>
    <message>Don't log &quot;remember me&quot; token

This token can be trivially recovered from the database, so excluding it
from the logs doesn't actually accomplish anything.  But there's no
reason to include it in the logs, either.</message>
    <tree>e68e88c291aa443bb67f1469e003600c25d5abdf</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>c500bf8e05c250d02672c30d079a0bdeb66f0569</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/64eff7f46ab8191d1dd766f7746f3a52d31fd7b3</url>
    <id>64eff7f46ab8191d1dd766f7746f3a52d31fd7b3</id>
    <committed-date>2008-12-20T07:43:45-08:00</committed-date>
    <authored-date>2008-12-20T07:43:45-08:00</authored-date>
    <message>Security: Attempt to block auth of nil tokens, etc.

Some Rails authentication systems have suffered from a vulnerability
involving nil or blank login tokens:

  http://www.rorsecurity.info/2007/10/28/restful_authentication-login-security/

This patch includes a bunch of test cases testing for possible attacks
along these lines, and some sanity-checking code in our authentication
methods.

Note that the tests and the code don't really &quot;line up&quot; here--most of
the test methods passed already, and most of the sanity-checking code
is probably unnecessary.  But again, better safe than sorry.</message>
    <tree>3b4e0fdd75748350aff26d604f7f5a7d6a61e552</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>ff0113a3c8ed63746af2a6c8398f29969330b439</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/c500bf8e05c250d02672c30d079a0bdeb66f0569</url>
    <id>c500bf8e05c250d02672c30d079a0bdeb66f0569</id>
    <committed-date>2008-12-20T06:10:37-08:00</committed-date>
    <authored-date>2008-12-20T06:10:37-08:00</authored-date>
    <message>Security: Force all GET requests to be read-only

The W3C makes a clear distinction between GET and POST requests.  GET
requests should only cause &quot;safe&quot; actions, and the user should never be
held accountable for making GET requests.  See the following for an
overview:

  http://www.w3.org/2001/tag/doc/whenToUseGet.html

The Rails 'protect_against_forgery' function (and possibly some web
browsers) rely on the distinction between GET and POST to provide
protection against CSRF attacks.  See:

  http://en.wikipedia.org/wiki/Cross-site_request_forgery
  http://guides.rubyonrails.org/security.html#_csrf_countermeasures

Unfortunately, enforcing these rules in rather difficult, especially in
a large application with lots of controllers and plugins.  So this patch
applies a rather heavy-handed fix: We globally block database writes
during GET requests, and specifically override that policy in one or two
places.

All of our current overrides invoke User#reset_token!.  I haven't
performed a full security analysis of allowing User#reset_token! (or
updates to session[:user] based on our &quot;remember me&quot; token) in a GET
request.  For now, I'm going to go ahead and allow this activity--if we
actually have some sort of vulnerability here, it affects a wide range
of web applications.

Note that this patch may break some part of the /admin interface.  I've
tried posting articles and other basic stuff, but I haven't used the
lesser-known corners of /admin since making these changes.  Please
report any problems.</message>
    <tree>58b206f97ec48143ffae2256ba548a18b1e21765</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>a644733791f42edc5d15ac8409639050f5d0a155</id>
      </parent>
      <parent>
        <id>b7cb8221e066cb55884bf941e1b421ccf6082404</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/284f1acd28abab4005f6388d095e9cd1cc2f52a0</url>
    <id>284f1acd28abab4005f6388d095e9cd1cc2f52a0</id>
    <committed-date>2008-12-19T20:47:10-08:00</committed-date>
    <authored-date>2008-12-19T20:47:10-08:00</authored-date>
    <message>Merge branch 'experimental'

Conflicts:

	app/drops/comment_drop.rb</message>
    <tree>653b1d47ba2601a3523006e48c7110310d48f4df</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>173c3b82e7dae0f7d616c5522104e48f76ef94ad</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/c8c4bcc772301abcee6735466df93b60291878aa</url>
    <id>c8c4bcc772301abcee6735466df93b60291878aa</id>
    <committed-date>2008-12-19T19:25:22-08:00</committed-date>
    <authored-date>2008-12-19T19:25:22-08:00</authored-date>
    <message>Security: Fix many broken filter regexps

In Ruby, &quot;foo\nbar&quot; =~ /^bar/ will result in a match, because ^ matches
at the start of any line, not at the start of the string.  In general,
we want to use \A and \z in place of ^ and $, respectively.

We rely heavily on regular expressions to filter untrusted data.  And
many of these regular expressions can be fooled easily because they rely
on ^ and $ when they shouldn't.  See comment_drop_test for a
user-exploitable example.

This patch does a bulk search-and-replace of the offending patterns.  It
may easily have missed something somewhere, but it's a good start.</message>
    <tree>7c76b84b39cf0d8fbaa0ec49c7c13251deb1f1d6</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>bf1a5deb79007d56901984d70eb3ad0f8122ef7a</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/06917544a35c178a5ab2c9ec61773693e4886d36</url>
    <id>06917544a35c178a5ab2c9ec61773693e4886d36</id>
    <committed-date>2008-12-19T14:53:05-08:00</committed-date>
    <authored-date>2008-12-19T14:53:05-08:00</authored-date>
    <message>Only accept known comment fields

The comment form is most-exposed attack point in all of Mephisto,
because it doesn't require an authenticity_token and can be used by
anybody on the internet.

In the interests of paranoia, this patch removes bulk assignment from
the comment-posting code.  I don't see any way to exploit the previous
code (several attr_accessible fields looked vulnerable, but don't
actually exist any more).  But better safe than sorry.</message>
    <tree>69c93bc46f89eb83bf1bce71c0615c77bfc357df</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>bf1a5deb79007d56901984d70eb3ad0f8122ef7a</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/b7cb8221e066cb55884bf941e1b421ccf6082404</url>
    <id>b7cb8221e066cb55884bf941e1b421ccf6082404</id>
    <committed-date>2008-12-19T06:26:23-08:00</committed-date>
    <authored-date>2008-12-19T06:26:23-08:00</authored-date>
    <message>Security: Fix XSS attack against new comment form

WARNING: If you're one of the first people testing this commit, please
use a backup database.

How to reproduce: Create a new comment, and set all fields to
&lt;script&gt;alert(&quot;Pwned&quot;)&lt;/script&gt;.  Submit it.  You will see a JavaScript
alert dialog, which is bad.

What's happening: Untrusted fields in Comment objects are sanitized
immediately before they're written to the database for the first time.
But if validation fails, it leaves the application with an unsanitized
comment object.  When the &quot;can't submit comment&quot; error is displayed,
this unsanitized comment object can be passed straight throught to
Liquid, which assumes that all HTML tags have been escaped.

(This may look like &quot;self XSS&quot; attack only, but hostile pages can
trigger it by tricking you into submitting a comment form back to your
own site, preloaded with malicious data.)

How we fix it: We make HTML escaping the responsibility of CommentDrop,
not the Comment model.  This means that we need to unescape several
existing fields in the database.

Possible issues: This means that we're storing dangerous, untrusted data
in our database, and that we need to rely on the proper use of 'h' and
'CGI.escapeHTML'.  In the case of 'h', we're already using SafeERB, so
insecure admin templates will be caught automatically, and dangerous
data should never be sent to the user.  In the case of Liquid, we need
to carefully examine our CommentDrop class to make sure that we're not
passing any unescaped data through to the Liquid templates.  But this is
a pretty manageable &quot;proof obligation&quot;--and remember that the old
&quot;sanitize on create&quot; code actually suffered from XSS attacks, because it
was too easy to do the sanitization in the wrong place.</message>
    <tree>0703ba7b1fb18d1eae97eb5c7a0537cffa8fb2eb</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>098bb13f543c47e652442e65c1402eb563ba99b8</id>
      </parent>
    </parents>
    <author>
      <name>isaac</name>
      <email>isaackearse@gmail.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/87b221f3914e412f4d376591240ea62a88b58785</url>
    <id>87b221f3914e412f4d376591240ea62a88b58785</id>
    <committed-date>2008-12-16T20:56:35-08:00</committed-date>
    <authored-date>2008-12-16T20:56:35-08:00</authored-date>
    <message>Change location of the default theme from themes/default =&gt; app/themes/default, and ignore the themes folder

Now you can just symlink the themes folder when deploying and not overwrite any changes.</message>
    <tree>b531ef6852c29ad31c0dedbce7893c538fad0fb1</tree>
    <committer>
      <name>isaac</name>
      <email>isaackearse@gmail.com</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>1189e41398778b7665a49338f6f063c4040b3472</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/e7af58c5fe9b993de16478b102e2e1af320a8402</url>
    <id>e7af58c5fe9b993de16478b102e2e1af320a8402</id>
    <committed-date>2008-12-15T06:05:21-08:00</committed-date>
    <authored-date>2008-12-15T06:05:21-08:00</authored-date>
    <message>Rename forgot_password template to have correct MIME type

This is part of some soon-to-be-committed work with safe_erb, but it
stands alone just fine.</message>
    <tree>fa0a571db05f28048598e2f830c88d47a970db8b</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>01e4d91b3f6faca894186a492a2b735396f0e598</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/1189e41398778b7665a49338f6f063c4040b3472</url>
    <id>1189e41398778b7665a49338f6f063c4040b3472</id>
    <committed-date>2008-12-14T06:34:43-08:00</committed-date>
    <authored-date>2008-12-14T06:33:58-08:00</authored-date>
    <message>Fix timezone bug caused by port to Rails 2.2

This bug was introduced in 3414a37d9432f2a64ae3dda4238c6f546555c9ed, and
was reported by &quot;barontick&quot; on #mephisto.  Changes introduced while
cleaning up unit test failures on the way to Rails 2.2 prevented users
from setting the site's timezone.

Some notes on this patch.
  1) We want to keep using 'tzinfo', and not Rail's built-in time zone
     classes, because the former supports daylight savings time.
  2) It's easier to just add a virtual timezone_name accessor instead of
     trying to do conversions in Site#timezone=.
  3) We can re-enable some old specs for Site, because there's no
     longer any danger of deleting site themes.

I really wish we had a better way of testing that HTML forms could be
submitted back to the database successfully, closing the loop between
two different sets of test cases on output and input.</message>
    <tree>b0c83e8282a973db66ceca68a330d145082e1e41</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>cd59873a681781388f5783b3b57b96c45fe5b43f</id>
      </parent>
    </parents>
    <author>
      <name>isaac</name>
      <email>isaackearse@gmail.com</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/d6b5007b25fb3487e6b508eae3927d4a56a16e38</url>
    <id>d6b5007b25fb3487e6b508eae3927d4a56a16e38</id>
    <committed-date>2008-12-12T15:21:18-08:00</committed-date>
    <authored-date>2008-12-12T15:21:18-08:00</authored-date>
    <message>fix warnings about adding parentheses for future versions of ruby</message>
    <tree>aa453c3d61ffc067785418a8b9c0a84687fbd3c4</tree>
    <committer>
      <name>isaac</name>
      <email>isaackearse@gmail.com</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>31430c44ac1d26cd3b4dbb26a7374dd6164e2b47</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/d2c8c8e3aee4c222c645f0b7b493799ffd826bc3</url>
    <id>d2c8c8e3aee4c222c645f0b7b493799ffd826bc3</id>
    <committed-date>2008-12-12T05:24:57-08:00</committed-date>
    <authored-date>2008-12-12T05:24:57-08:00</authored-date>
    <message>Security: Replace white_list with Rails 2.2 sanitizer

The Rails 2.2 santizer is an enhanced version of Rick's original
white_list plugin, so let's upgrade and get the latest fixes.

Note that Mephisto had separate rules for sanitizing comments and
non-comments in Atom feeds.  This difference was introduced in commit
88df87e3a1cb8474fa479d855035ab4d2ca2351e.  Unfortunately, I'm not able
to track down any information on the problem being fixed here.  Since we
already add half of the tags in question to the whitelist, I've decided
to just treat all sanitized Atom feed content the same.  Please let me
know if this breaks anything.</message>
    <tree>d442e5291b0aec71e6ecde67222ee49e59c38df1</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>7a20455fab59441d15e261172aa9fac109eb3893</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/31430c44ac1d26cd3b4dbb26a7374dd6164e2b47</url>
    <id>31430c44ac1d26cd3b4dbb26a7374dd6164e2b47</id>
    <committed-date>2008-12-12T04:40:42-08:00</committed-date>
    <authored-date>2008-12-12T04:40:42-08:00</authored-date>
    <message>Security: More h(...) tags

These are based on manual inspection.</message>
    <tree>20de9e4507d3b7dc76697df85d9e877837527dbb</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>a83309dbc833ce1ef255ac65275ba498115d1040</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/7a20455fab59441d15e261172aa9fac109eb3893</url>
    <id>7a20455fab59441d15e261172aa9fac109eb3893</id>
    <committed-date>2008-12-11T16:05:37-08:00</committed-date>
    <authored-date>2008-12-11T16:05:37-08:00</authored-date>
    <message>Security: Escape more strings

The sqlite3_ruby database adapter does not correctly taint strings
unless you first apply this patch:

  http://rubyforge.org/tracker/index.php?func=detail&amp;aid=20325&amp;group_id=254&amp;atid=1045

With this patch applied, SafeERB finds more errors.  These are now
fixed.  It would be highly desirable to update SafeERB and modify it for
production use with Rails 2.2.</message>
    <tree>eb43abe7ea4ced62e2f3cdc99532039644227102</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>f9d3c105eb0c22b7a66430619be41b697c98200f</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/a83309dbc833ce1ef255ac65275ba498115d1040</url>
    <id>a83309dbc833ce1ef255ac65275ba498115d1040</id>
    <committed-date>2008-12-11T15:31:50-08:00</committed-date>
    <authored-date>2008-12-11T15:29:51-08:00</authored-date>
    <message>Security: Escape strings where recommended by SafeERB

The SafeERB plugin attempts to automatically detect view code which
fails to properly escape HTML.  You can find information here:

  http://wiki.rubyonrails.com/rails/pages/Safe+ERB

I'm using a version of SafeERB modified by Matthew Bass, which can be
found on github:

  http://github.com/pelargir/safe_erb/tree/master

My local copy is modified to avoid some false positives, and isn't ready
for production use yet.  But here's the first batch of changes it
recommended.  Note that some of these changes weren't really necessary--
some of the values we're wrapping can't actually contain HTML
metacharacters, at least not in normal locales.

Also note that SafeERB is only useful for the normal view code in places
like /admin, and that it won't help us with Liquid plugins in the front
end.  But it's a start.</message>
    <tree>bf75a57264c39abb41b433917bea009351be6b48</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
  <commit>
    <parents type="array">
      <parent>
        <id>5186bb4204e0b3397109c4b40ce7643753badfcd</id>
      </parent>
    </parents>
    <author>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </author>
    <url>http://github.com/emk/mephisto/commit/f9d3c105eb0c22b7a66430619be41b697c98200f</url>
    <id>f9d3c105eb0c22b7a66430619be41b697c98200f</id>
    <committed-date>2008-12-11T05:33:43-08:00</committed-date>
    <authored-date>2008-12-11T05:31:25-08:00</authored-date>
    <message>Security: Make 'token' cookie HTTP-only

This prevents malicious JavaScript code injected by a XSS attack from
reading your &quot;Remember me&quot; token, and getting long-term access to your
account.  Note that not all browsers honor :http_only, and of those
that do, some allow it to be bypassed using XmlHttpRequest.</message>
    <tree>043277cf8ca6916df97dd005b77ec05a0cd2fbbc</tree>
    <committer>
      <name>Eric Kidd</name>
      <email>git@randomhacks.net</email>
    </committer>
  </commit>
</commits>
