Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

content: Required Content-Security-Policy headers needed to not break the application

Abierto
#2,962 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
react

Línea de trabajo

Comienza con la guía existente Web View Security en https://capacitorjs.com/docs/guides/security#web-view-security e investiga el comportamiento reportado de default-src 'self' en una PWA de Ionic React. Documenta las fuentes de Content-Security-Policy necesarias, especialmente para style-src y script-src, para que la aplicación siga funcionando sin los fallos de carga y visualización reportados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

triage
URL

https://capacitorjs.com/docs/guides/security#web-view-security

Issue Description

For additional protection against XSS attacks, I want to add Content-Security-Policy headers in my Ionic React application. I am, however, unable to figure out what Content-Security-Policies are required for the application to not break. The URL that I posted in this issue tells us to add a default-src 'self' tag, but when this tag is applied in a PWA, it breaks the larger part of the application. Components such as the search bar are no longer correctly displayed and the browser console shows some sources that cannot be loaded because of this 'self' tag. Even if I follow these instructions, I am not able to correctly include the different types of sources required in the Content-Security-Policies header for the application to completely work. Especially the style-src & the script-src tags need a configuration which is hard to figure out.

I believe it would be best to document some of the required Content-Security-Policy headers somewhere in the Ionic docs, so that people who want to secure their application further, can do this. I would assume that the answer to include all the inline script executions in the Content-Security-Policy headers is something that can be used on all Ionic React applications. This is why I think it would be best that it is documented somewhere.

Lenguaje dominante
MDX
Estrellas
621
Forks
3.2k
Merge medio
1 d 2 h
PR fusionados (30 d)
86

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ionic-team/ionic-docs

Todos los issues de ionic-team/ionic-docs

Issues similares

Más issues de Documentation

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.