[React2Shell] How to mitigate in React Native
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C++
- Star
- 127k
- Fork
- 25.3k
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 4
Mô tả
[!IMPORTANT]
See this comment for the impact to React Native and steps to mitigate.-@rickhanlonii
Description
A security vulnerability with React was disclosed (https://nvd.nist.gov/vuln/detail/CVE-2025-55182). While trying to upgrade a RN 0.81.5 old arch app to React version 19.1.2, an error is thrown from ReactNativeRender.
For 0.81.5, ReactNativeRenderer is expecting React version 19.1.0.
While React Native apps are not susceptible to the vulnerability, many apps live in monorepos with NextJS (or other RSC powered apps).
I'm wondering if there's a recommendation on how best to proceed? Would it be possible to release patch versions of React Native that increment the supported/expected React version?
Thank you!
Steps to reproduce
npx @react-native-community/cli init --version 0.81.5- Turn off new arch (i.e.
:new_arch_enabled => falseinPodfile) - Update React version in generated app's
package.jsonto19.1.2 npm run startnpm run ios- see errors:
console.js:661 Error: Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:
- react: 19.1.2
- react-native-renderer: 19.1.0
React Native Version
0.81.5, 0.82.1
Affected Platforms
Runtime - iOS, Runtime - Android
Output of npx @react-native-community/cli info
N/A
Stacktrace or Logs
console.js:661 Error: Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:
- react: 19.1.2
- react-native-renderer: 19.1.0
Learn more: https://react.dev/warnings/version-mismatch
at anonymous (ReactNativeRenderer-dev.js:16872:18)
at anonymous (ReactNativeRenderer-dev.js:17081:4)
at loadModuleImplementation (require.js:285:12)
at guardedLoadModule (require.js:190:36)
at metroRequire (require.js:98:24)
at anonymous (ReactNative.js:19:24)
at loadModuleImplementation (require.js:285:12)
at guardedLoadModule (require.js:183:45)
at metroRequire (require.js:98:24)
at renderElement (RendererImplementation.js:49:12)
at renderApplication (renderApplication.js:102:25)
at anonymous (AppRegistryImpl.js:89:22)
at runApplication (AppRegistryImpl.js:178:20)
at apply (native)
at __callFunction (MessageQueue.js:435:34)
at anonymous (MessageQueue.js:114:26)
at __guard (MessageQueue.js:369:11)
at callFunctionReturnFlushedQueue (MessageQueue.js:113:17)
anonymous @ console.js:661
overrideMethod @ backend.js:17416
reactConsoleErrorHandler @ ExceptionsManager.js:184
anonymous @ setUpDeveloperTools.js:42
reportException @ ExceptionsManager.js:108
handleException @ ExceptionsManager.js:173
handleError @ setUpErrorHandling.js:25
reportFatalError @ error-guard.js:49
guardedLoadModule @ require.js:185
metroRequire @ require.js:98
renderElement @ RendererImplementation.js:49
renderApplication @ renderApplication.js:102
anonymous @ AppRegistryImpl.js:89
runApplication @ AppRegistryImpl.js:178
__callFunction @ MessageQueue.js:435
anonymous @ MessageQueue.js:114
__guard @ MessageQueue.js:369
callFunctionReturnFlushedQueue @ MessageQueue.js:113
console.js:661 TypeError: Cannot read property 'default' of undefined
at renderElement (RendererImplementation.js:49:45)
at renderApplication (renderApplication.js:102:25)
at anonymous (AppRegistryImpl.js:89:22)
at runApplication (AppRegistryImpl.js:178:20)
at apply (native)
at __callFunction (MessageQueue.js:435:34)
at anonymous (MessageQueue.js:114:26)
at __guard (MessageQueue.js:369:11)
at callFunctionReturnFlushedQueue (MessageQueue.js:113:17)
anonymous @ console.js:661
overrideMethod @ backend.js:17416
reactConsoleErrorHandler @ ExceptionsManager.js:184
anonymous @ setUpDeveloperTools.js:42
reportException @ ExceptionsManager.js:108
handleException @ ExceptionsManager.js:173
handleError @ setUpErrorHandling.js:25
reportFatalError @ error-guard.js:49
__guard @ MessageQueue.js:371
callFunctionReturnFlushedQueue @ MessageQueue.js:113
console.js:661 Error: Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:
- react: 19.1.2
- react-native-renderer: 19.1.0
Learn more: https://react.dev/warnings/version-mismatch
at anonymous (ReactNativeRenderer-dev.js:16872:18)
at anonymous (ReactNativeRenderer-dev.js:17081:4)
at loadModuleImplementation (require.js:285:12)
at guardedLoadModule (require.js:190:36)
at metroRequire (require.js:98:24)
at anonymous (ReactNative.js:19:24)
at loadModuleImplementation (require.js:285:12)
at guardedLoadModule (require.js:183:45)
at metroRequire (require.js:98:24)
at renderElement (RendererImplementation.js:49:12)
at renderApplication (renderApplication.js:102:25)
at anonymous (AppRegistryImpl.js:89:22)
at runApplication (AppRegistryImpl.js:178:20)
at apply (native)
at __callFunction (MessageQueue.js:435:34)
at anonymous (MessageQueue.js:114:26)
at __guard (MessageQueue.js:369:11)
at callFunctionReturnFlushedQueue (MessageQueue.js:113:17)
anonymous @ console.js:661
overrideMethod @ backend.js:17416
reactConsoleErrorHandler @ ExceptionsManager.js:184
anonymous @ setUpDeveloperTools.js:42
reportException @ ExceptionsManager.js:108
handleException @ ExceptionsManager.js:173
handleError @ setUpErrorHandling.js:25
reportFatalError @ error-guard.js:49
guardedLoadModule @ require.js:185
metroRequire @ require.js:98
renderElement @ RendererImplementation.js:49
renderApplication @ renderApplication.js:102
anonymous @ AppRegistryImpl.js:89
runApplication @ AppRegistryImpl.js:178
__callFunction @ MessageQueue.js:435
anonymous @ MessageQueue.js:114
__guard @ MessageQueue.js:369
callFunctionReturnFlushedQueue @ MessageQueue.js:113
console.js:661 TypeError: Cannot read property 'default' of undefined
at renderElement (RendererImplementation.js:49:45)
at renderApplication (renderApplication.js:102:25)
at anonymous (AppRegistryImpl.js:89:22)
at runApplication (AppRegistryImpl.js:178:20)
at apply (native)
at __callFunction (MessageQueue.js:435:34)
at anonymous (MessageQueue.js:114:26)
at __guard (MessageQueue.js:369:11)
at callFunctionReturnFlushedQueue (MessageQueue.js:113:17)
anonymous @ console.js:661
overrideMethod @ backend.js:17416
reactConsoleErrorHandler @ ExceptionsManager.js:184
anonymous @ setUpDeveloperTools.js:42
reportException @ ExceptionsManager.js:108
handleException @ ExceptionsManager.js:173
handleError @ setUpErrorHandling.js:25
reportFatalError @ error-guard.js:49
__guard @ MessageQueue.js:371
callFunctionReturnFlushedQueue @ MessageQueue.js:113
MANDATORY Reproducer
N/A
Screenshots and Videos
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với các dòng 10606-10611 của ReactNativeRenderer-prod.js và stacktrace của ReactNativeRenderer-dev.js, sau đó xem xét hành vi của các phiên bản 0.81.5 và 0.82.1 cùng với Podfile và package.json của app được tạo. Tái hiện sự không khớp bằng các bước CLI, Metro và iOS được liệt kê; issue cần một mitigation được maintainer phê duyệt hoặc một khuyến nghị release trước khi có thể xác định việc hoàn tất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- android, ios, javascript, react-native
- Lĩnh vực
- mobile-dev, security
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100