fix: seguridad, accesibilidad y cleanup frontend#378
Open
devsart95 wants to merge 3 commits intomelizeche:devfrom
Open
fix: seguridad, accesibilidad y cleanup frontend#378devsart95 wants to merge 3 commits intomelizeche:devfrom
devsart95 wants to merge 3 commits intomelizeche:devfrom
Conversation
- Remover phone de serializers REST y search_fields (core + org) - Agregar rate limiting (100/h anon, 300/h user) y permisos explícitos - ALLOWED_HOSTS via env (no más wildcard), remover DEBUG_PROPAGATE_EXCEPTIONS - Headers de seguridad: HSTS, SESSION/CSRF_COOKIE_SECURE, X_FRAME_OPTIONS=DENY - Timeout=5 en Nominatim + try/except en org/models.py (3 modelos) - Fix import api_settings en core/api.py - Fix search_fields org/api.py (title no existe en DonationCenter → name) - Fix BaseResource.save() accedía a self.phone sin tenerlo - Fix device.save(device) → device.save() en middleware - Actualizar .env.example con nuevas variables
- Sanitizar innerHTML en popups de list.js y list-donation.js (sanitizeHTML) - Exportar sanitizeHTML como window global desde table-view.js - Sanitizar geocoding API response en create.html (escapeHTML) - encodeURIComponent en URL de geocoding externo - parseInt en pk de popups para evitar inyección en href - Prevención de doble submit: onsubmit en ambos formularios de creación - Remover console.log con coordenadas de producción
- Agregar lang="es" a <html> en base.html - Alt text en todas las imágenes (logo, footer, details, phone) - Convertir <p onclick> a <button type="button"> con aria-label en categorías - Fix login.html: class duplicado Bulma+Bootstrap → solo Bulma - Remover borde debug verde en list.html y donation_center/list.html - Agregar defer a scripts bloqueantes (fontawesome, bulmajs, moment) - Aria-labels en loading indicator, cities input, delete buttons - role="search" en dropdowns de ciudades (era role="menu") - Error handling en fetch: catch para ocultar spinner si API falla
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.
Resumen
Auditoría completa de seguridad y accesibilidad del proyecto con fixes implementados en 3 áreas:
Seguridad backend
phonede serializers REST ysearch_fields(datos personales expuestos vía API pública)ALLOWED_HOSTSvia env (era['*']), removerDEBUG_PROPAGATE_EXCEPTIONSapi_settingsno importado en core/api.pysearch_fieldsen org/api.py (titleno existe en DonationCenter)BaseResource.save()accedía aself.phonesin tenerlodevice.save(device)→device.save()en middlewareSeguridad frontend
encodeURIComponenten URL de API de geocodingconsole.logcon coordenadas en producciónAccesibilidad y performance
lang="es"en<html><p onclick>→<button type="button">con aria-label en categoríasclassduplicado en login.htmldeferen scripts bloqueantes (fontawesome, bulmajs, moment)role="search"en dropdowns (erarole="menu").catch()en fetch para evitar spinner congelado si API fallaTest plan
/api/v1/no retornaphoneen responsesdefer