Bug 413250 allows to steal data from sessionstore.js

RESOLVED FIXED

Status

()

Core
Security
P1
normal
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: moz_bug_r_a4, Assigned: dveditz)

Tracking

({verified1.8.1.12})

unspecified
verified1.8.1.12
Points:
---
Bug Flags:
blocking1.9 +
blocking1.8.1.12 +
wanted1.8.1.x +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sg:high])

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
It's possible to steal data from sessionstore.js including cookies.

I'm filing this bug to attach a testcase since bug 413250 is public.
(Reporter)

Comment 1

10 years ago
Created attachment 298422 [details]
testcase

This requires Download Statusbar:
https://addons.mozilla.org/en-US/firefox/addon/26
Flags: blocking1.9?
OS: Windows XP → All
Hardware: PC → All
Whiteboard: [sg:high]

Comment 2

10 years ago
Yea - we should fix this asap...
Flags: blocking1.9? → blocking1.9+
Priority: -- → P1
(Assignee)

Comment 3

10 years ago
I worried about that one :-(
Flags: wanted1.8.1.x+
Flags: blocking1.8.1.12+

Updated

10 years ago
Depends on: 413250
(Assignee)

Comment 4

10 years ago
trunk no longer uses sessionstore.js, but if it's an upgraded Firefox 2 profile we don't clean up and there may still be juicy stuff available. I'll file a bug on that aspect.

I thought we were going to make the Object and Array prototypes immutable to prevent this kind of attack? Is that something that has to wait for JS2?
(Assignee)

Comment 5

10 years ago
filed bug 413689 about stale sessionstore.js data in a FF3 profile.

Comment 6

10 years ago
> I thought we were going to make the Object and Array prototypes immutable to
> prevent this kind of attack?

I thought so too, but I'm still waiting for an answer from Brendan in bug 376957.
Jesse: it's not a mystery. Waldo patched SpiderMonkey to use the original values of Object and Array (and their prototype objects, which while mutable are bound by immutable 'prototype' properties in the ctor objects) when interpreting object and array initialisers. So no replacing or shadowing attacks are possible, but getters on the prototype can still be abused, maybe.

/be
(Assignee)

Updated

10 years ago
No longer depends on: 413250
Last I remember, shaver's patch in bug 322889 would make sets and gets not use getters/setters -- might be worth seeing what happens with that patch in place, if it's ready enough.
Of course, that's only Array and not Object, so that might not be meaningful here.
(Assignee)

Updated

10 years ago
Keywords: fixed1.8.1.12
(Assignee)

Comment 10

10 years ago
Fix for bug 413250 checked in.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
http://www.hiredhacker.com/2008/01/19/firefox-chrome-url-handling-directory-traversal/

has just been updated with a demo covering this very facet of the bug:

http://www.hiredhacker.com/steal_sessionstore.html

Still keeping this private? When can 2.0.0.12 be released?
(Assignee)

Comment 12

9 years ago
Release candidate builds are being generated now (see the usual nightly release directories). I'd like to give Window a chance to update http://blog.mozilla.com/security before opening up this bug -- drawing more attention to the problem just puts more people at risk, we're already going as fast as we can on the release.
though chrome: traversal seems fixed on trunk and latest-2.0,
resource: traversal still works.

resource:///%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f
^^^ this is "/"
resource:///%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc
^^^ this is "/etc"
(in case you don't get /, add more %2e%2e%2f

even more:
<script src="resource:///%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc">
works from the web.

this means it is possible to read at least some js files if the full
path is known via 'resource:///'.
resource stuff is public Bug 394075

this is none of my business, but i don't see any point in releasing .12 with resource: wide open - it is too similar to chrome: traversal
(Assignee)

Comment 15

9 years ago
> resource stuff is public Bug 394075

No, bug 380994

Updated

9 years ago
Group: security
Depends on: 413250
I've verified this fix with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/2008012820 Firefox/2.0.0.12 and Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/2008012822 Firefox/2.0.0.12. 

With this testcase (attached to bug), we get "undefined" as a result now.

I've also tested and verified bug 413250.
Keywords: fixed1.8.1.12 → verified1.8.1.12
You need to log in before you can comment on or make changes to this bug.