Adobe Security Chief Defends JavaScript Support
Trailrunner7 writes "Despite the fact that the majority of [PDF-related] malware exploits use JavaScript to trigger an attack in Adobe's PDF Reader product, the company says it's impossible to completely remove JavaScript support without causing major compatibility problems. In a Q&A on Threatpost, Adobe security chief Brad Arkin says the removal of JavaScript support is a non-starter because it's an integral part of how users do form submissions. '"Anytime you're working with a PDF where you're entering information, JavaScript is used to do things like verify that the date you entered is the right format. If you're entering a phone number for a certain country it'll verify that you've got the right number of digits. When you click 'submit' on the form it'll go to the right place. All of this stuff has JavaScript behind the scenes making it work and it's difficult to remove without causing problems," Arkin explained.'"
Why not let PDFs only display documents, and rely on web forms for submitting information? No? Too simple?
I personally have hated PDF forms for some - as a Mac user, having an OS with great PDF support built-in, but still having to use Adobe's products to use their non-standard (or newly made standard) forms implementation is a headache.
Well, gee -- how about creating the equivalent of noscript for Adobe, then? That way, the user can decide for themselves if they want to run scripts in what they THOUGHT was just a formatted text document.
Seriously, how damaged would the world be without form-based PDFs? I removed almost every plug-in from my copy of Adobe Reader. I don't need their "rights management" or their "braille reader" or their "web submission plugin" or any of that other cruft.
And somehow my life is not incomplete as a result.
John
"Anytime you're working with a baby pram where you're, say, also carrying diapers, our chainsaw is used to do things like verify that the Pampers fit on that little shelf underneath. If you're carrying some groceries as well, the chainsaw verifies that you don't try to fit too much on there. When you push the pram, the chainsaw makes sure you push it to the right place. All of this stuff has the chainsaw behind the scenes making it work and it's difficult to remove without causing problems," Arkin explained.
I watched C-beams glitter in the dark near the Tannhauser gate.
The only thing I learned when we used PDF forms a few years ago was ... don't do it. Just no. Really, don't .
White listed docs/publishers are the only ones allowed to run JavaScript. White listing
should be as easy as pushing a "Trust this document" or "Trust this publisher" button.
Will it/can it be abused? Sure, but it's better then running script by default without
user consent.
Creationist Textbook Stickers Declared Unconstitutional by CowboyNeal
Translation: "We don't want to expend the time, effort, resources and money- especially the money- it would take to replace quick and dirty Javascript code with something more secure and robust."
Anytime you're working with a PDF where you're entering information, JavaScript is used to do things like verify that the date you entered is the right format
I really can't remember the last time I saw a PDF that had a form in it that you could submit. Was it 2001? possibly 2003 at the very latest. The idea never caught on, and why would it? you get some minimal HTTP POST support in a proprietary format. To me it would seem more important that you have an up-to-date version of the form you are submitting, rather than having the form's formatting look *exactly* right without loss in formatting which is the whole point of PDF.
JavaShit, forms, DRM in PDF files should all be removed - all they do is make the reading software more bloated
Why does a product called "Reader" have to process user input?
the bloatware partisan
intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
I read it as saying, "It's cheaper to patch vulnerabilities than it is to re-write the code properly in the first place"
Sig Follows: "Suppose you were an idiot. And suppose you were a member of Congress. But I repeat myself." -- Mark Twain
I didn't know this until recently, but you script most of Adobe's CS products (Photoshop, etc) with JavaScript.
It's cross platform. The same scripts work on my Mac as they do on a Windows machine.
I already know it, syntax isn't something foreign and there is a ton websites out there for JavaScript support.
It makes stuff like making panoramas and HDR panoramas awesome.
Can anyone tell me WHY people want to fill forms inside PDFs? What am i missing here? We already have the technology to fill forms, what do adobe want to achieve with this? To me it smells like another CEO type of decision and desire for everything to be centralized.
Oh no, it's difficult to do the right thing! In many organizations, they would respond by saying "You're fired!" Good thing this guy works for Adobe.
Funny, I always turn off Javascript in every new PDF viewer installation and not having it never causes me any problems. This guy is making excuses for something that should never have existed in the first place. Those who don't learn the history of the MS Office macro virus debacle of the 1990s are doomed to repeat it.
Amazing that in the face of one known problem, someone knowledgeable about the issues can remain aware of another problem. This silly guy would be much better off to ignore all other issues when examining a problem, regardless of whether proposed solutions would have other undesired consequences.
Alphanos
His point is sound, but it dodges the real issue:
1) Most of the time people aren't doing forms submissions. It's somewhat of an obsolete concept. We use HTML for that. We use PDF when we want to print something. (Which we do a lot less often than we used to)
2) You can have Javascript that can do form validations without giving it commands like "open this file, write to it, then execute it" Adobe's Javascript security is stuck in 1998, back in the days of ActiveX controls that could trivially to break out of the sandbox.
I wish I was in a position where I didn't have to fix my strategic mistakes. It sure would be a nice a nice world if we didn't have to make mistakes and could call anything difficult a "non-starter."
Dont run it automatically. Have the default be JS off and a nice scary warning box about JS and how you should only enable it if you are certain this is a safe PDF. Sure, its not a perfect solution but its better than just having it on by default and running vulnerabilities at double-click.
Not to mention, when I shut it off under Preferences - KEEP IT OFF. If its off in preferences, it helpfully reminds the user than its off and offers to re-enable it via the prompt. What the hell is Adobe thinking?
While I'm at it how about updates to the reader that arent 40-150 megabytes big or an updater that actually works. Right now, sane people should be considering Reader are very serious security vulnerability and migrating off the platform. Adobe has shown nothing but contempt for even basic security.
Funny. The PDF format had forms before Javascript was tacked on. If they needed something to do validation they should have looked in house and used a language they already had like, oh I dunno... Postscript.
I am becoming gerund, destroyer of verbs.
What's happened is Adobe has tried to retrofit Acrobat with tubes. They did it with much haste so as to get a foothold in the 'cloud' computing craze. What we now have is a hastily coded bloated application that's somewhere between IE5 and MS Word 95 in terms of security. Adobe needs to start over, they f#cked up and need to fix it.
boycott slashdot February 10th - 17th check out: altSlashdot.org
Yep Java is such a powerful language... it is the only one that can verify the correct number of digits for a phone number, the right date, etc. So there all you purist language tards; things like C++, C, perl, python, etal are utter crap compared to the almighty Java and its scripts. Who cares if there are a few security issues introduced, Adobe could not give a shit about it.
My karma is not a Chameleon.
Obvious troll is obvious.
JavaScript isn't to blame; the protocols and formats implementing JavaScript, such as Adobe's rendition of PDF, are. You can avoid JavaScript if you want: Use Opera, Firefox or another mature, well-intending web browser that allows you to use whitelist policy against JavaScript online. Use a PDF-reader that isn't Adobe's. Etc. etc.
Yep Java is such a powerful language... it is the only one that can verify the correct number of digits for a phone number, the right date, etc. So there all you purist language tards; things like C++, C, perl, python, etal are utter crap compared to the almighty Java and its scripts. Who cares if there are a few security issues introduced, Adobe could not give a shit about it.
No, seriously, are you? Because I don't even know where to start here, I mean, come on! Are you trolling? This whole post is meaningless jibber-jabber. Java isn't java-script. In fact, they aren't even related. ANY general purpose language included in a document mark-up language can introduce vulnerabilities. This isn't about one language versus another. The question is, why does a document format need scripting at all? Sheesh.
- None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
Anytime you're working with a PDF where you're entering information, you've already failed
Fixed that for you, dipshit.
You can't defend a stupid idea by saying that without it, another stupid idea would be impossible.
Well, I guess you CAN, since this knob just DID. He just didn't do a very good job of it.
...that nobody uses these "I am an electronic form" features anyway. All we want is view and print documents. But then, PostScript did exactly that. Oh wait, PDF is based on PostScript. I never understood why it had to be Adobe and PDF that the world uses today. It could have been (a nice version of) Ghostview and PostScript. Hm, but then nobody could have sold PDF-Creation Add-Ons to MS Word, because you could have used a PS printer driver.
We have Javascript in web browsers, and it's rare to see vulnerabilities this rare.
What's the difference? Is Adobe just not sandboxing Javascript code properly? I've never really used Adobe's products for this... but what's to stop them from just using an established javascript implementation like that used in Firefox or Webkit?
"You know, Hobbes, some days even my lucky rocketship underpants don't help" -- Calvin
...or any other programming language for that matter? If the functionality is indeed only needed for checking that form input adheres to a specific format, should not a regular expression mechanism be enough in 99% of the cases? As in: if you design a form, you'll get the ability to specify a regex for each field and the PDF renderer will check new input against each field's regex. Less powerful, but also less likely to be exploitable, I would assume.
It smells like they painted themselves into a backward compatibility nightmare using a lightweight solution to what now needs to be a heavyweight security application because of its widespread usage. Anyone standing behind javascript as a security boundary on a compiled app is pretty much insane imho..
Why not just invent a new language exactly like javascript for Reader to use and then only expose the public API, which is similar to javascript. Make sure that main code base is securely sealed though so that when developer is trying to debug their script for some mystical, incomplete error message from the base classes it will be impossible. Call it something like actionPDFscript.
I am sure it will be a big hit.
quis custodiet ipsos custodes
Excuse me HOW has WC3 made html so hard to understand?
All things considered it's made it more legible! Consolidating style and content into different parts of the document makes things Very easy.
It's a pathetic excuse for a scripting language, let alone a full programming language
This proves it. If you don't understand that Javascript, you'd think that. But, you probably don't think LISP/SCHEME are REAL programming languages either. You probably don't even know WTF "Lambda Calculus" is? Shut the Fuck Up!
Over-the-top Response Guy! Giving "Over-the-Top Responses" since 1970.
JavaScript is a feature that Adobe believes is useful enough to tolerate the security compromises.
Or to rephrase it, Adobe Reader is so good, security doesn't matter as much as features.
Yup. That's how they see it.
deleting the extra space after periods so i can stay relevant, yeah.
Adobe is not a customer-centric company.
Unless you are buying software from the (i.e. Adobe Development Tools and Document Management Solutions) YOU AIN'T THEIR CUSTOMER. People who just use Adobe Reader and Flash Viewer ARE NOT Adobe's customers. The people who produce the content, using Adobe tools and work-flow management stuff are their customers.
I am not Adobe's Customer.
Over-the-top Response Guy! Giving "Over-the-Top Responses" since 1970.
Adobe should move away from JavaScript and move to declarative form definition and validation, which carries no risk of code attacks from errant JavaScript. In fact, there is a standard for validating forms declaratively, called XForms. It lets you write validation expressions for saying when data is valid, required, readonly, or calculated from other data (i.e. totals), and also lets you assign data types using the widely-deployed XSD type names (integer, URL, string, regexp string, etc).
XForms is modular enough that it's been incorporated into ODF, and there's no reason other that it can't be used in PDF to define and validate forms, other than that Adobe has a vested interest in maintaining its proprietary technology forms instead. There are a number of folks who would be quite ready to help Adobe incorporate XForms into PDF.
There are in-browser JavaScript implementations of XForms (here, here, and here), server side implementations a la GWT (here and here), and mobile implementations (here).
I've been working with XForms for many years, and find it an excellent solution for deploying rich internet applications; we've switched implementations a few times, and have had to do only minor changes to our applications, so using a standard preserves our investment in stuff already written.
Javascript default = OFF
"This PDF file uses JavaScript, which can sometimes be a security risk. Do you want to enable JavaScript support for this document in order to view it?" <YES> <NO>
Or the more sophisticated:
"This PDF file is a form that uses JavaScript for some of its function. Do you want to enable JavaScript support for this document?"
Sure, this guy is correct to defend support for JavaScript. But I can't think of any legitimate reason for a person interested in security to defend the decision to have it on by default.
I actually used Javascript in Adobe Acrobat a few years back. As part of a workflow process we were regularly bundling sets of PDFs together into one large PDF. This included a title page and a table of contents (talking about a printable one, not bookmarks.) So I futzed around with the Javascript and came up with a way to have the person creating the one big PDF to:
- open a blank Title/TOC PDF
- click a checkbox to unhide the form elements.
- enter a title into a field, which appeared on both the title page and the page headers
- check off which documents were being included in the PDF, which then showed those lines in the TOC. The chapter numbering e.g. 1), 2), 3) etc. also changed to match.
- click the checkbox again to hide the form elements, leaving just the printable title and TOC portions.
- save as a new copy, then bundle it with the other documents.
Pretty slick IMHO. It saved the users from having to waste time opening Word to create a new Title/TOC page every time.
But that being said, what happened in the PDF stayed in the PDF. It didn't have to connect to the web, etc.
This is of course the classic reason for bloatware. The feature that's unbelievably-useful-couldn't-do-my-work-without-it for 2% of the users is completely worthless to the other 98%, and we all belong to at least one group of 2%.
Adobe also has the problem of full Adobe Acrobat Pro vs. Acrobat Reader. Any changes made to a PDF in Acrobat Pro have to be compatible within Acrobat Reader e.g. if I highlight text in Pro and save the PDF I expect everyone who opens the PDF later on to see it too. Otherwise they could simply make all the additional features (including Javascript support) plug-ins and be done with it.
Prisencolinensinainciusol. Ol Rait!
All of this stuff has JavaScript behind the scenes making it work and it's difficult to remove without causing problems," Arkin explained. Translation: "We designed the products with a flawed security model to begin with and fixing that now would cause applications built on them that depend on defects in the security model in order to operate to no longer work."
I've abandoned my search for truth; now I'm just looking for some useful delusions.
Security is hard! Lets go shopping!
Here's the solution:
Use .PDF for documents WITHOUT javascript, and use a new extension for docs WITH javascript.
Users/admins can handle what app opens what format on their end, or disallow one format all together.
Done.
Why does it have to be Javascript. I thought PDF was built on top of Postscript, a language in it's own right. Why not use that?
The only trojan horse infection I have had in the past decade was due to visting a "security" web site that exploited a Java vulnerability. I use XP for work, and never run as an administrator anymore, unless I need to install software. In XP it is fundamentally unsafe.
I imagine running as limited user all the time seriously reduces the impact of Adobe Reader vulnerabilities like this, among others.
Please, let me hit him in the head with a bat, I promise I wont let him suffer, please, let me make him see the light.
What a mofo, sounds way too much like a clueless idiot, that got his job handed to him by being a family or friend.
Why do you need Javascript to verify that fields in a form match certain formats? Wouldn't, say, regexen be able to do the same thing?
Seems like he's just done a mea culpa and asked the world to stop using PDFs as a document format.
He's basically said: "Our document format is out of control. We no longer have the ability to keep it secure. Run for the hills. Save your women and children if you can. Treat our product the same way you treat malicious .exe's when your browser encounters them. Whatever you do, don't use it for encoding simple read only documents, it's not meant for that."
Maybe I do not need it at all? This explanation sounds like complete BS to me. PDF is a display format and active content has no business at all in it. At the same time it is rather obvious that having JavaScript in there is a huge, hige risk and the JavaScript should be implemented with great care and not fall over because of a simple, amateur-level buffer overflow...
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Javascript is EVIL! All of this validation can be done on the server side in a much more secure manner. Come to the server side, we have cookies.