Exploit databaseDownload repository ZIP
GH-19962432990af15d1c08913e3ea41264
theori-io/reactguard
Sources for CVE-2025-55182
257 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files7
theori-io/reactguardRevision a16b6e87f09e
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/reactguard/vulnerability_detection/resolvers/expo.py
Python · 1,304 bytes# SPDX-FileCopyrightText: 2025 Theori Inc.
# SPDX-License-Identifier: AGPL-3.0-or-later
from __future__ import annotations
import hashlib
from urllib.parse import urlsplit, urlunsplit
def _expo_random_action_url(url: str) -> str:
"""
Expo Router Server Functions encode the target module/export in the URL path (ACTION_...).
Use a deterministic, non-existent action target so we never invoke unknown app code while still
exercising decodeReply() before the router attempts module resolution.
"""
if not url:
return url
parts = urlsplit(url)
marker = "/ACTION_"
if marker not in parts.path:
return url
base_path, _ = parts.path.split(marker, 1)
token = hashlib.sha256(url.encode("utf-8")).hexdigest()[:12]
new_path = f"{base_path}{marker}./reactguard_probe_{token}.ts/probe.txt"
return urlunsplit((parts.scheme, parts.netloc, new_path, parts.query, parts.fragment))
def normalize_expo_action_endpoints(endpoints: list[str]) -> list[str]:
"""Normalize Expo Server Function endpoints into a safe, deterministic no-invoke target."""
normalized = [_expo_random_action_url(str(ep)) for ep in (endpoints or []) if ep]
return list(dict.fromkeys([e for e in normalized if e]))
__all__ = ["normalize_expo_action_endpoints"]