To add a little more background - I ran into this bug while doing work on our Drupal integration module. It's easy to demonstrate, and basically happens if a script is indexed in an unprocessed or untokenized field (e.g. a string field) and shows up as one of the top terms on the schema browser page (schema.jsp) when one goes to examine a particular field.
The risk of allowing such script to execute could include modification or deletion of the index, as well as other XSS attacks, and the danger of a small JS payload is potentially enhanced by the fact that is could probably use jQuery functions like jQuery.post().
For the Drupal module we are mitigating this risk by using the PHP strip_tags() function prior to indexing content, but it seems liek this is something Solr should handle more generally.
I first observed the bug in Solr 1.3, and it's still present in trunk (1.4)
Re-posting Paul's patch with the preferred naming.