CVE-2026-30838: Insecure Regex Domain Implode

Constructing a regular expression with a list of domains without enforcing a proper trailing boundary allows for spoofing. For instance, an allowlist for `example.com` might incorrectly match `example.com.evil.com`. Ensure that the domain regex enforces a boundary (e.g., `$` or `/`), or use `parse_url()` and exact string matching instead.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0PHPβ
greprules fetch cve-2026-30838-insecure-regex-domain-implode --engine opengrep

Description

Constructing a regular expression with a list of domains without enforcing a proper trailing boundary allows for spoofing. For instance, an allowlist for `example.com` might incorrectly match `example.com.evil.com`. Ensure that the domain regex enforces a boundary (e.g., `$` or `/`), or use `parse_url()` and exact string matching instead.