Security clarification: "wherever" is not a good place to store JWTs in the browser
@jkantr já está trabalhando nisso.
Desde 30/12/2019.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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.
- Linguagem predominante
- SCSS
- Estrelas
- 27
- Forks
- 124
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de graphile/graphile.github.io
-
help wanted quick
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 38/100
graphile/graphile.github.io#401 · 1 comentário · 1 reação ·
-
website: Update details on homepage and sponsor pageTalvez livre de novo @jemgillam assumiu há 1119 dias e não há nenhum pull request aberto. Abertaquick
graphile/graphile.github.io#399 · 4 comentários · 1 responsável ·
-
sponsor page: New wording around Grafast needed!Talvez livre de novo @jemgillam assumiu há 1149 dias e não há nenhum pull request aberto. Aberta
graphile/graphile.github.io#393 · 1 reação · 1 responsável ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 38/100
graphile/graphile.github.io#341 · 1 reação ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 25/100
graphile/graphile.github.io#280 · 2 comentários · 5 reações ·