-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better XSS protection #1056
Merged
rjmackay
merged 3 commits into
ushahidi:develop
from
rjmackay:html-purifier-xss-protect
Apr 16, 2013
Merged
Better XSS protection #1056
rjmackay
merged 3 commits into
ushahidi:develop
from
rjmackay:html-purifier-xss-protect
Apr 16, 2013
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Add HTMLPurifier library (LGPL) * Add helper functions to html helper * Set default encoding header to UTF-8 * Make sure the doctype is the same everywhere (admin/members/frontend) * Remove use of strip_tags() and htmlspecialchars() * Replace vanilla htmlentities with html::escape() - make sure no one forgets the UTF-8 * Remove _csv_text() fn - no longer used and was using strip_tags()
Closed
thinking about this a little more still need to add a note in the UI with a list of allowed tags.. ping @kamaulynder can you review this? |
Maybe share this with our security working group? |
For any other tags or iframes, these can be added when needed. Otherwise, it looks good. |
rjmackay
added a commit
that referenced
this pull request
Apr 17, 2013
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this pull request
Apr 23, 2013
rjmackay
added a commit
that referenced
this pull request
Apr 23, 2013
This avoids errors if upgraders don't update config.php Conflicts: application/hooks/2_settings.php
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this pull request
Apr 23, 2013
This avoids errors if upgraders don't update config.php
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this pull request
Apr 23, 2013
Conflicts: themes/default/views/reports/list.php
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this pull request
Apr 23, 2013
This avoids errors if upgraders don't update config.php
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this pull request
Apr 30, 2013
Conflicts: themes/default/views/reports/list.php
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this pull request
Apr 30, 2013
This avoids errors if upgraders don't update config.php
rjmackay
added a commit
that referenced
this pull request
May 1, 2013
This avoids errors if upgraders don't update config.php Conflicts: application/i18n
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feedback appreciated.
Particularly around the range of allowed tags, current: "a[href|title],p,img[src|alt],br,b,u,strong,em,i" and iframes from trusted sources: youtube, vimeo, soundcloud
Other iframes we should allow? Other tags we should allow?
Also on names of helper fns:
html::escape()
html::clean()
html::strip_tags()