Security clarification: "wherever" is not a good place to store JWTs in the browser
@jkantr arbeitet bereits daran.
Seit 30.12.2019.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- SCSS
- Sterne
- 27
- Forks
- 124
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus graphile/graphile.github.io
-
help wanted quick
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 38/100
graphile/graphile.github.io#401 · 1 Kommentar · 1 Reaktion ·
-
website: Update details on homepage and sponsor pageEvtl. wieder frei @jemgillam hat das vor 1119 Tagen übernommen, und es ist kein Pull Request offen. Offenquick
graphile/graphile.github.io#399 · 4 Kommentare · 1 zugewiesene Person ·
-
sponsor page: New wording around Grafast needed!Evtl. wieder frei @jemgillam hat das vor 1149 Tagen übernommen, und es ist kein Pull Request offen. Offen
graphile/graphile.github.io#393 · 1 Reaktion · 1 zugewiesene Person ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 38/100
graphile/graphile.github.io#341 · 1 Reaktion ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 25/100
graphile/graphile.github.io#280 · 2 Kommentare · 5 Reaktionen ·