Closed
Bug 174984
Opened 24 years ago
Closed 24 years ago
Prefetch requests should send Referer [was: Make Link prefetching work only with pages on the same server]
Categories
(Core :: Networking: HTTP, defect, P2)
Core
Networking: HTTP
Tracking
()
VERIFIED
FIXED
mozilla1.2final
People
(Reporter: robmv, Assigned: darin.moz)
References
Details
(Keywords: topembed, Whiteboard: [snap])
Attachments
(1 file, 1 obsolete file)
|
9.92 KB,
patch
|
gagan
:
review+
bzbarsky
:
superreview+
dbaron
:
approval+
|
Details | Diff | Splinter Review |
Link prefetching implemented in Bug #12274, must only prefetch files on the same
server, or at least make it a user preference. I think that trusting page
authors about what to prefetch is not right, If I visit a page, that has a link
tag to a pronography page that my company/school etc. proxy server bans, I can
be fired if the logs shows that it was requested using my proxy user
Comment 1•24 years ago
|
||
It's already trivially possible for pages to do this, regardless of prefetching.
<iframe src="http://www.example.com/very_naughty_page" style="display:
none"></iframe>.
| Reporter | ||
Comment 2•24 years ago
|
||
Sure but the Proxy log will show that is was refered form another page. The
prefetch implementation does not send the Referer header, so the user has no way
to demostrate that this wasn't his fault
Comment 3•24 years ago
|
||
I don't see any deliberate decision in that bug not to send
document.referer; perhaps that was an oversight in implementation, and
we should send a Referer header when we prefetch?
Darin, where do we stand on document.referer?
Assignee: gordon → darin
Component: Networking: Cache → Networking: HTTP
QA Contact: tever → httpqa
| Assignee | ||
Comment 5•24 years ago
|
||
will try to resolve this bug for moz 1.2 final, one way or the other.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: mozilla1.2
Priority: -- → P2
Target Milestone: --- → mozilla1.2final
Comment 6•24 years ago
|
||
As summarized this bug should be WONTFIX, limiting sites to the same server
would prevent large distributed sites from taking advantage of the feature for
no particularly good reason. If this bug has morphed into the referrer issue
then let's change the summary -- that does sound like a bug worth fixing since
many sites protect their content by checking referrers, and it would address the
original concern of this bug.
(If possible respect the referrer-spoofing prefs, or if not pre-emptively file
bugs about not doing so.)
Comment 7•24 years ago
|
||
*** Bug 175118 has been marked as a duplicate of this bug. ***
I am told this feature is ON by default. I was also pointed to the FAQ and see
from it that you're aware that in several countries people pay per downloaded
Kb. Even more ISP's offer billing shemes in that lane. I was considering one
myself. Depending on browsing habits, this might mean one ugly surprise in
increased Internet expenses for mozilla users who are unaware of this feature.
I'll certainly do my bit to issue warnings, but need to know how to disable the
feature. Anyone?
Comment 9•24 years ago
|
||
Speaking of extra downloading, is the pre-fetching smart enough to pay attention
to the image blocking prefs? I'd hate to waste time (and money in some locales)
prefetching an image I wouldn't display anyway.
Comment 10•24 years ago
|
||
Note that in the iframe case you can see that the browser is downloading
something, in the prefetch case ... the browser will just silently download ...
indeed I don't think it's possible for the user to find out what is being
downloaded on their behalf.
| Reporter | ||
Comment 11•24 years ago
|
||
If the referer issue is changed, It would be nice to have a preference set from
which sites prefetch is enabled with this posible values: All, same server and
same domain., this way the concern expressed in comment 6 about large
distributed sites can be solved
| Assignee | ||
Comment 12•24 years ago
|
||
R.K.Aa: remember, there is a balance here. websites are not going to litter
their sites with tons of prefetch links because they probably can't afford the
server bandwidth for that. perhaps the big problem is bad sites, but as has
been said before, bad sites can already cause a lot of trouble (without your
knowledge) once you visit them. disabling prefetching doesn't protect you
against silent downloads.
dveditz: there is no way to reliably determine if a href corresponds to an image
without seeing the response headers or the image data itself. there is not
contextual information about where the href will actually appear in a page
(i.e., we don't know if it will be later referenced via an <img> tag).
james: an <iframe> can easily be hidden via the DOM, and the src of an <iframe>
can be easily changed via JS from an onLoad handler, which would cause the
<iframe> to be loaded silently without any visible changes in the browser UI.
this is how websites currently prefetch content. <link> tag prefetching
provides an explicit way of doing the same thing, and because the browser is
made aware of the fact that a site is doing prefetching, the browser can be
smart about prioritizing prefetch requests.
robert: what is most important is figuring out the default setting because
websites will base deployment of <link> prefetching on that. if by default we
disable link prefetching across domains, then link prefetching will most likely
never be used by websites to fetch content across domains. so, what good is UI
for such a pref if there is no content?
Comment 13•24 years ago
|
||
Do we need to worry about non-malicious but poorly constructed existing sites
that might inadvertently cause a lot of hits on other sites by accidentally
causing a lot of prefetching?
My guess is this won't be a problem, but I wanted to put it out there.
| Assignee | ||
Comment 14•24 years ago
|
||
yes, and that's why we need to tag each prefetch request so sites can decide to
ignore prefetch requests if it becomes a burden. if we did this and if we
included a Referer header then websites could filter out prefetch requests from
other domains if they so desired.
morphing bug summary to reflect reality ;-)
Summary: Make Link prefetching work only with pages on the same server → Prefetch requests should send Referer [was: Make Link prefetching work only with pages on the same server]
| Assignee | ||
Comment 15•24 years ago
|
||
ok, this patch causes moz to send out a Referer header when prefetching. i'm
considering only allowing prefetching when the referrer is http: because some
referring URL types are not sent as a Referer header (in fact, we only allow
sending http:, ftp:, or gopher: as Referer on a http: load).
this patch also adds a "cache-control: x-moz-prefetch" header. i'm totally up
for suggestions here... this is just my initial cut at such a header.
lastly, i made it so that we won't prefetch if the disk cache and memory cache
are set to zero size.
Comment 16•24 years ago
|
||
Darin: There is a reason I don't enable JS, so random security holes/stupidity
in JS don't bother me ... if people start exploiting it then it'll just become
another one of those many don't let JS do X stupid thing preferences.
So the fact remains that before prefetch, it was very obvious if the browser
was using the network ... which is how it should be. And it was also possible to
just hit ESC and have all network activity stop, which is also how it should be.
I'm not trying to say prefetching is bad ... there are a lot of cases where
it'll be just want everyone wants. I can imagine there are a lot where the web
page writer thinks so and gets it wrong ... but that's not any different than
them having megton images everywhere.
Keep it going to external servers if you want, but as well as passing the
referer to tell the website owner, the UI needs to tell _me_ and the UI for stop
etc. need to work.
| Assignee | ||
Comment 17•24 years ago
|
||
> Darin: There is a reason I don't enable JS, so random security holes/stupidity
> in JS don't bother me ... if people start exploiting it then it'll just become
> another one of those many don't let JS do X stupid thing preferences.
yes, you are right. disabling javascript protects the user against a lot of
stuff. and this is probably the best argument for providing a user visible pref
to disable prefetching.
> So the fact remains that before prefetch, it was very obvious if the browser
> was using the network ... which is how it should be. And it was also possible
> to just hit ESC and have all network activity stop, which is also how it
> should be.
"obvious if the browser [is] using the network" only when javascript is disabled.
> Keep it going to external servers if you want, but as well as passing the
> referer to tell the website owner, the UI needs to tell _me_ and the UI for
> stop etc. need to work.
again, with javascript enabled, the UI doesn't always inform you that something
is being downloaded and the stop button may not always be enabled. but that
said, i think it might be cool to have a little icon appear in the status bar
when the browser is prefetching documents. it could provide easy access to stop
as well as view any active prefetches.
| Assignee | ||
Comment 18•24 years ago
|
||
same patch w/ strict referrer checking. switched to sending 'X-Moz: prefetch'
request header instead of 'Cache-Control: x-moz-prefetch' -- i don't want to
trample on 'Cache-control' until we have something standardized! i also added
a security check to avoid prefetching from mailnews, which i should have done a
long time ago :(
| Assignee | ||
Updated•24 years ago
|
Attachment #103400 -
Attachment is obsolete: true
Comment 19•24 years ago
|
||
Comment on attachment 103618 [details] [diff] [review]
v2 patch
r=gagan
Attachment #103618 -
Flags: review+
Comment 20•24 years ago
|
||
Comment on attachment 103618 [details] [diff] [review]
v2 patch
r=mstoltz for security on the HTMLContentSink part.
Comment 21•24 years ago
|
||
Comment on attachment 103618 [details] [diff] [review]
v2 patch
sr=bzbarsky; please file a bug on docshell to create a reasonable replacement
for that apptype business.... What about other gecko-based apps that want that
level of security? They should not get screwed...
Attachment #103618 -
Flags: superreview+
Comment on attachment 103618 [details] [diff] [review]
v2 patch
a=dbaron for trunk checkin
Attachment #103618 -
Flags: approval+
| Assignee | ||
Comment 23•24 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•24 years ago
|
Keywords: mozilla1.0.2
| Assignee | ||
Updated•24 years ago
|
Comment 24•24 years ago
|
||
Darin, how can this be verified?
| Assignee | ||
Comment 25•24 years ago
|
||
junruh: you will need to use a packet sniffer probably or inspect server logs to
verify that a Referer header is truly being sent in prefetch requests. you'll
also need a sample page that uses prefetching. i have some samples at:
http://unagi.mcom.com/~darinf/prefetch/testcases.html
you can also use a packet sniffer to verify that we aren't prefetching from
mailnews. that can be verified by sending yourself one of the pages (that does
prefetching) from testcases.html. let me know if you need any help w/ this.
two good packet sniffers:
www.ethereal.com (gui)
ngrep.sourceforge.net (command line)
Comment 26•24 years ago
|
||
Verified based on the following. Tested on the 10/25 Win2000 trunk build. From
this page - http://unagi/~darinf/prefetch/test1.html only one of 3 images
(Screenshot1.png) should be downloaded, which was the case, and shown in the
Ethereal log.
Partial source of the test page:
<head>
<link rel=next href="http://64.130.71.9/~darinf/test/Screenshot.png">
<link rel="prefetch" href="http://64.130.71.9/~darinf/test/Screenshot1.png">
<!--
<link rel="next alternate"
href="http://64.130.71.9/~darinf/test/Screenshot2.png">
-->
<meta HTTP-EQUIV="link"
CONTENT="<http://64.130.71.9/~darinf/test/Screenshot2.png>; rel=next">
</head>
Next, I emailed myself the page, opened it in a new profile, and nothing was
prefetched, as evidenced in the Ethereal log.
Status: RESOLVED → VERIFIED
Comment 27•24 years ago
|
||
adt+ for branch, please seek drivers approval before landing
| Assignee | ||
Comment 28•24 years ago
|
||
yup, request to drivers sent last thursday.
Comment 29•24 years ago
|
||
please checkin to the MOZILLA_1_0_BRANCH branch. once there, remove the
"mozilla1.0.2+" keyword and add the "fixed1.0.2" keyword.
Keywords: mozilla1.0.2 → mozilla1.0.2+
Comment 31•24 years ago
|
||
Verified on Win2000, OSX and Linux branch
Keywords: fixed1.0.2 → verified1.0.2
Comment 32•23 years ago
|
||
unverifying for retest in 1.0.2 builds -- according to darin and barrowman
prefetching isn't working at all because this fix stumbles on bug 142135 which
was never fixed on the branch.
Keywords: verified1.0.2 → fixed1.0.2
Comment 33•23 years ago
|
||
re-verifying -- I guess just because we don't use the pre-fetched data doesn't
mean we don't send the right headers. (I unverified the wrong bug)
Keywords: fixed1.0.2 → verified1.0.2
You need to log in
before you can comment on or make changes to this bug.
Description
•