• On MovieTome: See the TRAILER for TERMINATOR 4!
September 6, 2008 11:33 AM PDT

Security firm spots Chrome 'SaveAs' flaw

Posted by Jonathan Skillings
  • Print
Chrome beta logo

It's been only a few days since Google released its Chrome browser, and security researchers are still digging into the software in search of the first few flaws.

A company in Vietnam has turned up the latest vulnerability in Chrome, according to a story posted to Information Week's Web site. Bach Khoa Internet Security says that the Chrome 0.2.149.27 release is susceptible to a critical buffer-overflow flaw, which could allow a remote attacker to take control of a PC. BKIS says it has reported the vulnerability to Google.

Here's how BKIS describes the vulnerability and how it could be exploited:

The vulnerability is caused due to a boundary error when handling the "SaveAs" function. On saving a malicious page with an overly long title (title tag in HTML), the program causes a stack-based overflow and makes it possible for attackers to execute arbitrary code on users' systems.

To exploit the Vulnerability, a hacker might construct a specially crafted Web page, which contains malicious code. He then tricks users into visiting his Website and convinces them to save this Page. Right after that, the code would be executed, giving him the privilege to make use of the affected system.

Earlier this week, security researcher Rishi Narang reported a flaw related to how Chrome, still in beta, behaves with undefined handlers, while another researcher, Aviv Raff, developed a proof-of-concept demo that showed Chrome could be hit with a carpet-bombing flaw.

Click here for full coverage of the Google Chrome launch.

Jonathan Skillings is managing editor of CNET News, based in the Boston bureau. He's been with CNET since 2000, after a decade in tech journalism at the IDG News Service, PC Week, and an AS/400 magazine. He's also been a soldier and a schoolteacher. E-mail Jon.
Recent posts from Security
Apple deletes Mac antivirus suggestion
Vietnamese security firm: Your face is easy to fake
Apple suggests Mac users install antivirus software
Europe to get cybercrime alert system
Top-notch Vietnamese software BKAV raises antivirus bar
Add a Comment (Log in or register) 22 comments
by chuchucuhi September 6, 2008 1:31 PM PDT
NIfty, I guess that's kind of the good thing about this being a product by google everyone wants to pick it a part as fast as possible, make a headline a little advertising for their firm. In the end it benefits the end user.
Reply to this comment
by rhsc September 6, 2008 1:49 PM PDT
you'd think after 60-some-odd years of programming, buffer overflows would be a thing of the past
Reply to this comment
by limefan913 September 6, 2008 2:39 PM PDT
We can all dream :D
by The_Decider September 6, 2008 4:58 PM PDT
What is worse is that most of them are simple to avoid, but shockingly a large number of programmers still don't really understand what they are and what causes it.

I have even heard "professional" programmers state that buffer overflows are impossible using newer languages that handle memory management automatically.
by Imalittleteapot September 8, 2008 1:50 AM PDT
Well, actually after all the legacy code generated by 60 years of programming, I'd think you'd see em all over the place! lol. The sad truth is we still do :(
by Imalittleteapot September 8, 2008 2:23 AM PDT
The_Decide: "I have even heard "professional" programmers state that buffer overflows are impossible using newer languages that handle memory management automatically."

Marketting hype is great isn't it? Unfortuantly all you have to do is Google Open Office Buffer Overflow and you'll come across many such flaws in Open Office and it's written in Java. Some of these even allow the execution of arbritary code. Similar problems affect programs written in .NET too. Unfortunatly even managed execution environments are still created with imperfect, native compliers. There's always going to be a gotcha.
by the_vdog September 6, 2008 2:06 PM PDT
Sounds like could be easily avoided tho'; don't save pages with titles like "My home page fseek(fd,0,SEEK_END);fwrite(buffer,2,1,fd);fseek(fd,0,SEEK_SET);buffer[0]=0xcd;fwrite(buffer,2,1,fd);fclose(fd);..."
Reply to this comment
by The_Decider September 6, 2008 5:05 PM PDT
As already noted you can not inject uncompiled code and expect it to run. Here is a fun one(only partial code to keep people from crying, even though it is available online):

\x66\x81\xec\x80\x00\x89\xe6\xe8\xb7\x00\x00\x00\x89\x06\x89\xc3\x53\x68\x7e\xd8\xe2\x73\xe8\xbd\x00\x00\x00\x89\x46\x0c\x53\x68\x8e\x4e\x0e\xec\xe8\xaf\x00\x00\x00\x89\x46\x08\x31\xdb\x53\x68\x70\x69\x33\x32\x68\x6e\x65\x74\x61\x54\xff\xd0\x89\x46\x04\x89\xc3\x53\x68\x5e\xdf\x7c\xcd\xe8\x8c\x00\x00\x00\x89\x46\x10\x53\x68\xd7\x3d\x0c\xc3\xe8\x7e\x00\x00\x00\x89\x46\x14\x31\xc0\x31\xdb\x43\x50\x68\x72\x00\x73\x00\x68\x74\x00\x6f\x00\x68\x72\x00\x61\x00\x68\x73\x00\x74\x00\x68\x6e\x00\x69\x00\x68\x6d\x00\x69\x00\x68\x41\x00\x64\x00\x89\x66\x1c\x50\x68\x58\x00\x00\x00\x89\xe1\x89\x4e\x18\x68\x00\x00\x5c\x00\x50\x53\x50\x50\x53\x50\x51\x51\x89\xe1\x50\x54\x51\x53\x50\xff\x56\x10\x8b\x4e\x18\x49\x49\x51\x89\xe1\x6a\x01\x51

IIRC it creates a reverse shell in Windows and starts listening for connection requests
by September 6, 2008 2:25 PM PDT
the_vdog:

Code meant for use in a buffer overflow exploit is not conveniently displayed in human-readable uncompiled C.

Also, the boundary of the buffer is probably going to be a little wider than what is displayed in the browser's title bar.
Reply to this comment
by Penguinisto September 6, 2008 5:06 PM PDT
NOW we have a security issue (the previous flaw was IMHO not much more than attention-*******).

@rhsc: As long as you have folks who forget to sanitize their inputs, you will find the potential for blown buffers.

@the_vdog: PHP, ASP, and the like have the potential for that (injecting SQL commands into an unguarded input field), but throwing C source code uncompiled like that at a compiled binary won't get you very far. ;)

/P
Reply to this comment
by the_vdog September 6, 2008 5:37 PM PDT
@Penguinisto: I know, that's why I choose it (hence the 'like'). Also, most people who would fall for such an attack probably wouldn't know the difference between C/Java/PHP/JavaScript/ASP/etc anyway. ;-)

@Null: If you mouse over the tab you'll see the full title.
Reply to this comment
by texaslabrat September 6, 2008 5:43 PM PDT
While I can't speak for the_vdog...I think his "example" was an attempt at humor via a hyperbolic example that contained a grain of truth...try not to take it so literally. I know it's tough for programmer-types to let stuff like that slide...but give it a shot ;)
Reply to this comment
by betelgeuse68 September 7, 2008 1:14 AM PDT
This is a problem if you're on Windows XP but not Vista (with UAC on).

So in my investigation of how saving off HTML (from a View Source) worked in Google?s Chrome browser several days ago (before I saw this story), I used Mark Russinovich's Filemon tool to note what process was associated with savings the contents of doing a "View Source". I simply saved things off to:

C:\Windows\BadStuff.txt

Turns out, the ID belonged to the parent process that spawns off children (copies of Chrome.exe). Instead of threads, Chrome uses a privilege separation model and creates child Chrome.exe processes for each tab. These children do the actual HTML rendering and JavaScript execution but as I learned from my observations they are not involved in file I/O when it comes to saving off the contents of a "View Source". This surprised me a bit, namely, that the parent would save off the contents of doing a View Source.

I thought nothing of it but then I came across this story. Namely, someone finding a way to exploit the Chrome.exe parent process having administrative rights in a very unexpected way (that would be 99% of Windows XP users). However this exploit requires social engineering which doesn?t make this exploit a major flaw in my honest opinion.

This flaw showcases a bit of over-engineering on Google?s part. By going on the premise that the children should not interact with the file system and asking the parent to save off HTML, the default access control lists (ACLs) in NTFS (NT File System) which would have prevented malice don?t play a role. That?s because if the children with no admin rights just did the work themselves an attacker would not have much leverage in instrumenting a machine since any attempts to modify C:\Windows would by default fail.

But by having the parent Chrome.exe process do the work with admin rights on XP, an exploit is born.

So once again it is the same story I?ve preaching for a while now, don?t run *anything* that is associated with talking on the Net with administrative rights -- the principle of least privilege. While Google's Chrome makes things harder there is no such thing as infallibility when it comes to the security of a software system. There are an infinite number of permutations you can feed a web browser so it?s best to assume the worst.

This is why you should use this tool (RemoveAdmin) with Google's Chrome browser (or ANY browser for that matter):

http://www.download.com/RemoveAdmin/3000-2381_4-10824971.html?tag=lst-1&cdlPid=10835515

The RemoveAdmin installer creates shortcuts for IE and Firefox but if you look closely, it's a general purpose tool and you can create a new shortcut to launch Chrome (just provide a path to Chrome.exe as an argument).

RemoveAdmin strips out administrative rights on any process you wish to launch, thereby cutting the exploit talked about here at the knees.

-M
Reply to this comment
by The_Decider September 7, 2008 8:46 AM PDT
UAC won't save you.
by AppleSuxLeo September 7, 2008 3:27 AM PDT
Chrome is one big flaw.
Reply to this comment
by Penguinisto September 7, 2008 8:48 AM PDT
@Betelgeuse68:

Vista is just as vulnerable to buffer overflows as any other OS that uses an Intel/AMD x86 CPU. The problem has nothing to do with permissions, but how the memory stack itself reacts to bad logic.

You basically confuse the CPU itself with a buffer overflow, then chuck in your malware commands during that state of confusion, which the CPU will act on no matter what permissions the commands may have (NX bit be damned).

/P
Reply to this comment
by jemiller0 September 7, 2008 1:37 PM PDT
A buffer overflow right off the bat. That doesn't instill a lot of confidence. If they were smart, they would have implemented the browser in Java. It would have prevented a problem like this and the browser would already be cross platform.
Reply to this comment
by Imalittleteapot September 8, 2008 2:00 AM PDT
Yeah if you could convince regular users to actually use Java programs. Regular users still think it's slow even though it's much better now, and stupid programmers that can't keep their work off the events thread only enforces that harder.

Besides, they could have done it in Java to only find out it had vulnerabilities anyway. Java isn't perfect on secruity either. The saddest thing of all in my opinion is that people still think you can take an imperfect language like C++ and imperfect programmers and yet somehow manage to create a perfectly secure virtual machine with them. Unfortunatly that's just not the case. I wish it was though.
by public_pants September 8, 2008 6:01 AM PDT
Both carpet bomb and this has been fixed in the new beta 0.2.149.29. To update, go to wrench icon -> about google chrome. But you would probably be up to date by now.
Reply to this comment
by tinyang September 8, 2008 12:47 PM PDT
I like the features in Chrome, but it is too new to use for those of us who are not on the bleeding edge of technology. Besides this it saves passwords in clear text:
http://seclists.org/bugtraq/2008/Sep/0065.html

and Allows downloads of exe files with no prompt to open or save:
http://www.milw0rm.com/exploits/6355

and I'm sure they will find more yet.
Reply to this comment
by tinyang September 8, 2008 1:07 PM PDT
Oops, sorry for double post.
by tinyang September 8, 2008 12:49 PM PDT
I like the features in Chrome, but it is too new to use for those of us who are not on the bleeding edge of technology. Besides this it saves passwords in clear text:
http://seclists.org/bugtraq/2008/Sep/0065.html

and Allows downloads of exe files with no prompt to open or save:
http://www.milw0rm.com/exploits/6355

and I'm sure they will find more yet.
Reply to this comment
 See all 22 Comments >>
advertisement

In the news now

A tech veteran responds to the recession

LogLogic's Patricia Sueltz heard a clear message about the economy from investors, but she already knows a thing or two about navigating through tough times.


Obama's AG pick on privacy

Eric Holder has criticized the warrantless wiretapping program, but his views on other online policies may not be that far from those of the Bush administration.


About Security

Online security is threatened by more than hacking and phishing attempts. Check here for the latest updates on software vulnerabilities, data leaks, and rapidly spreading viruses--and learn how to protect your systems.

Add this feed to your online news reader

Security topics

advertisement
advertisement

Inside CNET News

Scroll Left Scroll Right