Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"attribute getter" steps skip security checks on namespaces #1133

Open
tabatkins opened this issue Apr 29, 2022 · 1 comment
Open

"attribute getter" steps skip security checks on namespaces #1133

tabatkins opened this issue Apr 29, 2022 · 1 comment

Comments

@tabatkins
Copy link
Contributor

The attribute getter algo can be called with an interface or a namespace. However, step 1.1.2 only checks if the object is an interface; if it is, it does some security checks, and actually grabs the IDL value, so step 1.1.3 can invoke the getter steps for the attribute on it.

A namespace will fail that check, meaning "idlObject" is left as null (set in step 1.1.1), and then 1.1.3 invokes the getter steps for the namespace's attribute on null. This'll break spec algos that expect the [=this=] value to actually be the namespace object the attribute is defined on.

Is this intentional? Are namespaces not intended to be able to carry any internal state that an attribute getter might look at? (And intended to be accessible cross-origin, since the security check is bypassed? Well, I suppose getting the namespace object from Window in the first place would fail, since none of the allowed cross-origin properties are namespaces.) If so, would you mind if I PR'd some editorial fixes that make it clear this is intentional rather than it just being a behavior that falls out of the algo?

@domenic
Copy link
Member

domenic commented Apr 29, 2022

Are namespaces not intended to be able to carry any internal state that an attribute getter might look at?

Exactly.

If so, would you mind if I PR'd some editorial fixes that make it clear this is intentional rather than it just being a behavior that falls out of the algo?

Seems like a great idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants