google / tamperchrome

Tamper Dev is an extension that allows you to intercept and edit HTTP/HTTPS requests and responses as they happen without the need of a proxy. Works across all operating systems (including Chrome OS).
https://tamper.dev
Apache License 2.0
4.19k stars 219 forks source link

Investigate about:srcdoc errors #176

Open sirdarckcat opened 3 years ago

sirdarckcat commented 3 years ago

Some times we get debugger permission errors which freeze the extension.

sirdarckcat commented 3 years ago

Repro: go to https://www.w3schools.com/jsref/event_onscroll.asp and reload a few times, eventually all requests will be stuck in "sent"

sirdarckcat commented 3 years ago

error happens on Fetch.continueRequest of "https://www.google.com/images/cleardot.gif"

I don't see anything special in that request.

0: {name: "Accept", value: "image/avif,image/webp,image/apng,image/*,*/*;q=0.8"}
1: {name: "Cookie", value: "CONSENT=YES+ES.en+20150607-14-1; __Secure-3PSID=..."}
2: {name: "Referer", value: "https://www.w3schools.com/"}
3: {name: "User-Agent", value: "Mozilla/5.0 (X11; CrOS x86_64 13505.73.0) AppleWeb…L, like Gecko) Chrome/87.0.4280.109 Safari/537.36"}
4: {name: "sec-ch-ua", value: ""Google Chrome";v="87", " Not;A Brand";v="99", "Chromium";v="87""}
5: {name: "sec-ch-ua-mobile", value: "?0"}
sirdarckcat commented 3 years ago

Full error is Cannot access contents of url "about:srcdoc". Extension manifest must request permission to access this host.

sirdarckcat commented 3 years ago

a simpler testcase is http://evilwebsite.com/xss.php?plain_xss=%3Ciframe%20srcdoc%3E something breaks with srcdoc

sirdarckcat commented 3 years ago

this is not related to activeTab, requesting with <all_urls> fails as well.

sirdarckcat commented 3 years ago

requesting about:srcdoc permission explicitly doesnt work either

sirdarckcat commented 3 years ago

looks like a chrome bug.

sirdarckcat commented 3 years ago

seems related to https://bugs.chromium.org/p/chromium/issues/detail?id=55084 - but will create a new bug

sirdarckcat commented 3 years ago

https://bugs.chromium.org/p/chromium/issues/detail?id=1162935

sirdarckcat commented 3 years ago

https://chromium-review.googlesource.com/c/chromium/src/+/2692548 fixes this