I am writing a simple webmail where I want (obviously) to display the emails.
I'm wondering if I should take any precaution while displaying HTML emails: is dumping the email content into a <div>
a security risk?
I'm guessing that yes since the email could contain anything (could it contain Javascript?). But then how should I proceed? How do other webmails do?
I'm thinking that stripping dangerous HTML tags would be a bad solution since it's impossible to think of all the cases.