Skip to content

AppRegistry mishandles keys inherited from Object.prototype #58196

Description

@OskarEichler

Description

The public AppRegistry stores app and section keys in plain object literals. Looking up an unregistered key such as constructor returns an inherited Object member. Registering the valid string key __proto__ mutates the registry prototype rather than creating an own entry, so the app/section key lists omit it.

The defect is present in React Native 0.87.1 and current main.

Steps to reproduce

Call AppRegistry.getRunnable("constructor"), then register an app or section named __proto__ and inspect getAppKeys() / getSectionKeys().

Expected behavior

Only explicitly registered keys should resolve, and all string app/section keys should be stored as ordinary own entries.

React Native Version

0.87.1 and current main.

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

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions