mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
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.
85 lines
3.4 KiB
JavaScript
85 lines
3.4 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
|
|
import typeof * as ExportsType from './ReactFeatureFlags.test-renderer';
|
|
|
|
export const debugRenderPhaseSideEffectsForStrictMode = false;
|
|
export const enableDebugTracing = false;
|
|
export const enableSchedulingProfiler = false;
|
|
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
|
|
export const enableProfilerTimer = __PROFILE__;
|
|
export const enableProfilerCommitHooks = __PROFILE__;
|
|
export const enableProfilerNestedUpdatePhase = __PROFILE__;
|
|
export const enableProfilerNestedUpdateScheduledHook = false;
|
|
export const enableUpdaterTracking = false;
|
|
export const enableCache = true;
|
|
export const enableLegacyCache = __EXPERIMENTAL__;
|
|
export const enableCacheElement = __EXPERIMENTAL__;
|
|
export const enableFetchInstrumentation = true;
|
|
export const enableFormActions = true; // Doesn't affect Test Renderer
|
|
export const enableBinaryFlight = true;
|
|
export const enableTaint = true;
|
|
export const enablePostpone = false;
|
|
export const disableJavaScriptURLs = false;
|
|
export const disableCommentsAsDOMContainers = true;
|
|
export const disableInputAttributeSyncing = false;
|
|
export const disableIEWorkarounds = true;
|
|
export const enableSchedulerDebugging = false;
|
|
export const enableScopeAPI = false;
|
|
export const enableCreateEventHandleAPI = false;
|
|
export const enableSuspenseCallback = false;
|
|
export const disableLegacyContext = false;
|
|
export const enableTrustedTypesIntegration = false;
|
|
export const disableTextareaChildren = false;
|
|
export const disableModulePatternComponents = false;
|
|
export const enableSuspenseAvoidThisFallback = false;
|
|
export const enableSuspenseAvoidThisFallbackFizz = false;
|
|
export const enableCPUSuspense = false;
|
|
export const enableUseMemoCacheHook = true;
|
|
export const enableUseEffectEventHook = false;
|
|
export const enableClientRenderFallbackOnTextMismatch = true;
|
|
export const enableComponentStackLocations = true;
|
|
export const enableLegacyFBSupport = false;
|
|
export const enableFilterEmptyStringAttributesDOM = false;
|
|
export const enableGetInspectorDataForInstanceInProduction = false;
|
|
|
|
export const createRootStrictEffectsByDefault = false;
|
|
export const enableUseRefAccessWarning = false;
|
|
|
|
export const disableSchedulerTimeoutInWorkLoop = false;
|
|
export const enableLazyContextPropagation = false;
|
|
export const enableLegacyHidden = false;
|
|
export const forceConcurrentByDefaultForTesting = false;
|
|
export const enableUnifiedSyncLane = __EXPERIMENTAL__;
|
|
export const allowConcurrentByDefault = false;
|
|
export const enableCustomElementPropertySupport = false;
|
|
|
|
export const consoleManagedByDevToolsDuringStrictMode = false;
|
|
export const enableServerContext = true;
|
|
|
|
export const enableTransitionTracing = false;
|
|
|
|
export const enableFloat = true;
|
|
export const enableHostSingletons = true;
|
|
|
|
export const useModernStrictMode = false;
|
|
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
|
|
export const enableFizzExternalRuntime = false;
|
|
export const enableDeferRootSchedulingToMicrotask = true;
|
|
|
|
export const enableAsyncActions = false;
|
|
|
|
export const alwaysThrottleRetries = true;
|
|
|
|
export const useMicrotasksForSchedulingInFabric = false;
|
|
|
|
// Flow magic to verify the exports of this file match the original version.
|
|
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
|