Closed Bug 568886 Opened 15 years ago Closed 14 years ago

Instead of severing the stack in SJOW, function.caller should refuse to return an object from a different compartment

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Assigned: jorendorff)

References

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 file)

Currently we have a hack in SJOW to sever the stack. This is specifically to prevent an attack where arguments.callee.caller.caller eventually reaches a more-privileged object. In the case of content reaching up to Greasemonkey scripts, .caller.caller eventually reaches an object which has the same principals, but from which too-powerful Greasemonkey APIs are reachable. So a principals check in function.caller would be insufficient. Instead, we should put Greasemonkey in a separate compartment (bug 568885) and make .caller return null rather than return a function object from another compartment.
Abso-freaking-lutely -- how did we live with this for so long? f.caller was censored in the old days of Netscape 4 signed scripts/applets. Great to see this getting fixed. /be
Attached patch v1 (deleted) — Splinter Review
Like so. But since Gecko does not actually put objects with different principals in different compartments yet, this patch is not yet safe to land.
Assignee: general → jorendorff
Attachment #453889 - Flags: review+
Depends on: 563106
Attachment #453889 - Flags: review?(mrbkap)
Comment on attachment 453889 [details] [diff] [review] v1 Actually, um -- can we land this now? I think the security check has been redundant for some time. The stack-severing code in SJOW is sufficient for now, and the new check added here will be sufficient when Gecko is properly compartmentalized.
Comment on attachment 453889 [details] [diff] [review] v1 Yeah, we should be able to land this now.
Attachment #453889 - Flags: review?(mrbkap) → review+
Whiteboard: [fixed-in-tracemonkey]
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: