midudev / la-velada-web-oficial

Web oficial de La Velada IV de Ibai Llanos
https://lavelada.es
Other
1.39k stars 609 forks source link

Fix bug when passing an unrelated boxer id as a voteId to `POST /api/votes/<combatId>` endpoint #947

Closed pjmartorell closed 6 months ago

pjmartorell commented 6 months ago

Descripción

A malicious user could do a call to POST /api/votes/<combatId> endpoint passing an arbitrary boxer id, i.e voting guanyar in 1-agustin-51-vs-carreraaa combat. To mitigate this issue, we can implement filtering on the voteId from combat boxers' IDs. This would prevent the submission or voting of any arbitrary boxer ID that isn't associated with the specified combat.

Problema solucionado

Fix bug when passing an unrelated boxer id as a voteId to POST /api/votes/<combatId> endpoint.

Cambios propuestos

Filter voteId from combat boxers ids to prevent passing or voting an arbitrary boxer id not related to the given combat

Capturas de pantalla (si corresponde)

Comprobación de cambios

Impacto potencial

Contexto adicional

Enlaces útiles

vercel[bot] commented 6 months ago

@pjmartorell is attempting to deploy a commit to the midudev pro Team on Vercel.

A member of the Team first needs to authorize it.