Skip to content

security/research: ReDoS guard L1 (#829) é heurística sintática — gap estrutural p/ L2/L3 não-confiável (#865); fortalecer testes + decisão→ADR #1081

Open

Description

@FabioLeitao

Tipo: security/research · enhancement security P3 no-code-yet · filho do #865
Proveniência: off-band (claude.ai, commit 9504bc9) + verificado RO. Item 2 do 00-TRIAGEM. Par com a issue wasmtime (a contenção).

O que JÁ existe (verificado RO)

core/detector.py:_load_regex_overrides (~L719) tem guard ReDoS pra pattern de override de 3º: _has_nested_quantifier (rejeita (a+)+) + try re.compile/except + descarte silencioso + teste tests/test_redos_guard.py. #829 resolveu o L1 (in-process), o único tier de hoje. Não mexer no que funciona.

A lacuna (estrutural, não bug)

_has_nested_quantifier é heurística sintática, não garantia matemática de tempo linear. Não cobre: alternância ambígua ((a|a)*, (a|ab)*c), quantificador contado grande (a{1,1000}{1,1000}), acúmulo de N padrões custosos. Volta a importar no L2/L3 do #865 (sidecar/IPC, API externa) — pattern de 3º chega por outro caminho, talvez sem passar pela mesma validação. O #865 item 3 já pede "timeout duro, cap CPU/mem, sandbox".

Escopo

Activity

  1. self-assigned this
    on Jun 30, 2026
  2. added
    enhancementNew feature or request
    P3Low — backlog / nice-to-have
    no-code-yetIssue tracked but no implementation started — audit finding, doc, or ops backlog
    securitySecurity hardening, abuse/DoS defense, leak prevention
    on Jun 30, 2026
  3. FabioLeitao commented on Jun 30, 2026

    @FabioLeitao
    CollaboratorAuthor

    🤖 Cursor — quick-win + far-horizon

    QUICK: testes de regressão ReDoS em tests/test_redos_guard.py (alternância ambígua (a|a)*/(a|ab)*c, quantificador contado grande a{1,1000}{1,1000}) — fortalece o guard L1 (#829). FAR: decisão de contenção L2/L3 = ADR quando #865 avançar (par com #1082). Sem mudar engine.

  4. added this to the v1.8.4 milestone on Aug 29, 2026
  5. added theissue type on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3Low — backlog / nice-to-haveenhancementNew feature or requestno-code-yetIssue tracked but no implementation started — audit finding, doc, or ops backlogsecuritySecurity hardening, abuse/DoS defense, leak prevention

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions