endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
828 stars 72 forks source link

feat(ses): tolerate omitted species #2108

Closed erights closed 8 months ago

erights commented 8 months ago

closes: #XXXX refs: #XXXX

Description

MetaMask is targeting React Native, that run on the Hermes JS engine. Thus, it would be good for the ses-shim to work on Hermes. Once problem we ran into is that Hermes omits Symbol.species. (Good riddance!) With this PR, the ses-shim should tolerate this difference from standard JS.

Security Considerations

Assuming that the semantics of the JS they implement is adjusted from the standard semantics in any of the obvious ways to cope with the absence of Symbol.species, this should have little effect on security.

Those "obvious ways" are

(FWIW, I further assume they make the first choice. Otherwise, what's the point of the omission? However, this PR should be compat with either.)

I say "little effect on security" above because this absence can in theory mislead correct JS code into silently doing the wrong thing.

Scaling Considerations

None

Documentation Considerations

None

Testing Considerations

I leave that to those set up to test on Hermes, since that is the point. Attn @naugtur @kumavis

Compatibility Considerations

It only causes an observable difference on platforms that omit Symbol.species, on which the ses shim previously refused to run. So none.

Upgrade Considerations

None. Nothing Breaking certainly. Nothing newsworthy yet. But when the ses-shim as a whole is know to support Hermes, that will be newsworthy ;)