Skip to content

Index Accessors Security Discussion #2

Description

@natashenka

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 ...

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions