Skip to content

Commit ff1e909

Browse files
committed
[Flight] Taint APIs (#27445)
This lets a registered object or value be "tainted", which we block from crossing the serialization boundary. It's only allowed to stay in-memory. This is an extra layer of protection against mistakes of transferring data from a data access layer to a client. It doesn't provide perfect protection, because it doesn't trace through derived values and substrings. So it shouldn't be used as the only security layer but more layers are better. `taintObjectReference` is for specific object instances, not any nested objects or values inside that object. It's useful to avoid specific objects from getting passed as is. It ensures that you don't accidentally leak values in a specific context. It can be for security reasons like tokens, privacy reasons like personal data or performance reasons like avoiding passing large objects over the wire. It might be privacy violation to leak the age of a specific user, but the number itself isn't blocked in any other context. As soon as the value is extracted and passed specifically without the object, it can therefore leak. `taintUniqueValue` is useful for high entropy values such as hashes, tokens or crypto keys that are very unique values. In that case it can be useful to taint the actual primitive values themselves. These can be encoded as a string, bigint or typed array. We don't currently check for this value in a substring or inside other typed arrays. Since values can be created from different sources they don't just follow garbage collection. In this case an additional object must be provided that defines the life time of this value for how long it should be blocked. It can be `globalThis` for essentially forever, but that risks leaking memory for ever when you're dealing with dynamic values like reading a token from a database. So in that case the idea is that you pass the object that might end up in cache. A request is the only thing that is expected to do any work. The principle is that you can derive values from out of a tainted entry during a request. Including stashing it in a per request cache. What you can't do is store a derived value in a global module level cache. At least not without also tainting the object. DiffTrain build for commit 843ec07.
1 parent 5bad9b0 commit ff1e909

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

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
@@ -23997,7 +23997,7 @@ function createFiberRoot(
2399723997
return root;
2399823998
}
2399923999

24000-
var ReactVersion = "18.3.0-canary-54baa7997-20231002";
24000+
var ReactVersion = "18.3.0-canary-843ec0702-20231002";
2400124001

2400224002
// Might add PROFILE later.
2400324003

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
@@ -8623,7 +8623,7 @@ var devToolsConfig$jscomp$inline_1030 = {
86238623
throw Error("TestRenderer does not support findFiberByHostInstance()");
86248624
},
86258625
bundleType: 0,
8626-
version: "18.3.0-canary-54baa7997-20231002",
8626+
version: "18.3.0-canary-843ec0702-20231002",
86278627
rendererPackageName: "react-test-renderer"
86288628
};
86298629
var internals$jscomp$inline_1229 = {
@@ -8654,7 +8654,7 @@ var internals$jscomp$inline_1229 = {
86548654
scheduleRoot: null,
86558655
setRefreshHandler: null,
86568656
getCurrentFiber: null,
8657-
reconcilerVersion: "18.3.0-canary-54baa7997-20231002"
8657+
reconcilerVersion: "18.3.0-canary-843ec0702-20231002"
86588658
};
86598659
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86608660
var hook$jscomp$inline_1230 = __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
@@ -9049,7 +9049,7 @@ var devToolsConfig$jscomp$inline_1072 = {
90499049
throw Error("TestRenderer does not support findFiberByHostInstance()");
90509050
},
90519051
bundleType: 0,
9052-
version: "18.3.0-canary-54baa7997-20231002",
9052+
version: "18.3.0-canary-843ec0702-20231002",
90539053
rendererPackageName: "react-test-renderer"
90549054
};
90559055
var internals$jscomp$inline_1270 = {
@@ -9080,7 +9080,7 @@ var internals$jscomp$inline_1270 = {
90809080
scheduleRoot: null,
90819081
setRefreshHandler: null,
90829082
getCurrentFiber: null,
9083-
reconcilerVersion: "18.3.0-canary-54baa7997-20231002"
9083+
reconcilerVersion: "18.3.0-canary-843ec0702-20231002"
90849084
};
90859085
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90869086
var hook$jscomp$inline_1271 = __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-54baa7997-20231002";
30+
var ReactVersion = "18.3.0-canary-843ec0702-20231002";
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
@@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
616616
exports.useTransition = function () {
617617
return ReactCurrentDispatcher.current.useTransition();
618618
};
619-
exports.version = "18.3.0-canary-54baa7997-20231002";
619+
exports.version = "18.3.0-canary-843ec0702-20231002";

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
@@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
619619
exports.useTransition = function () {
620620
return ReactCurrentDispatcher.current.useTransition();
621621
};
622-
exports.version = "18.3.0-canary-54baa7997-20231002";
622+
exports.version = "18.3.0-canary-843ec0702-20231002";
623623

624624
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
625625
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
54baa7997c7b0bbd456460ead6e051655ea43790
1+
843ec0702140f2d1e9407a38859abdf5b8dfe4e4

0 commit comments

Comments
 (0)