SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Sanitize module name to prevent Java code injection (#55484)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55484

This change adds content validation to ensure module names only contain safe identifier characters (alphanumeric and underscores, matching `^[a-zA-Z_][a-zA-Z0-9_]*$`). A new error class `IncorrectModuleRegistryCallArgumentValueParserError` provides a clear error message when an unsafe module name is detected.

Changelog: [Android][Fixed] - Validate module names in codegen

Reviewed By: CalixTang

Differential Revision: D92736956

fbshipit-source-id: 29b2c603bf97f9a2c30c8350d29b468d315765f0
R
Ramanpreet Nara committed
a748a405b66546367f0160425d135be88812763d
Parent: 9db85e7
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 2/10/2026, 3:23:22 PM