Closed
Bug 718486
Opened 14 years ago
Closed 14 years ago
Make Account Provisioner XML handler only request the XML once.
Categories
(Thunderbird :: Mail Window Front End, defect)
Tracking
(thunderbird11 fixed)
RESOLVED
FIXED
Thunderbird 12.0
Tracking | Status | |
---|---|---|
thunderbird11 | --- | fixed |
People
(Reporter: mconley, Assigned: mconley)
References
Details
(Whiteboard: [secr:dchan])
Attachments
(1 file, 3 obsolete files)
19.44 KB,
patch
|
standard8
:
approval-comm-aurora+
|
Details | Diff | Splinter Review |
This is a pretty serious bug that made itself known once we started live-testing against some of our account providers.
For one thing, the old code only considered XML where the contentType exactly matched "text/xml".
Next, it looks like we requested the XML twice - once to determine the content type, and a second time in order to invisibly parse / deal with the XML content.
That doesn't work if our providers dynamically generate the XML, and don't allow us to re-request it.
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → mconley
Assignee | ||
Comment 1•14 years ago
|
||
Here's my first pass at a solution. This is quite extensive for something we'd likely want to land on Aurora, but unfortunately, I don't think this can be helped.
Instead of stopping the request as soon as we detect the contentType, and re-requesting, I use the following approach:
1. Once the order form tab opens, wire up an observer to watch for any and all HTTP requests going in and out of Thunderbird (this observer is automatically unregistered once the order form tab is closed)
2. For each HTTP request, watch for one where the contentType *starts* with the string "text/xml". When we see one, ensure that the request is associated with the order form tab, and then attach an nsITraceableChannel listener to the request
3. The nsITraceableChannel listener does the job of assembling the XML and trying to parse it.
I have to stress that this is the first time I've ever had to work with nsITraceableChannel, and the input/output streams/buffers in this code. Most of this work is based upon examples found in http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/, Firebug, and this file: http://mxr.mozilla.org/comm-central/source/mozilla/netwerk/test/unit/test_traceable_channel.js
Assignee | ||
Comment 2•14 years ago
|
||
Fixing a typo, putting back a log message that I accidentally chopped out.
Attachment #588950 -
Attachment is obsolete: true
Assignee | ||
Comment 3•14 years ago
|
||
I should also point out that with this patch, I can successfully get an account from Hover.
Comment 4•14 years ago
|
||
Will this need security review ?
Assignee | ||
Comment 5•14 years ago
|
||
Comment on attachment 588953 [details] [diff] [review]
Patch v2
Hey Blake - let me know if I should redirect this review request elsewhere.
Attachment #588953 -
Flags: review?(bwinton)
Assignee | ||
Updated•14 years ago
|
tracking-thunderbird11:
--- → ?
Assignee | ||
Comment 6•14 years ago
|
||
Ludo:
I'm unsure, but I think I'm leaning towards "yes".
-Mike
Updated•14 years ago
|
Keywords: sec-review-needed
Assignee | ||
Updated•14 years ago
|
Attachment #588953 -
Flags: review?(bwinton) → review?(dbienvenu)
Comment 7•14 years ago
|
||
Comment on attachment 588953 [details] [diff] [review]
Patch v2
I can't test this, but it looks OK in general - but the scoping issues with the services includes are new and surprising to me. Are there other examples in the code of that happening?
Attachment #588953 -
Flags: review?(dbienvenu) → review+
Assignee | ||
Comment 8•14 years ago
|
||
(In reply to David :Bienvenu from comment #7)
> Comment on attachment 588953 [details] [diff] [review]
> Patch v2
>
> I can't test this, but it looks OK in general - but the scoping issues with
> the services includes are new and surprising to me. Are there other examples
> in the code of that happening?
They were a surprise to me too. I'm not sure why they happen, I just know that they do. :/ It might have to do with the Account Provisioner running within a modal dialog, and therefore possibly having a scope / event loop completely separated from the main one.
Ludo marked this bug as sec-review-needed...should I just hold on committing this until we receive a security review?
Assignee | ||
Updated•14 years ago
|
Attachment #588953 -
Flags: approval-comm-aurora?
Comment 9•14 years ago
|
||
(In reply to Mike Conley (:mconley) from comment #8)
> Ludo marked this bug as sec-review-needed...should I just hold on committing
> this until we receive a security review?
We should probably talk to some of the security guys to get a faster review adding Curtis to the bug list.
Assignee | ||
Comment 10•14 years ago
|
||
Is there anything else I need to do in order to receive a security review on this?
Comment 11•14 years ago
|
||
Comment on attachment 588953 [details] [diff] [review]
Patch v2
Review of attachment 588953 [details] [diff] [review]:
-----------------------------------------------------------------
::: mail/components/newmailaccount/content/uriListener.js
@@ +105,2 @@
>
> + if (contentType.indexOf("text/xml") != 0)
nsIHttpChannel doesn't do case-normalization of header values from what I know. This may not be an issue in practice if the current service providers return a lowercase Content-Type.
![]() |
||
Updated•14 years ago
|
Whiteboard: [secr:dchan]
Comment 12•14 years ago
|
||
The security review will be for bug #686347 . There isn't any further security work that needs to be done for this particular bug.
Mike: Can you address comment 11 ?
It may be a potential functionality bug but shouldn't have security implications.
Keywords: sec-review-needed
See Also: → 686347
Assignee | ||
Comment 13•14 years ago
|
||
Thanks for pointing that out, dchan. I'm running the content type through toLowerCase() first now, before checking for text/xml at index 0.
Attachment #588953 -
Attachment is obsolete: true
Attachment #588953 -
Flags: approval-comm-aurora?
Assignee | ||
Comment 14•14 years ago
|
||
I've taken the security review comments from bug 686347, and made the corrections in this patch.
I think this is ready to land on Aurora now.
Attachment #591631 -
Attachment is obsolete: true
Attachment #592263 -
Flags: approval-comm-aurora?
Assignee | ||
Comment 15•14 years ago
|
||
Committed to comm-central as http://hg.mozilla.org/comm-central/rev/5608d36000c9
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Attachment #592263 -
Flags: approval-comm-aurora? → approval-comm-aurora+
Assignee | ||
Comment 16•14 years ago
|
||
Committed to comm-aurora as http://hg.mozilla.org/releases/comm-aurora/rev/070572a7da3d
status-thunderbird11:
--- → fixed
tracking-thunderbird11:
? → ---
Target Milestone: --- → Thunderbird 12.0
Updated•13 years ago
|
Keywords: sec-review-complete
Updated•13 years ago
|
Flags: sec-review+
You need to log in
before you can comment on or make changes to this bug.
Description
•