Security clarification: "wherever" is not a good place to store JWTs in the browser
@jkantr đang làm issue này rồi.
Từ ngày 30/12/2019.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- SCSS
- Star
- 27
- Fork
- 124
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của graphile/graphile.github.io
-
help wanted quick
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
graphile/graphile.github.io#401 · 1 bình luận · 1 reaction ·
-
website: Update details on homepage and sponsor pageCó thể làm lại được @jemgillam đã nhận 1119 ngày trước và không có pull request nào đang mở. Đang mởquick
graphile/graphile.github.io#399 · 4 bình luận · 1 người được giao ·
-
sponsor page: New wording around Grafast needed!Có thể làm lại được @jemgillam đã nhận 1149 ngày trước và không có pull request nào đang mở. Đang mở
graphile/graphile.github.io#393 · 1 reaction · 1 người được giao ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
graphile/graphile.github.io#341 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
graphile/graphile.github.io#280 · 2 bình luận · 5 reaction ·