Skip to content
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

Escape HTML #16

Merged
merged 1 commit into from
Aug 21, 2013
Merged

Escape HTML #16

merged 1 commit into from
Aug 21, 2013

Conversation

davidfou
Copy link
Contributor

To prevent injection, the content is inserted with jquery.text instead of jquery.html.

@bugch3ck
Copy link

This fixes a DOM XSS vulnerability. The truncate method decodes HTML-encoded entities. The decoded data is then written back to the DOM without HTML-encoding. This may introduce new XSS vulnerabilities in applications following application security best practices.

Test case using jQuery 1.8.3 and jQuery-truncate (Jun 03, 2013 release)
http://jsfiddle.net/GAGFV/

Test case using jQuery 1.8.3 and jQuery-truncate (dfournier's fix_escape_html branch)
http://jsfiddle.net/GAGFV/1/

Best regards,
Jonas Vestberg

tbasse added a commit that referenced this pull request Aug 21, 2013
@tbasse tbasse merged commit ed59e7c into tbasse:master Aug 21, 2013
@tbasse
Copy link
Owner

tbasse commented Aug 21, 2013

Thanks to both of you! @DFournier for fixing this and @bugch3ck for bringing it up again after the pull request slipped my attention.

@davidfou
Copy link
Contributor Author

Thanks for your comment @bugch3ck. I should have pointed out the problem like you did earlier.

@tbasse my pleasure to contribute !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants