SlideShare a Scribd company logo
1 of 22
Talk about password resets, users, best practices,
and better future. Free speaker notes!
Michal Špaček @spazef0rze
Users forget their passwords because they are told to remember them and that's
hard. Did you ever forget your password? See, apps need to have resets.
Password reset mechanisms can also be good for the security of the user accounts.
Jabbim is a Jabber/XMPP server run by a Czech company. Unfortunately they
did not have automated password resets when they needed it the most.
December 2014
125k plaintext passwords
In December 2014 they suffered a breach and the attacker accessed 125k passwords
stored in plaintext, though Jabbim had their reasons for plaintext, like performance
and legacy client support. Data segmentation was also missing, but let's move on.
The leak wasn't made public, but the bad guy tried to sell it for a bitcoin or two.
No automated
password resets
The issue is that Jabbim doesn't have automated password resets because they don't
require users to enter email address during sign-up, so Jabbim can't send a reset
link. Their password reset mechanism is manual and that doesn't scale well.
In case of emergency
Issue a blog post
Jabbim could reset passwords immediately for all their users and send them reset
links via email, but this is what they did instead. Some of my friends lost access to
their Jabber accounts because somebody has changed their password before they
were able to read the blog post suggesting them to change their passwords.
They've eventually left the service because of “poor security practices.“
Your email maybe?
Because ¯_( ツ )_/¯
If an email address is not mandatory during sing-up it should be at least optional
and the benefits of adding one should be clearly stated. Breaches happen. Loosing
an account just because of one is another thing.
What are the benefits of adding an email? When something bad happens with one's
account or if the user forgets their password the service provider can send a link with
a random token to the email address provided and the user can set new password
once they click the link.
1. Random 16+ bytes
2.Expiring in 1 or 2 hours
3.Usable once
The link should be random random, not just random, not time based, not a hash of
something, should expire in few hours max so that the chance of an attacker using
a leaked token is limited. The link should be usable only once for the same reason.
SHA-512
Hash the token with SHA-512 before storing it in a database. It doesn't need to be
a slow hash like bcrypt, because the token has a high entropy already and is limited
in time anyway.
Option to invalidate
&
IP address and city
The email with the reset link should also contain option to invalidate the token to
minimize the chance of an attacker gaining access to a valid link and reset user's
password. It should be also nice to include the IP address and the city from where
the request originated so that the user can tell if it was them or somebody else.
Sometimes, the bad guys use this password reset feature to see whether their
neighbor has been using the service as well so it might not be a good idea to
provide more information than needed, especially if you're running a dating site
for example. Most of the times it does not really matter because it's possible to
use sign-up flow to see whether the address is already registered with the site or
not. It's also important to limit the number of attempts to access password resets.
Don't generate and email new password. I've seen a site which always generated
new 5 characters long password, upper and lowercase letters only. In that case,
someone's strong password could be easily downgraded to a short one by just using
the password reset feature. Last but not least, don't send the original password.
You can't, you don't even know it because it's properly hashed, right?
token=encrypt(email)
This should be old news for every developer but obviously it's not. One of the more
interesting ways of doing a password reset was this. The token was an encrypted user
email address which got decrypted when sent back and then used to find the user.
That would be fine but the site was leaking source code and encryption keys too, so it
was possible to reset password for anybody. Just use a random token, seriously.
https://www.google.com/transparencyreport/saferemail/
The bad thing about email is shown above. Roughly half of the email traffic is not
encrypted as of August 2015. So even if the web app runs on HTTPS and the reset
link is also HTTPS there's still quite a high chance that anybody with some leet skills
can read the link while in transit. That's not what I'd call a secure password reset.
https://starttls.info
https://ssl-tools.net
You can use starttls.info or ssl-tools.net to see whether your email traffic is
encrypted and how good the encryption is. It's sort of like SSL Labs Server Check
for email. And even if you score grade A, it's still not end-to-end encryption, just
between servers, so your provider can still read your emails. Your account is
essentially protected by DNS. Someone can just hack your DNS servers and change
the MX records and reset links will go elsewhere. It's similar to SMS, that's not
secure much either.
https://www.facebook.com/me/about?section=contact-info
Facebook did this to work around insecure email. They allow you to upload your PGP
public key and then they will encrypt all the notifications they send to you, including
password reset links. Even if you probably won't use the password reset feature
because you use a password manager (right?) then this makes it impossible for the
attacker to reset your password even if they have access to the message with the reset
link because that is encrypted with your public key and only you can decrypt it.
Off-the-Record Messaging
https://otr.cypherpunks.ca/
Other option of doing end-to-end encryption to deliver the links securely could be
the OTR library. It's supported out-of-the-box on numerous instant messengers
and has plugins for few others. It can be used from eg. Node.js, Python, Go, and
Java. Your users would need to be “friends” with your app and once they are the
app can send the reset links securely to their instant messenger.
☑ Disable password reset
Or you can just let users disable password resets completely. Just make sure you get
the messaging around that right, suggest using a password manager for example.
Disable
Insecure email
PGP email
OTR message
Save
Ideally, the app would let the users select preferred method of delivering the
HTTPS password reset link. More transports could be added, but some common
ones do not support automated sending very well or at all, like Skype for example.
Notify users of
password change
One thing the apps should definitely do is to notify the users when they or someone
else have changed their password. Again, clear copy is crucial. Might also be
interesting to require password change verification similar to two-step verification
or two-factor authentication, but I'm not sure yet how to handle cases like when the
device is lost etc.
oassword1
passwrod1
assword1
Michal Špaček @spazef0rze
www.michalspacek.cz
One last thing, when users forget their password just don't store the failed attempts.
Once the database leaks the correct password can be recovered easily, here the
password was Password1. Remember, think beyond just emailing links to people.

More Related Content

Similar to I forgot my password – what a secure password reset needs to have and why

How to choose a password that’s hard to crack
How to choose a password that’s hard to crackHow to choose a password that’s hard to crack
How to choose a password that’s hard to crackKlaus Drosch
 
Hay php architect eav modeling
Hay php architect   eav modelingHay php architect   eav modeling
Hay php architect eav modelingGiang Nguyễn
 
Blockmail Technical White Paper
Blockmail   Technical White PaperBlockmail   Technical White Paper
Blockmail Technical White Paperniallmmackey
 
Technology Training - Security, Passwords & More
Technology Training - Security, Passwords & MoreTechnology Training - Security, Passwords & More
Technology Training - Security, Passwords & MoreWilliam Mann
 
Top 10 Secure Email Providers to Consider in 2022
Top 10 Secure Email Providers to Consider in 2022Top 10 Secure Email Providers to Consider in 2022
Top 10 Secure Email Providers to Consider in 2022Temok IT Services
 
How to be safe on the internet. Make the web better!
How to be safe on the internet. Make the web better!How to be safe on the internet. Make the web better!
How to be safe on the internet. Make the web better!Octavian Irimia
 
Why is password protection a fallacy a point of view
Why is password protection a fallacy a point of viewWhy is password protection a fallacy a point of view
Why is password protection a fallacy a point of viewSTO STRATEGY
 
NCET Biz Bite | Darren McBride, Email Productivity Tips and Tricks | Mar 28
NCET Biz Bite | Darren McBride, Email Productivity Tips and Tricks | Mar 28NCET Biz Bite | Darren McBride, Email Productivity Tips and Tricks | Mar 28
NCET Biz Bite | Darren McBride, Email Productivity Tips and Tricks | Mar 28Dave Archer
 
So Many Passwords So Little Mind
So Many Passwords So Little MindSo Many Passwords So Little Mind
So Many Passwords So Little MindAlain Lemay
 
Module 1 : Section 4 Internet Hosting
Module 1 : Section 4 Internet HostingModule 1 : Section 4 Internet Hosting
Module 1 : Section 4 Internet Hostingwebhostingguy
 
Tips for web security
Tips for web securityTips for web security
Tips for web securitykareowebtech
 
Tips for web security
Tips for web securityTips for web security
Tips for web securitykareowebtech
 
Outlook and thunderbird ii
Outlook and thunderbird iiOutlook and thunderbird ii
Outlook and thunderbird iiBanukaVidusanka
 
Cyber security and emails presentation refined
Cyber security and emails presentation refinedCyber security and emails presentation refined
Cyber security and emails presentation refinedWan Solo
 

Similar to I forgot my password – what a secure password reset needs to have and why (20)

How to choose a password that’s hard to crack
How to choose a password that’s hard to crackHow to choose a password that’s hard to crack
How to choose a password that’s hard to crack
 
Hay php architect eav modeling
Hay php architect   eav modelingHay php architect   eav modeling
Hay php architect eav modeling
 
Blockmail Technical White Paper
Blockmail   Technical White PaperBlockmail   Technical White Paper
Blockmail Technical White Paper
 
Eseminar1
Eseminar1Eseminar1
Eseminar1
 
email security
email securityemail security
email security
 
Technology Training - Security, Passwords & More
Technology Training - Security, Passwords & MoreTechnology Training - Security, Passwords & More
Technology Training - Security, Passwords & More
 
Top 10 Secure Email Providers to Consider in 2022
Top 10 Secure Email Providers to Consider in 2022Top 10 Secure Email Providers to Consider in 2022
Top 10 Secure Email Providers to Consider in 2022
 
How to be safe on the internet. Make the web better!
How to be safe on the internet. Make the web better!How to be safe on the internet. Make the web better!
How to be safe on the internet. Make the web better!
 
Password craking techniques
Password craking techniques Password craking techniques
Password craking techniques
 
Ways to protect your data from hacking
Ways to protect your data from hackingWays to protect your data from hacking
Ways to protect your data from hacking
 
Why is password protection a fallacy a point of view
Why is password protection a fallacy a point of viewWhy is password protection a fallacy a point of view
Why is password protection a fallacy a point of view
 
E Mail
E MailE Mail
E Mail
 
NCET Biz Bite | Darren McBride, Email Productivity Tips and Tricks | Mar 28
NCET Biz Bite | Darren McBride, Email Productivity Tips and Tricks | Mar 28NCET Biz Bite | Darren McBride, Email Productivity Tips and Tricks | Mar 28
NCET Biz Bite | Darren McBride, Email Productivity Tips and Tricks | Mar 28
 
So Many Passwords So Little Mind
So Many Passwords So Little MindSo Many Passwords So Little Mind
So Many Passwords So Little Mind
 
Module 1 : Section 4 Internet Hosting
Module 1 : Section 4 Internet HostingModule 1 : Section 4 Internet Hosting
Module 1 : Section 4 Internet Hosting
 
W make107
W make107W make107
W make107
 
Tips for web security
Tips for web securityTips for web security
Tips for web security
 
Tips for web security
Tips for web securityTips for web security
Tips for web security
 
Outlook and thunderbird ii
Outlook and thunderbird iiOutlook and thunderbird ii
Outlook and thunderbird ii
 
Cyber security and emails presentation refined
Cyber security and emails presentation refinedCyber security and emails presentation refined
Cyber security and emails presentation refined
 

More from Michal Špaček

Víceúrovňová obrana vysvětlená na Cross-Site Scriptingu
Víceúrovňová obrana vysvětlená na Cross-Site ScriptinguVíceúrovňová obrana vysvětlená na Cross-Site Scriptingu
Víceúrovňová obrana vysvětlená na Cross-Site ScriptinguMichal Špaček
 
Lámání a ukládání hesel
Lámání a ukládání heselLámání a ukládání hesel
Lámání a ukládání heselMichal Špaček
 
Fantom Opery, "VPN" a Secure Proxy v Opeře
Fantom Opery, "VPN" a Secure Proxy v OpeřeFantom Opery, "VPN" a Secure Proxy v Opeře
Fantom Opery, "VPN" a Secure Proxy v OpeřeMichal Špaček
 
Jak zlepšit zabezpečení čtvrtiny celého webu
Jak zlepšit zabezpečení čtvrtiny celého webuJak zlepšit zabezpečení čtvrtiny celého webu
Jak zlepšit zabezpečení čtvrtiny celého webuMichal Špaček
 
XSS PHP CSP ETC OMG WTF BBQ
XSS PHP CSP ETC OMG WTF BBQXSS PHP CSP ETC OMG WTF BBQ
XSS PHP CSP ETC OMG WTF BBQMichal Špaček
 
Bezpečnost e-shopů (HTTPS, XSS, CSP)
Bezpečnost e-shopů (HTTPS, XSS, CSP)Bezpečnost e-shopů (HTTPS, XSS, CSP)
Bezpečnost e-shopů (HTTPS, XSS, CSP)Michal Špaček
 
Poučte se z cizích chyb
Poučte se z cizích chybPoučte se z cizích chyb
Poučte se z cizích chybMichal Špaček
 
Minulé století volalo (Cross-Site Scripting + BeEF + CSP demo)
Minulé století volalo (Cross-Site Scripting + BeEF + CSP demo)Minulé století volalo (Cross-Site Scripting + BeEF + CSP demo)
Minulé století volalo (Cross-Site Scripting + BeEF + CSP demo)Michal Špaček
 
Password manažeři detailněji – 1Password, LastPass, 2FA, sdílení
Password manažeři detailněji – 1Password, LastPass, 2FA, sdíleníPassword manažeři detailněji – 1Password, LastPass, 2FA, sdílení
Password manažeři detailněji – 1Password, LastPass, 2FA, sdíleníMichal Špaček
 
HTTPS (a šifrování) všude
HTTPS (a šifrování) všudeHTTPS (a šifrování) všude
HTTPS (a šifrování) všudeMichal Špaček
 
HTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English versionHTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English versionMichal Špaček
 
Bezpečnost na mobilních zařízeních
Bezpečnost na mobilních zařízeníchBezpečnost na mobilních zařízeních
Bezpečnost na mobilních zařízeníchMichal Špaček
 
Základy webové bezpečnosti pro PR a marketing
Základy webové bezpečnosti pro PR a marketingZáklady webové bezpečnosti pro PR a marketing
Základy webové bezpečnosti pro PR a marketingMichal Špaček
 
HTTP Strict Transport Security (HSTS)
HTTP Strict Transport Security (HSTS)HTTP Strict Transport Security (HSTS)
HTTP Strict Transport Security (HSTS)Michal Špaček
 
Víte, že nevíte, že já vím, že nevíte? (WebTop100 2014)
Víte, že nevíte, že já vím, že nevíte? (WebTop100 2014)Víte, že nevíte, že já vím, že nevíte? (WebTop100 2014)
Víte, že nevíte, že já vím, že nevíte? (WebTop100 2014)Michal Špaček
 
Noční můry webového vývojáře
Noční můry webového vývojářeNoční můry webového vývojáře
Noční můry webového vývojářeMichal Špaček
 

More from Michal Špaček (20)

Víceúrovňová obrana vysvětlená na Cross-Site Scriptingu
Víceúrovňová obrana vysvětlená na Cross-Site ScriptinguVíceúrovňová obrana vysvětlená na Cross-Site Scriptingu
Víceúrovňová obrana vysvětlená na Cross-Site Scriptingu
 
Lámání a ukládání hesel
Lámání a ukládání heselLámání a ukládání hesel
Lámání a ukládání hesel
 
Fantom Opery, "VPN" a Secure Proxy v Opeře
Fantom Opery, "VPN" a Secure Proxy v OpeřeFantom Opery, "VPN" a Secure Proxy v Opeře
Fantom Opery, "VPN" a Secure Proxy v Opeře
 
Jak zlepšit zabezpečení čtvrtiny celého webu
Jak zlepšit zabezpečení čtvrtiny celého webuJak zlepšit zabezpečení čtvrtiny celého webu
Jak zlepšit zabezpečení čtvrtiny celého webu
 
Medvědí služba
Medvědí službaMedvědí služba
Medvědí služba
 
XSS PHP CSP ETC OMG WTF BBQ
XSS PHP CSP ETC OMG WTF BBQXSS PHP CSP ETC OMG WTF BBQ
XSS PHP CSP ETC OMG WTF BBQ
 
Bezpečnost e-shopů (HTTPS, XSS, CSP)
Bezpečnost e-shopů (HTTPS, XSS, CSP)Bezpečnost e-shopů (HTTPS, XSS, CSP)
Bezpečnost e-shopů (HTTPS, XSS, CSP)
 
Poučte se z cizích chyb
Poučte se z cizích chybPoučte se z cizích chyb
Poučte se z cizích chyb
 
Minulé století volalo (Cross-Site Scripting + BeEF + CSP demo)
Minulé století volalo (Cross-Site Scripting + BeEF + CSP demo)Minulé století volalo (Cross-Site Scripting + BeEF + CSP demo)
Minulé století volalo (Cross-Site Scripting + BeEF + CSP demo)
 
Password manažeři detailněji – 1Password, LastPass, 2FA, sdílení
Password manažeři detailněji – 1Password, LastPass, 2FA, sdíleníPassword manažeři detailněji – 1Password, LastPass, 2FA, sdílení
Password manažeři detailněji – 1Password, LastPass, 2FA, sdílení
 
HTTPS (a šifrování) všude
HTTPS (a šifrování) všudeHTTPS (a šifrování) všude
HTTPS (a šifrování) všude
 
HTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English versionHTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English version
 
Bezpečnost na mobilních zařízeních
Bezpečnost na mobilních zařízeníchBezpečnost na mobilních zařízeních
Bezpečnost na mobilních zařízeních
 
Základy webové bezpečnosti pro PR a marketing
Základy webové bezpečnosti pro PR a marketingZáklady webové bezpečnosti pro PR a marketing
Základy webové bezpečnosti pro PR a marketing
 
Hlava není na hesla
Hlava není na heslaHlava není na hesla
Hlava není na hesla
 
HTTP Strict Transport Security (HSTS)
HTTP Strict Transport Security (HSTS)HTTP Strict Transport Security (HSTS)
HTTP Strict Transport Security (HSTS)
 
HTTP/2
HTTP/2HTTP/2
HTTP/2
 
Víte, že nevíte, že já vím, že nevíte? (WebTop100 2014)
Víte, že nevíte, že já vím, že nevíte? (WebTop100 2014)Víte, že nevíte, že já vím, že nevíte? (WebTop100 2014)
Víte, že nevíte, že já vím, že nevíte? (WebTop100 2014)
 
Přechod na HTTPS
Přechod na HTTPSPřechod na HTTPS
Přechod na HTTPS
 
Noční můry webového vývojáře
Noční můry webového vývojářeNoční můry webového vývojáře
Noční můry webového vývojáře
 

Recently uploaded

Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleanscorenetworkseo
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxBipin Adhikari
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 

Recently uploaded (20)

Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleans
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptx
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 

I forgot my password – what a secure password reset needs to have and why

  • 1. Talk about password resets, users, best practices, and better future. Free speaker notes! Michal Špaček @spazef0rze
  • 2. Users forget their passwords because they are told to remember them and that's hard. Did you ever forget your password? See, apps need to have resets.
  • 3. Password reset mechanisms can also be good for the security of the user accounts. Jabbim is a Jabber/XMPP server run by a Czech company. Unfortunately they did not have automated password resets when they needed it the most.
  • 4. December 2014 125k plaintext passwords In December 2014 they suffered a breach and the attacker accessed 125k passwords stored in plaintext, though Jabbim had their reasons for plaintext, like performance and legacy client support. Data segmentation was also missing, but let's move on. The leak wasn't made public, but the bad guy tried to sell it for a bitcoin or two.
  • 5. No automated password resets The issue is that Jabbim doesn't have automated password resets because they don't require users to enter email address during sign-up, so Jabbim can't send a reset link. Their password reset mechanism is manual and that doesn't scale well.
  • 6. In case of emergency Issue a blog post Jabbim could reset passwords immediately for all their users and send them reset links via email, but this is what they did instead. Some of my friends lost access to their Jabber accounts because somebody has changed their password before they were able to read the blog post suggesting them to change their passwords. They've eventually left the service because of “poor security practices.“
  • 7. Your email maybe? Because ¯_( ツ )_/¯ If an email address is not mandatory during sing-up it should be at least optional and the benefits of adding one should be clearly stated. Breaches happen. Loosing an account just because of one is another thing.
  • 8. What are the benefits of adding an email? When something bad happens with one's account or if the user forgets their password the service provider can send a link with a random token to the email address provided and the user can set new password once they click the link.
  • 9. 1. Random 16+ bytes 2.Expiring in 1 or 2 hours 3.Usable once The link should be random random, not just random, not time based, not a hash of something, should expire in few hours max so that the chance of an attacker using a leaked token is limited. The link should be usable only once for the same reason.
  • 10. SHA-512 Hash the token with SHA-512 before storing it in a database. It doesn't need to be a slow hash like bcrypt, because the token has a high entropy already and is limited in time anyway.
  • 11. Option to invalidate & IP address and city The email with the reset link should also contain option to invalidate the token to minimize the chance of an attacker gaining access to a valid link and reset user's password. It should be also nice to include the IP address and the city from where the request originated so that the user can tell if it was them or somebody else.
  • 12. Sometimes, the bad guys use this password reset feature to see whether their neighbor has been using the service as well so it might not be a good idea to provide more information than needed, especially if you're running a dating site for example. Most of the times it does not really matter because it's possible to use sign-up flow to see whether the address is already registered with the site or not. It's also important to limit the number of attempts to access password resets.
  • 13. Don't generate and email new password. I've seen a site which always generated new 5 characters long password, upper and lowercase letters only. In that case, someone's strong password could be easily downgraded to a short one by just using the password reset feature. Last but not least, don't send the original password. You can't, you don't even know it because it's properly hashed, right?
  • 14. token=encrypt(email) This should be old news for every developer but obviously it's not. One of the more interesting ways of doing a password reset was this. The token was an encrypted user email address which got decrypted when sent back and then used to find the user. That would be fine but the site was leaking source code and encryption keys too, so it was possible to reset password for anybody. Just use a random token, seriously.
  • 15. https://www.google.com/transparencyreport/saferemail/ The bad thing about email is shown above. Roughly half of the email traffic is not encrypted as of August 2015. So even if the web app runs on HTTPS and the reset link is also HTTPS there's still quite a high chance that anybody with some leet skills can read the link while in transit. That's not what I'd call a secure password reset.
  • 16. https://starttls.info https://ssl-tools.net You can use starttls.info or ssl-tools.net to see whether your email traffic is encrypted and how good the encryption is. It's sort of like SSL Labs Server Check for email. And even if you score grade A, it's still not end-to-end encryption, just between servers, so your provider can still read your emails. Your account is essentially protected by DNS. Someone can just hack your DNS servers and change the MX records and reset links will go elsewhere. It's similar to SMS, that's not secure much either.
  • 17. https://www.facebook.com/me/about?section=contact-info Facebook did this to work around insecure email. They allow you to upload your PGP public key and then they will encrypt all the notifications they send to you, including password reset links. Even if you probably won't use the password reset feature because you use a password manager (right?) then this makes it impossible for the attacker to reset your password even if they have access to the message with the reset link because that is encrypted with your public key and only you can decrypt it.
  • 18. Off-the-Record Messaging https://otr.cypherpunks.ca/ Other option of doing end-to-end encryption to deliver the links securely could be the OTR library. It's supported out-of-the-box on numerous instant messengers and has plugins for few others. It can be used from eg. Node.js, Python, Go, and Java. Your users would need to be “friends” with your app and once they are the app can send the reset links securely to their instant messenger.
  • 19. ☑ Disable password reset Or you can just let users disable password resets completely. Just make sure you get the messaging around that right, suggest using a password manager for example.
  • 20. Disable Insecure email PGP email OTR message Save Ideally, the app would let the users select preferred method of delivering the HTTPS password reset link. More transports could be added, but some common ones do not support automated sending very well or at all, like Skype for example.
  • 21. Notify users of password change One thing the apps should definitely do is to notify the users when they or someone else have changed their password. Again, clear copy is crucial. Might also be interesting to require password change verification similar to two-step verification or two-factor authentication, but I'm not sure yet how to handle cases like when the device is lost etc.
  • 22. oassword1 passwrod1 assword1 Michal Špaček @spazef0rze www.michalspacek.cz One last thing, when users forget their password just don't store the failed attempts. Once the database leaks the correct password can be recovered easily, here the password was Password1. Remember, think beyond just emailing links to people.

Editor's Notes

  1. My name is Michal, I'm from Prague, CZ and I'm a web dev. I'd like to talk a bit about password resets on the web and users and best practices and near future.
  2. Let's talk about users first. They forget things a lot. They also forget their passwords because they are told to remember them and that's hard. Did you guys ever forgot your password? Raise your hands. Obivously, apps need to have resets.
  3. Password reset mechanisms can also be good for the security of the user accounts. Jabbim is a jabber/xmpp server run by a Czech company. Unfortunately they did not have automated password resets when they needed it the most.
  4. In Dec14 they suffered a breach and the attacker accessed 125k passwords stored in plaintext. Jabbim had their reasons for plaintext like performance and legacy client support. They've also made some bad design desicions like missing data segmentation but yeah, let's move on. The data was not made public so far so that's the reason why you can't find it on haveibeenpwned.com
  5. The issue here was that Jabbim does not have automated password resets because they don't require users to enter email address during signup so they say they can't send a reset link. Their pw reset mechanism is manual and that does not scale well.
  6. Jabbim could reset passwords immediately for all their users and send them reset links via email, but this is what they did instead. Some of my friends lost access to their jabber accounts because somebody has changed their password before they were able to read the blog post suggesting them to change their pws. They've actually left the service for poor security practices.
  7. If an email address is not mandatory during singup it should be at least optional and the benefits of adding one or two should be clearly stated. Breaches happen. Loosing an account just because of one is another thing.
  8. What benefits of adding an email? When something bad happens with users account or if the user forgets their password the service provider can send a link with a random token to the email address provided and the user can set new password once they click the link.
  9. The link should be random, not time based, not a hash of something, should expire in few hours max so that the chance of using leaked token is limited. And of course, the link should be usable only once for the same reason.
  10. The token should be hashed before storing it in a database. It does not need to be a slow hash, because the token has a high entropy already and is limited in time anyway.
  11. The email with the reset link should also contain an option to invalidate the reset link to minimize the chance of an attacker gaining an access to a valid link and reset users password. It should be also nice to include the IP address and the city from where the request originated so that the user can tell if it was them or somebody else.
  12. Sometimes, the bad guys use this password reset feature to see whether their neighbor has been using the service as well so it might not be a good idea to provide more information than needed, especially if you're running a dating site for example. Most of the times it does not really matter because it's possible to use sign up flow to see whether the address is already registered with the site or not. It's also important to limit the number of attempts to access password resets.
  13. This is what you don't want to do, don't generate and send new password. I've seen a site which always generated 5 chars just upper and lowercase letters when forgotten. In that case my strong password was pretty much useless. And obviously, don't send the original password because you don't even know it because it's properly hashed, right?
  14. This all should be old news for everybody but obviously it's not. One of the more interesting ways of doing a password reset was this. The token was actually an encrypted user email address whichgot decrypted when sent back. That would be quite fine but the site was leaking it's source code and encryption keys too, so it was possible to reset password for anybody. Just use random token.
  15. The bad thing about email is this. Roughly half of the email traffic is not encrypted. So even if the app runs on HTTPS and the reset link is also HTTPS there's a high chance that anybody can read the link while in transit. So that's not what I'd call secure password reset.
  16. You can use starttls.info to see whether your email traffic is encrypted and how good the encryption is. It's sort of like SSLLabs Server Check for email. And even if you score grade A, it's still not end-to-end encryption, so your provider can still read your emails. Or you can just hack the DNS servers and change the MX records, your account is actually protected by DNS. It's similar to SMS, that's not secure much either.
  17. This is what Facebook did. They allow you to upload your PGP public key and they will encrypt all the notifications they send to you, inluding password reset links. So even if you probably won't use the password reset feature because you use password manager, right? Then this makes it impossible for the attacker to reset your password even if they have access to the message with the reset link because that is encrypted with your pubkey.
  18. Other option of doing end-to-end encryption could be the OTR library. It's supported out of the box on numerous instant messengers and has plugins for few others. It can be used from Nodejs, python, Go, Java. Your users would need to be friends with your app and once they are the app can send the reset links securely to their instant messenger.
  19. Or you can just let users disable password resets completely. Just make sure you get the messaging around that right.
  20. Ideally, the app would let the users select the method of delivering the HTTPS link. Just like this. More transports could be added, but some common ones do not support automated sending very well or at all, like Skype for example.
  21. One thing the apps should definitely do is to notify the users when they or someone else have changed their password. Might also be interesting to require password change verification similar to two-stepverification or 2FA, but I'm not sure yet how to handle cases like when the device is lost etc.
  22. One last thing, when users forget their password just don't store the failed attempts. Once the database leaks the correct password can be recovered easily. Remember, think beyond just emailing links to people.