react-native-community / cli

The React Native Community CLI - command line tools to help you build RN apps
MIT License
2.41k stars 905 forks source link

Security Vulnerability: SSRF in `ip` Package Dependency (`CVE-2023-42282`) #2538

Closed georgewrmarshall closed 3 weeks ago

georgewrmarshall commented 3 weeks ago

Environment

Description

A security vulnerability has been identified in the ip package used by both @react-native-community/cli-doctor and @react-native-community/cli-hermes. The ip package versions <=2.0.1 are susceptible to Server-Side Request Forgery (SSRF) due to improper categorization of certain IP addresses via the isPublic function.

Vulnerability Details:

Both @react-native-community/cli-doctor@11.3.2 and @react-native-community/cli-hermes@11.3.2 depend on ip@1.1.9, which falls within the vulnerable range.

Reproducible Demo

While this vulnerability doesn't involve a reproducible bug, it affects the project's security posture due to the following dependency tree:

@react-native-community/cli-doctor@11.3.2 └─ ip@1.1.9 (via ^1.1.5)

@react-native-community/cli-hermes@11.3.2 └─ ip@1.1.9 (via ^1.1.5)

Steps to Identify the Vulnerability:

  1. Ran yarn why ip and identified that both CLI packages depend on ip@1.1.9.
  2. Reviewed the CVE-2023-42282 details, which indicate that ip@<=2.0.1 is vulnerable to SSRF attacks.

Impact Assessment

georgewrmarshall commented 3 weeks ago

Resolve by upgrading react native from 0.72.0 to 0.72.15