[11:02:37] [1/2] wmf commons isn't allowed? [11:02:37] [2/2] https://cdn.discordapp.com/attachments/1006789349498699827/1565319942788620359/image.png?ex=6ae4794c&is=6ae327cc&hm=41b2715b48428cd5867a716baf004cc41e3c287084faa15f7127c4f2839ad42a& [11:06:36] i think it's less so wmf Commons and more the raw js [11:06:44] could be wrong tho [11:09:55] @posix_memalign I don't think this should happen? [12:45:58] -# wonder had we enabled extended csp for wmf projects yet... [12:53:41] wmf projects are definitely in the CSP [12:53:45] it might not be in script src though [14:02:57] [1/2] Which wiki is this? Meta? [14:02:58] [2/2] When you encounter the error, can you look at console logs to see if it's a real CSP violation? [14:03:41] [1/2] Meta [14:03:41] [2/2] https://cdn.discordapp.com/attachments/1006789349498699827/1565365508424081481/image.png?ex=6ae4a3bc&is=6ae3523c&hm=5b2cc491779c93546b94be2b13d89c7ff427ba4e35bfd4664767b0ebd14e95e8& [14:04:08] [1/4] translation: [14:04:08] [2/4] ``` [14:04:09] [3/4] Content-Security-Policy: The page's settings blocked the loading of a resource (default-src) at https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-Hotcatcheck.js&action=raw&ctype=text/javascript. It violates the following directive: "default-src 'self' https://.miraheze.org https://.wikitide.org https://*.wikitide.net" [14:04:09] [4/4] ``` [14:05:00] Firefox 158.0.1 [14:07:25] [1/2] Hmm. This is very odd because usually requests don't go through the default-src. Can you go to the network tab to make sure we are seeing the same CSP? [14:07:25] [2/2] https://cdn.discordapp.com/attachments/1006789349498699827/1565366446224314581/image.png?ex=6ae4a49b&is=6ae3531b&hm=291ce2a9e164ba6f3d8e43a6771511f67ba17e626042a9d3eeb3684f666aacca& [14:13:58] It stopped reproducing when I went to check just now. It is really strange. for now,I will report back again once I am able to extract the reproduced request. [15:08:28] I think you might be on a Cloudflare-cached page, hence your not getting the `script-src` CSP headers like you were expecting [15:09:36] cloudflare should cache CSP headers though [15:12:58] Anecdotally I've had on a few occasions hit external requests with missing Access-Control- headers which I later realized was because the response was fetched from Cloudflare and not the real wiki sites. (Adding since the Access-Control- notices were raising a few eyebrows) Could just be incidental to what's happening here tho. [17:22:19] I can't repro either on edit pages, if you get a clean one let me know! [17:22:39] If you don't see the popup, could you also check if there's anything in the console regardless? [18:05:07] Hi, all. I was looking at Miraheze's CSP and noticed it has the `unsafe-inline` directive in `script-src`. What's the rationale for doing this if Wikimedia can live without it? Has there been any recent effort to check what could break if it were to be removed? [18:07:09] [1/2] Miraheze also works whenever it feels like it. Yeah, I tried refreshing it and cleared some cache the other day, but it only works whenever it feels like it now. [18:07:10] [2/2] https://cdn.discordapp.com/attachments/1006789349498699827/1565426783569051668/image.png?ex=6ae4dccd&is=6ae38b4d&hm=0ae8151af7a3f42409bf0ca7508baa89ba09f37c9265eb3caeae9e1b502983f1& [18:07:37] I'll fix this soon. [18:08:30] fail2ban is acting up. You must have got rate limited more than 20 times in 10 minutes. [18:08:48] You talking to me? [18:08:55] Yes [18:09:39] Aha! So it wasn't being caused by my browser at all. [18:09:49] Nope. [18:09:58] Likely caused by scripts or something being loaded that are giving you errors and fail2ban takes that as suspicious activity and bans you for an hour. [18:11:17] That explains everything. [18:16:33] And yes, it seems like I was indeed rate-limited more than 20 times in 10 minutes, which explains the sudden error screen to pop up. [18:17:37] Thats a good question [18:18:25] Btw, I am not bringing this up due to fear of some hypothetical risk. I just came to know WMF are not vulnerable to something in MW core (but we are) because of their CSP which obviously makes fixing it less of a priority for them. [18:46:00] please [19:46:35] Do you mind making a task for that? We should probably review it but it'll probably get lost if no task. [19:46:46] I left a comment. [19:53:55] Thanks! Removed the comments [19:56:29] This was raised https://discord.com/channels/407504499280707585/1556072613669769216/1556157952463736854 [19:57:07] It may be best to raise these on Phorge as new issue [19:59:03] https://www.mediawiki.org/wiki/Manual:$wgCSPHeader#As_an_anti-XSS_measure but ig that hasn't been checked recently [20:03:13] A theoredical idea I had but didn't mention was hashing all scripts that come from ResourceLoader or external sources, adding strict-dynamic and dropping the URLs in script-src but I don't have enough technical knowledge to know if that would be viable. I will poke around upstream some more... [20:06:18] Thanks I'll merge soon. [20:06:34] Thanks so much! [20:55:32] I think WMF wikis do have `unsafe-inline`, it's just placed near the end [20:56:47] [1/2] E.g. the initialization script uses an inline `