Closed
Bug 49021
Opened 24 years ago
Closed 24 years ago
Parse incoming HTML msgs (Hack-Security)
Categories
(MailNews Core :: MIME, enhancement, P3)
MailNews Core
MIME
Tracking
(Not tracked)
VERIFIED
WONTFIX
M18
People
(Reporter: BenB, Assigned: BenB)
Details
I have a huge hack in my tree where I search for common threats in incomming
HTML msgs, e.g. external imgs, stylesheets, scripts etc., and remove or replace
them (so I can add a big warning per stylesheet).
If there is interest, I can add a pref (default off) for that and check it in,
assuming OK from relevant powers.
Note: This does not provide real security. I might have missed a threat. Also,
parsing the HTML source is a hack, if you compare this with the flexibility and
power the rendering engine provides (or can provide) for security. See bug 28327
for real (I hope) security.
Assignee | ||
Updated•24 years ago
|
Severity: normal → enhancement
Status: NEW → ASSIGNED
Target Milestone: --- → M18
Comment 1•24 years ago
|
||
I don't think it's worth spending time on such kludges.
Assignee | ||
Comment 3•24 years ago
|
||
If you say so...
WONTFIX.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → WONTFIX
Assignee | ||
Comment 4•24 years ago
|
||
It turns out that the bugfix would have been useful for other bug, bug 66938.
Unfortunately, I lost the change locally and didn't attach it. So, I'll roughly
describe what I did.
The HTML msgs run though libmime. In the content-handling function of the HTML
msg handler, which currently does almost nothing than just copying, I did a
search and replace for offending tags and replaced them with harmless ones. E.g.
I substituted. |<script| with |<span style="display: none" class="script"| or
|onclick| with |nil|* and similar. *(On a second thought, what did I do, if
|onclick| appeared in the content? I don't remember.)
To make my life easier, I first converted the char* to a nsString, which
provides nice replace functions.
Assignee | ||
Comment 5•24 years ago
|
||
Forgot the code-reference: function |MimeInlineTextHTML_parse_line|.
Assignee | ||
Comment 6•24 years ago
|
||
> *(On a second thought, what did I do, if |onclick| appeared in the content? I
> don't remember.)
We could check, if an open "<" is before it.
If we are talking about enabling this "hack" per default, we need to care about
holes a lot more.
Are there any cases constructable, where a |line.Find("<script"...)| would fail
to find the <script> tag?
Assignee | ||
Comment 8•23 years ago
|
||
Bug 108153 is the followup to this one and uses the main Mozilla parser, i.e. is
not a hack.
Updated•20 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•