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

Need to sanitize HTML #5

Closed
jhillyerd opened this issue Oct 18, 2012 · 5 comments
Closed

Need to sanitize HTML #5

jhillyerd opened this issue Oct 18, 2012 · 5 comments
Assignees
Milestone

Comments

@jhillyerd
Copy link
Collaborator

Inbucket presently makes no effort to sanitize HTML message bodies before displaying them. Research needs to be done on best practices, if we go overboard stripping things out it will reduce the usefulness of Inbucket for developers.

@takeyourhatoff
Copy link

I would recommend dumping the whole lot into a srcdoc element of a full size iframe with the sandbox attribute applied. This will prevent script execution and maintain visual fidelity of messages. The downside is you loose support for browsers that don't support srcdoc & sandbox.

@jhillyerd
Copy link
Collaborator Author

I need to keep IE compatibility, so it looks like srcdoc is out. But sandbox is supported by IE 10, so we could potentially use an iframe.

There's still the issue of resolving embedded MIME resources in HTML, so some sort of processing needs to be done eventually.

@jhillyerd jhillyerd modified the milestone: v1.2.0 Mar 2, 2016
@jhillyerd
Copy link
Collaborator Author

Right now it's looking like bluemonday is the best option: https://github.com/microcosm-cc/bluemonday

Unfortunately it doesn't allow any CSS with it's default policy; if you tune it to allow styles, they will not be stripped of XSS.

@jhillyerd
Copy link
Collaborator Author

Delaying sanitization until 1.3. 1.2.0 has enough new stuff in it, and nobody is asking for this.

@jhillyerd jhillyerd modified the milestones: v1.3.0, v1.2.0 Jan 17, 2017
@jhillyerd jhillyerd self-assigned this Dec 26, 2017
This was referenced Dec 30, 2017
@jhillyerd
Copy link
Collaborator Author

26c38b1 uses bluemonday and provides a basic tabbed UI

@jhillyerd jhillyerd added the done label Jan 7, 2018
@jhillyerd jhillyerd modified the milestones: v1.3.0, v1.2.1 Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants