Skip to content

Commit

Permalink
Strip tags before displaying project name
Browse files Browse the repository at this point in the history
A project name such as '""><script>alert("asd")</script>' was causing
problems as described in http://openhatch.org/bugs/issue875

Use the Django 'striptags' filter to remove the tag at the end (standard
escaping does not seem to catch this for some reason, even after
specifying the 'escape' filter.)

Resulting fix still leaves a mangled project name, like '"">' or such,
but otherwise leaves the list of projects alone. I'm not totally
satisfied with this fix, and think we should have a similar one in the
submission form so project names like this don't get into the database
to begin with.

Signed-off-by: Mandar Gokhale <mandar.mmg@gmail.com>
  • Loading branch information
mandarg committed Nov 22, 2013
1 parent f8140d2 commit f4cc4ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mysite/project/templates/project/project_list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% endif %}
>
<a href='{{ project.get_url }}'>
{{ project.display_name|break_long_words|safe }}
{{ project.display_name|break_long_words|striptags|safe }}
</a>
<div class='summary'>
{% if project.get_bug_count %}
Expand Down

0 comments on commit f4cc4ae

Please sign in to comment.