Skip to content

fix(security): corrigir vulnerabilidades do pip-audit (starlette, pytest)#96

Merged
lucasbrentano merged 1 commit into
mainfrom
hotfix/pip-audit-starlette-pytest
Jun 1, 2026
Merged

fix(security): corrigir vulnerabilidades do pip-audit (starlette, pytest)#96
lucasbrentano merged 1 commit into
mainfrom
hotfix/pip-audit-starlette-pytest

Conversation

@lucasbrentano
Copy link
Copy Markdown
Collaborator

Contexto

Duas dependências falhavam no gate do pip-audit na pipeline de CI.

Mudanças

Pacote De Para Motivo
starlette 0.49.1 1.2.1 PYSEC-2026-161 / CVE-2026-48710BadHost: falta de validação do header Host envenena request.url.path
fastapi 0.123.0 0.136.3 O fix do starlette só existe na linha 1.x; o FastAPI 0.123 travava starlette<0.51. A 0.136.3 aceita starlette>=0.46
pytest 8.3.3 9.0.3 CVE-2025-71176 — diretório temporário previsível (/tmp/pytest-of-{user}) em UNIX
pytest-cov 5.0.0 7.1.0 Compatibilidade com pytest 9
pytest-mock 3.14.0 3.15.1 Compatibilidade com pytest 9

Também alinha backend/.coveragerc (fail_under 90 → 80) com o CI (--cov-fail-under=80), o CLAUDE.md e os padrões do projeto.

Validação

  • pip-audit -r requirements.txtNo known vulnerabilities found
  • 340/340 testes passando sob pytest 9.0.3 + starlette 1.2.1 + FastAPI 0.136.3
  • ✅ App importa limpo (57 rotas); TestClient e pytest-cov funcionam sob as novas versões

Nota de severidade

O BadHost afeta auth baseada em path. Este backend usa JWT via header Authorization: Bearer, não auth por path — exploitabilidade prática baixa, mas o gate de CI falha de qualquer forma.

🤖 Generated with Claude Code

…est)

Duas dependências falhavam no gate do pip-audit:

- starlette 0.49.1 -> 1.2.1: corrige PYSEC-2026-161 / CVE-2026-48710
  (BadHost — falta de validação do header Host envenena request.url.path).
  O fix só existe na linha 1.x; como o FastAPI 0.123 travava starlette<0.51,
  o FastAPI subiu para 0.136.3 (aceita starlette>=0.46).
- pytest 8.3.3 -> 9.0.3: corrige CVE-2025-71176 (diretório temporário
  previsível em UNIX). pytest-cov 5.0.0->7.1.0 e pytest-mock 3.14.0->3.15.1
  para compatibilidade com pytest 9.

Validado: pip-audit sem vulnerabilidades, 340/340 testes passando.

Também alinha backend/.coveragerc (fail_under 90 -> 80) com o CI
(--cov-fail-under=80) e o CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lucasbrentano lucasbrentano merged commit be2dea2 into main Jun 1, 2026
3 checks passed
@lucasbrentano lucasbrentano deleted the hotfix/pip-audit-starlette-pytest branch June 1, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant