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

Index Accessors Security Discussion #2

Open
natashenka opened this issue Dec 6, 2017 · 6 comments
Open

Index Accessors Security Discussion #2

natashenka opened this issue Dec 6, 2017 · 6 comments

Comments

@natashenka
Copy link

Array index accessors have led to many security issues (see: https://docs.google.com/presentation/d/11fkQeEisoszNGF8SrautVT1ltSnsQBWRxJ4usoc-g_o/edit#slide=id.g2b34aaab4a_1_0). Unfortunately, the usage metrics on those slides turned out to be measured incorrectly, real usage is here: https://www.chromestatus.com/metrics/feature/timeline/popularity/2238 . The usage is actually very high, almost 5% of all pages. Most of this usage is because jQuery uses this feature. I think there are a few options to lessen the security impact here, especially:

  • Provide implementer guidance to be careful of index accessors in every new (and possibly existing) functions that handle array
  • Create new features involving arrays so that they don't trigger accessors (for example, make Array.flatten intentionally only handle own data properties of an Array). It might also be possible to do this with existing features with implementation inconsistencies.
  • Try to move jQuery off of this feature and then deprecate it. It's probably too late for this though ...
@caridy
Copy link

caridy commented Feb 8, 2018

@natashenka we have been debating this problem and potential mitigation strategies during the SES weekly meeting. We plan to discuss it in more details next Thursday, it will be great if you can join us. /cc @erights

@natashenka
Copy link
Author

natashenka commented Feb 10, 2018 via email

@caridy
Copy link

caridy commented Feb 12, 2018

@natashenka invited sent for next thursday.

@evilpie
Copy link

evilpie commented Feb 12, 2018

Do you have data for Firefox? I asked around and we don't think that indexed accessors are causing especially many security issues for us. I think I remember some issues with @@species, but I couldn't find the right bugs at this time.

@evilpie
Copy link

evilpie commented Feb 12, 2018

Additionally without indexed accessors, don't we still need to worry about proxies?

@natashenka
Copy link
Author

I haven't found any, or seen any externally reported in Firefox, though I haven't taken a look in a while. There have been a few issues with Proxies, but index accessors cause more problems because they won't be detected by a type check.

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

No branches or pull requests

3 participants