Open the-mace opened 6 years ago
That's odd - how can these hackers point to that content_object
?
The code uses:
content_object = comment.content_object
subject = u'[{0}] New comment posted on "{1}"'.format(site.name, content_object)
which means they've already managed to add a model somewhere, and then point to it by adding a comment. Adding a <script>
to the subject would target vulnerable webmail clients (as Django already escapes HTML in templates)
One thing is clear, the Django comments post data needs better checks to avoid linking to random models.
I've made some improvements in the 'master' branch to enable the comment moderator by default.
This also allows to reject comments to unregistered models (FLUENT_COMMENTS_DEFAULT_MODERATOR = 'deny'
, and call moderate_model()
on any model you'd allow comments to be posted at)
On the latest version 2.0.2 I get this thanks to some hackers:
Other than disabling the emails I don't see any way to block the bad content. I don't actually need to see the actual comment, just knowing there's one there is good enough.