Skip to content

Commit a892e8a

Browse files
committed
[Flight] Enforce "simple object" rule in production (#27502)
We only allow plain objects that can be faithfully serialized and deserialized through JSON to pass through the serialization boundary. It's a bit too expensive to do all the possible checks in production so we do most checks in DEV, so it's still possible to pass an object in production by mistake. This is currently exaggerated by frameworks because the logs on the server aren't visible enough. Even so, it's possible to do a mistake without testing it in DEV or just testing a conditional branch. That might have security implications if that object wasn't supposed to be passed. We can't rely on only checking if the prototype is `Object.prototype` because that wouldn't work with cross-realm objects which is unfortunate. However, if it isn't, we can check wether it has exactly one prototype on the chain which would catch the common error of passing a class instance. DiffTrain build for commit e61a60f.
1 parent 492aa81 commit a892e8a

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24770,7 +24770,7 @@ function createFiberRoot(
2477024770
return root;
2477124771
}
2477224772

24773-
var ReactVersion = "18.3.0-canary-1fc58281a-20231011";
24773+
var ReactVersion = "18.3.0-canary-e61a60fac-20231011";
2477424774

2477524775
// Might add PROFILE later.
2477624776

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8968,7 +8968,7 @@ var devToolsConfig$jscomp$inline_1008 = {
89688968
throw Error("TestRenderer does not support findFiberByHostInstance()");
89698969
},
89708970
bundleType: 0,
8971-
version: "18.3.0-canary-1fc58281a-20231011",
8971+
version: "18.3.0-canary-e61a60fac-20231011",
89728972
rendererPackageName: "react-test-renderer"
89738973
};
89748974
var internals$jscomp$inline_1201 = {
@@ -8999,7 +8999,7 @@ var internals$jscomp$inline_1201 = {
89998999
scheduleRoot: null,
90009000
setRefreshHandler: null,
90019001
getCurrentFiber: null,
9002-
reconcilerVersion: "18.3.0-canary-1fc58281a-20231011"
9002+
reconcilerVersion: "18.3.0-canary-e61a60fac-20231011"
90039003
};
90049004
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90059005
var hook$jscomp$inline_1202 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9394,7 +9394,7 @@ var devToolsConfig$jscomp$inline_1050 = {
93949394
throw Error("TestRenderer does not support findFiberByHostInstance()");
93959395
},
93969396
bundleType: 0,
9397-
version: "18.3.0-canary-1fc58281a-20231011",
9397+
version: "18.3.0-canary-e61a60fac-20231011",
93989398
rendererPackageName: "react-test-renderer"
93999399
};
94009400
var internals$jscomp$inline_1242 = {
@@ -9425,7 +9425,7 @@ var internals$jscomp$inline_1242 = {
94259425
scheduleRoot: null,
94269426
setRefreshHandler: null,
94279427
getCurrentFiber: null,
9428-
reconcilerVersion: "18.3.0-canary-1fc58281a-20231011"
9428+
reconcilerVersion: "18.3.0-canary-e61a60fac-20231011"
94299429
};
94309430
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
94319431
var hook$jscomp$inline_1243 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-canary-1fc58281a-20231011";
30+
var ReactVersion = "18.3.0-canary-e61a60fac-20231011";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
580580
exports.useTransition = function () {
581581
return ReactCurrentDispatcher.current.useTransition();
582582
};
583-
exports.version = "18.3.0-canary-1fc58281a-20231011";
583+
exports.version = "18.3.0-canary-e61a60fac-20231011";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ exports.useSyncExternalStore = function (
583583
exports.useTransition = function () {
584584
return ReactCurrentDispatcher.current.useTransition();
585585
};
586-
exports.version = "18.3.0-canary-1fc58281a-20231011";
586+
exports.version = "18.3.0-canary-e61a60fac-20231011";
587587

588588
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
589589
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1fc58281af73ca4507c41d53a3e08dc2038b0c1f
1+
e61a60fac02d205ad928bff6de2449f00646a92c

0 commit comments

Comments
 (0)