News for hackers. Stuff that matters.
Re:TeamViewer stores user passwords in registry, encrypted w... by Someone1234 on Monday February 03, 2020 @01:04PM (#22226978)
They're doing nothing too wrong, the person criticising them doesn't understand basic computer security.

When the user hits "save password" on the client-side, the client needs to save the actual (plain text) password in order to replay it for future logins. A hashed password cannot be stored, otherwise that hashed password becomes the plain text password anyway (essentially destroying any benefit hashing would have here). The rules that apply to servers/services aren't the same as those for clients/saved logins.

Using reversible encryption is unavoidable, because they ultimately need plain text to send to the TeamViewer remote service. It is still marginally better than storing the actual plain text even if it is security through obscurity (using a hard-coded key in this case).

Storing it in the user's registry hive instead of a higher privilege allows the TeamViewer client to run in the user's context, instead of needing to run as administrator, have a broker, or similar.

One potential upgrade might be to use Windows' Data Protection API. It works essentially the same way as their current method, but Windows is responsible for protecting the encryption key (and has a broker than can house it at a higher privilege level).

But ultimately if you have a process running in the user's context and can manipulate the TeamViewer client, you can bypass the Data Protection API pretty trivially (e.g. injected DLL, UI hooks, other misc memory hooks, etc).

So my question would be: Describe the scenario where a bad actor has the ability to arbitrarily read data within a user's execution context, but not manipulate the TeamViewer Client also running in that same user's context? Because I got nothing.

My security advice here is simple: Don't save passwords to your local machine if you don't want them saved to your local machine. And don't leave backups of your saved passwords in insecure locations. I'm going to research if I can get a CVE assigned to that.

Re:TeamViewer stores user passwords in registry, encrypted w... by Justsignedup on Monday February 03, 2020 @01:08PM (#22227025)
A smart use of "save password" is where you authenticate and store the login token locally. You can then log in without a password, but also your session can be invalidated any time you say... change your password, or ask for a session to be kicked off.

We have to do this with web apps all the time. Nobody stores passwords in local browser store.

Re:TeamViewer stores user passwords in registry, encrypted w... by Someone1234 on Monday February 03, 2020 @01:13PM (#22227108)
I don't know if that applies to TV's circumstances because you can use the client to connect to endpoints without either end being internet accessible.

TeamViewer does operate account infrastructure like you're describing, but that isn't exclusively what they offer. They do point-to-point too.

Re:TeamViewer stores user passwords in registry, encrypted w... by signal11 on Monday February 03, 2020 @01:44PM (#22227446)
Yes, looking at this page it’s possible to disconnect the client from Team Viewer’s online infrastructure entirely: https://community.teamviewer.com/t5/Knowledge-Base/Can-TeamV...

> Hint: If you choose Accept exclusively, TeamViewer will disconnect from the internet – that means it will no longer be possible to make or receive connections using the TeamViewer ID, and the Computer & Contacts list will no longer be available.

Re:TeamViewer stores user passwords in registry, encrypted w... by Nullabillity on Monday February 03, 2020 @01:29PM (#22227280)
The TV host could issue its own persistent tokens, no internet access required.
Re:TeamViewer stores user passwords in registry, encrypted w... by NieDzejkob on Monday February 03, 2020 @01:24PM (#22227227)
I don't see how network position relates to the authentication scheme. As far as I can see, these are entirely separate issues, handled at different layers of the OSI stack.
Re:TeamViewer stores user passwords in registry, encrypted w... by crtlaltdel on Monday February 03, 2020 @03:14PM (#22228473)
^this. i recently had to explain this to a product manager who wanted the user's email and password to be autofilled it they landed at the login page.
Re:TeamViewer stores user passwords in registry, encrypted w... by nwsm on Monday February 03, 2020 @10:40PM (#22232164)
It's not the same thing at all. TeamViewer literally has to take in the password and paste it plaintext in later. They cannot simply validate that a user knows the password.

This does not happen "all the time" in web dev.

Re:TeamViewer stores user passwords in registry, encrypted w... by cpach on Monday February 03, 2020 @05:43PM (#22230176)
I’ve actually seen that functionality in the wild. Quite horrible. IIRC it was some weird open source web app.
Re:TeamViewer stores user passwords in registry, encrypted w... by stefan_ on Monday February 03, 2020 @01:58PM (#22227603)
That's a cool idea for a web service where once someone tries to actually change something, you can ask again for the password. I struggle to see how it makes any sort of difference for a remote management software; it's essentially an enterprise ready trojan. The moment someone has connected to a machine through token or password, that machine is utterly compromised and can not be saved by you clicking "revoke" in a web interface. That kinda situation calls for you to physically disconnect the machine from power.
Re:TeamViewer stores user passwords in registry, encrypted w... by gowld on Monday February 03, 2020 @01:27PM (#22227258)
> Nobody stores passwords in local browser store.

Yes, quite many body do:

chrome://settings/passwords

Re:TeamViewer stores user passwords in registry, encrypted w... by simongg on Monday February 03, 2020 @01:51PM (#22227523)
He's talking about web apps
Re:TeamViewer stores user passwords in registry, encrypted w... by shawnz on Monday February 03, 2020 @05:34PM (#22230078)
And TeamViewer isn't a web app. The parent is just demonstrating how other local, non-web apps have exactly the same issue for the same reason
Re:TeamViewer stores user passwords in registry, encrypted w... by cy6erlion on Monday February 03, 2020 @06:39PM (#22230619)
deep tangle
Re:TeamViewer stores user passwords in registry, encrypted w... by simcop2387 on Monday February 03, 2020 @01:10PM (#22227066)
> When the user hits "save password" on the client-side, the client needs to save the actual (plain text) password in order to reply it for future logins.

Since there's a central server involved in this authentication (as far as I understand how TV works), that's not the only way to do this, nor is it the best way. A better way is to store some other token that can be used to verify that the user has logged in before and has a valid session, one way to do that is to sign and encrypt data saying which user they were logged in as. This prevents the password itself from ever being retrieved even if they can still use it to impersonate the user to TV

Re:TeamViewer stores user passwords in registry, encrypted w... by sowbug on Monday February 03, 2020 @04:38PM (#22229458)
It is the only way if the action is labeled "save password," rather than "stay signed in" or "authorize this device" or similar.

It's a subtle distinction for the average user who doesn't care, but for a sophisticated user it does indicate a specific kind of behavior, and the relevance is what you do in case of compromise. Do you change your password and make the eavesdropped one useless? Do you deauthorize the stolen computer via a centralized interface?

Re:TeamViewer stores user passwords in registry, encrypted w... by comex on Monday February 03, 2020 @07:50PM (#22231142)
Right, but that means that what you actually want to do is store a hash of the password salted based on the identity of the machine you’re connecting to. (And the authentication protocol would be changed to verify possession of that hash rather than the password itself.) That way, not only do you avoid leaking the password itself, you ensure the hash can’t be used to connect to any other machines that use the same password. But changing the password is still what you need to do to block future access, preserving the expected semantics for sophisticated users.

(For bonus points, the salt should be re-randomized whenever the password changes, so that changing the password makes old hashes permanently useless, even if someone later changes the password back to its old value. Not that going back to an old password is ever a good idea, but some users will inevitably do it anyway.)

Edit: Actually, it’s probably better to use a completely random token and just have the server reset it whenever the password changes. That avoids any possibility of cracking the hash to recover the original password.

Re:TeamViewer stores user passwords in registry, encrypted w... by Dylan16807 on Monday February 03, 2020 @05:08PM (#22229804)
"the only way" Don't let pedantic adherence to the wording of the UI be more important than security.
Re:TeamViewer stores user passwords in registry, encrypted w... by pushrax on Monday February 03, 2020 @03:36PM (#22228707)
These are the ways the strategies differ:

- a token can be invalidated individually, while resetting a password invalidates all sessions

- a token can be given a predetermined expiry without the issues that arise from predetermined password expiry

- a token can be given a limited permission set

- a token can be used to track the origin and extent of an attack

In practise for something like TeamViewer I find it likely that none of these except the first would be implemented. If the attacker has access to the registry chances are you're f*cked anyway.

Re:TeamViewer stores user passwords in registry, encrypted w... by Daniel_sk on Monday February 03, 2020 @04:54PM (#22229634)
Also - a token can’t be used to change your password or steal the account completely. The app can ask you to enter your password again if you are doing these changes to your account. A token would not allow the attacker to pass this.
Re:TeamViewer stores user passwords in registry, encrypted w... by Thorrez on Tuesday February 04, 2020 @01:21AM (#22232929)
> Since there's a central server involved in this authentication

According to a comment above, it's possible to use teamviewer purely locally, without a central server.

Re:TeamViewer stores user passwords in registry, encrypted w... by marcus_holmes on Tuesday February 04, 2020 @01:52AM (#22233076)
How does TV authenticate a login locally if disconnected from the server?

I mean, in an ideal world where they didn't save the user's password locally...

Re:TeamViewer stores user passwords in registry, encrypted w... by Thorrez on Tuesday February 04, 2020 @11:01PM (#22243901)
Are you asking how they currently do it, or how it could theoretically be done better?

If you're asking how they currently do it, I guess by sending the password, but I don't really know.

One way that would be slightly better than that would be to send the hash. That's still a replayable token, but it has the advantage that if someone does password reuse it's not immediately replayable against other websites. Ideally the hash would be salted (maybe with the username and some teamviewer-specific constant). Even better than sending it would be to use a PAKE, authenticated with that salted hash.

Maybe an alternative would be some sort of asymmetric key system, where each device gets its own keypair. I guess it depends on exactly what functionality is needed. Does it need to be able to be setup offline, or can it be setup online, then go offline for further use?

Re:TeamViewer stores user passwords in registry, encrypted w... by marcus_holmes on Thursday February 06, 2020 @09:41AM (#22256271)
Yeah I guess the first.

I suppose they could insist on an online login before they allow an offline login, then save the hash locally. A bad person would need to generate a hash collision to login then.

Re:TeamViewer stores user passwords in registry, encrypted w... by tptacek on Monday February 03, 2020 @02:22PM (#22227897)
The normal thing to do here is to use the credential just once to generate a (revocable) token, and to store that (reversibly encrypted). Especially if you own both sides of the connection, it is in fact a bad idea to store user passwords; they're irrevocable and inevitably shared across services.

As security advice for developers, the writeup you're commenting about isn't especially useful. But that's not the point. It's a standard consulting war story post, about how they managed step-by-step to exploit a weakness in an application. As a war story, it seems plenty competent.

Re:TeamViewer stores user passwords in registry, encrypted w... by Polylactic_acid on Monday February 03, 2020 @07:34PM (#22231040)
If you are able to grab the users password off of their computer then you are able to capture it as they type it. Passwords are stored unencrypted on computers all the time, your browser stores passwords.
Re:TeamViewer stores user passwords in registry, encrypted w... by tptacek on Monday February 03, 2020 @08:04PM (#22231251)
The point of tokenizing is to minimize the number of times you ever need to handle the actual password, in part to avoid exactly those attacks.
Re:TeamViewer stores user passwords in registry, encrypted w... by closeparen on Monday February 03, 2020 @07:52PM (#22231157)
Reading keystrokes sent to other applications requires higher privileges than reading registry and filesystem, no?
Re:TeamViewer stores user passwords in registry, encrypted w... by _nedR on Tuesday February 04, 2020 @06:30AM (#22234424)
Not on linux/x.org (wayland is more secure)for certain... i am guessing not on windows either but i am not sure...
Re:TeamViewer stores user passwords in registry, encrypted w... by signal11 on Monday February 03, 2020 @01:22PM (#22227189)
I am not familiar with Team Viewer but you’re correct: any software that allows you to “save passwords for later use” is writing your password to disk/cloud — maybe reversibly encrypted but decipherable all the same, especially if the keys are held locally for offline use.

IIRC Chrome used to do this until 2013, for example, and resisted fixing it saying your OS account should protect you[1]. I suspect these days it’s encrypted to your Google Account as it’s synced, and additionally requires you to re-enter your OS password.

[1] https://news.ycombinator.com/item?id=6166793

PS. Does anyone know what Firefox does these days with their master password, especially now that they too ship a password manager? Their master password approach was similarly criticised [2].

[2] https://nakedsecurity.sophos.com/2018/03/20/nine-years-on-fi...

Re:TeamViewer stores user passwords in registry, encrypted w... by dx034 on Tuesday February 04, 2020 @02:46AM (#22233303)
Firefox encrypts passwords with your master password. The clear downside is that you lose all data if you forget your password. That's clearly good for security but I don't think it's an option for most services.
Re:TeamViewer stores user passwords in registry, encrypted w... by nightcracker on Monday February 03, 2020 @01:26PM (#22227243)
This is trivially solvable by salted hashing twice, once client side (which then can get saved post hash) and once server side.
Re:TeamViewer stores user passwords in registry, encrypted w... by marcinzm on Monday February 03, 2020 @01:58PM (#22227601)
That doesn't help you since you authenticate using the client hash so knowing that lets you authenticate remotely anyway. It only protects you against a password that was reused for something else as well.
Re:TeamViewer stores user passwords in registry, encrypted w... by nightcracker on Tuesday February 04, 2020 @02:00AM (#22233110)
> It only protects you against a password that was reused for something else as well.

That was the thing I was protecting against... Of course, no matter what form the access token takes when you press "Keep me logged in" allows you to authenticate remotely.

Re:TeamViewer stores user passwords in registry, encrypted w... by 0xff00ffee on Monday February 03, 2020 @01:12PM (#22227089)
Tokens were introduced to avoid saving passwords anywhere and they have the benefit of expiration.

Don't save plaintext passwords. Ever. It's really that simple. Why is this still an issue in 2019/2020?

Re:TeamViewer stores user passwords in registry, encrypted w... by gowld on Monday February 03, 2020 @01:30PM (#22227288)
> Tokens were introduced

before 1990

https://en.wikipedia.org/wiki/Kerberos_(protocol)

Re:TeamViewer stores user passwords in registry, encrypted w... by 0xff00ffee on Monday February 03, 2020 @01:31PM (#22227300)
Precisely.
Re:TeamViewer stores user passwords in registry, encrypted w... by mcny on Monday February 03, 2020 @02:05PM (#22227687)
> Don't save plaintext passwords. Ever.

Sorry if I am saying something obvious but just so I understand... we need Team viewer to expose some way for a program to send a username and a password and team viewer then sends back a token saying store this instead. Now, every time the client makes a request, it should use this token? and if the client tries to use a user password, refuse? Thank you

Re:TeamViewer stores user passwords in registry, encrypted w... by munk-a on Monday February 03, 2020 @02:12PM (#22227790)
When the user initially attempts to authenticate into Team Viewer send the user a randomly generated (not-derived off of user information at least) token in the response and register it with a data-store on the server. From that point on the user can re-authenticate with Team Viewer by sending the token until, for some reason, you decide to invalidate the token on the server - then the user is forced to re-authenticate with their password. At any point before their token is forcefully invalidated the user can optionally re-authenticate with their password to get a new token.

That's the general gist, but if you're thinking of writing some software for it I'd suggest searching out some third party tool to manage these tokens for you or, if you're unable to find anything, then doing a bit of research into the pitfalls you can run into with this approach. The less you write in-house the better.

Re:TeamViewer stores user passwords in registry, encrypted w... by 0xff00ffee on Monday February 03, 2020 @02:32PM (#22228021)
To build on what user "munk-a" said below...

Back up a little bit. Start from the premise that you should never ever know the user's password. Period. Consider that a liability. This is the beginning of a mindset. With this in mind, erase the statement "we need a program to send a username and a password". That is the wrong mentality. (IMHO)

Now, you want your user, who you have authenticated, to be able to access other services that you don't own, am I correct? E.g., like IFTTT or Gmail?

If that is the case, you need to use an authentication mechanism (e.g. Oauth2) that allows the user to approve authentication to a service. Then you store the token returned by that service and use that to obtain access. If it is not a big-name platform, then you need to work that platform service to implement OAuth (or Auth0, or Cognito, or some other token-based authentication system).

If you are trying to access a service that does not support a token authentication system and only supports passwords, you should not allow the user to connect.

This may damage your functionality value proposition, but IMHO it is more secure because you minimize exposure of the user's password.

I wouldn't use a service that stored my plaintext password and logged in as me. To me, that's a no-go.

Again, all my opinion.

In fact, I'm eagerly reading this thread because I was in this situation years ago, and went with Auth0 (actually Stormpath before they were bought by Auhto0), but I had to argue for budget to pay for the service because I faced exactly the same pushback: "Just save the password!" I'd like to know if I missed something obvious.

Re:TeamViewer stores user passwords in registry, encrypted w... by naasking on Tuesday February 04, 2020 @12:21AM (#22232665)
> Back up a little bit. Start from the premise that you should never ever know the user's password. Period. Consider that a liability.

This sounds reasonable until you realize that requiring only the user to handle passwords creates an even bigger liability: users are terrible at creating, handling and remembering passwords. Giving them this sole responsibility means they create simple, short passwords and reuse them across multiple services, thus increasing their vulnerability.

Browsers that started handling passwords and helping users create good passwords was one of the greatest security UX improvements of the past 20 years IMO.

Re:TeamViewer stores user passwords in registry, encrypted w... by 0xff00ffee on Tuesday February 04, 2020 @12:08PM (#22238046)
Everything you said is true, but completely unrelated. :)

Here's why: we are talking about the huge legal difference between liability of the user and liability of the service. If user's pick poor passwords, that's their problem, and a problem with passwords in general. But if you store the password, suddenly you are opening yourself up to bigger risks, risks that could sink your product.

Big difference.

Re:TeamViewer stores user passwords in registry, encrypted w... by continuational on Monday February 03, 2020 @01:10PM (#22227057)
What you normally do in this scenario (which is similar to a cookie), is to have an "Remember me" option that generates a unique token you can use to log in with. It's not your password, and ideally you can look in your online account and see what devices has such a token and revoke access.
Re:TeamViewer stores user passwords in registry, encrypted w... by xxs on Monday February 03, 2020 @01:43PM (#22227438)
Also the token should be regenerated as well on use, not stored as plaintext token, either. But yeah - the idea to store plaintext password encrypted or hashed is just stupid.
Re:TeamViewer stores user passwords in registry, encrypted w... by ggerganov on Monday February 03, 2020 @01:12PM (#22227095)
Do I understand correctly - it's the same reason why browsers keep plain text passwords locally when the users selects to save them?

[0] https://security.stackexchange.com/questions/170481/how-secu...

Re:TeamViewer stores user passwords in registry, encrypted w... by professorTuring on Monday February 03, 2020 @01:24PM (#22227231)
No, you can only access browser's stored passwords if you can log in as the user in the machine (see second response).

In this case, anyone can access that registry and get the pwd.

Re:TeamViewer stores user passwords in registry, encrypted w... by amluto on Monday February 03, 2020 @02:40PM (#22228098)
Storing a bearer token in the registry means that anyone who compromises the registry once gets persistent access. There are multiple solutions:

1. Store a token that is replaced with a new token on every successful connection. This makes it very obvious if the token is stolen: either the stolen token stops working quickly or your connection stops working.

2. Store a key using a privileged service (TPM, Microsoft KSP, etc) that provides only the ability to use the key, not to read it.

3. Both 1 and 2.

Re:TeamViewer stores user passwords in registry, encrypted w... by nullc on Monday February 03, 2020 @02:13PM (#22227798)
FWIW, it's still better that the thing you save is a hash, because that's less useful for cracking other related passwords than the raw password itself.

E.g. If you make your password to access your home computer "eb49wsrew-home" ... what are the odds that the password for your work computer is "eb49wsrew-work"?

In an ideal world passwords would be independently selected, but we write software for non-ideal users in a non-ideal world.

> So my question would be: Describe the scenario where a bad actor has the ability to arbitrarily read data within a user's execution context, but not manipulate the TeamViewer Client also running in that same user's context? Because I got nothing.

If there was a system service which you could hand a read only secret and then it could perform challenge response queries of the form response = H(secret||challenge), and had the server send a fresh random challenge on every every connection then you could have a setup where even if the attacker could run as teamviewer (but not the system admin) he couldn't steal the credential he could only make use of it.

When you save your credential you'd hash the password, the server would also store the same hashed password. You'd send the hashed password to the system service, and the server could challenge your knowledge of it. For bonus points, have the service implement some simple ZKP (such as SRP) so being able to observe the challenge-responses doesn't allow you to grind offline attack the password.

This would be at least a small improvement.

Re:TeamViewer stores user passwords in registry, encrypted w... by anon176 on Monday February 03, 2020 @01:33PM (#22227317)
They also used CBC over EBC for the encryption mode. Which is good. Looks like they were at least trying to keep it safe.
Re:TeamViewer stores user passwords in registry, encrypted w... by mothershipper on Tuesday February 04, 2020 @01:26AM (#22232951)
Assuming one byte per character, you'd have to have a 17 character password before you're using multiple blocks. For any password shorter than that, this cipher is pretty much operating in ECB mode due to the re-used IV.
Re:TeamViewer stores user passwords in registry, encrypted w... by kjaftaedi on Monday February 03, 2020 @02:23PM (#22227909)
I agree with your arguments.. however the unanswered question is why the passwords need to be stored locally at all?

The passwords are saved to your Teamviewer profile which exists on their servers. It seems like it would be safer to request and decrypt only when needed by an authorized user, rather than storing it for someone else to find.

Re:TeamViewer stores user passwords in registry, encrypted w... by tinus_hn on Monday February 03, 2020 @03:23PM (#22228559)
The solution is to hash the password once, salted, and store and use that as a plaintext equivalent instead of storing the real password. This way if the password is reused on other services and an attacker retrieves it from the store it isn’t as much of a disaster.
Re:TeamViewer stores user passwords in registry, encrypted w... by pcmonk on Monday February 03, 2020 @01:51PM (#22227519)
The article doesn't say anything about hashing the password, this is a perfect case of the title having a large influence on how we read the article.

@dang This title is misleading.

Re:TeamViewer stores user passwords in registry, encrypted w... by e12e on Monday February 03, 2020 @05:09PM (#22229819)
Re:TeamViewer stores user passwords in registry, encrypted w... by m-p-3 on Monday February 03, 2020 @01:14PM (#22227112)
> When the user hits "save password" on the client-side, the client needs to save the actual (plain text) password in order to replay it for future logins.

It's still insecure to store a user password as-is. TeamViewer should create an session key of some sort that is unique to this machine instead of replaying the username/password.

Re:TeamViewer stores user passwords in registry, encrypted w... by RachelF on Monday February 03, 2020 @05:18PM (#22229913)
As you say, if you have to save the passwords locally, you have to save them locally. Web browsers that save passwords and password managers like LastPass all have to do this.

If you look in the Windows "Control Panel" app you'll see something called "Credential manager" that provides an API for saving passwords.

Re:TeamViewer stores user passwords in registry, encrypted w... by mooneater on Monday February 03, 2020 @01:07PM (#22227006)
> A hashed password cannot be stored, otherwise that hashed password becomes the plain text password anyway (essentially destroying any benefit hashing would have here).

The plaintext password may be re-used by the user on other systems, so yes hashing would still benefit here.

Re:TeamViewer stores user passwords in registry, encrypted w... by wlesieutre on Monday February 03, 2020 @01:17PM (#22227141)
I think parent is saying you can't have a login system where you store the hashed password locally and then log in by sending the hashed password to the server. The hashing to validate a password has to happen on the server, otherwise anyone could get a copy of your hashed password and submit it as a login.

But as other replies have pointed out, you can generate a login token to offer a "save password" feature without actually saving the password to disk.

Re:TeamViewer stores user passwords in registry, encrypted w... by xxs on Monday February 03, 2020 @01:39PM (#22227378)
Storing password encrypted or a function of the original password (hashed) is all wrong and the entire premise of the post follows suit.

After a successful authentication with username/password - store a one time token (randomly generated) on the client. Each time the token is used - generate a new one. That's it. On the server store a hash of that token, so getting the database of tokens does nothing, either.

The user retains ability to revoke any tokens at any time and also to know where they have been stored and used (if they choose to name a device/storage)

Re:TeamViewer stores user passwords in registry, encrypted w... by magicalhippo on Monday February 03, 2020 @01:13PM (#22227100)
Storing a hash would be better because it wouldn't leak the actual password. People have a tendency to use the same password over again as well as sharing them between logins, so this is bad.

Not using the Data Protection API makes it easier to extract the password.

So while you're right that storing the password has some consequences, they should have done better, especially since their product is focused towards non-techs as well.