Weaknesses of type CWE-185

34 results

Expressão regular incorreta

Ocorre quando uma regex é mal escrita e valida dados de forma imprecisa, deixando passar entradas malformadas ou rejeitando dados legítimos. Um padrão fraco permite contorno de validações ou cause negação de serviço, pois regexes complexas podem consumir recursos excessivos (ReDoS).

Example

Um formulário usa regex para validar email como `/^[a-zA-Z0-9@.]*$/` — tão genérica que aceita 'aaa@bbb.' (inválido) e permite injeção. Ou uma regex com backtracking excessivo como `(a+)+b` trava quando enfrenta 'aaaaaaaaaaaaaaaaaac', causando negação de serviço.

How to mitigate

Use bibliotecas de validação prontas (como frameworks web nativos) em vez de regex manual. Se precisar regex, prefira padrões simples e âncoras (`^...$`), teste com casos extremos, e valide tamanho da entrada antes para prevenir ReDoS. Ferramentas como regex101.com ajudam a identificar problemas.

CVE-2024-6641MEDIUMWP Hardening – Fix Your WordPress Security <= 1.2.6 - Unauthenticated Security Feature Bypass to Username EnumerationEPSS 0.4%CVE-2026-25479MEDIUMLitestar has an AllowedHosts validation bypass due to unescaped regex metacharacters in configured host patternsEPSS 0.4%CVE-2026-54506HIGHVvveb: Stored XSS via sanitizeHTML() bypass in user profile bio fieldEPSS 0.4%CVE-2026-45065LOWSymfony: UrlGenerator Route-Requirement Bypass via Unanchored Regex Alternation → Off-Site //host URL InjectionEPSS 0.3%CVE-2026-64655LOWGitHub CLI: Attestation Verification Bypass via Unescaped Regex Metacharacters in SAN MatchingEPSS 0.3%CVE-2026-24398MEDIUMHono's IPv4 address validation bypass in IP Restriction Middleware allows IP spoofingEPSS 0.3%CVE-2026-88021HIGHConsul vulnerable to an authorization bypass in the Connect service meshEPSS 0.3%CVE-2026-73425LOW@astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escapedEPSS 0.3%CVE-2026-25542MEDIUMTekton Pipelines: VerificationPolicy regex pattern bypass via substring matchingEPSS 0.3%CVE-2026-33347MEDIUMleague/commonmark has an embed extension allowed_domains bypassEPSS 0.3%CVE-2026-47674MEDIUMHono: IP Restriction bypasses static deny rules for non-canonical IPv6EPSS 0.2%CVE-2026-114653HIGHSilent client-side encryption bypass via unescaped field-name regex in CSFLE schema builderEPSS 0.2%CVE-2026-39350MEDIUMIstio AuthorizationPolicy Incorrect Regex Matching of Dots in serviceAccounts Fields Allows Policy BypassEPSS 0.2%CVE-2026-48147MEDIUMBudibase: Unanchored Regex in `matchers.ts` Allows CSRF Bypass via Query String Injection in Budibase WorkerEPSS 0.1%