Security clarification: "wherever" is not a good place to store JWTs in the browser
@jkantr ya está trabajando en esto.
Desde el 30/12/2019.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
This note is more for myself - but feel free to engage in discussion if there's any necessary.
Problem
The security page (https://www.graphile.org/postgraphile/security/) has some general practices regarding JWT use. One in particular can be a huge security pitfall the way it's notated.
Within the code snippet under "Sending JWTs to the server":
// get the authentication token from wherever you store it
Although it's not necessarily in a browser context, i think it's pretty safe to say that is the general majority use of apollo-client. While it's well known that JWTs should never be stored in arbitrarily accessible locations (such as localStorage and sessionStorage, see: owsap reasonings), unfortunately there are a lot of careless "tutorials" around from a number of years ago when JWT first became a hot topic that claim cookies are dead and shouldn't be used. It's gotten better, but even today a google search for "where to store authentication token" reveals a 3rd position result to SO with a selected "answer" that touts html5 storage (localStorage) as the superior option.
Solution
While I think the discussion in https://github.com/graphile/postgraphile/issues/1049 is an important one, and there should be probably be a section just as large discussing cookie/session auth + maybe a note that the creator of postgraphile doesn't use JWT themselves.... for now I think it's important this specific comment gets replaced with either a note / link to a security-related source or a small subsection explaining the attack vectors - which is the scope of this issue.
I'll make a note when I actually take this on - but please just leave a comment if someone else wants to make this fix in the meantime so we don't duplicate work.
- Lenguaje dominante
- SCSS
- Estrellas
- 27
- Forks
- 124
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de graphile/graphile.github.io
-
help wanted quick
Dificultad 2/5 1-3 horas Aptitud para principiantes 38/100
graphile/graphile.github.io#401 · 1 comentario · 1 reacción ·
-
website: Update details on homepage and sponsor pageQuizá libre de nuevo @jemgillam la tomó hace 1119 días y no hay ningún pull request abierto. Abiertoquick
graphile/graphile.github.io#399 · 4 comentarios · 1 asignado ·
-
sponsor page: New wording around Grafast needed!Quizá libre de nuevo @jemgillam la tomó hace 1149 días y no hay ningún pull request abierto. Abierto
graphile/graphile.github.io#393 · 1 reacción · 1 asignado ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 38/100
graphile/graphile.github.io#341 · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
graphile/graphile.github.io#280 · 2 comentarios · 5 reacciones ·