-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: SES lockdown v0.18.8 (iOS JSC) #6586
Conversation
With ESLint disabled since added to global
--exclude 'nothing' required to include package.json
--exclude 'nothing' required to include package.json is buggy Trim exccess fat
--exclude 'nothing' required to include package.json
--exclude 'nothing' required to include package.json is buggy Trim excess fat
Exclude polyfillGlobal
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
- Branch hash - COCOAPODS: 1.12.0 to 1.12.1
@SocketSecurity ignore [email protected] Unmaintained (via devDep)
|
65a7945
to
615abc6
Compare
Fix iOS native animation (non-nil/non-zero) assertion failure (on initial parentNode then childNode), after nav to bot 4th WebView tab (unable to load pages, likely caused by current excluded RN Promise polyfillGlobal) - Df (Foundation) *** Assertion failure in - disconnectAnimatedNodes:childTag - E [com.facebook.react.log:native] Exception thrown while executing UI block: 'parentNode' is a required parameter - Df (Foundation) *** Assertion failure in - connectAnimatedNodes:childTag - E [com.facebook.react.log:native] Exception thrown while executing UI block: 'childNode' is a required parameter Exclude iOS native animation (non-nil/non-zero) assertion macros - for now, when nodes (pointers to tags) attach/detach (to old/new parents and new views) QA: no empty animation frames observed ✅ Low probability possible risks introduced - incomplete node invalidation (outdated nodes) - race condition: prop updated before UIManager created view (outdated props) QA: no outdated animation frames observed ✅ iOS native animation assertion refs - Summary: facebook/react-native@c858420 - PR: facebook/react-native#10663 - Examples: facebook/react-native#9120 - nb: mimics ReactAndroid (i.e. NativeAnimatedNodesManager.java) nb: metro-react-native-babel-preset (0.72.3) - @babel/plugin-transform-regenerator has been removed since initial investigation - @babel/plugin-transform-runtime (removed) - 4 fewer SES warnings - intrinsics: Object.setPrototypeOf.default, Object.setPrototypeOf.__esModule, Reflect.construct.default, Reflect.construct.__esModule - @babel/plugin-transform-runtime > regenerator: false - immediate error thrown (recurring) Todo: Fix WebView page load (likely caused by current excluded RN Promise polyfillGlobal), thus fixing these assertion failures on nav, then revert this patch - Problem: Including (default) RN Promise polyfillGlobal causing app to boot empty root view Todo: Root cause of above 'regenerator: false' causing nil/zero parent/child nodes immediately to reoccur
615abc6
to
e52f13a
Compare
Until Hermes runtime working on Android (currently only bundling successful)
E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2643987a-2d33-44ce-88f1-db28cf311e11 |
"lint:eslint": "*.js" | ||
}, | ||
- "main": "lib/index.js", | ||
+ "main": "src/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, I don't understand here why we needed to point to the src
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question ^ these couple ethjs contract/query libs we use (transitively via ethjs) to init our engine service
both optimise their bundles with few Babel runtime helpers (notably regenerator and asyncToGenerator)
both currently incompatible with SES, so using their source code instead is less problematic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so captured the details mentioned here
both in a code comment and issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered patching babel-runtime
and regenerator-runtime
instead? They're used in quite a few packages (including some that we'll be introducing soon to the codebase, like our ethjs-*
forks of packages like this one). It may be easier to fix the problem at the source. The extension already has patches for them to make them SES compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the answers Leo! LGTM!
branch updated to re-run smoke tests before merge, but all CI broken on yarn audit, fixed in after fix merged ^ re-update branch, re-run smoke tests, then merge squash edit: merged |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/156c9199-a45a-41b6-a518-6f6232b927d0 |
|
Description
Problem being solved: prototype pollution/poisoning
SES lockdown (shim v0.18.8) on iOS JSC, baked early into RN core before RN initialisation for the simplest minimal solution
as opposed to previous approach of shim'ing at the beginning of our entry file requiring further complex lib patches
with SES lockdown on Android Hermes (introduced earlier in our RN v0.71.6 upgrade) being followed up separately
currently bundling successfully, but runtime not yet functional
SES lockdown on Android JSC was also passing smoke tests after some work prior to Hermes
so a backup engine worth keeping on ice being followed up separately
Previous patches no longer required:
eth-keyring-controller
,ethjs-contract
(one not two),web3-core-methods
,metro-react-native-babel-preset
, Sentry config (see previous PR: #3794)Nb:
@babel/plugin-transform-regenerator
removed frommetro-react-native-babel-preset
since initial investigationNb:
@babel/plugin-transform-runtime
config optregenerator: true
previously caused iOS animated node assertion failuresNb: default
@babel/plugin-transform-runtime
viametro-react-native-babel-preset
causes additional 4 SES warningsNb: Current behaviour (not SES)
Previous SES warnings when locking down at entry file (not RN InitializeCore)
https://www.diffchecker.com/fjj1iObp
Notes on patch creation
--exclude 'nothing'
to includepackage.json
changes, then trim patchreact-native
requires trimming majority of patch after initial diffsgit clean -fdx
and re-createRelated issues
Worthy read for everyone on adding/upgrading libraries
Fixes
Manual testing steps
App functions normally
Screenshots/Recordings
Before
Previously failing iOS (JSC) E2E tests have now been fixed
And more screenshots in related issues linked above
After
App functioning normally
Pre-merge author checklist
Pre-merge reviewer checklist