fix: security patches and bug fixes for trilhas feature#80
Draft
caimanoliveira wants to merge 1 commit into
Draft
fix: security patches and bug fixes for trilhas feature#80caimanoliveira wants to merge 1 commit into
caimanoliveira wants to merge 1 commit into
Conversation
- Upgrade Next.js 16.2.0 → 16.2.10 (patches 14 CVEs: middleware bypass, cache poisoning, XSS, DoS with Server/Cache Components, SSRF) - Fix ws dependency: upgrade to patched version via npm audit fix - fix(exportar-star): add explicit mentorado ownership check before querying etapa_respostas (mirrors pattern in exportar-pdf) - fix(trilhas/content): guard getEtapa against undefined trilha to prevent TypeError crash on invalid slug input - fix(trilhas/actions): replace getTrilha (unsafe cast) with getTrilhaSafe in completeEtapa and submitPlanoAcao; guard allDone check on null trilha - fix(trilhas/actions): check and throw on Supabase write errors in startTrilhaIfNeeded, saveResposta, completeEtapa, and submitPlanoAcao - fix(trilhas/schemas + actions): relax planoAcao array from .length(3) to .min(1).max(5) to match planoAcaoConfigSchema n_acoes range
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security
npm audit fix/api/exportar-star: added explicit mentorado ownership check (join throughmentorados.user_id) before queryingetapa_respostas, mirroring the pattern already used in/api/exportar-pdfBug Fixes
getEtapacrash on unknown slug (content.ts): addedif (!trilha) return nullguard before accessing.etapas, preventing aTypeErrorwhen callers pass an arbitrary string cast asTrilhaSluggetTrilhaunsafe calls (actions.ts): replaced bothgetTrilha(trilhaSlug as TrilhaSlug)calls incompleteEtapaandsubmitPlanoAcaowithgetTrilhaSafe, guarding theallDonecheck against nullactions.ts): all upsert/update calls (startTrilhaIfNeeded,saveResposta,completeEtapa,submitPlanoAcao) now destructure and throw onerror, preventing silent data-loss scenarios whererevalidatePathwas called after a failed writeplanoAcaoarray length mismatch (schemas.ts+actions.ts): changed.length(3)to.min(1).max(5)in bothplanoAcaoRespostaSchemaandsubmitPlanoAcaoInputto match then_acoes: z.number().int().min(1).max(5)range inplanoAcaoConfigSchema— previously any trilha configured withn_acoes ≠ 3would produce a Zod validation error on submitRemaining known risk
postcss < 8.5.10(moderate, GHSA-qx2v-qp2m-jg93) lives inside Next.js's own bundled copy; the only available fix would downgrade Next.js to v9.3.3, which is not viable. Accepted as a transitive risk until Next.js ships an internal update.Generated by Claude Code