Skip to content

Commit f92b601

Browse files
security: Attempt to disable RegExp
1 parent ee256f8 commit f92b601

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/react-native-reanimated/src/shareables.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ Offending code was: \`${getWorkletCode(value)}\``);
209209
}
210210
freezeObjectIfDev(value);
211211
} else if (value instanceof RegExp) {
212-
const pattern = value.source;
212+
// disabled, contact appsec if needed: https://github.com/ExodusMovement/exodus-mobile/pull/24699#issuecomment-2709694172
213+
/* const pattern = value.source;
213214
const flags = value.flags;
214215
const handle = makeShareableCloneRecursive({
215216
__init: () => {
@@ -219,6 +220,10 @@ Offending code was: \`${getWorkletCode(value)}\``);
219220
});
220221
shareableMappingCache.set(value, handle);
221222
return handle as ShareableRef<T>;
223+
*/
224+
throw new ReanimatedError(
225+
'RegExp has been disabled. Contact AppSec if needed.'
226+
);
222227
} else if (value instanceof Error) {
223228
const { name, message, stack } = value;
224229
const handle = makeShareableCloneRecursive({

0 commit comments

Comments
 (0)