July 28, 2006 12:44 PM PDT

JavaScript opens doors to browser-based attacks

Security researchers have found a way to use JavaScript to map a home or corporate network and attack connected servers or devices, such as printers or routers.

The malicious JavaScript can be embedded in a Web page and will run without warning when the page is viewed in any ordinary browser, the researchers said. It will bypass security measures such as a firewall because it runs through the user's browser, they said.

"We have discovered a technique to scan a network, fingerprint all the Web-enabled devices found and send attacks or commands to those devices," said Billy Hoffman, lead engineer at Web security specialist SPI Dynamics. "This technique can scan networks protected behind firewalls such as corporate networks."

A successful attack could have significant impact. For example, it could scan your home network, detect a router model and then send it commands to enable wireless networking and turn off all encryption, Hoffman said. Or it could map a corporate network and launch attacks against servers that will appear to come from the inside, he said.

"Your browser can be used to hack internal networks," said Jeremiah Grossman the chief technology officer at Web application security company WhiteHat Security. Both SPI Dynamics and WhiteHat Security came up with the JavaScript-based network scanner at about the same time, he said. The companies plan to talk about their findings at next week's Black Hat security event in Las Vegas.

JavaScript, AJAX and the Web
JavaScript has been around for about a decade. The scripting programming language is used on Web sites and is increasingly popular in recent years thanks to a programming technique known as AJAX--Asynchronous JavaScript and XML--that makes sites more interactive. AJAX has its own share of security pitfalls.

While malicious JavaScript has been possible for a long time, security researchers have not focused much on it, said Fyodor Vaskovich, creator of the popular Nmap network port scanning tool. Instead, bug hunters have been focused on finding Web browser flaws that allow for a quicker and simpler PC hijack, he said.

"There has been little motivation to explore side-channel attacks such as this one," Vaskovich said. "But a key advantage of the SPI Dynamics vulnerability is that it is difficult to fix without breaking many Web applications. So it may be around for years to come."

There have been similar attempts to craft JavaScript-based network scanners, but none as advanced as the SPI Dynamics example, Vaskovich said. "SPI Dynamics deserves credit for a clever attack vector and a solid demonstration of the issue. Their method of fingerprinting servers by checking for default image paths and names is slick."

When run, the JavaScript first determines the internal network address of the PC. Then, using standard JavaScript objects and commands, it starts scanning the local network for Web servers. These can be computers that serve Web pages, but they can also include routers, printers, IP phones and other networked devices or applications that have a Web interface.

"Everything has a Web server these days," Grossman said.

Pings from the host
The JavaScript scanner determines whether there is a computer at an IP address by sending a "ping" using JavaScript "image" objects. It then determines what servers are running by looking for image files stored in standard places, the traffic it receives back and the error messages it receives, according to a SPI Dynamics paper.

A malicious JavaScript could be hosted on an attacker's site, but an attack could also lurk on a trusted Web site by exploiting a common flaw known as cross-site scripting. Big-name Web companies including Google, Microsoft and eBay have had to plug such holes. Earlier this week AOL's Netscape.com fixed such a flaw that let apparent fans of rival Digg.com plant JavaScript on the Netscape Web site.

At BlackHat, Grossman is slated to demonstrate one attack. "We will be showing off how to get the internal IP address, how to scan internal networks, how to fingerprint and how to enter DSL routers," he said. "As we're attacking the intranet using the browser, we're taking complete control over the browser."

There is little a PC user can do in terms of protection. The burden largely rests on Web site developers to make sure their users and servers stay safe, experts said. Some PC security software will detect malicious JavaScript, but typically only after an attack has surfaced, because they rely on attack signatures (the "fingerprint" of the threat) to block the attack.

"All our protection recommendations are server-side," Grossman said. Site operators should fix cross-site scripting flaws and validate any user-submitted JavaScript. "The users really are at the mercy of the Web sites they visit. Users could turn off JavaScript, which really isn't a solution because so many Web sites rely on it," he said.

Also, if you suspect something fishy is going on, surfing to a different Web page or shutting down your browser will likely stop the JavaScript.

Attacks aren't widespread, Grossman said. "JavaScript malware is still cutting-edge, and nobody really knows what you can do with it," he said. "Liken it to the early days of an e-mail virus--that's where we're at now. I think we're going to see (many) more attacks."

See more CNET content tagged:
SPI Dynamics, JavaScript, corporate network, internal network, AJAX

Add a Comment (Log in or register) 29 comments (Showing first 20 comments)
too bad, oh well
by emancipated July 28, 2006 2:56 PM PDT
Disappointed, not surprised. Item provides weekend reading material.
Reply to this comment
limited user mode
by superdave132 July 28, 2006 6:45 PM PDT
would running in limited user mode prevent such attacks?
Reply to this comment View reply
Thank you for confirming...
by OneWithTech July 28, 2006 10:41 PM PDT
....what I have suspected and came to learn of before this article was released. And if you all think that is the only JavaScript manipulation attack that can be mustered up just wait.

I have been studying JavaScript extensively as part of my Web Development regime and am finding more and more way's to manipulate it for evil than for good! And you though cookies were harmless!

J Gund
Tech01
www.tech01.net
Reply to this comment
NoScript Extension w/ Firefox
by Anysia July 28, 2006 11:36 PM PDT
Totally disabling JavaScript won't work but you can pick what sites/sources to allow JavaScript. Guess it's not just an extension to speed up surfing and blocking some annoying ads.
Reply to this comment View reply
Why Use a MacBook?
by brodda2 July 29, 2006 6:51 AM PDT
Are they suggesting that OS-X machines are vunerable to Java-
script attacks or was that just a poor choice on the graphic
artist's part?
Reply to this comment View reply
A change is needed
by MaxiSteel July 29, 2006 5:31 PM PDT
This is very scary. I think that the entire methode of web browesing should be re-engineered as in IPV6 for communications, to be become a trusted application.

Users are having to accept patches to problems when they are wanting REAL solutions.

Society actualy cares, but is not able to cope with the ever increasing speed of tech and lack of knowledge of the same.

Maxi
Reply to this comment
Turning off Javascript isn't that bad
by Jackson Cracker July 30, 2006 2:28 AM PDT
I've found that a number of sites, including some shopping
sites, work just fine without Javascript. I think it makes
more sense to have Javascript turned off by default and then
only activate it when really necessary.
Reply to this comment
Java is a script and known to be vulnerable
by wbenton July 30, 2006 8:43 AM PDT
That said... why do SO MANY pages on the internet require Javascript to be enabled to browse them.

If you want to view a link... it can be done in HTML... no need to use Javascript... but many do.

Javascript looses readers... especially those like me because I don't allow javascript for just anybody. There must be a reason.

But if that reason is because some bloody javascript crazy programmer decided to use javascript rather than just plain HTML... then I don't view that site and I also voice my opinion against that site to all of my buddies.

Javascript needs to be used with care... only when required... not just when desired.

And if you haven't figured it out yet... I block ALL javascript by default. And must have sound reasoning why to unblock it.

Sadly however... much of the internet doesn't understand the vulnerabilites of it and thus programs javascript for everything.

Walt
Reply to this comment View all 3 replies
First ActiveX, Now This
by maxwis July 30, 2006 10:48 AM PDT
So we dumped MS IE in favor of Firefox or Opera to browse more securely. We eschewed ActiveX because it was a threat to security. Now we find out that Javascript, which is even more pervasive than ActiveX, is just as bad. Sure, you can disable Javascript, but then almost every site you visit is going to fail in some way. Good luck trying to checkout from online shopping as your cart crashes and burns. Also, as the CNET story points out, even if you only allow Javascript on trusted sites, if those sites are hacked due to poor security then you are at risk too. This seems a totally unworkable solution. I think what is needed is an Internet appliance, akin to a hardware firewall, that uses a limited, hardened OS. All web browsing would be done through a proxy that communicates with the appliance.
Reply to this comment View reply
VMware
by mycall0 July 30, 2006 4:08 PM PDT
Here is one powerful solution: use free VMware and one of the free virtual machines (http://www.vmware.com/vmtn/appliances/) to do your websurfing. Even if it is 0wn3d, the virtual networking will sandbox the scanning of your real network.
Reply to this comment View reply
The TRUTH about Firefox
by umbrae July 31, 2006 6:54 AM PDT
Disabling JavaScript in Firefox does, in fact, block this request. I have no experience with the NOSCRIPT "3rd Party" extension for Javascript, but this is a "3rd Party" tool and does not reflect upon any of the "core" Firefox development team. Regardless of what Google tools Mozilla decides to include in 2.0.

Please understand how a browser works and is developed before you lay claims to what they do and do not know.

Once again, you can uncheck "Enable Javascript" in Firefox and it will block this exploit.
Reply to this comment
 See all 29 Comments >>
Powered by Jive Software
advertisement

Latest tech news headlines

RSS Feeds

Add headlines from CNET News to your homepage or feedreader.

More feeds available in our RSS feed index.

advertisement

Inside CNET News

Scroll Left Scroll Right
  • News - Business Tech

    Samsung Electronics contemplating SanDisk acquisition

    Samsung Electronics is considering a buyout of SanDisk, in a move to reportedly lower its NAND flash memory costs, according to paidcontent.org.

  • Gallery

    Photos: Ron Paul's RNC alternative

    As the Republican convention took place just miles away, a crowd rallied for the former presidential candidate and his message of limited government, ensured civil liberties, lower taxes, and peace.

  • News - Apple

    iPhone to get EA's 'Spore Origins'

    The game that lets players design creatures and see them through a digital evolution is coming to Apple's iPhone and iPod Touch.

  • Beyond Binary

    Microsoft begins big ad push

    Microsoft's multi-year push, estimated at $300 million, begins with a spot featuring Bill Gates and Jerry Seinfeld aired during Thursday's NFL game.

  • Video

    YouTube plays party politics

    During the presidential campaigning four years ago, YouTube didn't even exist. Now it's a tool candidates must master to get their message across. CNET's Kara Tsuboi stops by the YouTube upload booths at the Democratic and Republican conventions to find out why Google's video site has such a big presence in Denver and St. Paul, Minn.

  • News - Wireless

    Was EarthLink's failed citywide Wi-Fi a blessing in disguise?

    Wireless Philadelphia, the nonprofit charged with providing broadband bundles to low-income families in Philadelphia, may be better off in the long run without EarthLink.

  • Video

    Political party playlists

    We know the Democrats and Republicans are split over policy issues, but does their musical taste fall down party lines too? And what kind of gadgets did they bring to the conventions to listen to their music? CNET reporter Kara Tsuboi finds out.

  • News - Gaming and Culture

    Behind the prototyping of 'Spore'

    Many of the components of Will Wright's highly anticipated evolution game started out as small concept projects that are now available to the public.

  • News - Cutting Edge

    Execs predict next Google-like tech

    On eve of company's 10-year anniversary, researchers and business pundits speculate about what technologies might someday have as much impact as Google.

  • Gallery

    Photos: The brains behind Google Chrome

    Here's a look at some of the engineers and executives who took the stage at the company's headquarters as they unveiled the new browser.

  • The Cheapskate

    Record TV in style with a refurbished TiVo HD, $179.99 shipped

    TiVo is offering refurb HD units for cheap, though you'll still have to pay for the TiVo service.

  • Green Tech

    Green news harvest: stolen solar panels, love for small wind

    Tata to bring small all-electric car to Norway next year; a banner years for wind power; a home hydrogen filling station; comparing the presidential candidates on plug-in cars; a microbial fuel cell for developing world; tips on greening your PC; large co