Aggressive PDF message
Reported by
hakerh403@gmail.com,
Oct 17 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce the problem: 1. Open the attached PDF file 2. Notice the message "Focusing, please wait..." What is the expected behavior? Probably some non-blocking message should be displayed or no message at all should be displayed. What went wrong? I'm writing an enhanced extension for blocking ads. My goal is to create an extension which should be able to handle very aggresive ads where adblock and adblock plus are helpless. However, I just noticed an issue (or feature?) which appears only in Chrome and seems to be impossible to prevent. The website I found this PDF on uses a very weird technique to prevent a user from closing advertisement window. When a user tries to close the window, it immediatelly opens that window again and also creates a few iframes containing the attached PDF. Unlike the `alert` or `prompt` messages, this message doesn't seem to provide a way for user to block it. The file is obviously created by AdSupply organization (as it can be seen in the file itself) and its purpose is just to abuse the appearance of the message in Chrome in order to prevent closing the ads. They combine iframes and `window.open` to create a chain of un-closable messages and the only way I found to close the website is to kill `chrome.exe` from task manager. This is probably some PDF exploit. I must admit that I don't know much about PDF specification, but I noticed that even Firefox complains about it saying that "This file may not be displayed correctly". But Firefox displays one message per tab and doesn't repeat it. Also, unlike Chrome, Firefox doesn't block DOM interactions while the message is visible. No Adobe or other PDF viewer extensions are used. This is related to the native Chrome's PDF viewer. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 61.0.3163.100 Channel: stable OS Version: 6.3 Flash Version: /
,
Oct 18 2017
Able to reproduce the issue on the reported chrome version stable 61.0.3163.100 and on the latest canary 64.0.3243.0 on Windows10, Mac 10.12.6 and on Ububtu 14.04 with the steps mentioned in comment#0. As the issue is seen from M50(50.0.2634.0) considering it as non-regression and marking as untriaged.
,
Oct 18 2017
,
Oct 18 2017
,
Oct 18 2017
This PDF alone just uses JavaScript to show a dialog, which is a feature of PDF. PDFs like this are often an important piece of abusive behavior, allowing a page to activate itself while still being able to dismiss the dialog. However, this is common. What would be interesting is the larger picture, what's happening around the PDF to make windows uncloseable. This PDF, alas, doesn't help.
,
Oct 19 2017
When I close the alert, it doesn't pop up again. I just see a PDF saying "Copyright AdSupply 2016", and that's it. It can be closed, it doesn't pop up other windows.
,
Oct 19 2017
Right. The PDF alone has a one-time alert. That's why we need to know the entire picture, and how the PDF is used in combination with other parts to be abusive.
,
Oct 19 2017
I found a way to prevent this message using my extension. I blocked all requests whose mime type is pdf and I overrided `document.appendChild` (using `window.Proxy`) to reject all attempts of creating an iframe whose type is "application/pdf". As answer to your questions, your are right, the PDF displays only one message and doesn't pop up new windows. However, another javascript (which created the iframe) creates a new frame on each page load, so it pops up every time the url is changed. The problem with opening a new window is solved by overriding `window.open` method (using extension) or by blocking pop-ups. But, why even need for the message? What is the reason Chrome introduced this message?
,
Oct 19 2017
"But, why even need for the message? What is the reason Chrome introduced this message?"
I don't understand your question.
This is a PDF that runs JavaScript to show a dialog. The message shown in the dialog is a message provided by the PDF.
It's as if a web page called "window.alert('hi')". A dialog saying "hi" would show up. Chrome didn't introduce the message "hi". The web page is showing the message.
Unless I'm misunderstanding your question.
,
Oct 19 2017
What is happening here is that this PDF is calling the JavaScript window.alert() function to show an alert. The string displayed is not a Chrome string. Imagine a web page that said "onload='javascript:window.alert("yo!")'". You would see a dialog with the words "yo!" but you wouldn't say "hey, Chrome, why are you saying the string 'yo'?" Chrome is displaying the message on behalf of the webpage. Same thing here. Chrome is displaying the message "Focusing, please wait" on behalf of the PDF.
If TYL that PDFs can contain and run JavaScript, my sympathies.
Why do websites use PDFs to display seemingly nonsensical JavaScript alerts that say things like "loading"?
Alert dialogs activate the tabs showing them. If a tab shows a JavaScript alert, it is brought to the front. Now, the JavaScript window.alert() call is synchronous, so if abusers were to call window.alert() directly, they would have to wait for the user to respond. So they work around this by putting the window.alert() call into a PDF in an iframe. Then they have the PDF show the dialog, and while the PDF's JavaScript engine is stopped, the engine of the page is free to remove the iframe at any time, closing the dialog. When they do so, they use strings like "loading" or "focusing please wait" to make it seem like bad Chrome UI rather than what it is, abusive website behavior.
This is one of the many reasons why the activation of tabs via window.alert() is bad. I'm working on removing it and have a CL almost ready to go. Please feel free to follow along on bug 747117 , or just wait for Chrome 64.
Unless you can provide more information about what's going on around the PDF iframe, I'll close this.
,
Oct 19 2017
Thank you for explaining. You may merge this into bug 747117 if you want, or you can close this anyway. Sorry for me not being informed enough.
,
Oct 19 2017
Not a problem! Thank you for checking with us. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ligim...@chromium.org
, Oct 17 2017