Restrict the use of HTML and JavaScript in stories and comments #64

Closed
opened 2015-04-04 16:12:29 +00:00 by GoogleCodeExporter · 8 comments
GoogleCodeExporter commented 2015-04-04 16:12:29 +00:00 (Migrated from github.com)
To prevent users from saving possibly malicious HTML and JavaScript in
comments and stories, at blogger.de, University of Erlangen and twoday.net,
the user input is sanitized. Maybe that (or something similar) could be
integrated in Antville?

phoque describing his changes (antville 1.1):
http://groups.google.com/group/antville-dev/browse_thread/thread/79db3c73f3e9d62
8

The settings at blogger.de (in app.properties):
<code># allowedTags: List of tags/attributes that are allowed for a story,
resp.
# for a comment. All other tags/attributes are being removed. This
# should guarantee that no users can insert malicious (script) code, esp.
# the XMLHttpRequest-Object. By adding '%[.]' to this list, it is possible
# to allow macros to be inserted.
allowedTagsForStory   = textmodule, hypertextmodule, legacymodule,
editmodule, listmodule, targetmodule, presentationmodule, tablemodule,
imagemodule, objectmodule, custommodule, iframemodule, %[.]
allowedTagsForComment = textmodule, hypertextmodule, legacymodule,
editmodule, presentationmodule, %[.], imagemodule

# allowedTagsForStory = a[name|href|target|title|hreflang], strong, b,
em, i, strike, p[align], ol, ul, li, br, nobr, wbr,
img[src|border|alt|title|width|height|align], blockquote[cite],
div[align], pre, code, center, cite,
table[border|cellpadding|cellspacing|width|height|bgcolor],
th[width|height|align|valign|colspan|rowspan],
tr[width|height|align|valign|colspan|rowspan],
td[width|height|align|valign|colspan|rowspan], q[cite], samp, kbd,
var, dfn, acronym, abbr, ins, del, hr[size|width|align],
font[size|color|face], basefont[size|color|face], big, small, tt, sub,
sup, s, blink
# allowedTagsForComment = a[name|href|target|title|hreflang], strong,
b, em, i, strike, p[align], ol, ul, li, br, nobr, wbr,
img[src|border|alt|title|width|height|align], blockquote[cite],
div[align], pre, code, center, cite, q[cite], samp, kbd, var, dfn,
acronym, abbr, ins, del, font[size|color|face],
basefont[size|color|face], big, small, tt, sub, sup, s, blink</code>

Well, <i>blink</i> should have been omitted.


Original issue reported on code.google.com by kinomu.w...@gmail.com on 20 Dec 2009 at 7:06

Attachments:

``` To prevent users from saving possibly malicious HTML and JavaScript in comments and stories, at blogger.de, University of Erlangen and twoday.net, the user input is sanitized. Maybe that (or something similar) could be integrated in Antville? phoque describing his changes (antville 1.1): http://groups.google.com/group/antville-dev/browse_thread/thread/79db3c73f3e9d62 8 The settings at blogger.de (in app.properties): <code># allowedTags: List of tags/attributes that are allowed for a story, resp. # for a comment. All other tags/attributes are being removed. This # should guarantee that no users can insert malicious (script) code, esp. # the XMLHttpRequest-Object. By adding '%[.]' to this list, it is possible # to allow macros to be inserted. allowedTagsForStory = textmodule, hypertextmodule, legacymodule, editmodule, listmodule, targetmodule, presentationmodule, tablemodule, imagemodule, objectmodule, custommodule, iframemodule, %[.] allowedTagsForComment = textmodule, hypertextmodule, legacymodule, editmodule, presentationmodule, %[.], imagemodule # allowedTagsForStory = a[name|href|target|title|hreflang], strong, b, em, i, strike, p[align], ol, ul, li, br, nobr, wbr, img[src|border|alt|title|width|height|align], blockquote[cite], div[align], pre, code, center, cite, table[border|cellpadding|cellspacing|width|height|bgcolor], th[width|height|align|valign|colspan|rowspan], tr[width|height|align|valign|colspan|rowspan], td[width|height|align|valign|colspan|rowspan], q[cite], samp, kbd, var, dfn, acronym, abbr, ins, del, hr[size|width|align], font[size|color|face], basefont[size|color|face], big, small, tt, sub, sup, s, blink # allowedTagsForComment = a[name|href|target|title|hreflang], strong, b, em, i, strike, p[align], ol, ul, li, br, nobr, wbr, img[src|border|alt|title|width|height|align], blockquote[cite], div[align], pre, code, center, cite, q[cite], samp, kbd, var, dfn, acronym, abbr, ins, del, font[size|color|face], basefont[size|color|face], big, small, tt, sub, sup, s, blink</code> Well, <i>blink</i> should have been omitted. ``` Original issue reported on code.google.com by `kinomu.w...@gmail.com` on 20 Dec 2009 at 7:06 Attachments: - [htmlparser.jar](https://storage.googleapis.com/google-code-attachments/antville/issue-64/comment-0/htmlparser.jar) - [sanitize.js](https://storage.googleapis.com/google-code-attachments/antville/issue-64/comment-0/sanitize.js)
GoogleCodeExporter commented 2015-04-04 16:12:29 +00:00 (Migrated from github.com)
[deleted comment]
``` [deleted comment] ```
GoogleCodeExporter commented 2015-04-04 16:12:29 +00:00 (Migrated from github.com)
[deleted comment]
``` [deleted comment] ```
GoogleCodeExporter commented 2015-04-04 16:12:30 +00:00 (Migrated from github.com)

Original comment by interf...@p3k.org on 18 Jan 2010 at 11:32

  • Added labels: Milestone-Release-1.2
Original comment by `interf...@p3k.org` on 18 Jan 2010 at 11:32 - Added labels: **Milestone-Release-1.2**
GoogleCodeExporter commented 2015-04-04 16:12:30 +00:00 (Migrated from github.com)
Postponed to 1.3.

Original comment by interf...@p3k.org on 23 Apr 2010 at 8:10

  • Added labels: Milestone-Release-1.3
  • Removed labels: Milestone-Release-1.2
``` Postponed to 1.3. ``` Original comment by `interf...@p3k.org` on 23 Apr 2010 at 8:10 - Added labels: **Milestone-Release-1.3** - Removed labels: **Milestone-Release-1.2**
GoogleCodeExporter commented 2015-04-04 16:12:30 +00:00 (Migrated from github.com)

Original comment by interf...@p3k.org on 29 May 2011 at 9:08

  • Added labels: Milestone-Release-1.4
Original comment by `interf...@p3k.org` on 29 May 2011 at 9:08 - Added labels: **Milestone-Release-1.4**
GoogleCodeExporter commented 2015-04-04 16:12:30 +00:00 (Migrated from github.com)

Original comment by m...@tobischaefer.com on 28 Jul 2013 at 8:50

  • Added labels: Milestone-Release-1.5
  • Removed labels: Milestone-Release-1.4
Original comment by `m...@tobischaefer.com` on 28 Jul 2013 at 8:50 - Added labels: **Milestone-Release-1.5** - Removed labels: **Milestone-Release-1.4**
GoogleCodeExporter commented 2015-04-04 16:12:30 +00:00 (Migrated from github.com)
This issue was closed by revision 86edcaac33b0.

Original comment by interf...@p3k.org on 22 Mar 2015 at 4:23

  • Changed state: Fixed
``` This issue was closed by revision 86edcaac33b0. ``` Original comment by `interf...@p3k.org` on 22 Mar 2015 at 4:23 - Changed state: **Fixed**
GoogleCodeExporter commented 2015-04-04 16:12:31 +00:00 (Migrated from github.com)
This issue was closed by revision 95d3a7f6cb5c.

Original comment by interf...@p3k.org on 25 Mar 2015 at 10:32

``` This issue was closed by revision 95d3a7f6cb5c. ``` Original comment by `interf...@p3k.org` on 25 Mar 2015 at 10:32
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
antville/antville#64
No description provided.