-
annevk
TIL: Chrome/Safari block style sheets without an ok status...
-
MikeSmith
annevk: non-2xx status you mean?
-
MikeSmith
they won’t follow 3xx’s?
-
annevk
MikeSmith: at the point where the relevant algorithm gets a response, redirects have been handled
-
croraf
When rendering an <object> element I would need to set the Authorization header to be used for fetching its data. Is this possible to do "directly"?
-
annevk
I'm not sure I understand the question, but I'm pretty sure the answer is no
-
croraf
What is not clear in the question? annevk
-
croraf
I have <object data='
my.url.com/path' />
-
croraf
This will make a request for the object (a pdf) to this url. But the url won't allow unauthorized requests.
-
croraf
So in the request additional headers should be specified.
-
croraf
The <image src='...' > is a similar example that I saw people are struggling with.
-
croraf
Is this possible? If it is not possible why not add this capability to the standard?
-
annevk
I think everyone removed that (you could use the username/password fields of a URL) because it would allow for dictionary attacks
-
MikeSmith
annevk: so what does “without an ok status” mean? what other status is there that would not also cause all browsers to not load the stylesheet either?
-
annevk
MikeSmith: Firefox applies a style sheet whose status is 600
-
annevk
MikeSmith: can I rename the default branch on whatwg/misc-server?
-
croraf
annevk, what do you mean by "everyone removed that", you mean every browser? does this mean some browsers supported something like that?
-
annevk
yes
-
croraf
Why not add to the standard to add some header fields to the img or object elements?
-
croraf
would really come handy in situations like this, and a lot of people are wondering this over the internet
-
andreubotella
As annevk said, letting some script on some random website manipulate the Authentication header would be a big security risk
-
gsnedders
annevk: IIRC Opera blocked everything !ok as part of the cross-origin stylesheet snooping fixes, IIRC
-
annevk
gsnedders: well, they didn't standardize it
-
gsnedders
annevk: hence WebKit/Blink (quite possibly pre-fork) blocking them doesn't seem super surprising?
-
gsnedders
annevk: none of that cross-origin protection stuff was standardised for a long time after, AFAIK :|
-
gsnedders
and wasn't there some quirks mode scoping of some of it, at least the text/css check, originally?
-
annevk
The main things about being strict on text/css has been standardized for a long time
-
gsnedders
(this is CVE-2010-0654 I'm referring to)
-
annevk
So if !ok was part of that I would have expected that to have come up, but it hasn't and Firefox doesn't implement it
-
croraf
andreubotella, annevk how would it be a security risk, and what does it have to do with dictionary attacks?
-
croraf
What does allowing Authentication header have anything to do with a dictionary attack?
-
andreubotella
-
andreubotella
I'm not actually sure that img.decode works that way – this is an example, not a proof of concept
-
croraf
And what possible workaround offers protection by such attacks?
-
andreubotella
I always confuse atob and btoa
-
croraf
This is silly I think. Why is having Authorization header in the image making site less secure than not having.
-
andreubotella
croraf: the point is not having the header, it's letting scripts from other sites modify it
-
croraf
An attacker can try dictionary attacks on everything, it can try to access the same resource using fetch and with dictionary attack.
-
andreubotella
huh, right
-
andreubotella
with fetch probably not because of cors
-
andreubotella
but an attacker could use any non-browser http client
-
Domenic
This is the usual problem
-
Domenic
You cannot use fetch to access internal (e.g. intranet) resources, because of CORS
-
Domenic
You can use <img> to do so
-
croraf
I see.
-
Domenic
So <img> with arbitrary headers can be used for attacks on intranets
-
croraf
Why is cors not applied to images?
-
Domenic
Because it wasn't in Netscape 1.0 :(
-
andreubotella
"don't break the web" is an important principle, and that means if something used to work, it must keep working unless the risks would be huge
-
Domenic
Arguably the risks are pretty bad these days, but we've gone with less strict mitigations than full CORS. E.g. CORB is such a mitigation.
-
gsnedders
annevk: oh,
trac.webkit.org/changeset/72743/webkit might be the change that made this happen in WebKit, which makes it look accidental?
-
annevk
gsnedders: isn't that for images? Pretty sure that it's important to ignore status there
-
gsnedders
annevk: it changes WebCore/loader/cache/CachedResource.h and WebCore/loader/loader.cpp to make < 400 a failure by default, except where things opt-in to it being okay (like images)
-
andreubotella
Domenic: with "these days" you mean because of Spectre, right?
-
gsnedders
annevk: basically anywhere that didn't explicitly check "has an error occured" started being strict about this
-
annevk
gsnedders: I guess that means I should check media as well, at least for ORB purposes
-
Domenic
andreubotella: indeed
-
annevk
gsnedders: there's a bunch of other things like text tracks that might then also need to be checked, but I care less about those
-
croraf
I still need slight clarification. So scripts on website A loaded from any origin can access the <image>. Or the issue is that scripts from any origin can create the <image> element with some URL and access that data?
-
andreubotella
croraf: some of the CORS-related restrictions that were put on the <img> element means you can't access the contents of the image from a website in a different origin, because those capabilities were only added after CORS, but you can see if the image loads or not
-
andreubotella
so if you can change the Authorization header, just create an <img> element in any origin that points to a resource in the intranet, and see if it loads
-
annevk
Domenic: are there server aspects that depend on the default branch name? Or would that all be documented in misc-server in which case I should find it shortly?
-
Domenic
annevk: my guess is if you do a full-text search on misc-server for "master" you'll find all such dependencies.
-
annevk
great
-
Domenic
(assuming you are only talking about renaming misc-server)
-
annevk
Domenic: I'm talking about renaming all repos, but I'm also grepping all repos
-
annevk
Domenic: so the main question is if we have stuff that's outside repos I suppose
-
croraf
andreubotella, how can you see that it loads?
-
Domenic
annevk: OK, I can't think of anything outside repos then. We'll see...
-
andreubotella
croraf: my example was using the img.decode() method, that I believe returns a promise that rejects if the image doesn't load. but you can also listen for an "error" event
-
annevk
If anything breaks down it should be easy to fix, not planning on switching today though
-
annevk
Maybe Tuesday would be a good day after we get the RDs out
-
croraf
andreubotella, I see
-
croraf
I'm also confused now with this <object> element, it loads a document in my example, but I cannot apply Network latency in Chome devtools to it.
-
croraf
<object type='application/pdf' data={url} />
-
croraf
I'm so confused with this <object_
-
andreubotella
croraf: <object> and <embed> used to be elements that allowed you to integrate plugins like flash into a page
-
croraf
So I should use Iframe for pdf's?
-
andreubotella
yeah
-
croraf
:thumbs-up:
-
croraf
I mean I know there are subtle differences between the three.
-
andreubotella
see
whatwg/html #6003, which will make object and embed more similar to iframe now that flash is deprecated
-
croraf
I'm wondering if the latency will be applied on the iframe
-
croraf
it is not :(
-
andreubotella
that sounds like a chrome devtools issue, rather than something the spec would require
-
croraf
yes
-
croraf
Can I apply custom headers to Iframe, I guess not :( ?
-
croraf
-
croraf
Damn, thats from 2012, and still open
-
croraf
But even on FF it is not throttled
-
andreubotella
annevk: I think I'll file a PR for
whatwg/html #6247 and see what the folks from the different browsers think
-
annevk
andreubotella: sounds reasonable, unfortunate that people are not more proactive, but that's pretty common I'm afraid
-
» annevk hits that all the time
-
annevk
Domenic: if you're okay with it I think I'm also happy to switch tomorrow
-
annevk
Domenic: it doesn't seem like we have many dependencies on the default branch name so all the PRs have been rather straightforward
-
annevk
Domenic: misc-server doesn't need updating at all; participate.whatwg.org does though
-
annevk
And whatwg.org of course
-
Domenic
annevk: sounds good to me
-
annevk
Domenic: cool, I think I'll do it around this time and then watch the fireworks for a one or two hours, assuming you don't find anything problematic
-
croraf
Is there any way to put <iframe> into loading state?