W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2018

Re: [csswg-drafts] [css-syntax] Consider disallowing NULL code points in stylesheets

From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
Date: Wed, 27 Jun 2018 16:48:29 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-400750621-1530118108-sysbot+gh@w3.org>
The Working Group just discussed `Consider disallowing NULL code points in stylesheets`.

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: Consider disallowing NULL code points in stylesheets<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/2757<br>
&lt;fantasai> Tab's position: https://github.com/w3c/csswg-drafts/issues/2757#issuecomment-396337601<br>
&lt;dael> florian: The issue is that having a null codepoint in the middle of stylesheet is not useful in general, but is a potential security risk. Could single something like a code extract. Therefore we should kill the stylesheet somehow. How and how much should be discussed. Poss reject entire stylesheet or a milder version<br>
&lt;dael> florian: Going further I'm not the right person, but that's high level.<br>
&lt;dael> hober: Current interop?<br>
&lt;dael> florian: I believe not. Current is that browsers discard, but how they recover doesn't seem interop.<br>
&lt;dael> florian: There are mentions of differences in the issue. HOw different I'm not sure<br>
&lt;dael> Rossen_: I ran through all of these locally. I was seeing interop between Edge Chrome and FF on all the test cases in the issue<br>
&lt;dael> Rossen_: Curious to hear from dbaron<br>
&lt;dael> dbaron: Sounds like emilio has but I haven't<br>
&lt;dael> bradk: Any idea how often this is in the wild as possibly a mistake?<br>
&lt;dael> Rossen_: Not sure we have such data<br>
&lt;dael> Rossen_: If you're asking how often people try and spoof browsers it's quite often and this is a potential attach vector, but this is more speculative.<br>
&lt;dael> florian: Question is how often do we have almost valid style sheets that were meant to be read.<br>
&lt;dael> Rossen_: Don't think we can disambiguate between<br>
&lt;dael> bradk: Concern is break working stylesheets<br>
&lt;dael> Rossen_: My understanding is you could have actual end user effects<br>
&lt;dael> bradk: Will this break websites?<br>
&lt;emilio> Err, present+<br>
&lt;dael> Rossen_: Potentially<br>
&lt;dael> plinss: Tooling injecting null bites is fairly low unless they'll already be present<br>
&lt;dael> florian: Current possible interop you Rossen_ observed is it reasonably safe or interop unsafe?<br>
&lt;Rossen_> http://jsbin.com/vozudorilu/edit?html,output<br>
&lt;dael> Rossen_: I won't make statements in terms of this as an attack vector. From interop, I just re-ran a variation on some test cases I observe differences here ^<br>
&lt;dael> Rossen_: In this case you join the null character. This invalidates in Chrome the entire selector. In FF and Edge we only invalidate the join part of the last selector and honor the first part.<br>
&lt;dael> Rossen_: Result is after joining selector with null Edge and FF get red and black default in Blink<br>
&lt;dael> florian: I get black in FF<br>
&lt;dael> Rossen_: Well...I don't know version.<br>
&lt;dael> florian: 61. Updated today<br>
&lt;dael> Rossen_: I'm on 60. Let me take the 61 update<br>
&lt;dael> emilio: [something about nightly]<br>
&lt;dael> Rossen_: So there is non-interop<br>
&lt;dael> Rossen_: FF 61 I still see red<br>
&lt;emilio> s/[Something about nightly]/Nightly shows red to me/<br>
&lt;dael> fremy: I see red in every browser<br>
&lt;dael> Rossen_: Instead of debating this test case. Let's go back to the behavior in issue.<br>
&lt;dael> florian: Safe proposal is if you see any null descard entire stylesheet<br>
&lt;dael> fantasai: 3 proposals<br>
&lt;dael> fremy: I don't see doing that. I don't see why a null bite is a security issue. I don't see why discard an entire stylesheet<br>
&lt;dael> florian: One nul bit not dangerious. no known use case but can be sign of attack<br>
&lt;dael> fremy: Any JS is sign of potential attack.<br>
&lt;dael> Rossen_: That's not only option. it's A option.<br>
&lt;dael> fantasai: Otehrs were terminate stylesheet at that point. 3rd was auto invalidate any construct with that null according to normal invalid rules<br>
&lt;fantasai> e.g. invalidate declaration, or style rule, or whatever construct we would normally invalidate<br>
&lt;dael> Rossen_: 3rd makes most sense. Finding the closest adjacent or encompasisng rule/select/whatever and discard that is most intuative.<br>
&lt;bradk> Option 3 seems most reasonable to me<br>
&lt;gsnedders> I agree with fremy, given we don't do the same in HTML.<br>
&lt;dael> Rossen_: 2nd is a variation of that and almost as bad as discard entire stylesheet<br>
&lt;dael> plinss: Another option is ignore null and pretend not there. Rossen_ you seem to favor terminate existing construct, but that's most dangerious for security because ti means you have to pass it through. If you ignore the null or terminate or discard you can do that at preparse and then you're safe.<br>
&lt;liam> +1 to plinss<br>
&lt;dael> fremy: Still dont' understand premise null bit is unsafe<br>
&lt;dael> florian: It may be a tell tale sign something else is being attempted. If someone is dumping content of memory you'll see null bits<br>
&lt;dael> plinss: Risk is you have some code that takes entire construct with the null in the middle and others that terminate the string and you're opening to security vulnerabilities.<br>
&lt;dael> Rossen_: Thinking a bit more I like the 4th option to ignore null codepoints during preparse and curate the stylesheet as if there were no code points.<br>
&lt;dael> florian: If you dump memory without nulls you can still export that to some server.<br>
&lt;fantasai> plinss, wouldn't handle Tab's concern in 1st paragraph of https://github.com/w3c/csswg-drafts/issues/927<br>
&lt;gsnedders> q+<br>
&lt;dael> gsnedders: As presedent html replaces null with +fffd and that's better then drop<br>
&lt;gsnedders> ack<br>
&lt;dael> plinss: [missed]<br>
&lt;gsnedders> Zakim: ack<br>
&lt;gsnedders> q-<br>
&lt;dael> florian: Then not dealing with security problem. If you keep null bites you can keep them on server.<br>
&lt;liam> s/bites/bytes/<br>
&lt;dael> fremy: I don't buy it. I think it's pointless. If you're able to dump memory you can literally do a JS script. The whole premise makes no sense. I see no reason to not use syntax. Browsers can impl css syntax and do what it says. I don't see why do something special because then you create edge cases.<br>
&lt;gsnedders> s/html replaces null with +fffd/html replaces null with +fffd in some cases/<br>
&lt;dael> fremy: I think premise of thread is not based on something real. I haven't seen anyone from security team say it's real. If no one from security says it's a problem we should fix I don't think we should make any change to algo. There's no strong indication of a problem. If we agree to make a change from security we need someone from security<br>
&lt;dael> florian: How do we handle this? If we say a browser has a known vulnerability on this how do they discuss it with us?<br>
&lt;dael> gsnedders: Member only<br>
&lt;dael> florian: Is that private enough?<br>
&lt;dael> liam: [missed]<br>
&lt;liam> [there's also a team-only list]<br>
&lt;dael> Rossen_: We can either postpone to F2F and discuss in person to see all the concerns and options. Or at least we can record the preference of the listed options as at least a proposed resoltuion<br>
&lt;dael> Rossen_: 1 drop entire ss 2 drop ss after null 3 drop encompassing selector around null 4 drop null during pre process<br>
&lt;dael> Rossen_: That's what's on the table. Only remaining question is do we want to resolve on any of those?<br>
&lt;dael> ??: Also option of no change<br>
&lt;dael> Rossen_: Yes<br>
&lt;dael> fantasai: I would say we've had a good discussion. List the options in the issue, request TAG review, give people time to think.<br>
&lt;dael> Rossen_: Exactly. That's why I wanted to repeat the options.<br>
&lt;dael> Rossen_: Doesn't sound like we'll resolve. Discussion worth capturing. Potentially with TAG assistance or at F2F we can resolve<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2757#issuecomment-400750621 using your GitHub account
Received on Wednesday, 27 June 2018 16:48:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 27 June 2018 16:48:34 UTC