Repository navigation
chore: upgrade to 4.5.5-exodus.0 for RN 0.85 - #38
Merged
Merged
Conversation
…lobal (0056) Remove the ArrayBuffer-based raw pointer exposure that leaked the worklet runtime address into JavaScript-accessible global scope. (cherry picked from commit 52508b4)
…ollution (0057+0067) Replace direct bracket assignment (result[key] = value) with Object.defineProperty-based safeAssign helper inside the runAnimations worklet, preventing __proto__ / constructor injection via animation keys. (cherry picked from commit 50decef)
…ollution (0058) Add early-return guards for __proto__, constructor, and prototype keys in the setPath loop body and final assignment to block prototype pollution via crafted animation paths. (cherry picked from commit c95d4fe)
… (0073+0074) Replace recursive _flattenArray with iterative stack-based implementation to prevent stack overflow via deeply nested arrays. Switch has() from 'in' operator to Object.prototype.hasOwnProperty.call() to avoid prototype chain lookups. (cherry picked from commit 2ae5492)
…33) 2ae5492 replaced the recursive flatten with an iterative stack to avoid stack overflow on deeply nested input, but seeded the stack with `[...array]` and popped from the end, so top-level entries came out reversed ([a, b, c] -> [c, b, a]) while nested entries stayed in order. filterStyles reduces the flattened list in order, so on every Animated.* component with `style={[base, override]}` the base entry won, and when several animated styles targeted the same prop the first one attached last. Upstream 4.3.0 and the shipped 3.16.7 fork both flatten in order. Seed the stack with the array itself: popping it pushes its children in reverse, which then pop in document order. Still iterative, so the 0073 hardening is preserved; the test covers both the ordering and a 100k-deep input. (cherry picked from commit 56eb675)
…0078)
Replace {} with Object.create(null) for animation copies in
decorateAnimation, props accumulator in PropsFilter, and inline props
objects in InlinePropManager. Also switch for...in to Object.entries()
in extractSharedValuesMapFromProps to avoid prototype chain traversal.
(cherry picked from commit 5f9d8c8)
… (0074) Comment out the Keyframe re-export from the package index as part of the security hardening against prototype pollution vectors. (cherry picked from commit 8036a01)
…er overflow (0080) Add upper-bound clamping in the sensor data copy loop to ensure the JNI-provided size cannot exceed the fixed-size local array capacity. (cherry picked from commit 094e2e3)
…parsing (0074) Remove all RegExp objects (MATCHERS array, NUMBER/PERCENTAGE patterns, call/callWithSlashSeparator/commaSeparatedCall helpers) from Colors.ts and replace with manual character-by-character validation functions (isAllHexDigits, isAllDigits, isAllDigitsDot, isPercentage) and substring matching. This eliminates ReDoS risk and prevents potential code execution via the RegExp constructor in the worklet runtime. Port of the 3.x patch 0074 Colors.ts portion to reanimated 4.x. (cherry picked from commit 491a0e0)
…id cloneRegExp serializer Reanimated 4 ships several CSS-style parsers as worklets whose closures captured module-level RegExp constants (SHADOW_PARTS_REGEX, SHADOW_SPLIT_REGEX, FILTER_REGEX, FILTER_VALUE_REGEX, DROP_SHADOW_REGEX). The Exodus AppSec hardening in `@exodus/react-native-worklets` explicitly throws when a worklet's serializer encounters a captured RegExp instance (`cloneRegExp` in serializable.native.ts), so any render mounting a component with `box-shadow` / `filter` / `drop-shadow` styles via reanimated trips `WorkletsError: RegExp has been disabled`. Move each captured RegExp literal into the worklet body that uses it so the literal lives in the worklet's serialized source and the UI runtime evaluates a fresh RegExp instance when the worklet runs. This bypasses `cloneRegExp` entirely without weakening the AppSec hardening — captured RegExps remain banned everywhere else. - common/utils/parsers.ts: SHADOW_PARTS_REGEX + SHADOW_SPLIT_REGEX moved into parseBoxShadowString. - common/style/processors/filter.ts: FILTER_VALUE_REGEX + DROP_SHADOW_REGEX moved into parseDropShadowString; FILTER_VALUE_REGEX also redeclared in parseFilterProperty (each worklet needs its own copy in its serialized source); FILTER_REGEX moved into parseFilterString. (cherry picked from commit 6e0689d)
…ntime-toggleable 4.5.5 note: upstream software-mansion#9527 (sync-status eviction for settled props) rewrote AnimatedPropsRegistry::update. The runtime flag now gates the timestamp and invalidation block, which still skips when USE_ANIMATION_BACKEND is on. (cherry picked from commit b03042e)
Scope the package under @Exodus and point every worklets reference (peer dependency, Babel plugin, Gradle subproject, CMake prefab) at the @exodus/react-native-worklets fork. The app autolinks the fork as the Gradle subproject :exodus_react-native-worklets, and Babel module aliases do not apply to plugin loading. Example apps keep importing `react-native-reanimated` through a path-based workspace alias, so their type checks still resolve. Port of 7c3bf1a and 0f1ec8e from exodus-4.3.0 onto the Kotlin Gradle script that upstream adopted in 4.4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebase the Exodus Reanimated patches from
exodus-4.3.0(4.3.0-exodus.4) onto upstream 4.5.5, the latest 4.5.x patch release. Part of the RN 0.85 upgrade: ExodusMovement/exodus#38584.4.5.5is the upstream4.5.5tag, so this diff shows only Exodus changes.@exodus/react-native-reanimated@4.5.5-exodus.0(version set, not published).@exodus/react-native-worklets0.11.x. The worklets fork is in draft PR chore: upgrade worklets to 0.11.4-exodus.0 for RN 0.85 #39 on baseworklets-0.11.4, because upstream now releases worklets from its ownworklets-0.x-stablebranches.Carried commits
_WORKLET_RUNTIMEpointer leak (0056)52508b40esafeAssigninrunAnimations(0057+0067)50decef02setPath(0058)c95d4fe9bflattenArrayand own-property check inhas()(0073+0074)2ae549256Object.hasOwnreplaced byObject.prototype.hasOwnProperty.call. This passes lint without the ES2022libbumpflattenArraykeeps style order (#33)56eb675d9Object.create(null)accumulators (0074+0078)5f9d8c87eKeyframeexport (0074)8036a016fSensorSetterbounds check (0080)094e2e357491a0e0386e0689d1eFORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONSb03042e5bAnimatedPropsRegistry::update. The runtime flag now gates the timestamp and invalidation block, and the block still skips whenUSE_ANIMATION_BACKENDis on. The app callssetDynamicFeatureFlagfor this flag@exodus/react-native-reanimated7c3bf1a17,0f1ec8ea5build.gradle.kts. CMake, Babel plugin and peer dependency point at@exodus/react-native-worklets. Example apps use a path-based workspace aliasjsVersion.tsis set to the fork versionDropped commits
c0ee02625(#35, registry race backport of upstream software-mansion#9323)89e7f4d25)4cbcc1e17(jsVersion read frompackage.json)set-versionbuild step that writesjsVersion.ts. The fork sets the literal. This also removes the../../package.jsonimport that broke jest in the app5ca2246ab(#37, types pathlib/typescript/src)package.jsonimport, tsc emitslib/typescript/index.d.tsagain, which upstreamtypesalready points at9a2b92cc5, version bump commitsstaticFlags.jsonis the upstream 4.5.5 file.FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS,USE_SYNCHRONIZABLE_FOR_MUTABLESandDISABLE_COMMIT_PAUSING_MECHANISMkeep the same defaults as the 4.3 fork. Upstream 4.5 also turns onEXPERIMENTAL_CSS_ANIMATIONS_FOR_SVG_COMPONENTSby default and addsIOS_CSS_CORE_ANIMATIONandUSE_ANIMATION_BACKEND(both off).Upstream changes that matter for the app
FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONSworkaround targets. The workaround can likely be removed after verification.UIManagerAnimationDelegate(refactor(LayoutAnimations): stop taking over UIManagerAnimationDelegate software-mansion/react-native-reanimated#9901, 4.5.4). Nil_performOperationsguard (fix(iOS): guard against nil _performOperations block in REANodesManager software-mansion/react-native-reanimated#10229). No release note names a fast tab-switch slowdown.EventTargetcrash inhandleRawEvent(fix: crash in handleRawEvent on stale EventTarget with null InstanceHandle software-mansion/react-native-reanimated#9926), exiting views stuck under load (fix: Android ANR deadlock between CSS updates-registry lock and Fabric commit software-mansion/react-native-reanimated#9715 area). No release note names a sheet backdrop touch issue.useInterpolateConfig,InterpolateConfigandColorSpaceare gone. JSC support is removed.Test plan
Done (JS only, no native builds):
yarn jestinpackages/react-native-reanimated: 91 suites, 1389 tests passtype:check:src:nativeandtype:check:src:webpasslint:jspasses (0 errors). 22n/no-unpublished-importwarnings appear because the peer dependency is now the scoped namebob buildemitslib/moduleandlib/typescript/index.d.tstype:check:appandtype:check:testsfail only onKeyframeimports. This is expected, because the security patch removes the exportTo do before release: