Bug 29754 - Replace FrameLoadDelegate mixed content warning SPI with a single one
Summary: Replace FrameLoadDelegate mixed content warning SPI with a single one
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-25 16:55 PDT by Sam Weinig
Modified: 2009-09-29 12:54 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2009-09-25 16:55:29 PDT
We should replace the two FrameLoadDelegate mixed content warning callbacks: 

- (void)webViewDidDisplayInsecureContent:(WebView *)webView;
- (void)webView:(WebView *)webView didRunInsecureContent:(WebSecurityOrigin *)origin;
 
with a single one that notifies that a webView has become insecure.  This put the origin tracking in WebKit instead of at the App level.
Comment 1 Adam Barth 2009-09-26 00:38:53 PDT
We can do that, but the app still needs to do the origin tracking work to understand certificate errors properly.
Comment 2 Sam Weinig 2009-09-26 13:40:36 PDT
(In reply to comment #1)
> We can do that, but the app still needs to do the origin tracking work to
> understand certificate errors properly.

Interesting.  Can you elaborate briefly on this?  Perhaps we should document what the app is expected to do with these delegate methods a little better.
Comment 3 Adam Barth 2009-09-26 17:48:28 PDT
(In reply to comment #2)
> Interesting.  Can you elaborate briefly on this?

Sure.  Suppose we have two tabs open to the same HTTPS site.  In one tab, the user approves a certificate error and receives HTML over a broken certificate.  Now, we need to remove the lock icon from the other tag because the attacker can inject script into the first tab.

Similarly, suppose the user approves a certificate error for https://foo.com.  Now, later, https://bar.com includes a <script src="https://foo.com/ttt"> and the browser loads the script over a broken HTTPS connection.  Now, we need to remove the lock icon from that https://bar.com tab as well as all the others.

It's possible the best thing to do is teach WebCore about certificate errors.  That way, we can ask the WebKitClient whether to approve the bad certificate (instead of doing it via the back door in the network stack).  If we do that, we can manage the cert error state and the mixed content state together in WebCore.

> Perhaps we should document
> what the app is expected to do with these delegate methods a little better.

I can write up a short white paper about how all this stuff ought to work if that would be helpful.