Skip to content

fix(security): paramétrage GraphQL (V5) + verrou GET /discord-users (V7)#3

Merged
makcimerrr merged 1 commit into
mainfrom
security/highmed-api
Jun 4, 2026
Merged

fix(security): paramétrage GraphQL (V5) + verrou GET /discord-users (V7)#3
makcimerrr merged 1 commit into
mainfrom
security/highmed-api

Conversation

@makcimerrr

Copy link
Copy Markdown
Owner

Vulns élevées API

V5 — Injection GraphQL par interpolation

user.ts, promotion.ts (×2), additional.ts, specialty.ts interpolaient username/eventId dans la chaîne GraphQL.
Variables GraphQL paramétrées ($username: String!, $eventId: Int!) + validation Number.isInteger(eventId) (400 sinon). Forme des réponses inchangée.

V7 — login↔Discord public

GET /discord-users et /discord-users/:login exposaient toute la table login↔discordId sans auth → ajout de requireApiKey.

V8 — secrets .env

.env déjà gitignoré (aucun changement code) ; rotation + env Deno Deploy = opérationnel.

⚠️ À vérifier au merge : le type $eventId: Int! doit matcher le schéma Hasura (event.id). Tester /api/v1/promotions/<eventId>/students juste après déploiement ; si erreur de type, passer Int!bigint!. deno check : 0 nouvelle erreur (22 préexistantes RouterContext).
🤖 Generated with Claude Code

V5 - GraphQL injection via string interpolation: convert user-info and
all event-progress queries (promotion, additional, specialty) to use
parameterized GraphQL variables ($username: String!, $eventId: Int!)
instead of interpolating values into the query string. Validate eventId
with Number.isInteger and return 400 when invalid. Response shape and
selected fields are unchanged.

V7 - public login<->Discord lookup: add requireApiKey middleware to both
GET /discord-users and GET /discord-users/:login routes.

V8 - .env already present in .gitignore and untracked; no change needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@makcimerrr
makcimerrr merged commit 3eea49e into main Jun 4, 2026
1 of 2 checks passed
@makcimerrr
makcimerrr deleted the security/highmed-api branch June 4, 2026 13:51
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