Subject: [draft-freed-sieve-in-xml-02] Escaping "*/" In Structured Comments

From: Robert Burrell Donkin <[email-masked]>
Date: Fri, 30 Jan 2009 17:13:12 +0000

Issue
-----
No discussion is made about the merits of escaping content which will
be transformed into structured comments. For example, the following
fragment might be used to smuggle content into the script:

<displayblock><trouble>*/
if header :contains "from" "[email-masked]" {
     discard;
}
/*</trouble></displayblock>

Proposal
--------
To "4.2. Structured Comments" Add:

 If "*/" is found in the XML content, when mapped into a comment it
 would prematurely terminate that comment. Escaping of this sequence
 would often be inconvenient for processors. Editors SHALL NOT include
 "*/" within displayblock, displaydata or foreign markup. Processors MAY
 regard documents containing "*/" in foreign markup, displayblock
 or displaydata as invalid.

To "5. Security Considerations" Add:

 Little effective protection can be offered by a processor to the user
 of a malicious editor.

Rationale
---------
Only limited protection can be offered to the user by a processor against
a malicious or buggy editor. The effectiveness of that protection should
b weighed against the implementation complexity. Escaping is inconvenient
for processors and introduces complexity for very little security gain.
Editors control the meta-data they wish to insert and it is simpler just
to ensure that this meta-data does not contain "*/".

---

From: Philip Guenther <[email-masked]>
Date: Fri, 30 Jan 2009 11:09:14 -0800

On Fri, 30 Jan 2009, Robert Burrell Donkin wrote:
...
>  or displaydata as invalid.

Ick.  Wouldn't it be better to tell processors to generate '#' style 
comments instead of /*...*/ style comments, at least in that case?

>  Little effective protection can be offered by a processor to the user

How is this specific to sieve-in-xml and not just a general consideration 
for anyone using any editor for any purpose?

Philip Guenther

---

From: Robert Burrell Donkin <[email-masked]>
Date: Fri, 30 Jan 2009 19:52:39 +0000

> comments instead of /*...*/ style comments, at least in that case?

better for some editors but worse for some processors and line endings
would also need some thought. this would be tricky to implement in
XSLT (say).

i think it not unreasonable to expect sieve editors to adopt a
meta-data schema that plays well with Sieve

> for anyone using any editor for any purpose?

yes, it is a general consideration. i thought the rest of that section similar.

- robert