Password Security

Status
Not open for further replies.

Asmodaios

Seniorius Lurkius
19
Working on a web site, and want to be 100% ( well, as close as possible ) to not being "that guy" who just used MD5 in my database after an attack. SO I'm looking for comments, criticisms, or other suggestions.

So I'll outline what I have.

You sign in with a username and password, BUT if you opted in for 2 factor, my app is integrated with Twilio, so you send a txt message to the phone number containing just AUTH, it sends back a 5 digit code you must also use, which is only good for 5 minutes.

Before that password is sent, it's hashed with SHA512, combined with another hash of you username ( to avoid the Birthday Problem ), and key stretched a few times.

The login data is not sent in the body ( because I have compression on, and we have BEAST and CRIME, although I'm trying to avoid RC4 ), but my testing shows I have PFS/ECC available for most browsers that support it. ( I have an A grade from ssllabs.com )

So, I can honestly say that I have not seen the users plaintext password.

The server side of auth is rate limited ( Guava's RateLimiter ), but, to prevent timing based attacks, I record the start time, and throughout the day the average successful login time. If the login is not successful, the thread sleeps for the difference of duration to the average success time.

I also have some form of session ID rotation, IP tracking, etc, which I'm not going to detail here.

When the password is first created, I then use BCrypt, with the salt and users other information in not just different tables, but different databases.

Then it is encrypted, AES-256/PKCS, and I have many keys and salts, so there isn't just ONE AES key, if one key is compromised, the entire database is not. Which key/salt to use is based of a numeric hash of the users login ID and other information when they created their account.

BUT here is my issue. I need to store those AES keys SOMEWHERE. Somewhere secure, so that the keys can't be expose if the machine is broken into.

Currently I have them in a file on an encrypted filesystem, that I have to mount and enter the password for THAT, boot the app server, and unmount the filesystem.

Anyone have a better idea for storing the master key file???

I also have,... about 5% of my accounts as honey pot accounts, IF they are successfully signed into, I get an immediate alert, and I know SOMETHING was hacked.

Any other comments/criticisms welcome :)
 

LordFrith

Ars Legatus Legionis
25,252
Subscriptor++
[url=http:/civis/viewtopic.php?p=26542909#p26542909:35bpyur9 said:
dmitriyk[/url]":35bpyur9]
[url=http:/civis/viewtopic.php?p=26542665#p26542665:35bpyur9 said:
LordFrith[/url]":35bpyur9]
What's your defense against a government issued subpoena?
I think that's his question. ;)
There isn't a protection against a subpoena. Other than a willingness to go to jail.
 

Asmodaios

Seniorius Lurkius
19
[url=http:/civis/viewtopic.php?p=26542665#p26542665:3a2rzevq said:
LordFrith[/url]":3a2rzevq]
[url=http:/civis/viewtopic.php?p=26542575#p26542575:3a2rzevq said:
Asmodaios[/url]":3a2rzevq]EVERY attack vector. ;)

What's your defense against a government issued subpoena?

I'm not building something like Silent Circle, where the users data is encrypted beyond a subpoena, I'm trying to prevent a situation like Adobe, etc, from happening, where my password system was compromised and I have to notify everyone that
they have to change their passwords everywhere.
 

CanSpice

Ars Tribunus Angusticlavius
7,147
[url=http:/civis/viewtopic.php?p=26535995#p26535995:9eosxamu said:
Asmodaios[/url]":9eosxamu]When the password is first created, I then use BCrypt, with the salt and users other information in not just different tables, but different databases.

Then it is encrypted, AES-256/PKCS, and I have many keys and salts, so there isn't just ONE AES key, if one key is compromised, the entire database is not. Which key/salt to use is based of a numeric hash of the users login ID and other information when they created their account.
Is there something you know that I don't where bcrypt is reversible? You've already encrypted the password once with bcrypt, why are you encrypting it again?
 

Faramir

Ars Legatus Legionis
36,356
Subscriptor
[url=http:/civis/viewtopic.php?p=26535995#p26535995:3hvx2zl5 said:
Asmodaios[/url]":3hvx2zl5]You sign in with a username and password, BUT if you opted in for 2 factor, my app is integrated with Twilio, so you send a txt message to the phone number containing just AUTH, it sends back a 5 digit code you must also use, which is only good for 5 minutes.
What happens if you lose your phone / your change phone numbers / etc. This "recovery" process is often a gaping hole in two factor schemes. Also for passwords in general.

Before that password is sent, it's hashed with SHA512, combined with another hash of you username ( to avoid the Birthday Problem ), and key stretched a few times.
Not sure what "that password" is referring to here. The second factor? The username and password? Either way it's confusing as to what the purpose of this step is.

So, I can honestly say that I have not seen the users plaintext password.
Okay, now I think I see what you may have been getting at. You are sending a sort of complicated fingerprint rather than the username and password. Not sure that's a great idea. *If* you want a zero knowledge password proof system, there's off the shelf options like TLS-SRP. There's a reason no one uses them though -- it's very complicated to get right, and even if you get it right you still can't trust javascript cryto so you are no better off. "Industry standard" is to send the plaintext password over TLS and check it against the password hash server side.

The server side of auth is rate limited ( Guava's RateLimiter ), but, to prevent timing based attacks, I record the start time, and throughout the day the average successful login time. If the login is not successful, the thread sleeps for the difference of duration to the average success time.
Is this intended to mitigate timing attacks against BCrypt?

When the password is first created, I then use BCrypt, with the salt and users other information in not just different tables, but different databases.
So you aren't using the standard Bcrypt format? E.g.
$2a$10$KssILxWNR6k62B7yiX0GAe2Q7wwHlrzhF3LqtVvpyvHZf0MwvNfVu
That seems like to a future headache waiting to happen when you want to upgrade the cost factor or the like, for dubious benefits.

Then it is encrypted, AES-256/PKCS, and I have many keys and salts, so there isn't just ONE AES key, if one key is compromised, the entire database is not. Which key/salt to use is based of a numeric hash of the users login ID and other information when they created their account.
Are you talking about per user pepper?

Separately, I'd be very wary of hashing into your password system any account information that can possibly change -- including usernames. It makes changing any of those informational columns a real pain in the neck.

BUT here is my issue. I need to store those AES keys SOMEWHERE. Somewhere secure, so that the keys can't be expose if the machine is broken into.
That's the problem with pepper.

Currently I have them in a file on an encrypted filesystem, that I have to mount and enter the password for THAT, boot the app server, and unmount the filesystem.
So if the server crashes for whatever it can't come back up until login and mount the encrypted file store?

Any other comments/criticisms welcome :)
It's good to take security seriously, too many people don't. But don't make things more complicated than they need to be. Figure out your threat model, and use well known, well specified techniques to mitigate those threats.
 

Asmodaios

Seniorius Lurkius
19
Tank you for your thoughtful, and constructive responses.

[url=http:/civis/viewtopic.php?p=26550873#p26550873:6ss5nk5m said:
Faramir[/url]":6ss5nk5m]
[url=http:/civis/viewtopic.php?p=26535995#p26535995:6ss5nk5m said:
Asmodaios[/url]":6ss5nk5m]You sign in with a username and password, BUT if you opted in for 2 factor, my app is integrated with Twilio, so you send a txt message to the phone number containing just AUTH, it sends back a 5 digit code you must also use, which is only good for 5 minutes.
What happens if you lose your phone / your change phone numbers / etc. This "recovery" process is often a gaping hole in two factor schemes. Also for passwords in general.

Agreed that the recovery process could be a hole, looking more into how Gmail/Google does this, but there are not millions, or thousands of users, so it could be a support call. I have had requests to use RSA key-fobs, but given the recent news, that has dropped off severely.

Before that password is sent, it's hashed with SHA512, combined with another hash of you username ( to avoid the Birthday Problem ), and key stretched a few times.
Not sure what "that password" is referring to here. The second factor? The username and password? Either way it's confusing as to what the purpose of this step is.

All hashes have possible collisions, aka the birthday problem, using just something like WireShark, you could search for collisions, and break at least one password.

So, I can honestly say that I have not seen the users plaintext password.
Okay, now I think I see what you may have been getting at. You are sending a sort of complicated fingerprint rather than the username and password. Not sure that's a great idea. *If* you want a zero knowledge password proof system, there's off the shelf options like TLS-SRP. There's a reason no one uses them though -- it's very complicated to get right, and even if you get it right you still can't trust javascript cryto so you are no better off. "Industry standard" is to send the plaintext password over TLS and check it against the password hash server side.

In is possible for a MITM attack, if the plaintext was sent, to extract the password, but basically I just want to say, no, I have never seen your plaintext, so no, IF I was ever broken into, the cost of reverse engineering your plaintext would be SO prohibitive, that I could reassure people that, as they often do and use the same password on multiple services, they would be in no danger.

The server side of auth is rate limited ( Guava's RateLimiter ), but, to prevent timing based attacks, I record the start time, and throughout the day the average successful login time. If the login is not successful, the thread sleeps for the difference of duration to the average success time.
Is this intended to mitigate timing attacks against BCrypt?

Yes, partly, but all password end points can emit a "signal", just in the number of instructions to process deny an account that exists, and an account that does not, this is a classic timing attack, not on the encrypted password, but on valid usernames. But rate limiting in an of itself will slow down the effectiveness of any timing based attack attempt.

When the password is first created, I then use BCrypt, with the salt and users other information in not just different tables, but different databases.
So you aren't using the standard Bcrypt format? E.g.
$2a$10$KssILxWNR6k62B7yiX0GAe2Q7wwHlrzhF3LqtVvpyvHZf0MwvNfVu
That seems like to a future headache waiting to happen when you want to upgrade the cost factor or the like, for dubious benefits.

cost factor is already 12, and no plans to increase it.

Then it is encrypted, AES-256/PKCS, and I have many keys and salts, so there isn't just ONE AES key, if one key is compromised, the entire database is not. Which key/salt to use is based of a numeric hash of the users login ID and other information when they created their account.
Are you talking about per user pepper?

Separately, I'd be very wary of hashing into your password system any account information that can possibly change -- including usernames. It makes changing any of those informational columns a real pain in the neck.

Again, usernames won't change, but IF it has to be done, we can capture it locally ( a separate admin system ) and just edit the database, or after a change, reset that password for the use over the phone, and expire password immediately, which requires them to change it on login.

BUT here is my issue. I need to store those AES keys SOMEWHERE. Somewhere secure, so that the keys can't be expose if the machine is broken into.
That's the problem with pepper.

Agreed.

Currently I have them in a file on an encrypted filesystem, that I have to mount and enter the password for THAT, boot the app server, and unmount the filesystem.
So if the server crashes for whatever it can't come back up until login and mount the encrypted file store?

I just removed that, it was a pain in the... anyway, the filesystem exists, but it only mounted during the boot process. Not quite a secure as I wanted, but it was a pain.

Any other comments/criticisms welcome :)
It's good to take security seriously, too many people don't. But don't make things more complicated than they need to be. Figure out your threat model, and use well known, well specified techniques to mitigate those threats.

I have been over OSWAP at least 2 dozen times, but this system in general was borne out of... extremely paranoid Banks ( Wall St ), and those banks have not had a password break in. And lets imagine this is a service for many of those banks, and their paranoia, which I know very well, because I have been on the Street for 15 years, I'd need to get past THEIR due diligence. In these places, I have been subject to countless PEN tests, so much of it was from points on their PEN tests or security teams. ( but sometimes I think they were just making crap up because they found no other weakness, and felt that HAD to have some criticisms or they weren't doing their jobs )
 

Asmodaios

Seniorius Lurkius
19
[url=http:/civis/viewtopic.php?p=26554649#p26554649:3tftg3cz said:
sryan2k1[/url]":3tftg3cz]
and those banks have not had a password break in.


If you really believe this you are truly naive.

IF a system I was responsible for had a password break-in, the sh*t would come down on me like a load of bricks, assuming I still had a job.

In that world, there is no "OOPS. sorry", your desk is cleaned out before you get back from the meeting about it.

You really think I WOULDN'T know?

Were not talking about, ooo, well, someone can see your purchase, someone can read a message, were talking about exposing BILLIONS of dollars of account information, and I'd need to go to the proctologist to get the SEC out of my rectum.
 

Asmodaios

Seniorius Lurkius
19
[url=http:/civis/viewtopic.php?p=26555751#p26555751:9v0mnww7 said:
dragonlord[/url]":9v0mnww7]Realistically is there any reason that you can't store the "pepper" on a separate internal web service that the externally facing service has access to and only uses once?

To install that on another web service, to avoid the probability of a machine break-in would expose the keys, I would then have to move it to a different machine, correct?

I would then have to lock down that machine to the same sort of intrusion that I had to worry about on the primary machine, THO, I could restrict the firewalls, IPTables to only allow connections from the primary machine(s) ( aside from the other lockdowns to SSH. etc )

Currently also going through everything in http://www.amazon.com/The-Basics-Hackin ... 1597496553 because, you know, it's not illegal to HACK your own box

;)
 

dragonlord

Ars Scholae Palatinae
1,123
However white lists are much easier to manage than black lists. And if you're worried enough about break ins then having the keys on the same server that does the authentication is just asking for trouble anyway. As anyone that gets the sort of access that you're afraid of will be able to grab the keys from memory.

If you had the entire key generation on an isolated machine that only allowed access to a white list of machines and ports, you can be sure that unless someone cracks the first machine and then discovers the second machine and cracks that one too, will they discover your key generation method.

given that this second machine will only be providing a hash for given input and the primary machine will still be doing the comparisons, you can lock the second machine down so tight that it squeaks.
 

Faramir

Ars Legatus Legionis
36,356
Subscriptor
[url=http:/civis/viewtopic.php?p=26554541#p26554541:rpoj71ft said:
Asmodaios[/url]":rpoj71ft]All hashes have possible collisions, aka the birthday problem, using just something like WireShark, you could search for collisions, and break at least one password.
You are tunneling over TLS, no?

In is possible for a MITM attack, if the plaintext was sent, to extract the password, but basically I just want to say, no, I have never seen your plaintext, so no, IF I was ever broken into, the cost of reverse engineering your plaintext would be SO prohibitive, that I could reassure people that, as they often do and use the same password on multiple services, they would be in no danger.
If the attacker has MitM'ed the connection then he can serve new javascript that passes the plaintext to the attacker rather than hashing it locally. Plus as I mentioned zero knowledge password proofs are a studied problem, so there's no good reason to roll your own even if you decide you want to use such a system despite the inherent limitations of the browser client.

cost factor is already 12, and no plans to increase it.
So then you must have an date certain EOL for this product?

Again, usernames won't change, but IF it has to be done, we can capture it locally ( a separate admin system ) and just edit the database, or after a change, reset that password for the use over the phone, and expire password immediately, which requires them to change it on login.
Of course you *can* it's not impossible, but it's a PITA to mix your user data into password hashes. BTDT.

BUT here is my issue. I need to store those AES keys SOMEWHERE. Somewhere secure, so that the keys can't be expose if the machine is broken into.
That's the problem with pepper.
Agreed.
Which is one reason many people decide that on the balance pepper doesn't add much, if any, overall security to the system.
 

Bengie25

Ars Praefectus
5,506
Subscriptor
Since you have so much custom stuff going on, I have an idea for the "where to store the AES key".

Have whatever is encrypting with AES be a separate service that you can pass in whatever you want to encrypt, and get back an encrypted version, but never the key. This separate service could be a very locked down account with deny permissions for all other users to access the file that has the AES key in it.

If you're using an OS like FreeBSD 10, you can use Capsicum to read in the AES key, then immediately drop permissions to that file, in case someone tries to do some attack that attempts to output the file. Not a lot of extra protection, but still more.

The main point is that user facing code does not have access to the key(s), but only a highly restricted and well vetted simple interface to request to request something be encrypted. Since you're talking about encrypting hashes, you already have an upper bound on the size of the byte arrays to be encrypted. You can use this knowledge to enforce no arbitrary sized data comes in. A well defined struct. If the request does not exactly match the length/etc, it can be discarded and assume there is a bug or security issue.
 

Asmodaios

Seniorius Lurkius
19
[url=http:/civis/viewtopic.php?p=26556877#p26556877:346ccxzi said:
Faramir[/url]":346ccxzi]
[url=http:/civis/viewtopic.php?p=26554541#p26554541:346ccxzi said:
Asmodaios[/url]":346ccxzi]All hashes have possible collisions, aka the birthday problem, using just something like WireShark, you could search for collisions, and break at least one password.
You are tunneling over TLS, no?

Yes, TLS 1.2

In is possible for a MITM attack, if the plaintext was sent, to extract the password, but basically I just want to say, no, I have never seen your plaintext, so no, IF I was ever broken into, the cost of reverse engineering your plaintext would be SO prohibitive, that I could reassure people that, as they often do and use the same password on multiple services, they would be in no danger.
If the attacker has MitM'ed the connection then he can serve new javascript that passes the plaintext to the attacker rather than hashing it locally. Plus as I mentioned zero knowledge password proofs are a studied problem, so there's no good reason to roll your own even if you decide you want to use such a system despite the inherent limitations of the browser client.

This is possible, but not probable, unless you were VERY determined, and VERY skilled. Yes, it's JavaScript, but it's a sort of "hardened" GWT app ( http://www.gwtproject.org/overview.html ), the entire app is delivered as 1 big JavaScript chunk. GWT is a true compiler, it takes Java, and compiles it to JavaScript, inso doing, applies dozens of optimizations, inlining, and incredible minifying. The resulting JavaScript bears as much resemblance to anything readable as C++ does to Assembly Code *. But where this differs from regular GWT is that this "chunk" has a ... lets say - Checksum. and if you modify the JavaScript in any way, and the checksum doesn't match the checksum on the server, it will not run **. This is not impenetrable however, as you could subvert the checksum code on the client, but it will keep most amateur hackers at bay, the truly pro ones, well, you just have to know from the start, that you can NEVER, EVER, trust the browser.

* I have been using GWT since it's first release, and even I have a near impossible time debugging the compiled JavaScript.

** this feature did not start out as "hardening", but a feature to make sure the version you were running matched the server version ( as the JavaScript could be cached ), it was modified later to support some hardening. It's not totally true that it will not run, it will notice the mismatch, and attempt to reload the JavaScript from the server.

*** no language wars, if you work in Finance, Telecom, etc, Java ( and somewhat J2EE ) is King.
 

Asmodaios

Seniorius Lurkius
19
[url=http:/civis/viewtopic.php?p=26556441#p26556441:4jmuvvoj said:
dragonlord[/url]":4jmuvvoj]However white lists are much easier to manage than black lists. And if you're worried enough about break ins then having the keys on the same server that does the authentication is just asking for trouble anyway. As anyone that gets the sort of access that you're afraid of will be able to grab the keys from memory.

If you had the entire key generation on an isolated machine that only allowed access to a white list of machines and ports, you can be sure that unless someone cracks the first machine and then discovers the second machine and cracks that one too, will they discover your key generation method.

given that this second machine will only be providing a hash for given input and the primary machine will still be doing the comparisons, you can lock the second machine down so tight that it squeaks.

This seems the most reasonable, move that part to another machine, install the MINIMAL set of software to allow the machine to run, block EVERYTHING but the request port, and whitelist that.

I don't even need ssh always active on that box, as I just set it up, and have serial line access...
 

Asmodaios

Seniorius Lurkius
19
[url=http:/civis/viewtopic.php?p=26557611#p26557611:1oupgmvs said:
Bengie25[/url]":1oupgmvs]Since you have so much custom stuff going on, I have an idea for the "where to store the AES key".

Have whatever is encrypting with AES be a separate service that you can pass in whatever you want to encrypt, and get back an encrypted version, but never the key. This separate service could be a very locked down account with deny permissions for all other users to access the file that has the AES key in it.

If you're using an OS like FreeBSD 10, you can use Capsicum to read in the AES key, then immediately drop permissions to that file, in case someone tries to do some attack that attempts to output the file. Not a lot of extra protection, but still more.

The main point is that user facing code does not have access to the key(s), but only a highly restricted and well vetted simple interface to request to request something be encrypted. Since you're talking about encrypting hashes, you already have an upper bound on the size of the byte arrays to be encrypted. You can use this knowledge to enforce no arbitrary sized data comes in. A well defined struct. If the request does not exactly match the length/etc, it can be discarded and assume there is a bug or security issue.

I'll take a look at Capsicum. Not running FreeBSD, usually a Red Hat derivative.

I don't have total control over the operating system, as this was made to be installed on a clients own Linux infrastructure.
 

Asmodaios

Seniorius Lurkius
19
And... you may call me a bit of a grey-beard, I may have a low post count here, but I started at Bell Labs in 1984, so I was working with Unix in research before a lot of people here were born. ;)

My first web apps were with CERN HTTPD and Mosaic.

please don't assume i'm a newb.

I'm asking these questions here because I wanted a fresh set of eyes on assumptions that have been made by "higher up's" in the Banking world, that are very likely outdated or just plain wrong.
 

Faramir

Ars Legatus Legionis
36,356
Subscriptor
[url=http:/civis/viewtopic.php?p=26559783#p26559783:3m1n5ub1 said:
Asmodaios[/url]":3m1n5ub1]
[url=http:/civis/viewtopic.php?p=26556877#p26556877:3m1n5ub1 said:
Faramir[/url]":3m1n5ub1]
[url=http:/civis/viewtopic.php?p=26554541#p26554541:3m1n5ub1 said:
Asmodaios[/url]":3m1n5ub1]All hashes have possible collisions, aka the birthday problem, using just something like WireShark, you could search for collisions, and break at least one password.
You are tunneling over TLS, no?

Yes, TLS 1.2
So where does the wireshark come in? After the attacker has compromised the TLS session?

In is possible for a MITM attack, if the plaintext was sent, to extract the password, but basically I just want to say, no, I have never seen your plaintext, so no, IF I was ever broken into, the cost of reverse engineering your plaintext would be SO prohibitive, that I could reassure people that, as they often do and use the same password on multiple services, they would be in no danger.
If the attacker has MitM'ed the connection then he can serve new javascript that passes the plaintext to the attacker rather than hashing it locally. Plus as I mentioned zero knowledge password proofs are a studied problem, so there's no good reason to roll your own even if you decide you want to use such a system despite the inherent limitations of the browser client.

This is possible, but not probable, unless you were VERY determined, and VERY skilled. Yes, it's JavaScript, but it's a sort of "hardened" GWT app ( http://www.gwtproject.org/overview.html ), the entire app is delivered as 1 big JavaScript chunk. GWT is a true compiler, it takes Java, and compiles it to JavaScript, inso doing, applies dozens of optimizations, inlining, and incredible minifying. The resulting JavaScript bears as much resemblance to anything readable as C++ does to Assembly Code *. But where this differs from regular GWT is that this "chunk" has a ... lets say - Checksum. and if you modify the JavaScript in any way, and the checksum doesn't match the checksum on the server, it will not run **. This is not impenetrable however, as you could subvert the checksum code on the client, but it will keep most amateur hackers at bay, the truly pro ones, well, you just have to know from the start, that you can NEVER, EVER, trust the browser.
I'm familiar with GWT, for my many sins I'm even currently supporting a GWT application. Not sure why you'd use it on a greenfield project given that google has essentially abandoned it and the new guys seem more interested in mobile widgets than fixing bugs, but that's neither here nor there.

While decompiling javascript generated by the GWT compiler in obfuscated mode is indeed a nightmare, a Mallory who has MitM'ed the TLS session need not do so. GWT does not prevent additional javascript from being attached to the DOM. So all the attacker needs to do is have a second javascript snippet that on submit sends a copy of the plaintext password in an insecure way while also allowing the usual GWT generated js to login the usual way.

As you say, you can never trust the browser, if the TLS session is compromised nothing else matters. If MitM is really part of your threat model, consider client side certificates. Generating and distributing certificates is a pain, and the client side UXs are awful, but the server can detect a tampered with session and there is no plaintext password to leak.

please don't assume i'm a newb.
I don't think anyone is, I know I'm not. This just isn't the place to fish for compliments or seek validation, the culture of the place is good technical responses mixed with needless pedantry and some good natured ribbing.
 

Asmodaios

Seniorius Lurkius
19
[url=http:/civis/viewtopic.php?p=26561265#p26561265:3ombfq63 said:
gnuuser[/url]":3ombfq63]have you tried 2 stage usb key storage
pass keys stored on one stick and access program on another
accessing the pass keys requires both sticks to be inserted
had this on an old server once but i forgot the program
damn im gettin old

Yes, but if you LOSE one of the sticks, you basically screwed.

There is a remedy, see Shamir's Secret Sharing http://en.wikipedia.org/wiki/Secret_sha ... 27s_scheme
 

Asmodaios

Seniorius Lurkius
19
I'm familiar with GWT, for my many sins I'm even currently supporting a GWT application. Not sure why you'd use it on a greenfield project given that google has essentially abandoned it and the new guys seem more interested in mobile widgets than fixing bugs, but that's neither here nor there.

While decompiling javascript generated by the GWT compiler in obfuscated mode is indeed a nightmare, a Mallory who has MitM'ed the TLS session need not do so. GWT does not prevent additional javascript from being attached to the DOM. So all the attacker needs to do is have a second javascript snippet that on submit sends a copy of the plaintext password in an insecure way while also allowing the usual GWT generated js to login the usual way.

As you say, you can never trust the browser, if the TLS session is compromised nothing else matters. If MitM is really part of your threat model, consider client side certificates. Generating and distributing certificates is a pain, and the client side UXs are awful, but the server can detect a tampered with session and there is no plaintext password to leak.

I'm not sure why you are under the impression that Google has abandoned GWT, it's very much active, 2.6 was just released, 2.7 is close, and 3.0 is a rewrite for Java 8, which I am TRYING to contribute to by implementing the Streams API. Google has quite a bit of interest in AngularJS, but... most of the major Banks I have seen over the last few years are still green fielding GWT. It's not like them to just jump to the ever changing hottest ( for now ) JavaScript framework, it's about "SOFTWARE ENGINEERING", and all that term implies.

Not matter tho, I mean, that's the current front end, it does NOT use GWT's serialization mechanisms, it can be called from almost anything, as it's semi-REST'y and JSON, and validated with JSONSchema inbound and outbound ( as well for XSS, etc ), and currently is called and used from a .NET/WPF application, so...
 

dragonlord

Ars Scholae Palatinae
1,123
I think that the server should assume that whatever is being sent from the client is the correct password and hash that using the requisite procedure. The reason for this is that as a bank you probably need to cater for browsers that don't have javascript enabled.

As you're talking about "hashing" the password on the client so that you never know what the original password is, you're going to run into the problem of the hash is the password, so any man in the middle attack is just going to harvest the hash, then use the hash to log into your site bypassing all of your login scripts for hashing.

The user will still need to change their password as the hash is still the password. The only advantage I can see of hashing the password is that in the event of someone getting your password file, the password that entered your algorithm is much more complex than anything that most users are going to come up with.

Realistically the best thing the bank can do is to provide their customers with a dongle that generates a one time password (not one that uses their existing bank card though, as those are easy to "lose" and gather the "pin" for). HSBC (in the UK) has a very nice 2 factor system. The other advantage of a 2 factor system is that the password file becomes less valuable to an attacker because they know that they need to also gather the details of how the 2 factor system works, the root key for the dongle, and x consecutive numbers from the actual dongle to work out where in the series the dongle is.

Another thing I've seen banks do is require a telephone confirmation whenever you access the bank from an unknown location (i.e. new browser, computer, etc.) - So an out of band confirmation, which then adds yet another thing that the attacker has to control.
 
[url=http:/civis/viewtopic.php?p=26551527#p26551527:21xkrtso said:
koala[/url]":21xkrtso]You might want to investigate an HSM for key storage, but IMHO, they are expensive for what they offer.

if other feedback interests you, it seems that you might be obscuring and overcomplicating some things for marginal benefits.


This. If standard password salting/hashing are insufficient for the requirements (and it sounds like they might be) the only meaningful solution is to get an HSM. He should probably also be implementing some kind of TPM-based white-listing of the programs running on the server(s). These aren't exactly new solutions though, so I'm curious how the OP ended up needing such measures without anyone on the project understanding all this already.
 
[url=http:/civis/viewtopic.php?p=26559915#p26559915:3t92y97f said:
Asmodaios[/url]":3t92y97f]
[url=http:/civis/viewtopic.php?p=26556441#p26556441:3t92y97f said:
dragonlord[/url]":3t92y97f]However white lists are much easier to manage than black lists. And if you're worried enough about break ins then having the keys on the same server that does the authentication is just asking for trouble anyway. As anyone that gets the sort of access that you're afraid of will be able to grab the keys from memory.

If you had the entire key generation on an isolated machine that only allowed access to a white list of machines and ports, you can be sure that unless someone cracks the first machine and then discovers the second machine and cracks that one too, will they discover your key generation method.

given that this second machine will only be providing a hash for given input and the primary machine will still be doing the comparisons, you can lock the second machine down so tight that it squeaks.

This seems the most reasonable, move that part to another machine, install the MINIMAL set of software to allow the machine to run, block EVERYTHING but the request port, and whitelist that.

I don't even need ssh always active on that box, as I just set it up, and have serial line access...

Don't implement your own custom (and comparatively shitty) HSM. Just buy a real one.
 
Status
Not open for further replies.