顯示具有 Security 標籤的文章。 顯示所有文章
顯示具有 Security 標籤的文章。 顯示所有文章

2018年7月2日 星期一

reset password token leaking

reset password 的網址常常是

https://yourdomain/password/reset?token=xxxx

但這樣就會被第三方網站從 `HTTP Referer` 內找到並紀錄起來 reset password 的 token,例如 google analytics,就有安全疑慮

幾個做法:

1. 一進到這個頁面馬上 invalidate 這個 token 然後generate 一個新的塞到 form 裡面
2. 進到 passwords#edit 時就把 params 移除存到 session 裡面再 redirect 回 passwords#edit 頁面,這樣 referer 就沒有token 資訊

https://robots.thoughtbot.com/is-your-site-leaking-password-reset-links


2018年5月29日 星期二

ssl-cookie-without-secure-flag-set


 HTTPOnly flag


https://portswigger.net/kb/issues/00500200_ssl-cookie-without-secure-flag-set

https://stackoverflow.com/questions/3773605/how-can-i-make-cookies-secure-https-only-by-default-in-rails