Repository navigation
Conversation
Owner
Author
|
Je suis prêt à traiter le retour. Peux-tu préciser la modification ou le point exact à corriger dans cette PR ? |
Owner
Author
|
@copilot vérifie que la pull request ne pause pas de problème et peux être merge |
Vérification faite : la PR est en |
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.
Problème
path.extname), permettant.html/.svgservis statiquement..html/.svgdéjà présents restaient servis.requestTimeout=0/headersTimeout=0désactivaient les timeouts HTTP.localStorage, exposé au XSS.Correctif
safeAvatarExtension()dérive l'extension du MIME (png/jpeg/webp) et rejette le reste ; nom aléatoire (randomUUID)./uploadsne sert plus que.png/.jpg/.jpeg/.webp(404 pour les anciens.html/.svg) +X-Content-Type-Options: nosniff.tvtracker_session:HttpOnly,SameSite=Lax,Path=/, 30 j ;COOKIE_SECURE=1pour HTTPS (câblé dans les deux compose,.env.exampleet le README).cookie-parser, middleware cookie avec repli Bearer, routePOST /api/auth/logout.credentials: 'include', suppression du token localStorage (y compris le jeton legacy au chargement et au logout).mainvia2598dfd).Vérification
npm test→ 26 passed (16 existants + 10 nouveaux).npm run buildOK./meavec cookie, 401 sans cookie, upload.html+ MIMEimage/pngstocké.png,text/html/image/svg+xmlrejetés, ancien.html/.svg→ 404,.png→ 200 + nosniff,COOKIE_SECURE=1→Secure, logout → cookie effacé + 401.Note de déploiement
COOKIE_SECURE=1est requis derrière HTTPS. En HTTP LAN, laisser0pour ne pas casser le login. Le login ne renvoie plus detokenJSON ; le frontend utilise le cookie. Les clients Bearer existants restent acceptés par le middleware.