48 Commits

Author SHA1 Message Date
norris%netscape.com
78ff426219 Fix 18439 windows.status allows reading links
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@60428 18797224-902f-48f8-a5cc-f745e15eee43
2000-02-11 04:18:39 +00:00
norris%netscape.com
8d750ce9f0 For some reason the sun compiler doesn't like the ?: assignment.
git-svn-id: svn://10.0.0.236/trunk@60290 18797224-902f-48f8-a5cc-f745e15eee43
2000-02-10 06:24:38 +00:00
norris%netscape.com
36450a3f42 Fix 25062 Reload vulnerability
25206 Reload vulnerability #2
Implement grant dialogs and persistence for capabilities.
most r=mstoltz, some code from morse w/ r=norris


git-svn-id: svn://10.0.0.236/trunk@60281 18797224-902f-48f8-a5cc-f745e15eee43
2000-02-10 04:56:56 +00:00
norris%netscape.com
d5401f0901 Fix domain generalization for site-specific security policy.
also fix bug with enablePrivilege.
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@59674 18797224-902f-48f8-a5cc-f745e15eee43
2000-02-03 23:28:36 +00:00
norris%netscape.com
6fc5a6608b Fix bug #25864 watch() vulnerability
r=vidur,rogerl


git-svn-id: svn://10.0.0.236/trunk@59445 18797224-902f-48f8-a5cc-f745e15eee43
2000-02-02 00:22:58 +00:00
norris%netscape.com
2beb5e9dfd Fix warning.
git-svn-id: svn://10.0.0.236/trunk@58942 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-27 15:59:34 +00:00
norris%netscape.com
0dd1063455 Fix 23227 Document object vulnerability
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@58789 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-26 15:33:57 +00:00
jband%netscape.com
7ac1267323 Lots of xpconnect bug fixes...
- fix bug 12954 "should throw when setting non-settable props".

- fix bug 13418 "xpconnect needs to be threadsafe".
I think I filled in the cracks. Tests would be nice :)

- fix bug 22802 "[MLK] XPConnect Leaks".

- fix bug 24119 "[MLK] Reminder about cleaning up maps".

- fix bug 24453 "xpconnect needs default security manager".
I also changed the code in DOM and caps to just install a default secman and
not install a secman for each JSContext.

- fix bug 24687 "xpconect should avoid resolve performance suckage".
Added (modified) patch from shaver to create my JSObjects with the
global object as the temporary proto to avoid losing lookup.

- hack for bug 24688 "runtime errors in wrapped JS are not made obvious"
Added a debug only printf. We still need a JSErrorConsole service for this.

- fix bug 16130 "createInstanace and getService can create wrappers around wrappers"
Fixing this one really entailed changing the semantics of nsIXPConnect::wrapNative
and nsIXPConnect::wrapJS to use common code in xpcconvert that deals with existing
wrappers and DOM objects (with their own schemes for wrapping and unwrapping).
So, I changed the callers because the params changed slightly and some callers
were doing more work than necessary given the new semantics.

- Continued in the crusade to replace manaual refcounting with nsCOMPtrs whenever
touching old code.

- Added myself as first contributor to xpconnect files (vanity prevails!)

- Added new copyright header on some files that were missing it.

- Added some API comments.

- Converted nsXPCWrappedJS to implement nsIXPConnectWrappedJS via MI rather than
the old loser scheme of the nsIXPConnectWrappedJSMethods tearoff object.

- added DumpJSStack as globals to xpconnect and DOM dlls to be callable from
debuggers. I have ideas on how to improve and expand this support soon.

r=mccabe


git-svn-id: svn://10.0.0.236/trunk@58762 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-26 08:38:10 +00:00
norris%netscape.com
e4653042f2 Files:
caps/include/nsScriptSecurityManager.h
	caps/src/nsScriptSecurityManager.cpp
	modules/libpref/src/init/all.js
Fix
24565 nsScriptSecurityManager::GetSecurityLevel() is a performance
24567 re-write DOM glue security checks to avoid NS_WITH_SERVICE()
r=waterson

Files:
	dom/src/base/nsGlobalWindow.cpp
	layout/base/src/nsDocument.cpp
	layout/base/src/nsGenericElement.cpp
Fix assertion failure for 1-character property names.


Files:
	dom/src/jsurl/nsJSProtocolHandler.cpp
	webshell/src/nsDocLoader.cpp
Fix 18653 "javascript:" URLs cross windows problems (probably regressi
r=nisheeth

Files:
	layout/events/src/nsEventListenerManager.cpp
Fix
23834 document.onkeypress allows sniffing keystrokes
24152 document.onclick shows links from other window
r=joki


git-svn-id: svn://10.0.0.236/trunk@58429 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-23 04:23:14 +00:00
norris%netscape.com
c76212942e Fix bug 24378 All DOM security checks inadvertently disabled
r=mstoltz,rogerl;a=jar


git-svn-id: svn://10.0.0.236/trunk@58269 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-19 23:39:07 +00:00
mstoltz%netscape.com
55356cc71b Implemented the reading of capabilities data from prefs. Reads codebase and certificate principal data and populates ScriptSecurityManager's principals table. bug= 18122 r=norris, rginda
git-svn-id: svn://10.0.0.236/trunk@58125 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-18 21:54:01 +00:00
norris%netscape.com
2dd1e30161 Fix bug 16536.
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@57486 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-12 01:42:37 +00:00
norris%netscape.com
66694f8a98 Get IRCChat working without compromising security.
Fix bugs 20261, 23518
r=rginda,mstoltz


git-svn-id: svn://10.0.0.236/trunk@57437 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-11 22:02:06 +00:00
norris%netscape.com
02d0724222 Fix
858  [Feature] JavaScript auto-disable per-domain RFE
    13023 Users must be able to disable Java and JavaScript (for JS in mail)
    21923 Executing functions in "chrome:" protocol - #2.
    r=mstoltz

    (Checked in with red on Mac; Wan-Teh says his changes are localized so
     it shouldn't interfere with his fixing bustage.)


git-svn-id: svn://10.0.0.236/trunk@57214 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-08 16:51:54 +00:00
norris%netscape.com
82970f315d Fix 22909 previousSibling vulnerability
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@56914 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-06 00:59:18 +00:00
jband%netscape.com
191411b358 Landing big set of DOM and XPConnect changes:
DOM: getting rid of JS_GetContextPrivate wherever possible. Use static parent
links where we can. When we do need to find this info about the caller
we call a function that knows how to get that info rather than inline calls
to JS_GetContextPrivate. This is all required for calling DOM objects on
non-DOM JSContexts as we do via xpconnect.

XPConnect: basic refactoring work to disassociate wrappers from the JSContext
that was active when the wrapper was constructed. This allows for calling into
wrapped JS objects on the right JSContext and for proper grouping of wrapped
native objects so that they can share proto objects. This also allows for
better sharing of objects and lays the foundations for threadsafety and
interface flattening.

Also, xpconnect tests are reorganized and improved.

fixes bugs: 13419, 17736, 17746, 17952, 22086

r=vidur r=mccabe r=norris r=cbegle
a=chofmann


git-svn-id: svn://10.0.0.236/trunk@56202 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-18 20:29:29 +00:00
norris%netscape.com
1f0d69f6d9 Fix crash seen by waterson.
r=waterson


git-svn-id: svn://10.0.0.236/trunk@55024 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-02 05:41:17 +00:00
norris%netscape.com
1ffa0ae294 Fix
20257 unable to edit existing images in editor due to JS error
	19933 JavaScript "window.location" core dumps in CAPS
Back out previous changes for enforcing security on listeners and go with a
simple restriction of access to the method for adding listeners.
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@54940 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-01 22:23:22 +00:00
buster%netscape.com
a5b61285a7 bug 2253. added controller to html text input
r = kmcclusk, norris


git-svn-id: svn://10.0.0.236/trunk@54909 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-01 15:11:33 +00:00
norris%netscape.com
2429ef124a Fix 18553 [DOGFOOD] addEventListener allows sniffing keystrokes
Add checks to nsScriptSecurityManager::CheckCanListenTo that take
a principal and ensure that the currently executing script code
either is from the same origin as that principal or has the
UniversalBrowserRead privilege enabled. (chrome code has all
privileges enabled by default.) It's okay for the principal passed in
to be null. That just signifies a privileged window/document that only
can be listened to with privileges.

I added GetPrincipal/SetPrincipal methods to nsIEventListenerManager.
nsDocument::GetNewListenerManager sets a principal on the listener
manager when it creates one. Obviously there are other places that
create listener managers, but scripts seem to go through this one.

Another change is to save some memory usage. Currently I allocate an
array of PolicyType that is NS_DOM_PROP_MAX elements long.
Unfortunately, compilers appear to allocate four bytes for each
PolicyType, so the array takes around 2400 bytes. I've added changes
to use two bit vectors that should consume about 1/16 that space.

r=joki

There are also changes that push nsnull onto the JSContext stack when
entering a nested event loop.

r=jband


git-svn-id: svn://10.0.0.236/trunk@54477 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-25 05:28:18 +00:00
norris%netscape.com
f77a65d9d4 Modify generated dom code to use a enum rather than a string for codesize
and efficiency.
Tighten checks on document properties and node properties. Should resolve
several bugs:
18965 document.firstChild vulnerability
19043 document.childNodes vulnerability
19044 document.lastChild vulnerability
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@54051 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-20 07:28:34 +00:00
norris%netscape.com
331cf153db * Fix 12124 [DOGFOOD] Reading user's preferences
* Implement site-specific security policies (bug 858)
r=mstoltz
* Use Recycle rather than delete[] to clean up Purify logs
r=law


git-svn-id: svn://10.0.0.236/trunk@53631 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-16 05:07:31 +00:00
norris%netscape.com
af6af01717 Restore original changes with bustage fixes.
git-svn-id: svn://10.0.0.236/trunk@53310 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-12 03:07:37 +00:00
norris%netscape.com
dca5057dcd Remove call that the compilers can't figure out.
Appears that perhaps the IDL compiler isn't getting called on nsIPref.idl in time.


git-svn-id: svn://10.0.0.236/trunk@53278 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-11 23:25:59 +00:00
norris%netscape.com
8add0018e4 Fix build bustage.
My build on Linux worked; don't understand why the Tinderbox build is different.


git-svn-id: svn://10.0.0.236/trunk@53274 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-11 23:07:14 +00:00
norris%netscape.com
d83622d4ac * Fix the following bugs by tightening the default security policy.
17977 [DOGFOOD] Reading documents using document.body
17538 document.lastModified is exposed
17537 document.images vulnerabilities
16036 [DOGFOOD] document.Element exposes the DOM of documents from
15757 [DOGFOOD] Injecting JS code using setAttribute and getElemen
15550 Injecting text in documents from any domain using createText
15067 [DOGFOOD] getElementsByTagName() allows reading of arbitrary
* Create an array of dom property policy types and initialize it when the script security manager is created.
* Move some implementation code to a new shared implementation base class.
* Implement privilege enabling, disabling and reverting
* Implement stack walking for checking privileges.
r=mstoltz@netscape.com

* Modify nsIPref to support security policy work.
r=neeti@netscape.com


git-svn-id: svn://10.0.0.236/trunk@53254 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-11 22:10:36 +00:00
dmose%mozilla.org
0efb7c174c updated xPL license boilerplate to v1.1, a=chofmann@netscape.com,r=endico@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@52910 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 03:43:54 +00:00
norris%netscape.com
a825f1738a work on bug 7270.
r=mstoltz.
Implement netscape.security.PrivilegeManager callbacks.


git-svn-id: svn://10.0.0.236/trunk@52128 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:09:03 +00:00
norris%netscape.com
68023d9210 Use NS_GET_IID, remove dead code, clean up error conditions for XPConnect security calls.
r=jband


git-svn-id: svn://10.0.0.236/trunk@51754 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:22:16 +00:00
law%netscape.com
95fc4f832f Fixes for bug #16789; permit OpenDialog to work on hidden window even if document load has not completed yet; r=norris@netscape.com, r=danm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51243 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 01:25:41 +00:00
norris%netscape.com
0b51721d30 Remove references to unsupported JVM_ calls. Needed for bug 16577.
r=shaver


git-svn-id: svn://10.0.0.236/trunk@51187 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:45:29 +00:00
norris%netscape.com
9323b18962 Fix a Unix warning by removing an unused local variable
git-svn-id: svn://10.0.0.236/trunk@50732 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:49:36 +00:00
norris%netscape.com
f686bba5d8 Fix part of 5403 Services improperly released: Use NS_WITH_SERVICE
reviewed by mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50493 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:51:54 +00:00
norris%netscape.com
c3494a9ffb Fix the following bugs:
14443 "Same origin" security policy may be circumvented using docu
14820 Fixing up the relationship between nsCodeBasePrincipal and n
14919 Crash in JS MM code
Reviewed by mstoltz, approved by scc.


git-svn-id: svn://10.0.0.236/trunk@49647 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-02 03:41:37 +00:00
norris%netscape.com
761b5f5706 Add ability to disable JS. Fix 13978 shopping at webvan.com crashes
git-svn-id: svn://10.0.0.236/trunk@47995 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-17 20:13:52 +00:00
norris%netscape.com
3036cb7a8a Add security support for javascript: uris.
git-svn-id: svn://10.0.0.236/trunk@47649 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-15 20:58:41 +00:00
norris%netscape.com
47554a1bf7 Create preferences for security checks.
Add new methods on nsIScriptSecurityManager for capabilities.
Fix 13739 MLK: nsScriptSecurityManager::CreateCodebasePrincipal
Fix 11666 Eliminate plvector (was: [infinite loop] bugs - plvector.c)


git-svn-id: svn://10.0.0.236/trunk@47517 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-15 04:05:43 +00:00
norris%netscape.com
a8e5ba22e5 Makefile.in: remove unused file
nsScriptSecurityManager.cpp: Fix CheckURI problems (but still disabled)
nsSecurityManagerFactory.cpp: Make registration string match convention


git-svn-id: svn://10.0.0.236/trunk@46566 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-09 13:47:16 +00:00
don%netscape.com
3a21477635 Temporarily disabled CheckURI so the Manage Bookmarks dialog and other windows work again. Norris will fix the window.open problem later.
git-svn-id: svn://10.0.0.236/trunk@46298 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-08 04:25:14 +00:00
norris%netscape.com
1405f1b83a disable XPConnect security check, perhaps related to test failure. Getting reports of failures on Mac at least.
git-svn-id: svn://10.0.0.236/trunk@46231 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-07 22:29:56 +00:00
norris%netscape.com
74202f2741 Fix bug 13253.
Enable restrictions on use of Components array from web JavaScript.


git-svn-id: svn://10.0.0.236/trunk@46223 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-07 20:40:20 +00:00
norris%netscape.com
4e8768c593 * Add checks on urls formed from web scripts
* Make nsScriptSecurityManager implement nsXPCSecurityManager
* Fix unix warnings


git-svn-id: svn://10.0.0.236/trunk@46152 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-07 02:54:19 +00:00
shaver%netscape.com
75770de0d4 quell assignment-as-boolean warning
git-svn-id: svn://10.0.0.236/trunk@46047 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-05 05:28:28 +00:00
norris%netscape.com
34b474302b Add all-powerful system principals. Remove some dead code from the build.
git-svn-id: svn://10.0.0.236/trunk@45380 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-01 00:54:35 +00:00
joki%netscape.com
9db6478cb3 Adding new flag to the security check calls out of the DOM generated JS files.
git-svn-id: svn://10.0.0.236/trunk@45348 18797224-902f-48f8-a5cc-f745e15eee43
1999-08-31 14:23:55 +00:00
norris%netscape.com
3a6d863c13 * clean up nsScriptSecurityManager
* remove nsJSSecurityManager
* save principals in nsIChannels and nsIDocuments


git-svn-id: svn://10.0.0.236/trunk@45080 18797224-902f-48f8-a5cc-f745e15eee43
1999-08-29 21:58:42 +00:00
gagan%netscape.com
16f9ee173e Fixed some memory leaks showing up on bruce's log-
http://www.cybersight.com/~bruce/apprunner.mongo.19990827.log.


git-svn-id: svn://10.0.0.236/trunk@44793 18797224-902f-48f8-a5cc-f745e15eee43
1999-08-27 08:36:49 +00:00
arielb%netscape.com
ad40dbfcd5 includes updates to codbase matching security checks currently turned off
but in place.  redefined the script security manager in caps and it is
now generating codebase principals.


git-svn-id: svn://10.0.0.236/trunk@43798 18797224-902f-48f8-a5cc-f745e15eee43
1999-08-20 09:51:02 +00:00