Skip to main content
Documented one more backdoor
Source Link

I've been looking into the security issues of several password managers on a number of occasions. In particular, I reported twelve security issues to LastPass so far and wrote aboutanalyzed the design decisions whichthat led to those on a number of occasionsthese. So while paj28 gave a very good general answer about password managers, I can provide some details.

No matter how weak the protection, brute force attacks will always be ineffective against the strongest master passwords. However, the design of LastPass contains plenty of backdoors that would allow decrypting the data without expending any effort. I'll describe three backdoors here, one more report is still being worked on by LastPass.

Exposure of the encryption key

There is also a number of occasions where the extension will directly expose your local encryption key to LastPass servers. This is meant to help web-based LastPass functionality integrate better with the browser extension, but it nullifies the effects of encrypting data locally. The following actions are all problematic:

  • Opening Account Settings, Security Challenge, History, Bookmarklets, Credit Monitoring
  • Linking to a personal account
  • Adding an identity
  • Importing data if the binary component isn’t installed
  • Printing all sites
  • Clicking on a breach notification

The last one is particularly serious because the LastPass server can send you breach notifications at will. So this allows LastPass to gain access to your data whenever they like, rather than waiting for you to use problematic functionality on your own.

I've been looking into the security issues of several password managers on a number of occasions. In particular, I reported twelve security issues to LastPass so far and wrote about the design decisions which led to those on a number of occasions. So while paj28 gave a very good general answer about password managers, I can provide some details.

No matter how weak the protection, brute force attacks will always be ineffective against the strongest master passwords. However, the design of LastPass contains plenty of backdoors that would allow decrypting the data without expending any effort. I'll describe three backdoors here, one more report is still being worked on by LastPass.

I've been looking into the security issues of several password managers on a number of occasions. In particular, I reported twelve security issues to LastPass so far and analyzed the design decisions that led to these. So while paj28 gave a very good general answer about password managers, I can provide some details.

No matter how weak the protection, brute force attacks will always be ineffective against the strongest master passwords. However, the design of LastPass contains plenty of backdoors that would allow decrypting the data without expending any effort.

Exposure of the encryption key

There is also a number of occasions where the extension will directly expose your local encryption key to LastPass servers. This is meant to help web-based LastPass functionality integrate better with the browser extension, but it nullifies the effects of encrypting data locally. The following actions are all problematic:

  • Opening Account Settings, Security Challenge, History, Bookmarklets, Credit Monitoring
  • Linking to a personal account
  • Adding an identity
  • Importing data if the binary component isn’t installed
  • Printing all sites
  • Clicking on a breach notification

The last one is particularly serious because the LastPass server can send you breach notifications at will. So this allows LastPass to gain access to your data whenever they like, rather than waiting for you to use problematic functionality on your own.

Restructured the answer, added info on security issues that are publicly documented by now
Source Link

I lookedI've been looking into the security designissues of LastPass recentlyseveral password managers on a number of occasions. In particular, I reported twelve security issues to LastPass so far and it seems that I've gotwrote about the design decisions which led to those on a good idea where to look for issuesnumber of occasions. So while paj28 gave a very good general answer about password managers, I can provide some details.

It's important to understand thatWhen people talk about the main security token withof online password managers like LastPass is your master password, they usually focus on server security. If LastPass servers get compromised (or if a LastPass employee turns evil) then this master passwordThe focus is what prevents the attackers from decrypting all your passwords. If they manage to guesson how easy is it then all your passwordsto compromise the server and what will be gonehappen then. ConsequentlyThis is only one attack vector however, LastPass tries to make it hard to intercept or guessbecause attacking your masterlocal password. This means in particular that manager instance might lead to the LastPass login form doesn't actually sendsame results. In fact, attacking the master passwordbrowser extension might be a more promising course of action, as the data is already decrypted there and you entered it. Instead it uses PBKDF2won't leave traces in order to derive a new password that is then sent to LastPassany logs.

I can seeLet me look at these two potential weaknesses here. First one is the login form available on lastpass.com. If we don't trust LastPass servers (and we don't, because why else would we encrypt the password data?) then this login form should never be used. If the servers are compromised the attackers could manipulate this login form in order to get your master password before PBKDF2 is applied - it's unlikely that you will notice anything weird, yet the attackers will be able to get the password and decrypt your data stored on the server. Unfortunately, LastPass browser extensions currently use pages from lastpass.com for some of their user interface - so when you see a login form, it might be non-trivial to verify that it doesn't come from the webaspects separately.

Attacking the browser extension

The more complicated approach requires bruteforcing your master password, particularly ifThere is a lot of historical data on vulnerabilities in the password youLastPass browser extension. All these vulnerabilities could be exploited by arbitrary webpages. At the very least, these are using:

Did you notice a pattern here? LastPass has been struggling for years to secure their AutoFill functionality and to restrict access to their internal API. Each time a new report proved that their previous fix was incomplete.

Now it isn't very strongunusual that password managers fail to implement AutoFill securely, most of them had issues in this area when I checked. PBKDF2 cannot be reversedWhile totally avoidable, sothese issues are common enough that I even compiled a list with recommendations to avoid the traps.

But the internal API issues are quite remarkable. LastPass exposes this involves generating lotsAPI to websites in a number of guessesdifferent ways. It's meant to be restricted to lastpass.com but the logic is so complex that the restrictions have been circumvented several times in the past. And while LastPass did their best to downplay the severity in their official announcements, applying PBKDF2each of these issues allowed websites to read out all passwords at once. Worse yet, the guesses and checking whether you getlast report by Tavis Ormandy proved that the expected resultinternal API could be used to make the binary LastPass component execute arbitrary code on user's machine. Same could probably be done with anyall the previous flaws which exposed internal API.

One could of themcourse ask why LastPass failed to restrict access to the internal API properly. PBKDF2But the better question is designedwhy this API is exposed to be computationally intensivewebsites at all. That's because a significant part of the LastPass functionality isn't contained in the extension but rather relies on the LastPass website to work. That's a very problematic design decision but so far LastPass didn't seem interested in fixing it.

Attacking server-side data

Let's state this very clearly: we don't trust the server. It's not that bruteforcing won't succeedwe particularly distrust LogMeIn, yet it is essentialInc. - at least not more than any other company. But our passwords are very sensitive data, and even the most ethical company might have a rogue employee. Add to this the possibility that US authorities demand them to produce your data, something that isn't even necessarily associated with a criminal investigation. Never mind the possibility that their servers get hacked, like it already choose the number of iterations used by the algorithm as high as possiblehappened once.

How many iterations does LastPass use? On the client sideSo it is very important that your data on the defaultserver is merely 5,000 iterations. We have year 2016,encrypted and this number should be considered way too low when confronted with contemporary hardware. Documentation explains this default with the necessityuseless to support Internet Explorer 7 and smartphonesanybody who can get hold of it. Well, IBut what can possibly stop the attackers from decrypting it? Exactly one thing: they don't think that Internet Explorer 7know your master password which is still supported, and even if you use a smartphone you should definitely change this setting and test whether it will be ableused to handle at least 100,000 iterationsderive the encryption key. So the essential question is: does LastPass sufficiently protect your master password and encryption key?

There is a tweak toIn this: LastPass claims to add another 100,000 iterations on the server side! So before storing your derived password they will apply PBKDF2 to it again. This definitely makes sense, and it is a good measure if a successful attacker merely copies the data from the LastPass server. However area, the attacker could also start intercepting passwords as these are being received by the LastPass serverI am not aware of any publicized research but my own, before additional hashing is applied. So when you logmost of it written down in with yourthis blog post. My conclusion here: LastPass extension they will interceptsuffers from a derived password with merely 5number of design flaws here,000 iterations which will be considerably easier to bruteforce some being resolved by now while others are still active.

So much for the general architecture, it has its weak spots but all in all it is pretty solid and your passwords are unlikely to be compromised at this level (or maybe they are, see update below). However, as described in my blog post the browser integration turned out to be a massive weakness. The LastPass extension on your computer works with decrypted data, so it needs to be extra careful - and at the moment it isn't.

Bruteforcing the master password

This starts with Auto Fill functionality which is known to be a bad idea since at least 2006. A password manager filling in passwords automatically means that any reflected XSS vulnerability in a website immediately exposesIf the user's passwordattackers got their hands on a bunch of encrypted data, whichthe most straightforward decryption approach is why password managers usually require user interaction before: guess the master password is filled inused to derive the encryption key. The blog post also goes into how URL parsing componentYou can try an unlimited number of this critical functionality is unnecessarily error-proneguesses locally, which in the past resulted in exposure of passwords for websites that the attacker didn't controlon whatever hardware you can afford, so this process will be comparably quick.

It's obviously a good idea for such an extension to limit interaction with websitesLastPass uses PBKDF2 algorithm to derive the bare minimum and review parts touching websites very carefullyencryption key from the master password. This doesn't appearWhile being inferior to have happenednewer algorithms like bcrypt, with all kinds of LastPass functionality acting within websites' domain. Sometimes this is completely unnecessaryscrypt or Argon2, like different parts ofthis algorithm has the extension communicating via window.postMessage() rather than using extension-specific messaging APIsimportant property of making key derivation slow, so attackers doing guessing locally will be slowed down. Sometimes itThe time required is merely semi-unnecessaryproportional to the number of iterations, such asmeaning: the complex messaging API for communication with lastpass.com (something that wouldn't be necessary ifhigher the entire user interface were contained withinnumber of iterations, the extension). Butharder it look like in all cases the security implications weren't thought through properlywill be to guess a master password.

I have to stress that this is merely capturing the current state of LastPass. They might get their act together: get rid of mixing web pages with extension pages, adjust security-relevant defaults for modern hardwareFor a long time, limit the number of communication channels within the extension exposed to websiteLastPass default was 5, stop generating HTML code dynamically etc000 iterations. What they have there can be secure, andThis is an extremely low value that provides very little protection. I also looked atcalculated that a competing extension which does mostlysingle GeForce GTX 1080 Ti graphics card could be used to test 346,000 guesses per second. That’s enough to go through the same thing without any potential security issuesdatabase with over a billion passwords known from various website leaks in barely more than one hour.

Update (2018 Following my reports, LastPass increased the default to 100,000 iterations mid-012018 which is far more adequate. Of course, if you are an important target who could expect state-30): Originallylevel resources being thrown at guessing your master password, I looked mostly intoyou should still choose an extremely strong master password.

Getting hold of data to bruteforce

One of my findings in early 2018 was that the script https://lastpass.com/newvault/websiteBackgroundScript.php could be loaded by any website. That script contained both your LastPass browser extensionsusername and it seemsa piece of encrypted data (private RSA key). With your LastPass username being also the password derivation salt, that's all someone needs to bruteforce your master password locally.

This issue was resolved quickly of course. However, the flaw was obvious enough that I'm left wondering whether I relied too much on the official documentation as far aswas the server's inner workings gofirst to discover it. NowWhile I triedurged LastPass to understandcheck their logs for signs of this vulnerability being exploited in the server-side mechanisms better and realized thatwild, to my knowledge this investigation never happened.

"Server-side rounds" as useless protection

Following a number of issues could exposesecurity incident in 2011, LastPass implemented an additional security mechanism: in addition to your data here as wellPBKDF2 iterations on the client side they would add another 100,000 iterations on the server. I'm listingSo in theory, if somebody could get data off the less serious and/or already publicly documented issues hereserver, this would increase the effort required to guess your master password.

In practice, I could conclusively prove that these additional 100,000 iterations are only applied to the password hash. All the other ones being still under investigation by LastPasspieces of user data (passwords, RSA keys, OTPs and more) are only encrypted using the encryption key derived locally from your master password, no additional protection here. Conclusion: this additional "protection" is a complete waste of server resources and doesn't provide any value whatsoever.

Getting in through the back door

No matter how weak the protection, brute force attacks will always be ineffective against the strongest master passwords. However, the design of LastPass contains plenty of backdoors that would allow decrypting the data without expending any effort. I'll describe three backdoors here, one more report is still being worked on by LastPass.

The web interface

LastPass conveniently provides you with a web interface to access your passwords without the help of a browser extension. This feature is a trap however: whenever you enter your master password into a login form on the web, there is no way of knowing whether it will hash your master password with PBKDF2 before sending it to the server or whether it will transmit it as clear text.

Remember that we don't trust the server? Yet a trivial modification of the JavaScript code served up by the server is enough to compromise all your passwords. Even if you inspect that JavaScript code, there is too much of it for you to notice anything. And it would be possible to serve up the modified code only to specific users.

Account settings

Even if you use the browser extension consistently, whenever you go to the account settings it will load up the lastpass.com website. Here again, there is no way for you to know that this website isn't compromise and won't steal your data in the background.

Several other pieces of the extension functionality are also implemented by falling back to the lastpass.com website, and LastPass doesn't see the issue here.

Recovery OTP

LastPass has the concept of One-Time Passwords (OTPs) that you can use to recover data from your account if you ever forget the master password. These OTPs allow decrypting your data but aren't normally known to the server.

To make recovery even more reliable, LastPass will create a recovery OTP automatically by default and store it in the extension data. The issue here: the recovery process has been designed in such a way that the extension would immediately give lastpass.com that recovery OTP on demand, without even notifying you. So a compromised LastPass server could ask the extension for your recovery OTP and use it to decrypt your data.

According to LastPass, this issue has been resolved in August 2018. I don't know how they resolved it however, at least I couldn't see any of the obvious solutions in their code.

More design flaws

  • As you can see by yourself by opening up https://lastpass.com/getaccts.php while logged in, the LastPass vault is by no means an encrypted blob of data. It rather has encrypted data here and there, while other fields like the URL corresponding to the account merely use hex encoding. This issue was pointed out in this 2015 presentation and more fields became encrypted since then - still by far not all of them however. In particular, a report I filed pointed out that Equivalent Domains not being encrypted allowed LastPass server to modify that list and extract your passwords in that way. This particular issue has been resolved in August 2018 according to LastPass.
  • Same presentation scolds LastPass for their use of AES-ECB for encryption. Among other things, it gives away which of your passwords are identical. LastPass has been transitioning to AES-CBC ever since, yet when I looked at my "vault" I saw a bunch of AES-ECB-encrypted credentials there (you can tell because AES-ECB is merely a base64-encoded blob whereas the LastPass variant of AES-CBC starts with an exclamation mark).
  • One Time Passwords should be handled with care, these are backdoors into your vault. Yet LastPass considers it to be a good idea to create oneRecovery OTP being created automatically without telling you and hide the corresponding setting rather far. If you look atstored in the documentation you will learnextension data means that somebodyanybody with access to both your device and email will be able to take overaddress can access your LastPass account, something that. This is actually documented and considered a low risk. Maybe one of your co-workers played a prank on you by sending an email in your name because you forgot to lock your computer - next time they might take over your LastPass account even if you are logged out of LastPass.
  • Speaking of being logged out, the default session expiration time is two weeks. While certainly being convenient, there is a reason why most products handling sensitive data have much shorter session expiration intervals, typically well below one day.
  • For combining a value with a secret (e.g. as a signature) one would usually use SHA256-HMAC. LastPass uses a custom approach instead, applying SHA256 hashing twice. While the attacks that HMAC is meant to address don't seem to play a role here, I wouldn't bet on somebody with better crypto knowledge than me not finding a vulnerability here after all. Also, the server side will occasionally produce some SHA256 tokens as well - I wonder what kind of humbug is going on where I cannot see it and whether it's really secure.

I looked into the security design of LastPass recently, and it seems that I've got a good idea where to look for issues. So while paj28 gave a very good general answer about password managers, I can provide some details.

It's important to understand that the main security token with password managers like LastPass is your master password. If LastPass servers get compromised (or if a LastPass employee turns evil) then this master password is what prevents the attackers from decrypting all your passwords. If they manage to guess it then all your passwords will be gone. Consequently, LastPass tries to make it hard to intercept or guess your master password. This means in particular that the LastPass login form doesn't actually send the master password as you entered it. Instead it uses PBKDF2 in order to derive a new password that is then sent to LastPass.

I can see two potential weaknesses here. First one is the login form available on lastpass.com. If we don't trust LastPass servers (and we don't, because why else would we encrypt the password data?) then this login form should never be used. If the servers are compromised the attackers could manipulate this login form in order to get your master password before PBKDF2 is applied - it's unlikely that you will notice anything weird, yet the attackers will be able to get the password and decrypt your data stored on the server. Unfortunately, LastPass browser extensions currently use pages from lastpass.com for some of their user interface - so when you see a login form, it might be non-trivial to verify that it doesn't come from the web.

The more complicated approach requires bruteforcing your master password, particularly if the password you are using isn't very strong. PBKDF2 cannot be reversed, so this involves generating lots of guesses, applying PBKDF2 to the guesses and checking whether you get the expected result with any of them. PBKDF2 is designed to be computationally intensive so that bruteforcing won't succeed, yet it is essential to choose the number of iterations used by the algorithm as high as possible.

How many iterations does LastPass use? On the client side the default is merely 5,000 iterations. We have year 2016, and this number should be considered way too low when confronted with contemporary hardware. Documentation explains this default with the necessity to support Internet Explorer 7 and smartphones. Well, I don't think that Internet Explorer 7 is still supported, and even if you use a smartphone you should definitely change this setting and test whether it will be able to handle at least 100,000 iterations.

There is a tweak to this: LastPass claims to add another 100,000 iterations on the server side! So before storing your derived password they will apply PBKDF2 to it again. This definitely makes sense, and it is a good measure if a successful attacker merely copies the data from the LastPass server. However, the attacker could also start intercepting passwords as these are being received by the LastPass server, before additional hashing is applied. So when you log in with your LastPass extension they will intercept a derived password with merely 5,000 iterations which will be considerably easier to bruteforce.

So much for the general architecture, it has its weak spots but all in all it is pretty solid and your passwords are unlikely to be compromised at this level (or maybe they are, see update below). However, as described in my blog post the browser integration turned out to be a massive weakness. The LastPass extension on your computer works with decrypted data, so it needs to be extra careful - and at the moment it isn't.

This starts with Auto Fill functionality which is known to be a bad idea since at least 2006. A password manager filling in passwords automatically means that any reflected XSS vulnerability in a website immediately exposes the user's password, which is why password managers usually require user interaction before the password is filled in. The blog post also goes into how URL parsing component of this critical functionality is unnecessarily error-prone, which in the past resulted in exposure of passwords for websites that the attacker didn't control.

It's obviously a good idea for such an extension to limit interaction with websites to the bare minimum and review parts touching websites very carefully. This doesn't appear to have happened, with all kinds of LastPass functionality acting within websites' domain. Sometimes this is completely unnecessary, like different parts of the extension communicating via window.postMessage() rather than using extension-specific messaging APIs. Sometimes it is merely semi-unnecessary, such as the complex messaging API for communication with lastpass.com (something that wouldn't be necessary if the entire user interface were contained within the extension). But it look like in all cases the security implications weren't thought through properly.

I have to stress that this is merely capturing the current state of LastPass. They might get their act together: get rid of mixing web pages with extension pages, adjust security-relevant defaults for modern hardware, limit the number of communication channels within the extension exposed to website, stop generating HTML code dynamically etc. What they have there can be secure, and I also looked at a competing extension which does mostly the same thing without any potential security issues.

Update (2018-01-30): Originally, I looked mostly into the LastPass browser extensions and it seems that I relied too much on the official documentation as far as the server's inner workings go. Now I tried to understand the server-side mechanisms better and realized that a number of issues could expose your data here as well. I'm listing the less serious and/or already publicly documented issues here, the other ones being still under investigation by LastPass:

  • As you can see yourself by opening up https://lastpass.com/getaccts.php while logged in, the LastPass vault is by no means an encrypted blob of data. It rather has encrypted data here and there, while other fields like the URL corresponding to the account merely use hex encoding. This issue was pointed out in this 2015 presentation and more fields became encrypted since then - still by far not all of them however.
  • Same presentation scolds LastPass for their use of AES-ECB for encryption. Among other things, it gives away which of your passwords are identical. LastPass has been transitioning to AES-CBC ever since, yet when I looked at my "vault" I saw a bunch of AES-ECB-encrypted credentials there (you can tell because AES-ECB is merely a base64-encoded blob whereas the LastPass variant of AES-CBC starts with an exclamation mark).
  • One Time Passwords should be handled with care, these are backdoors into your vault. Yet LastPass considers it to be a good idea to create one automatically without telling you and hide the corresponding setting rather far. If you look at the documentation you will learn that somebody with access to both your device and email will be able to take over your account, something that is considered a low risk. Maybe one of your co-workers played a prank on you by sending an email in your name because you forgot to lock your computer - next time they might take over your LastPass account even if you are logged out of LastPass.
  • Speaking of being logged out, the default session expiration time is two weeks. While certainly being convenient, there is a reason why most products handling sensitive data have much shorter session expiration intervals, typically well below one day.
  • For combining a value with a secret (e.g. as a signature) one would usually use SHA256-HMAC. LastPass uses a custom approach instead, applying SHA256 hashing twice. While the attacks that HMAC is meant to address don't seem to play a role here, I wouldn't bet on somebody with better crypto knowledge than me not finding a vulnerability here after all. Also, the server side will occasionally produce some SHA256 tokens as well - I wonder what kind of humbug is going on where I cannot see it and whether it's really secure.

I've been looking into the security issues of several password managers on a number of occasions. In particular, I reported twelve security issues to LastPass so far and wrote about the design decisions which led to those on a number of occasions. So while paj28 gave a very good general answer about password managers, I can provide some details.

When people talk about the security of online password managers, they usually focus on server security. The focus is on how easy is it to compromise the server and what will happen then. This is only one attack vector however, because attacking your local password manager instance might lead to the same results. In fact, attacking the browser extension might be a more promising course of action, as the data is already decrypted there and you won't leave traces in any logs.

Let me look at these two aspects separately.

Attacking the browser extension

There is a lot of historical data on vulnerabilities in the LastPass browser extension. All these vulnerabilities could be exploited by arbitrary webpages. At the very least, these are:

Did you notice a pattern here? LastPass has been struggling for years to secure their AutoFill functionality and to restrict access to their internal API. Each time a new report proved that their previous fix was incomplete.

Now it isn't unusual that password managers fail to implement AutoFill securely, most of them had issues in this area when I checked. While totally avoidable, these issues are common enough that I even compiled a list with recommendations to avoid the traps.

But the internal API issues are quite remarkable. LastPass exposes this API to websites in a number of different ways. It's meant to be restricted to lastpass.com but the logic is so complex that the restrictions have been circumvented several times in the past. And while LastPass did their best to downplay the severity in their official announcements, each of these issues allowed websites to read out all passwords at once. Worse yet, the last report by Tavis Ormandy proved that the internal API could be used to make the binary LastPass component execute arbitrary code on user's machine. Same could probably be done with all the previous flaws which exposed internal API.

One could of course ask why LastPass failed to restrict access to the internal API properly. But the better question is why this API is exposed to websites at all. That's because a significant part of the LastPass functionality isn't contained in the extension but rather relies on the LastPass website to work. That's a very problematic design decision but so far LastPass didn't seem interested in fixing it.

Attacking server-side data

Let's state this very clearly: we don't trust the server. It's not that we particularly distrust LogMeIn, Inc. - at least not more than any other company. But our passwords are very sensitive data, and even the most ethical company might have a rogue employee. Add to this the possibility that US authorities demand them to produce your data, something that isn't even necessarily associated with a criminal investigation. Never mind the possibility that their servers get hacked, like it already happened once.

So it is very important that your data on the server is encrypted and useless to anybody who can get hold of it. But what can possibly stop the attackers from decrypting it? Exactly one thing: they don't know your master password which is used to derive the encryption key. So the essential question is: does LastPass sufficiently protect your master password and encryption key?

In this area, I am not aware of any publicized research but my own, most of it written down in this blog post. My conclusion here: LastPass suffers from a number of design flaws here, some being resolved by now while others are still active.

Bruteforcing the master password

If the attackers got their hands on a bunch of encrypted data, the most straightforward decryption approach is: guess the master password used to derive the encryption key. You can try an unlimited number of guesses locally, on whatever hardware you can afford, so this process will be comparably quick.

LastPass uses PBKDF2 algorithm to derive the encryption key from the master password. While being inferior to newer algorithms like bcrypt, scrypt or Argon2, this algorithm has the important property of making key derivation slow, so attackers doing guessing locally will be slowed down. The time required is proportional to the number of iterations, meaning: the higher the number of iterations, the harder it will be to guess a master password.

For a long time, the LastPass default was 5,000 iterations. This is an extremely low value that provides very little protection. I calculated that a single GeForce GTX 1080 Ti graphics card could be used to test 346,000 guesses per second. That’s enough to go through the database with over a billion passwords known from various website leaks in barely more than one hour.

Following my reports, LastPass increased the default to 100,000 iterations mid-2018 which is far more adequate. Of course, if you are an important target who could expect state-level resources being thrown at guessing your master password, you should still choose an extremely strong master password.

Getting hold of data to bruteforce

One of my findings in early 2018 was that the script https://lastpass.com/newvault/websiteBackgroundScript.php could be loaded by any website. That script contained both your LastPass username and a piece of encrypted data (private RSA key). With your LastPass username being also the password derivation salt, that's all someone needs to bruteforce your master password locally.

This issue was resolved quickly of course. However, the flaw was obvious enough that I'm left wondering whether I was the first to discover it. While I urged LastPass to check their logs for signs of this vulnerability being exploited in the wild, to my knowledge this investigation never happened.

"Server-side rounds" as useless protection

Following a security incident in 2011, LastPass implemented an additional security mechanism: in addition to your PBKDF2 iterations on the client side they would add another 100,000 iterations on the server. So in theory, if somebody could get data off the server, this would increase the effort required to guess your master password.

In practice, I could conclusively prove that these additional 100,000 iterations are only applied to the password hash. All the other pieces of user data (passwords, RSA keys, OTPs and more) are only encrypted using the encryption key derived locally from your master password, no additional protection here. Conclusion: this additional "protection" is a complete waste of server resources and doesn't provide any value whatsoever.

Getting in through the back door

No matter how weak the protection, brute force attacks will always be ineffective against the strongest master passwords. However, the design of LastPass contains plenty of backdoors that would allow decrypting the data without expending any effort. I'll describe three backdoors here, one more report is still being worked on by LastPass.

The web interface

LastPass conveniently provides you with a web interface to access your passwords without the help of a browser extension. This feature is a trap however: whenever you enter your master password into a login form on the web, there is no way of knowing whether it will hash your master password with PBKDF2 before sending it to the server or whether it will transmit it as clear text.

Remember that we don't trust the server? Yet a trivial modification of the JavaScript code served up by the server is enough to compromise all your passwords. Even if you inspect that JavaScript code, there is too much of it for you to notice anything. And it would be possible to serve up the modified code only to specific users.

Account settings

Even if you use the browser extension consistently, whenever you go to the account settings it will load up the lastpass.com website. Here again, there is no way for you to know that this website isn't compromise and won't steal your data in the background.

Several other pieces of the extension functionality are also implemented by falling back to the lastpass.com website, and LastPass doesn't see the issue here.

Recovery OTP

LastPass has the concept of One-Time Passwords (OTPs) that you can use to recover data from your account if you ever forget the master password. These OTPs allow decrypting your data but aren't normally known to the server.

To make recovery even more reliable, LastPass will create a recovery OTP automatically by default and store it in the extension data. The issue here: the recovery process has been designed in such a way that the extension would immediately give lastpass.com that recovery OTP on demand, without even notifying you. So a compromised LastPass server could ask the extension for your recovery OTP and use it to decrypt your data.

According to LastPass, this issue has been resolved in August 2018. I don't know how they resolved it however, at least I couldn't see any of the obvious solutions in their code.

More design flaws

  • As you can see by yourself by opening up https://lastpass.com/getaccts.php while logged in, the LastPass vault is by no means an encrypted blob of data. It rather has encrypted data here and there, while other fields like the URL corresponding to the account merely use hex encoding. This issue was pointed out in this 2015 presentation and more fields became encrypted since then - still by far not all of them however. In particular, a report I filed pointed out that Equivalent Domains not being encrypted allowed LastPass server to modify that list and extract your passwords in that way. This particular issue has been resolved in August 2018 according to LastPass.
  • Same presentation scolds LastPass for their use of AES-ECB for encryption. Among other things, it gives away which of your passwords are identical. LastPass has been transitioning to AES-CBC ever since, yet when I looked at my "vault" I saw a bunch of AES-ECB-encrypted credentials there (you can tell because AES-ECB is merely a base64-encoded blob whereas the LastPass variant of AES-CBC starts with an exclamation mark).
  • Recovery OTP being created automatically and stored in the extension data means that anybody with access to your device and email address can access your LastPass account. This is actually documented and considered a low risk. Maybe one of your co-workers played a prank on you by sending an email in your name because you forgot to lock your computer - next time they might take over your LastPass account even if you are logged out of LastPass.
  • Speaking of being logged out, the default session expiration time is two weeks. While certainly being convenient, there is a reason why most products handling sensitive data have much shorter session expiration intervals, typically well below one day.
  • For combining a value with a secret (e.g. as a signature) one would usually use SHA256-HMAC. LastPass uses a custom approach instead, applying SHA256 hashing twice. While the attacks that HMAC is meant to address don't seem to play a role here, I wouldn't bet on somebody with better crypto knowledge than me not finding a vulnerability here after all. Also, the server side will occasionally produce some SHA256 tokens as well - I wonder what kind of humbug is going on where I cannot see it and whether it's really secure.
Updated disclaimer
Source Link

Disclaimer: I created Easy Passwords extensionPfP: Pain-free Passwords as a hobby, it could be considered a LastPass competitor.

I looked into the security design of Last PassLastPass recently, and it seems that I've got a good idea where to look for issues. So while paj28 gave a very good general answer about password managers, I can provide some details.

Disclaimer: I created Easy Passwords extension as a hobby, it could be considered a LastPass competitor.

I looked into the security design of Last Pass recently, and it seems that I've got a good idea where to look for issues. So while paj28 gave a very good general answer about password managers, I can provide some details.

Disclaimer: I created PfP: Pain-free Passwords as a hobby, it could be considered a LastPass competitor.

I looked into the security design of LastPass recently, and it seems that I've got a good idea where to look for issues. So while paj28 gave a very good general answer about password managers, I can provide some details.

Updated with more info on server side issues
Source Link
Loading
replaced http://security.stackexchange.com/ with https://security.stackexchange.com/
Source Link
Loading
added 1 character in body
Source Link
Loading
Source Link
Loading