News for hackers. Stuff that matters.
Re:Using HTTP Basic Auth in 2022 by zimbatm on Saturday January 01, 2022 @03:22PM (#29762298)
HTTP Basic Auth could be so much better with a little help from browsers. If it was a bit better, most websites wouldn't need to implement login pages over and over again. Plus it would be more secure since the popup is in its own security context.

* Add a button to log out. Logout never really worked across browsers with basic auth.

* Allow to inject a logo or a tiny bit of customization for branding. The default popup looks too ugly.

* Improve the Digest auth to modern crypto standards. Stop passing plain passwords over the wire.

That's it. It's not a massive amount of work and it could enable to simplify a lot of the Internet.

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @03:32PM (#29762395)
"Stop passing plain passwords over the wire."

If you are using HTTPS, you are equally as good as any other login form.

Some have suggested using JavaScript to encrypt passwords before send - but in my opinion, this is generally stupid because it breaks support on browsers without JavaScript, and this doesn't protect you from the server at all because a hacker could just change the JavaScript to send plaintext copies somewhere. You are reliant on the server being a source of truth either way.

Re:Using HTTP Basic Auth in 2022 by oconnore on Saturday January 01, 2022 @03:39PM (#29762483)
No, it would be much better to use a zero knowledge proof (typically called a PAKE — password authenticated key agreement) to demonstrate that the user knows their password without sending that password over the channel.

Sending the password over HTTPS doesn’t expose the password to passive observers, but it does unnecessarily expose the password to the server.

https://en.m.wikipedia.org/wiki/Password-authenticated_key_a...

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @03:44PM (#29762547)
> "but it does unnecessarily expose the password to the server"

Yes - it does - but I am having a hard time thinking that this actually matters in the real world.

I can understand why not sending the password to the server, would be theoretically more secure. However in practice, what hacking attempts does this actually prevent?

If I was a hacker, I can add JavaScript to send plaintext somewhere. If I was a hacker, I could change the login form to stop hashing them client-side and instead send them over to the server for hashing and inspection.

It's theoretically more secure... but against what? Accidental logging? I mean, I guess, but then just set up your logs correctly instead of breaking login for anyone without JavaScript.

In my opinion, client-side hashing is security theater. It sounds impressive, but it doesn't really stop any real-world attacks, and the attacks it does prevent can be prevented using simpler methods. Ironically, the other methods (i.e. making sure your logs are clean) are so much simpler to implement it's probably more secure than trying to build a secure client-hashing implementation in the first place.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @04:04PM (#29762768)
> Accidental logging?

Yes, it happens all the time that passwords get logged.

> I mean, I guess, but then just set up your logs correctly instead of breaking login for anyone without JavaScript.

I have no idea what "set up your logs correctly" is supposed to mean but clearly no one's doing it. What is a "clean log" ?

> If I was a hacker, I can add JavaScript to send plaintext somewhere. If I was a hacker, I could change the login form to stop hashing them client-side and instead send them over to the server for hashing and inspection.

This assumes you have full control over the client page. But that's not necessarily (or often? most people don't serve JS from the same code that serves their auth API) the case.

1. The JS could be loaded from a CDN, not the same service that has access to the password. You may have absolutely no control over the JS on the page.

2. Every point between the browser and the password DB is a point where the password is in cleartext. So a compromise of any of those, including any logging paths, is a compromise of the password.

3. I don't think anyone cares about breaking login for users who don't use JS, nor should they.

What's more, ZKP means that if your password database is owned the impact is far less. If you're doing things right for password storage on top of ZKP you can practically make your password db public.

Even if we're talking about a basic client side hashing approach you're significantly improving security, but to be clear, the parent poster is talking about ZKPs, which involve more than that.

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:11PM (#29762837)
> "I have no idea what "set up your logs correctly" is supposed to mean but clearly no one's doing it. What is a "clean log"?"

As you admitted, passwords get logged "all the time." So the reasonable solution in most cases would be to ensure all applicable logs were clean and not logging passwords, not over-engineer a JavaScript-powered client-side-hashing algorithm. That's like taking a sledgehammer to a nail.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @04:15PM (#29762895)
Sorry, but the idea that implementing "clean logs" is:

a) Tractable

b) Simple or straightforward

compared to client side hashing is absurd.

Client side hashing is a one time solution forever that exists in one place, requiring no 'cooperation' from other code to be safe. "Cleaning logs", which you still haven't defined at all, is going to be a constant maintenance burden that can break in any place where you log ie: absolutely fucking everywhere by absolutely fucking everyone.

Re:Using HTTP Basic Auth in 2022 by peanut-walrus on Saturday January 01, 2022 @06:37PM (#29764047)
And how exactly would having the hash in the log versus having the password in the log be an improvement? If someone gets that hash it's exactly the same as having the password, as it is the hash that gets sent to your server in the http request.

Edit: alright, I saw that you mentioned password reuse in another reply, fair enough, it does help against that.

Re:Using HTTP Basic Auth in 2022 by lolc on Sunday January 02, 2022 @04:36AM (#29767236)
Proper client-side hashing uses a nonce generated by the server. The transmitted hash is only valid in that session. Even if the nonce and the hashed product are logged, you can't reuse it, because the nonce will be different for your login attempt.
Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:32PM (#29763052)
How complex and unusual is the authentication system you are working on?

If it was a consumer-facing web app, it's not like your password is logged in a million different places. It's possibly logged by your web server software (nginx in my case), and it's possibly logged by your web app framework's requests handler. It's not terribly hard to ensure that these points where the password passes through do not have passwords in their logs, or to ensure that said passwords are not logged to begin with.

If it was a massive enterprise system, I would hope that you would use a single-sign-on system with a centralized login page rather than exposing passwords to every web app within it. And then, just ensure that said passwords are not stored in logs. This is what I meant by clean logs - anywhere the password is used, ensure there is no record. How much code and how many layers does a password need to go through?

And yes, maybe client-side hashing does resolve some attacks, but I remain convinced that it is overkill and less protective than it initially seems. And in the future we would move to Zero-Knowledge Proofs but we aren't there yet for general users.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @04:51PM (#29763216)
Plenty of very simple web apps terminate TLS at the edge ie: at something like API Gateway. So if you then turn on request logging... voila. Hardly a complex scenario, happens all the time. Or at the application layer:

    @path("/login")
    def login(request):
        print("I have a bug, I'll just log the whole request real quick to see wtf is up!", request)
It's actually very hard to ensure that the password doesn't get logged. It requires constant discipline and maintenance. Any bug or change could expose it.

> I would hope that you would use a single-sign-on system with a centralized login page rather than exposing passwords to every web app within it

Implementing SSO is a great idea. Not everyone wants to use SSO though. If I were hosting a porn site I wouldn't expect my users to happily "sign in with Facebook". It's also much more work than a basic client hash.

> This is what I meant by clean logs - anywhere the password is used, ensure there is no record. How much code and how many layers does a password need to go through?

You underestimate the places logs can be generated or passwords can be accidentally persisted.

1. Your proxy

2. Crashes, stack traces, segfaults, core dumps, thread dumps, VM snapshots, free'd memory

3. Firewalls, both network and host

4. Audit logs for security, such as via ebpf or other auditing frameworks

5. The application, at any layer. In Python, did you know I can get a reference to the calling function? I've done this for logging purposes before, in fact. So even if your caller is super careful not to pass the password in, saving me from accidentally logging it, I can crawl back up the stack and get it anyway.

6. Your database logs

7. Services/ RPCs that sit between your auth API and your database

And as your business grows and your code changes you'll have to track all of that.

Orrrrrrrrr, you can just hash your password on the client side and significantly reduce the damage of a leak. Or put the extra work in to implement OPAQUE. Or use webauthn, that's cool too.

Re:Using HTTP Basic Auth in 2022 by huntertwo on Saturday January 01, 2022 @06:46PM (#29764115)
If the hash is used to authenticate, how is leaking the hash less bad than leaking the password? If I have the hash I can already impersonate you.
Re:Using HTTP Basic Auth in 2022 by Too on Sunday January 02, 2022 @02:32AM (#29766644)
The hash is not constant.

With public key crypto you can implement a challenge response. Server generates random garbage, send to client, client signs the garbage using priv key, sends it back as a hash that the server can verify using pub key.

Another version of this is with shared secrets instead of public/private, by replacing the signature with simply HMAC(secret, garbage) and keep rest of flow same as above.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Sunday January 02, 2022 @03:08AM (#29766806)
Yeah, once you get to the ZKP approach, which is what you're describing, the benefits are more significant.
Re:Using HTTP Basic Auth in 2022 by u801e on Sunday January 02, 2022 @11:33PM (#29777359)
> With public key crypto you can implement a challenge response.

Or just use a client side TLS certificate to authenticate instead of or in addition to the username and password.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @06:57PM (#29764198)
There are like a dozen other posts where I answer this question so I'd recommend just going to my comment history.
Re:Using HTTP Basic Auth in 2022 by PuercoPop on Saturday January 01, 2022 @09:03PM (#29765006)
Because many inputs map to that hash (the hashing function is surjective instead of bijective). People re-use passwords all the time. If the hash leaks it will only affect the particular service.
Re:Using HTTP Basic Auth in 2022 by gsich on Saturday January 01, 2022 @10:20PM (#29765467)
Because pass the hash only works for the current server. People reuse passwords, so without brute-forcing you are out of luck.
Re:Using HTTP Basic Auth in 2022 by gsich on Saturday January 01, 2022 @10:18PM (#29765451)
>As you admitted, passwords get logged "all the time." So the reasonable solution in most cases would be to ensure all applicable logs were clean and not logging passwords, not over-engineer a JavaScript-powered client-side-hashing algorithm. That's like taking a sledgehammer to a nail.

Maybe, but as a client I can't verify that this happens. So never sending the cleartext password is the only solution.

Re:Using HTTP Basic Auth in 2022 by 5e92cb50239222b on Sunday January 02, 2022 @02:12AM (#29766560)
> 1. The JS could be loaded from a CDN, not the same service that has access to the password. You may have absolutely no control over the JS on the page.

You have full control over it, as long as you don't embed any third-party maps or crap like ads.

https://developer.mozilla.org/en-US/docs/Web/Security/Subres...

Re:Using HTTP Basic Auth in 2022 by marcosdumay on Saturday January 01, 2022 @06:47PM (#29764120)
Zero knowledge proofs protect against the password leaking due to any kind of error from the server. That's not security theater, passwords leak all the time.

And the nice thing is that browsers already implement that, no need for Javascript. The bad news is that the UX sucks so much that you just can not use, so it's as useful as it not being there.

But digest password authentication protects against nearly none of those errors. On this case, leaking a digest is just as bad as leaking a password.

Re:Using HTTP Basic Auth in 2022 by throwaway81523 on Saturday January 01, 2022 @08:48PM (#29764907)
> Zero knowledge proofs protect against the password leaking due to any kind of error from the server. That's not security theater, passwords leak all the time.

That's a little confused. PAKE usually still stores a password or hashed password on the server, with the password potentially recoverable by brute force reversing the hash. What it avoids is transmitting a hash over the wire that can be reversed into a password, the way HTTP digest auth allows. The stuff transmitted over the wire by PAKE instead reveals no info about the password.

Most login pages on web sites today send the cleartext password underneath the https encryption layer, so the server sees the password (though hopefully stores it in only in hashed or MAC'd form). That is equivalent to http basic auth sent through https.

I use basic auth + https for my own stuff (where I don't care about styling) and it suffices for most things. Obviously you can escalate from there to 2fa, client certificates with credentials wrapped in hardware tokens, or whatever. I haven't needed that for personal stuff so far.

Re:Using HTTP Basic Auth in 2022 by marcosdumay on Sunday January 02, 2022 @10:56AM (#29769723)
There are more ways to do zero knowledge proofs than PAKE. (Besides, PAKE isn't the way current browsers support.)

PAKE is interesting mostly because we have some infrastructure for dealing with passwords already, but passwords in any form are not optimal.

Re:Using HTTP Basic Auth in 2022 by unscaled on Saturday January 01, 2022 @10:11PM (#29765401)
Most PAKE implementations actually make a security trade-off here - they protect the password transmitted over the wire, but you end up with a weaker password hash stored in the server's database.

Modern PAKE implementations, like SRP, don't store the plaintext password on the server side, but rather store a "verifier", which is essentially a hashed and salted version of the password. This way the server never sees the actual password, even at the registration phase.

The problem is with the hashing function though. For instance, all the SRP implementations I've seen use fast hash functions like SHA-1, SHA-256 or Blake2b by default. But contrary to folk wisdom (which is unfortunately often repeated here as well), hashing and salting a password is not enough. This is not 2003 anymore, and rainbow tables are not your main threat - your main threat is a cluster of fast GPUs demolishing your hashed passwords at rates that often just start at 1 GH/s.

The best practice nowadays is to use a function which is both computationally expensive and memory-hard such as scrypt or the newer Argon2 (and not PBKDF2!). You could very well do that with a PAKE, but now you run across a nasty UX trade-off: the computationally expensive function would have to be executed on the client side every time the client authenticates. There are WASM implementations of Argon2 out there, so this is probably not a big issue on a beefy PC, but you'll have to aim for the lowest common denominator here, and tune your function for a low-end smartphone.

tl;dr: In practice, with a carefully implemented PAKE, you'll give the attacker a 10-100 times faster hashrate than you would with a plain-text password authentication approach implemented with the same amount of care. In real practice, you'll probably use whatever defaults your library gives you and give often end up with a ridiculously weak hash.

Now, I said this is a trade-off. If you implement PAKE well, you will reduce the resiliency of your stored password hashes against brute force attacks, but this is what you get in return:

* Protection against password sniffing at TLS-terminating proxies

* Protection against hackers taking over your server and stealing user passwords as they login (Online password leak)

* Protection against MITM with a stolen CA key[1]

All of these things are still an issue with clear-text passwords even if you're using TLS. If any of these issues are a concern for you, this means you consider your users' passwords to be significantly more sensitive than the data that flows between your clients and servers, but that could be a valid threat model. In this case PAKE looks like a nice solution.

For everything else, I don't recommend PAKE. It is harder to implement correctly (with library defaults being insecure as I mentioned above), and this is more important than whatever theoretical strengths it has. Cryptographic systems are generally broken because of incorrect implementation rather than theoretical weaknesses in the algorithm.

[1] Not very common, but that did happen in the past: https://en.wikipedia.org/wiki/DigiNotar

Re:Using HTTP Basic Auth in 2022 by amluto on Saturday January 01, 2022 @09:59PM (#29765337)
PAKE is highly phishing resistant. If you type your password for an important website into a browser-controlled PAKE UI, but you’re being phished and the browser tries to authenticate to a malicious website, the worst the website can do is guess one single password. It can’t relay the password to the real website.
Re:Using HTTP Basic Auth in 2022 by Thorrez on Saturday January 01, 2022 @11:15PM (#29765758)
Good point that it protects against a phishing site that exactly replicates the victim site but with a different URL.

But the phishers could do a slight variation. They could create a website that looks very similar to the browser's Basic Auth popup, but implemented in HTML and Javascript. Most people won't notice the difference. Most people don't understand the line of death[1].

[1] https://textslashplain.com/2017/01/14/the-line-of-death/

Re:Using HTTP Basic Auth in 2022 by eru on Sunday January 02, 2022 @02:14AM (#29766574)
You could make the line of death better.

In the context of the pop-up: a simple pop up can be faked. But what if the browser would flash all the borders (and other stuff outside the line of death) when the real popup is displayed?

I'm not saying any of this is 100% foolproof, just that we should be doing some UI experiments on real people to see what works better.

Re:Using HTTP Basic Auth in 2022 by thesz on Sunday January 02, 2022 @04:22AM (#29767174)
This is what was done in the EROS [1] (extremely reliable operating system) UIs - it was not possible for user window to be rendered completely undistinguishable from system windows like, you knew it, a password prompt.

[1] https://en.wikipedia.org/wiki/EROS_(microkernel)

EROS used capabilities to enforce such rules. If you lack a capability to be a system window, you can't pretend to be one.

Re:Using HTTP Basic Auth in 2022 by amluto on Sunday January 02, 2022 @01:24PM (#29771800)
This is also what a secure attention key is for. Sadly the well known implementation (Windows NT) made it sufficiently obnoxious that it went away.

I can imagine keyboards having a special “password” key and trying to train people that all passwords start with the password key. I don’t know if this would work, but it can’t be worse than Ctrl-alt-delete.

Re:Using HTTP Basic Auth in 2022 by oconnore on Saturday January 01, 2022 @03:58PM (#29762696)
- If you share your password across sites that used a hypothetical browser-implemented PAKE, site A cannot login to your account on site-B

- If a site is attacked, there is no risk that password material was extracted from application memory — site operator can dump session tokens and safely re-auth users.

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:02PM (#29762738)
This sounds like an interesting system, but I think you are arguing for a system that as-of-now is only theoretical and is very different against the current crop of JavaScript-powered client-side-hashing methods which I am arguing against.
Re:Using HTTP Basic Auth in 2022 by indymike on Saturday January 01, 2022 @04:22PM (#29762972)
The first implementation was Bellovin and Merritt's Encrypted Key Exchange in 1992. In 2000 a provably secure implementation was released. PAKE has been around for quite some time and is proven, and is in wide use in the field. Here's a decent article on the subject: https://blog.cryptographyengineering.com/2018/10/19/lets-tal...
Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:37PM (#29763092)
I don't dispute the technology exists - I dispute that this technology can be deployed on a web app to general users effectively. I don't believe that is currently possible in production effectively in a way that neutralizes my arguments that an attacker could just change the JavaScript to record passwords somewhere.
Re:Using HTTP Basic Auth in 2022 by madacol on Saturday January 01, 2022 @05:39PM (#29763609)
That's why the browser's built-in login Form could be so useful, it would have its own security context, so I, as a user can be sure that no Javascript could read that

I would happily sign up and reuse a password for a website that I didn't trust if it were as secure as described (PAKE + browser built-in login)

Re:Using HTTP Basic Auth in 2022 by indymike on Sunday January 02, 2022 @10:02AM (#29769223)
I'm really not sure what you are disputing here. PAKEs are for preventing man in the middle attacks, not for securing a local program or preventing malicious code from running in the browser. No one is advocating, use a PAKE and all your problems are gone - it's about addressing key exchange over the wire and eliminating an entire class of attack. Password managers are a tough subject - they are like coffee . Yes, there may be small amounts of toxic stuff in it, but that is offset by a factor of 10,000 by the number of people who do not get in a wreck on the way to work, thanks to being awake and aware form 70mg of caffeine.
Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @04:05PM (#29762778)
PAKE isn't theoretical at all and the post you're responding to didn't say client side hashing it said zero knowledge proofs.
Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:15PM (#29762904)
PAKE is theoretical from a web-development perspective because there is no secure way for me to implement PAKE in my web app for a user to log in with in 2022. It doesn't exist - you tell me how to implement PAKE login right now.

Zero Knowledge Proofs would be awesome (something like WebAuthn/FIDO right now?) but I am arguing more in general against client-side hashing methods that are currently usable, mainly JavaScript-based ones.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @04:17PM (#29762921)
Not sure what you mean.

1. There is, of course, a way to implement it in your web app. I don't know what you mean by "no secure way" ?

> I am arguing more in general against client-side hashing methods that are currently usable, mainly JavaScript-based ones.

Even a trivially implemented client side hashing approach protects against a number of attacks.

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:34PM (#29763068)
I meant, let's say I picked a framework. Django, Laravel, Express, similar.

How would I implement PAKE login for my users? How would I get every user to log in with PAKE? How would I ensure that my code for PAKE could not be overwritten if a hacker took over part of my server?

It doesn't exist, AFAIK, on a user-facing front at this time in a secure way that a hacker couldn't just change the logic for.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @04:44PM (#29763164)
Implementing opaque isn't overly hard. You can find pseudocode, implementations, state machine diagrams, etc, online. Here's a good post that links to implemented code: https://blog.cloudflare.com/opaque-oblivious-passwords/

I know nothing of framework support, I don't use frameworks. I'm likely going to contribute some open source code in the near future from my company to simplify things though.

But you could also just have your client do:

    salt = sha256("your company name goes here" + username)
    password_hash = pbkdf2(plaintext_password, salt)
and get some nice benefits.

> How would I ensure that my code for PAKE could not be overwritten if a hacker took over part of my server?

Depends on the server and the level of control. But it'll help in a number of cases. You're assuming the attacker has full control over the web-page's contents (among other things - even if an attacker had the web page's contents CORS means they couldn't send http only cookies to an attacker controlled server), which is a very specific, powerful position to be in.

Re:Using HTTP Basic Auth in 2022 by pests on Saturday January 01, 2022 @05:05PM (#29763331)
What benefits would you get though?

You are still exposing the password_hash to the server and any compromise there (software or hardware, as described in your link) would still let an attacker grab password_hash, craft a custom client, and send it as if the original client had hashed the plaintext_password to begin with.

The attacker doesn't need to know plaintext_password, just the string you use to authenticate with in order to replay it. The password_hash becomes the new password.

Then due to the salt being on the client, it still opens the password up to rainbow table attacks etc.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @05:09PM (#29763367)
If the attacker only has access to the hash that hash is only usable for your website. If the user uses the same password for another site an attacker can not log into that other site using the hash.

That's really the main benefit of this approach - it reduces the impact of password reuse.

Re:Using HTTP Basic Auth in 2022 by wswope on Saturday January 01, 2022 @05:30PM (#29763541)
If I’m understanding your argument correctly (I may not be) - implementing PAKE would only be helpful in a scenario where an attacker gets access to hashed passwords, but isn’t able to modify front-end code to directly intercept unhashed passwords, right?
Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @05:36PM (#29763583)
You are correct. I (and I think most people?) consider that to be the most common attacker scenario.
Re:Using HTTP Basic Auth in 2022 by wswope on Saturday January 01, 2022 @06:03PM (#29763807)
Gotcha - and I can definitely see the utility with a large userbase.

From a corporate perspective, with a segmented + well-firewalled architecture, and a lot of surface area for injection vulns, I totally agree with you. The article was priming me to think of a flat, single-box solodev environment, where if someone breaks in, they own everything - which is why I think the original post above us mentioning PAKE is getting a lot of questioning.

Re:Using HTTP Basic Auth in 2022 by cassonmars on Saturday January 01, 2022 @04:40PM (#29763123)
PAKE isn’t about preventing compromise at the serving of the front end. That’s still the responsibility of the server maintainer. PAKE is about reducing damage potential. The responsibility of keeping your servers secure applies regardless of use of PAKE. PAKE just makes it possible that if your database is leaked in some smash-and-grab someone can’t just run a rainbow table against it to suss out passwords against emails.
Re:Using HTTP Basic Auth in 2022 by scoopertrooper on Saturday January 01, 2022 @04:31PM (#29763043)
Not theoretical, you can do it today.

https://www.npmjs.com/package/libopaque

Re:Using HTTP Basic Auth in 2022 by somebodythere on Saturday January 01, 2022 @06:27PM (#29763972)
Metamask basically works this way and is used on thousands of apps.
Re:Using HTTP Basic Auth in 2022 by fivelessminutes on Saturday January 01, 2022 @03:54PM (#29762653)
If someone gets a copy of the encrypted traffic - and we know that 'full take' is being done routinely for some parts of the internet - the credential in the plaintext means that if they are ever able to decrypt it even weeks later, they can make fresh connections using the valid credential afterwards.

If the server issues a different challenge each time, decrypting one response doesn't buy you anything.

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @03:59PM (#29762705)
I guess this makes sense - but who is capable of decrypting it weeks later unless the original private key was stolen, in which case it could be decrypted almost in real-time? Maybe if you were concerned a nation-state or something was trying to get your private key, but you've got bigger fish to fry at that point.
Re:Using HTTP Basic Auth in 2022 by w3ll_w3ll_w3ll on Saturday January 01, 2022 @04:31PM (#29763042)
Also, using TLS with Perfect Forward Secrecy (all modern ciphers), it's not possible to just capture the traffic and dectypt it later. You have to know the private key and do MITM.
Re:Using HTTP Basic Auth in 2022 by rixed on Saturday January 01, 2022 @11:10PM (#29765740)
> You have to know the private key and do MITM.

Which can safely be assumed to happen whenever the equipment is provided by another party such as an employer. All in the name of security, just not that of the user.

Re:Using HTTP Basic Auth in 2022 by throw0101a on Saturday January 01, 2022 @03:54PM (#29762654)
> If I was a hacker, I can add JavaScript to send plaintext somewhere. If I was a hacker, I could change the login form to stop hashing them client-side and instead send them over to the server for hashing and inspection.

If a zero knowledge (ZK) system combined with HTTP Basic was used, then account entry would come from the browser itself and not a web form that could be intercepted by JavaScript.

Further, a ZK system would help with the silliness of folks using bad algorithms (straight MD-5 / SHA-1) to store passwords, or even storing them in plain-text.

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:14PM (#29762885)
Right - it would, I don't disagree, it'd be awesome. It's something like WebAuthn.

I'm arguing here more against some people who think that using a JavaScript-based system to hash the password entry before sending it to the server is a good idea.

Re:Using HTTP Basic Auth in 2022 by masklinn on Saturday January 01, 2022 @04:21PM (#29762958)
> I'm arguing here more against some people who think that using a JavaScript-based system to hash the password entry before sending it to the server is a good idea.

So you're arguing against something nobody is arguing for?

Re:Using HTTP Basic Auth in 2022 by madacol on Saturday January 01, 2022 @05:47PM (#29763682)
So you are strawmanning?
Re:Using HTTP Basic Auth in 2022 by weaksauce on Saturday January 01, 2022 @03:53PM (#29762644)
I could be missing something but they are not suggesting to use a javascript version but the version where the zero knowledge algorithm is used at the browser level. the password would never be outside the secure context of the browser and nothing other than the algorithm bits would be sent.
Re:Using HTTP Basic Auth in 2022 by masklinn on Saturday January 01, 2022 @04:20PM (#29762951)
You're not missing anything, GP is.
Re:Using HTTP Basic Auth in 2022 by almost on Saturday January 01, 2022 @03:50PM (#29762600)
Credential stuffing is a thing. So it’s pretty good if a compromised website just cannot leak your password.

But as the other comment pointed out the current situation with web form login is that password is sent to server so it wouldn’t be worse than the the status quo.

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @03:56PM (#29762670)
I hope you are kidding.

A compromised website that was well designed should not leak your password any more than a client-side hashing implementation. This is because the passwords are hashed in the database. Client-side hashing means that, yes, initially the website is not receiving plaintext passwords, but a few quick code edits to maybe add some logging JavaScript or disable the client-side hashing implementation will fix that.

And credential stuffing? Client-side hashing does absolutely nothing to prevent credential stuffing other than that you may need a GPU to do a lot of hashes quickly. Client-side hashing doesn't make a server handle more or less authentication requests.

Re:Using HTTP Basic Auth in 2022 by masklinn on Saturday January 01, 2022 @04:19PM (#29762942)
> A compromised website that was well designed

Ah yes, "if nobody makes any mistake there's no problem", that's worked so well forever hasn't it?

> Client-side hashing means that, yes, initially the website is not receiving plaintext passwords, but a few quick code edits to maybe add some logging JavaScript or disable the client-side hashing implementation will fix that.

That makes quite literally no sense, did you miss the entire thing and go off with whatever?

The request here is to make the browser's support for HTTP authentication better. The entire point is that there is no "quick code edit" without owning the entire browser at which point you're quite thoroughly owned anyway.

Re:Using HTTP Basic Auth in 2022 by garbagecoder on Saturday January 01, 2022 @04:57PM (#29763278)
I don’t think he understands salts or really hashing at all and this is messing up the logic in his posts.
Re:Using HTTP Basic Auth in 2022 by garbagecoder on Saturday January 01, 2022 @04:56PM (#29763262)
If “should” were a word that meant what people thinks it means, we wouldn’t need security at all.
Re:Using HTTP Basic Auth in 2022 by lordlimecat on Saturday January 01, 2022 @08:45PM (#29764890)
Scenario 1: Attacker compromises ECOMMERCE_SITE where you have a login. The ECOMMERCE_SITE uses md5 for logins, so the attacker just brute-forces the hash and then uses that password to compromise your logins on other sites.

Scenario 2: The ecommerce site has upgraded to SHA512, so cracking isnt an option. But the site is relying on basic auth, so the attacker simply sniffs your password when you auth.

Scenario 3: the ecommerce site is using a secure zero-knowledge auth against a hashed/salted/peppered/whatever credential. They cannot brute force it, and the server never sees your password. They can mess around with the ECOMMERCE_SITE but cannot pivot to any of your other logins.

>If I was a hacker, I can add JavaScript to send plaintext somewhere.

We've just shifted from "quiet, persistent threat" to "hacker announces to the world that he's in". Changing javascript on a prod website is going to trigger alarms.

Re:Using HTTP Basic Auth in 2022 by BeefWellington on Sunday January 02, 2022 @01:04AM (#29766282)
> We've just shifted from "quiet, persistent threat" to "hacker announces to the world that he's in". Changing javascript on a prod website is going to trigger alarms.

While I'd like that to be true, it really isn't. There have been loads of card skimming operations injected into production sites which weren't noticed for sometimes months.[0][1][2][3]

[0]: https://blog.malwarebytes.com/hacking-2/2020/03/criminals-ha...

[1]: https://www.wired.com/story/british-airways-hack-details/

[2]: https://www.riskiq.com/blog/external-threat-management/magec...

[3]: https://sansec.io/research/svg-malware

Re:Using HTTP Basic Auth in 2022 by na85 on Saturday January 01, 2022 @03:59PM (#29762712)
>Yes - it does - but I am having a hard time thinking that this actually matters in the real world.

In the 90s and early aughts it was fashionable for php sites to store passwords hashed, usually some combination of a salt with md5 and later the SHA variants.

For a brief few years there were entire communities on IRC and elsewhere dedicated to making rainbow tables for cracking stolen password hashes.

Often the salt would be common across all passwords, so if you got a database dump it was a gold mine for credentials.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @04:11PM (#29762840)
A trivial fix here is to:

a) Add a static value to the salt ie: your company's name

b) Add the user's email address to the salt

The "right" way would be a zero knowledge proof.

Re:Using HTTP Basic Auth in 2022 by na85 on Saturday January 01, 2022 @05:07PM (#29763356)
Yeah well PHPnuke wasn't exactly written by secure coding experts.
Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:03PM (#29762754)
Right - but that's been resolved, PHP and others now store the unique salt used with the password together, so every password has its own salt.

That didn't need client-side hashing to fix it.

Re:Using HTTP Basic Auth in 2022 by garbagecoder on Saturday January 01, 2022 @04:59PM (#29763289)
Gee, it’s almost like on the internet there are computers between you and the destination.
Re:Using HTTP Basic Auth in 2022 by Too on Sunday January 02, 2022 @02:39AM (#29766678)
bcrypt solves that in two ways. It uses per password unique salts and it has a tunable cost-parameter to deliberately slow down the computation, making it slow and infeasible to build a rainbow table.
Re:Using HTTP Basic Auth in 2022 by garbagecoder on Saturday January 01, 2022 @04:53PM (#29763229)
Is this a parody of a webdev?
Re:Using HTTP Basic Auth in 2022 by michaelcampbell on Saturday January 01, 2022 @03:59PM (#29762707)
> No, it would be much better to use a zero knowledge proof

Yes, it would. A further improvement to an improvement doesn't take away from the first improvement. Don't let the perfect be the enemy of the good.

Re:Using HTTP Basic Auth in 2022 by ibic on Sunday January 02, 2022 @06:31AM (#29767885)
I don't think this is a major concern here, many websites pass username and password in plain text and rely on https for security (Just take a look at HN's log in form). If I'm not wrong, J2EE's login is implemented using plaint text also for password.
Re:Using HTTP Basic Auth in 2022 by rcxdude on Sunday January 02, 2022 @08:55AM (#29768707)
Don't such methods require you to store the password in a non-hashed form on the server? That seems mostly worse than this approach, since now the passwords of all users are visible at rest and can be used directly as authentication. RADIUS I know commonly uses this approach and it always made me nervous having the passwords in plaintext.
Re:Using HTTP Basic Auth in 2022 by armchairhacker on Saturday January 01, 2022 @05:26PM (#29763512)
idk if you even need a zero knowledge proof.

Server sends client a salt, client hashes the salt and password and sends back to server.

Implement this as a built-in feature of the web browser, and the browser can show a special icon or symbol to mark that the password will be sent hashed (and later show a warning on password fields sent via plaintext).

Re:Using HTTP Basic Auth in 2022 by hnick on Saturday January 01, 2022 @07:40PM (#29764499)
Then you either have:

1) A different salt each time, meaning the server must know your plaintext password to validate, or 2) The same salt every time, in which case the hash is essentially the password since that's all the attacker has to pass to the server next time.

Re:Using HTTP Basic Auth in 2022 by xmprt on Saturday January 01, 2022 @05:29PM (#29763535)
Could that really work? Sounds like it's highly abusable if someone compromises the database and gets a list of all the hashes. Now, they don't even need to use rainbow tables or any brute force to compute the password. They just send the hash to the server and will be logged in.
Re:Using HTTP Basic Auth in 2022 by armchairhacker on Saturday January 01, 2022 @09:02PM (#29764996)
Yes, if an attacker compromises the database they can send the direct hash.

The point is that a malicious or badly-secured site can't use your password on other websites, because ultimately most people use the same password on many different sites.

Re:Using HTTP Basic Auth in 2022 by mikea1 on Saturday January 01, 2022 @06:13PM (#29763869)
The salt-and-hash combo is how email logins worked for decades. The problem with this approach is that what you really want different salts, which requires that the server knows the plain text password.
Re:Using HTTP Basic Auth in 2022 by geektips on Saturday January 01, 2022 @04:09PM (#29762820)
Intresting idea, this kind implementation would have prevented password leak from something like Cloudbleed[0]

[0] https://en.m.wikipedia.org/wiki/Cloudbleed

Re:Using HTTP Basic Auth in 2022 by thrashh on Saturday January 01, 2022 @03:43PM (#29762534)
But most login forms don’t do that anyway so it wouldn’t be any worse than how things are already done.
Re:Using HTTP Basic Auth in 2022 by dllthomas on Saturday January 01, 2022 @04:23PM (#29762973)
You've responded as if the bit you've quoted is advice to individual developers in the present context, but the topic of conversation was about extending browsers so that the standard login form would do this (... better than existing auth digest). If we did that and people were used to using the browser's built-in login dialog, and (as with https) we made it visible what security features were enabled, then a trivial server-side change wouldn't compromise user passwords.
Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @04:38PM (#29763113)
Right... that would be awesome. But it would still be susceptible to a hacker replacing it with a traditional login page with some logging... unless somehow you could prevent any traditional web pages from working.
Re:Using HTTP Basic Auth in 2022 by madacol on Saturday January 01, 2022 @05:51PM (#29763732)
And users WILL NOTICE before that happens

Please, stop using those strawman arguments

Re:Using HTTP Basic Auth in 2022 by gjsman-1000 on Saturday January 01, 2022 @05:59PM (#29763777)
I beg to differ. You'd be surprised how many users probably would not recognize any difference whatsoever as long as the hacker got things looking relatively identical.
Re:Using HTTP Basic Auth in 2022 by dllthomas on Saturday January 01, 2022 @06:13PM (#29763866)
Some users will notice. If we've succeeded to the point of "traditional login pages" being unusual and remarkable, many users will notice. Probably in any case some users will fail to notice.

In any case, though, it seems likely to reduce the impact of a compromise.

Re:Using HTTP Basic Auth in 2022 by remram on Saturday January 01, 2022 @09:19PM (#29765091)
Except you usually send the password once, and get back a cookie with a token that you present for the rest of your session (possibly to other endpoints/servers). Whereas with basic auth, the login/password keeps being sent.
Re:Using HTTP Basic Auth in 2022 by gsich on Saturday January 01, 2022 @10:16PM (#29765437)
>If you are using HTTPS, you are equally as good as any other login form.

Or equally as bad. TLS only protects you from sniffing, not the server seeing your password in cleartext.

Re:Using HTTP Basic Auth in 2022 by merlinscholz on Saturday January 01, 2022 @04:50PM (#29763206)
Please do not add logo customization. This will end with prompts asking you for your Apple and Microsoft passwords which are difficult to differentiate from official prompts (at least for end users).
Re:Using HTTP Basic Auth in 2022 by Kalium on Saturday January 01, 2022 @07:03PM (#29764233)
Thank you! This is a deeply underappreciated point.

I understand how annoying, painful, and disruptive to the user experience it is to have part of your app taken over by browser or OS default widgets and behavior is. It's sheer hell on UX. Yet the custom styling that would make it integrate smoothly would be a godsend for attackers and phishers.

The role that UX - and misuses of UX - play in security is often not considered deeply by highly sophisticated users.

Re:Using HTTP Basic Auth in 2022 by jamil7 on Saturday January 01, 2022 @08:12PM (#29764697)
Is this actually hell on UX or is that something product people and designers tell us because it’s in their personal interest to create custom solutions for every webapp? iOS apps pretty regularly defer user actions to OS level controls and prompts and frankly I believe the UX there is far superior to webapps using bespoke UX for these. Wouldn’t standardised browser behaviour and OS level styling for common flows and behaviour be a big win for webapps and take some of the drudgery out of web development?
Re:Using HTTP Basic Auth in 2022 by Kalium on Monday January 03, 2022 @10:47AM (#29781894)
Like you, I suspect it's not, but I've found that leading with telling people that the thing they deeply want to believe is wrong is a poor way to convince them of things. You have to go through a ritualistic performance of empathy first.
Re:Using HTTP Basic Auth in 2022 by maficious on Saturday January 01, 2022 @08:21PM (#29764750)
What prevents the hacker from cloning the whole web-page of, say, facebook.com login and phish users for credentials this way? This is not a hyphotetical thing, Kali Linux even bundles a utility program for that.

Compared to that, one icon, that is the same as that of the company, is not that threatening.

Not only that, but if you consider a sign in form that wouldn't have a logo, it would be way easier to trick user into putting their credentials in, because the user wouldn't be able to differentiate them. Also OAuth is always branded AFAIK.

Users may also notice discrepancies in the logo, if it was cloned poorly. Though I can't think of a way someone couldn't forge a logo given all the possibilities. Adobe Illustrator can trace images into svg and there's plenty of companies' svg logos just in the google search.

Re:Using HTTP Basic Auth in 2022 by Kalium on Monday January 03, 2022 @10:50AM (#29781942)
As you say, nothing at all.

I think the real answer is that allowing this kind of deep and arbitrary styling of interfaces is far more dangerous than it is helpful.

Re:Using HTTP Basic Auth in 2022 by maficious on Wednesday January 05, 2022 @04:33AM (#29806956)
Let's ban CSS?
Re:Using HTTP Basic Auth in 2022 by Aeolun on Saturday January 01, 2022 @08:06PM (#29764652)
I’m kind of inclined to think that completely indefferentiated username and password forms are much more of a godsent?
Re:Using HTTP Basic Auth in 2022 by cobbzilla on Sunday January 02, 2022 @08:05AM (#29768399)
What if the icons are NFTs with automated browser verification? I’m only half joking— could this actually be doable?
Re:Using HTTP Basic Auth in 2022 by Kalium on Monday January 03, 2022 @10:49AM (#29781924)
Verification of what, precisely? That it's authorized for the domain it's on? This seems like a re-implementation of existing access control systems, with the same weakness of being vulnerable to being copied.

Unless you're somehow able to get everyone to transition at once, never support a non-NFT fallback and, ensure that no sufficiently visually similar logo ever gets registered... which IMO sounds both challenging and like a hacky re-implementation of a trademark system.

Re:Using HTTP Basic Auth in 2022 by cobbzilla on Tuesday January 04, 2022 @07:44AM (#29794119)
This would be verification that any branding on the HTTP Basic Auth popup represents the company it claims to. This would be optional — any site that didn’t use this would still have the default (generic/unbranded) browser behavior.

The stated (and valid) concern is that malicious actors would use fraudulent branding on those browser auth popups — let’s tell the user we are MSFT or AAPL and steal their password.

One solution is for the branding to consist entirely of NFT assets that can all be tracked to a definitive owner, and use some DNS-based glue (ala DKIM/SPIF for email) to link the NFT to the TLD.

Then your browser can refuse to show the MSFT logo (and show a big red fraud alert page) if the owner of the branding can’t be reliably traced back to Microsoft (owner of the site).

Re:Using HTTP Basic Auth in 2022 by Kalium on Tuesday January 04, 2022 @09:05AM (#29794839)
At this point you're talking about checking a signature. Naively, it seems to me like you could skip the NFT entirely and embed a verifiable sig in a securely delivered DNS record. Then it's linked to the domain. You can do this now, with tooling that already exists and is deployable today. You'd need to deliver the record securely to avoid attacks on the glue anyway.

Of course, neither the NFT nor the sig-in-DNS approach actually solves the problem of a visually identical but technically different image (use a slightly different color in a few places, etc.) being used to trick people. I'm not sure what we've gained. The malicious use case would seem like it's not effectively prevented.

Re:Using HTTP Basic Auth in 2022 by cobbzilla on Tuesday January 04, 2022 @01:27PM (#29798124)
You’re right. Both about the problem still being present and NFT being not strictly necessary anyway.

I can’t help but think there must be a way to make it work.

Re:Using HTTP Basic Auth in 2022 by Kalium on Tuesday January 04, 2022 @01:46PM (#29798399)
There probably is, provided you can get a perceptual model that correctly models all human visual perception and reduce it to a hash. I am not sure one exists currently. Until then, it really does seem like we're trying to find a way to re-implement trademarks in a way that doesn't require the interpretive work that trademarks rely on.

I suspect there's a lot of complexity hidden in the perceptual model requirement, though.

Re:Using HTTP Basic Auth in 2022 by lordlimecat on Saturday January 01, 2022 @08:49PM (#29764912)
You can already do this.

As always the only defense is to compare what is being asked for with the FQDN.

Re:Using HTTP Basic Auth in 2022 by fzzt on Saturday January 01, 2022 @05:02PM (#29763306)
There's a lot more to that. A bank doesn't want the "back" button to work forever; they want to control the lifetime of your session, ideally on the server. Google wants to let you sign into multiple accounts on the same origin. Many others want to have seamless single sign-on across several of their web properties. Sometimes, you want the change of your password to invalidate other sessions (say, when recovering a compromised account); other times, you don't want to kick out your smart thermostat and have to set it up from scratch.

Admittedly, there are some simple use cases where HTTP auth is all you need, but it's just way too inflexible, unless you turn it into some mammoth spec that is never going to be as flexible and tempting as managing user identity yourself.

Especially since HTTP auth doesn't actually mean you can stop doing that anyway. You're still handling account creation, password checking, all the abuse / bot detection bits... all you're getting rid of is the sign-on and logout functionality, which is really not that complicated to begin with.

Re:Using HTTP Basic Auth in 2022 by madacol on Saturday January 01, 2022 @05:27PM (#29763522)
Maybe we don't want them to be able to do any of that

And I think you are missing the point, the goal it's not to standardize logins, it's about making impossible for servers to know my password, hence impossible passwords leaks

That would allow people to reuse strong passwords, and not need passwords managers, because that's what they are doing anyway!

Re:Using HTTP Basic Auth in 2022 by fzzt on Saturday January 01, 2022 @06:08PM (#29763843)
> Maybe we don't want them to be able to do any of that

"We" who? Application owners want that, browser vendors want that (their greatest fear is that mobile will eat the web, so they don't want to make the platform less flexible)... and users generally don't mind.

> impossible for servers to know my password, hence impossible passwords leaks

That would require deeper architectural changes to HTTP auth, but is probably a reasonable goal. That said, it's more readily approximated with unique passwords + having a good password manager. The main risk of password leaks is not that they make that particular breach worse (since the attackers can just grab your data), but that passwords are reused too often.

Federated login is another approximation, where the password is only known to your identity provider, not to every identity consumer. It's modestly successful for some lower-value services.

Re:Using HTTP Basic Auth in 2022 by madacol on Tuesday January 04, 2022 @07:41PM (#29803240)
We = users *
Re:Using HTTP Basic Auth in 2022 by alerighi on Saturday January 01, 2022 @06:30PM (#29764005)
Depends if that is required. For most enterprise software, that nowadays is more and more web based, you don't need all of that. Accounts are created by the system administrator, the password check is fine with the default mechanism of Nginx or Apache with a .htpasswd file, bot detection and all other things are not really that necessary, especially if the page is not exposed to the internet but only in a LAN.

Beside that, if you need a more sophisticated authentication mechanism nowadays your default is to go with something that uses the Oauth protocol: so I guess the next step would be to standardize that protocol and have it integrated as a browser API so that a user doesn't even have to insert a password.

Re:Using HTTP Basic Auth in 2022 by adamzochowski on Saturday January 01, 2022 @03:36PM (#29762446)
One of my favourite auth is the NTLM/SSPI which came out of the the windows NTLM world.

Users don't even see they are being asked to be authenticated, they are either logged in, or told they don't have access.

Works great in corporate world.

Re:Using HTTP Basic Auth in 2022 by RedShift1 on Saturday January 01, 2022 @03:43PM (#29762522)
I love it too, when it works... When it doesn't, the users get the login prompt like the basic auth one, which can be confusing because you have no opportunity to add information to that prompt.
Re:Using HTTP Basic Auth in 2022 by marcosdumay on Saturday January 01, 2022 @07:00PM (#29764220)
Yeah, users aren't asked about anything, the browser just sends their passwords to whoever asks.

The SSPI part is good, it just uses kerberos. But the full set can be downgraded at any time by the server.

Re:Using HTTP Basic Auth in 2022 by slim on Saturday January 01, 2022 @03:27PM (#29762347)

  Stop passing plain passwords over the wire
this is already solved by https
Re:Using HTTP Basic Auth in 2022 by StefanKarpinski on Saturday January 01, 2022 @03:33PM (#29762409)
The password is still revealed to the server. There are password verification protocols where the password is not revealed to the server either, which is much more secure as it means that you’re not at the mercy of whether the sever operator follows good security practices about not saving your password in plain text somewhere.
Re:Using HTTP Basic Auth in 2022 by LinAGKar on Saturday January 01, 2022 @05:43PM (#29763641)
>The password is still revealed to the server.

And with digest auth, the server must have the plain text password already. But sure, maybe there is a third option.

Re:Using HTTP Basic Auth in 2022 by thaumasiotes on Saturday January 01, 2022 @03:42PM (#29762509)
> There are password verification protocols where the password is not revealed to the server either, which is much more secure as it means that you’re not at the mercy of whether the sever operator follows good security practices about not saving your password in plain text somewhere.

Well, the most common such protocol is TOTP, which still requires the server to store your full password. In that sense it's worse than a naive password exchange, which only requires the server to store your hashed password.

There are other password protocols that require neither transmission nor server retention of the full password, but it seems worth noting that the protocol we actually have didn't bother with that.

Re:Using HTTP Basic Auth in 2022 by teekert on Saturday January 01, 2022 @05:02PM (#29763311)
Does it matter if the pw is stored salted and hashed?
Re:Using HTTP Basic Auth in 2022 by thaumasiotes on Saturday January 01, 2022 @05:52PM (#29763738)
Yes, that's why we do that.

I'm not sure what you want to ask.

Re:Using HTTP Basic Auth in 2022 by alerighi on Saturday January 01, 2022 @06:22PM (#29763938)
As every other login form does. In this situation basic authentication is no different from every other authentication mechanism that uses passwords...
Re:Using HTTP Basic Auth in 2022 by jeroenhd on Saturday January 01, 2022 @06:26PM (#29763962)
Not necessarily, you can set up TLS client auth with signed certificates, generated locally, that the server never receives the private key of. The server can validate and authenticate without knowledge of the secret, and cannot impersonate the user.

The problem with TLS client certs, of course, is the fact you need a method of signing CSR's, and the terrible UX modern browsers have for client auth, especially on mobile.

Re:Using HTTP Basic Auth in 2022 by alerighi on Sunday January 02, 2022 @02:34PM (#29772723)
Yes in theory you can but it's a pain, a certificate needs to be installed in the browser, the user gets a popup every time saying that you want to use a certificate, when the user changes computer either needs to backup the certificate or install it again, etc. My bank did that in the past and they no longer support that, instead they opted for a classical multiple factor authentication: password + authorize the access with your phone.
Re:Using HTTP Basic Auth in 2022 by lukevp on Saturday January 01, 2022 @03:31PM (#29762390)
Only partially. If the client and server have an agreement on a hashing protocol, there’s no reason that the browser shouldn’t be able to hash as well and prevent the password from ever leaving memory on the client system. HTTPS is still vulnerable to many man in the middle attacks, and many corporate and business networks do deep packet inspection to decrypt https (they control the machines so intercepting the cert issuance and installing their own root CA is easily doable). Another issue is that improper logging on the server (or depending on the implementation, even intermediate load balancers) could accidentally leak the plaintext password. Client side hashing is a much better solution to this, and if it’s a native browser supported protocol, it would even work without JS.
Re:Using HTTP Basic Auth in 2022 by jeroenhd on Saturday January 01, 2022 @03:39PM (#29762482)
What does it matter? If a criminal gains the hash, they can log in and be malicious anyway. If a criminal can do a MitM, they can substitute the Javascript that's hashing your password with all the nonces and salts and peppers you add to it and send the password anyway.

If you just hash the password, the hash becomes the password. You're not solving the problem that way, you're just switching around definitions.

There is an alternative that's supported in most platforms, and that's WebAuthn. Not even a need for a password automatic secure handshakes and with the right protocols, the keys differ per site so they're very hard to spoof through phishing. You can achieve much of the same thing with client TLS certificates, but the UX for that is even worse than the UX for HTTP Basic.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @04:13PM (#29762866)
> What does it matter? If a criminal gains the hash, they can log in and be malicious anyway.

To that one site. But users reuse passwords and if a criminal only has a hash they can't reuse it across sites.

Re:Using HTTP Basic Auth in 2022 by jeroenhd on Saturday January 01, 2022 @04:37PM (#29763103)
But the attacker controls the TLS connection already, so they'll just strip out the hashing functionality or send a piece of JS to steal the password directly from the password field.

It's not that I don't understand where you're coming from (I once almost started writing such a library a few years back!), but I just can't think of a threat model where this makes sense. That's also what moved me away from working on such a system.

To me, this approach feels like an attempt to recreate software-only U2F, but outside the browser. I don't think client side code can fix these problems. It can make stealing passwords more difficult for criminals if every website uses their own bespoke password processing script, but that'll also add a huge attack surface to your code and it'll be a burden to maintain.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @05:01PM (#29763297)
I don't know why people are assuming the attacker:

A) Controls the code running the auth API

B) Controls the javascript

As if that's the common attack.

The common attack is that the attacker has a read on the hash, either through injection vulnerabilities or other leaks.

Your attacker, as described, has remote code execution on a server that hosts the auth API and the Javascript in one place. That is a very specific, powerful attacker!

> but I just can't think of a threat model where this makes sense

1. An attacker has CSRF and can trick your code into sending the hash to them. This significantly reduces the harm of that attack.

2. An attacker has an injection vulnerability giving them read access to hashes ie: sql injection, perhaps the most significant and relevant attack to discuss with passwords.

3. An attacker takes advantage of a timing attack, bruteforcing the server and measuring response times to leak its value. They can now only leak the hashed value, which is going to take way longer to leak and doesn't expose their password.

And more!

This defense tackles what are very very arguably the major threats to consider with regards to password security (they're the big ones in OWASP top 10).

> It can make stealing passwords more difficult for criminals if every website uses their own bespoke password processing script, but that'll also add a huge attack surface to your code and it'll be a burden to maintain.

You can significantly reduce harm and attack surface with all of 3 lines in your frontend code.

    salt = hash(username + static_salt)
    password_hash = pbkdf2(plaintext_password, salt)
it's trivial to implement this.

I'll grant you that PAKEs may be more complex to implement today, but even if we talk about a very basic implementation of client side hashing I think there's obvious value.

Re:Using HTTP Basic Auth in 2022 by jeroenhd on Saturday January 01, 2022 @06:22PM (#29763936)
The attacker I describe has MITM access. The attacker can read and modify page contents, but nothing on the server side. This can only be achieved by malware on the client side or tomfoolery with certificates, so it's not a common attack for sure. But, breaking basic passwords sent over a secure channel aren't a common attack in general.

If you presume the attacker can only read the data transmitted but cannot alter it, your system might work, but I'm not sure in what scenario a hacker can break HTTPS secrecy without also being able to modify the contents of traffic over the wire.

A CSRF vulnerability won't let you send the password to a random host, unless you have full arbitrary code execution (in which case your protections don't make sense either) or if your auth code is unrealistically buggy (letting the attacker embed secrets in a resource somehow).

The database already contains hashes for normal password auth, so I'm not sure why your system would be any better. The password database isn't stored client side, after all, and I hope nobody is still storing passwords in plaintext.

I'm not sure why an attacker would be able to guess the hash from a timing attack, if they can do that then the hashing implementation is very flawed, to the point you just shouldn't be hashing passwords with it.

Your custom salt/hashing system solves password reuse I suppose, but it doesn't add any protections to your website while adding complexity at your cost. For your website, you just changed the way the password looks (which is the hash, not the direct input) at the cost of needing Javascript execution.

In my opinion, your login page would be a lot more secure with a CSP that disallows all scripting, just in case, and uses a simple system that's easy to spot mistakes in, like HTTPS POST or Basic auth.

Re:Using HTTP Basic Auth in 2022 by staticassertion on Saturday January 01, 2022 @06:52PM (#29764160)
> The attacker I describe has MITM access. The attacker can read and modify page contents, but nothing on the server side. This can only be achieved by malware on the client side or tomfoolery with certificates, so it's not a common attack for sure. But, breaking basic passwords sent over a secure channel aren't a common attack in general.

I don't think that attacker is worth dealing with. At that point you're outside of the security responsibilities of a website and it's the operating systems job to provide security.

> But, breaking basic passwords sent over a secure channel aren't a common attack in general.

Isn't it? Lots of passwords are sent over TLS but SQL injection is still a top 10 vulnerability.

> a hacker can break HTTPS secrecy without also being able to modify the contents of traffic over the wire.

I'm not implying that they can. I'm implying they can read the hashed values after being transmitted to the server.

So attacker in the following positions, at least: 1. Owns your auth endpoint (but not your CDN)

2. Owns your proxy

3. Has read access to your logs and the password is in those logs

4. Has a SQL injection or timing attack against your password auth/ db

> A CSRF vulnerability won't let you send the password to a random host, unless you have full arbitrary code execution

Yeah true, I was thinking about the auth token, not the password.

> I'm not sure why an attacker would be able to guess the hash from a timing attack, if they can do that then the hashing implementation is very flawed,

Timing attacks aren't a property of the hash but of the operations on that hash.

> The database already contains hashes for normal password auth, so I'm not sure why your system would be any better.

Do you mean that the database would be doing server side hashing regardless? That's true (I sure hope). But the attacker will have to brute force a much larger space to recover the plaintext password and the point of doing the client side hashing is to protect other sites if a user reuses their password on those sites.

> Your custom salt/hashing system solves password reuse I suppose

To be clear, that's the point, and I don't think that's small. It's about reducing harm to your users - even if within the scope of your website your user is still vulnerable you are protecting them within the scope of other websites.

I haven't made this argument yet, but I believe it also adds security elsewhere by distributing the cost of your hashing to clients. Your server has to handle N clients, and maybe needs to response in 5ms to each client - so it can spend, say, 3ms on hashing. To keep your tail latencies down you might try to do 1ms of hashing.

But you don't have to worry about your compute if you push it to the client. You can have the client perform, say, 1M rounds of PBKDF2.

So the attacker has two choices.

1. Brute force the client hash, which is 32bytes and really not feasible. That is to say that in a naive brute force they start with 32bytes 0'd out and start counting until they reach your hash - not fun.

2. Brute force the client password, which has a huge number of rounds that you could never get away with on your server. 1M rounds of pbkdf2 is not something you'd want to do on your server but distributed across your clients it's no problem at all - a few hundred milliseconds perhaps. But that's devastating to an attacker trying to recover the plaintext - of course, with some caveats (a relatively weak salt).

I haven't put enough thought into this benefit to claim it, but I may as well throw it out there.

> but it doesn't add any protections to your website while adding complexity at your cost.

It's very little complexity at very little cost. It's a few lines of code that execute at the edge - you pay nothing for those cycles.

> at the cost of needing Javascript execution.

I don't consider this a cost. I think it's totally ridiculous to say that JS execution as a requirement is a "cost" - the vast majority of websites require JS, and there are plenty of good reasons for it (like telling your user their password is too short). If you care so much about JS as a cost, ok, don't do client side hashing.

> In my opinion, your login page would be a lot more secure with a CSP that disallows all scripting, just in case, and uses a simple system that's easy to spot mistakes in, like HTTPS POST or Basic auth.

I disagree. A CSP would be an excellent thing to implement, and everyone should do so. But I don't think that completely denying script execution is a good idea - your users are far more vulnerable to using weak and/or reused passwords than XSS on a site with the minimal scripting necessary to implement this code (no 3rd party packages are required for the code I mentioned).

Re:Using HTTP Basic Auth in 2022 by axiosgunnar on Saturday January 01, 2022 @03:35PM (#29762437)
Your suggestion is vulnerable to the https://en.m.wikipedia.org/wiki/Pass_the_hash attack.

Your suggestion is basically going back to the days where databases stored plaintext passwords in the database, just that the plaintext happens to be a hash.

Re:Using HTTP Basic Auth in 2022 by lixtra on Saturday January 01, 2022 @03:37PM (#29762461)
> If the client and server have an agreement on a hashing protocol, there’s no reason that the browser shouldn’t be able to hash as well and prevent the password from ever leaving memory on the client system.

Shouldn’t it be a proper challenge/response? Otherwise the hash is barely better than the password.

Re:Using HTTP Basic Auth in 2022 by ncann on Saturday January 01, 2022 @03:38PM (#29762474)
How do you do client side hashing without the server sending the salt/pepper to the client, which is a really bad thing?
Re:Using HTTP Basic Auth in 2022 by notfed on Saturday January 01, 2022 @05:19PM (#29763453)
There are answers to this. I asked myself this a few years ago, which led recursively to new tricky questions. I eventually solved the tree of the questions: I designed myself into a solution that I later realized was essentially an asymmetric PAKE (e.g., analogous to OPAQUE).

So, an attempt to solve your question eventually leads to using an asymetric PAKE. But, this is way, way more complex. You'd really have to squint your eyes to believe that the diminishing returns are worth it.

Re:Using HTTP Basic Auth in 2022 by vbezhenar on Saturday January 01, 2022 @03:33PM (#29762407)
I don't really see it simplifying a lot of internet. Everyone will make his custom login page anyway, you need to add links to registration, password recovery and so on. And sending password on every request, hashed or not, is just bad security, you need session token anyway.
Re:Using HTTP Basic Auth in 2022 by adolph on Saturday January 01, 2022 @04:09PM (#29762816)
I think second party controls are probably the reason why browser intermediated login was never pursued until the present era of password management--the browser is a third party that can facilitate/intermediate communication between the first party (user) and second party (website). It would be foolish for a website operator to hand their users over to Microsoft back in the day, just as "social login" is a convenience/optimization trap today.
Re:Using HTTP Basic Auth in 2022 by ClumsyPilot on Saturday January 01, 2022 @05:33PM (#29763561)
"you need to add links to registration, password recovery and so on"

All of which could be easilly standardized

Re:Using HTTP Basic Auth in 2022 by IgorPartola on Sunday January 02, 2022 @12:48AM (#29766215)
Don’t even stop there. Instead of typing in a username and password, have my browser give me a drop down with my identities so I can use just one of them. Then have the browser sync my (encrypted with my pass phrase) identities across all my browsers/devices. No more passwords.
Re:Using HTTP Basic Auth in 2022 by speedgoose on Sunday January 02, 2022 @01:09AM (#29766304)
I think this is already implemented with HTTPS but very rarely used.
Re:Using HTTP Basic Auth in 2022 by mooreds on Saturday January 01, 2022 @05:17PM (#29763441)
> Add a button to log out. Logout never really worked across browsers with basic auth.

In my experience, the way to logout is to close the browser. Is this standardized anywhere?

> Allow to inject a logo or a tiny bit of customization for branding. The default popup looks too ugly.

I think that this would be nice, but most anyone who wants customization will want to control everything, and wouldn't be a fit for the limits of basic auth.

> Improve the Digest auth to modern crypto standards. Stop passing plain passwords over the wire.

As others have mentioned, TLS helps with this, but I agree that it would be a good idea to hash it anyway.

Have you thought about submitting these improvements to chromium and firefox (as feature requests)?

Re:Using HTTP Basic Auth in 2022 by 1vuio0pswjnm7 on Saturday January 01, 2022 @10:12PM (#29765407)
Perhaps it would be even more useful if so-called "modern" browsers implemented SRP support. Some would agree SRP is better than HTTP Basic Authentication.

https://web.archive.org/web/20210422025330if_/http://srp.sta...

SRP allows for TLS without server (or client) certificates. The presence of the verifier on the server provides authentication. No passwords are sent over the wire.

The conventional use for SRP is a replacement for weak passwords (e.g., HTTP Authentication), but what would stop SRP from being used in some cases as a replacement for server certificates even where a website is public (no passwrd required). With SRP, the user becomes the one who is in control of "trust", not a third party certificate issuer or browser vendor. The user decides whether to send a verifier to a website operator.

Re:Using HTTP Basic Auth in 2022 by cookiengineer on Sunday January 02, 2022 @04:56AM (#29767334)
Imagine a HTTP Basic Auth workflow that has another "Token: ..." header that is based on TOTP. This would help make things so much better compared to what's the situation right now.

The stuff we see nowadays is mostly hacks that upgrade legacy systems with things like "the password is actually your-password#token" and "oh yeah, if you use # in your password, it crashes the server ... so don't do that".

Something like a standardized HTTP-based authentication workflow (Basic Auth + maybe parts of the Web AuthN spec) could make things so much easier in regards to maintainability. Then we could finally get rid of stupid workarounds like JWT which weren't designed for this purpose.

Re:Using HTTP Basic Auth in 2022 by fulafel on Sunday January 02, 2022 @12:49PM (#29771271)
That wouldn't be basic authentication any more which is by definition username+password. HTTP currently already supprots other authentication types besides basic auth, such as digest and bearer authentication. Bearer is rather close to what you describe.
Re:Using HTTP Basic Auth in 2022 by LinAGKar on Saturday January 01, 2022 @05:39PM (#29763613)
Digest auth is fundamentally less secure, as it requires the server to have access to the plain text password, whereas with basic auth you can store it salted and hashed. And you should be using HTTPS regardless.
Re:Using HTTP Basic Auth in 2022 by drdaeman on Saturday January 01, 2022 @09:15PM (#29765066)
> Improve the Digest auth to modern crypto standards

There is https://datatracker.ietf.org/doc/html/draft-yusef-httpauth-s... but looks like it had never gained any traction.

And most likely won't, because browser vendors seem to be extremely reluctant to do anything but deprecate all those standard UIs in favor of messed up JS APIs.

Re:Using HTTP Basic Auth in 2022 by nirui on Saturday January 01, 2022 @10:19PM (#29765462)
Is there any chance to go even further than this? I'm imaging a public key based authentication scheme.

The user submit their public key to the server first, then in the feature logins, server will generate a challenge for client to decrypt and respond.

Of course the browser can apply some UX magic at the client end, for example displaying a pop window to allow user to select a public key for the authentication process, etc.

Re:Using HTTP Basic Auth in 2022 by jannes on Sunday January 02, 2022 @11:56AM (#29770411)
Sounds like client certificates. I guess you have never used those. All major browsers support them.

In Firefox you can find them here: Settings -> Privacy & Security -> View Certificates -> Your Certificates

Re:Using HTTP Basic Auth in 2022 by nirui on Sunday January 02, 2022 @11:36PM (#29777379)
Yes, but the advantage is that the user sends their own public keys and they can switch it freely (and preferably easily, user click "login", a window pop up, user select a public key, done) at will. While client certificates is currently managed fully by the browser, and you need to adjust your HTTPS infrastructure in order to enable the feature.
Re:Using HTTP Basic Auth in 2022 by andreareina on Sunday January 02, 2022 @06:39AM (#29767914)
Isn't that basically client certificates?
Re:Using HTTP Basic Auth in 2022 by p4bl0 on Saturday January 01, 2022 @10:17PM (#29765448)
Another thing that's missing is multiple credentials stored in by the browser. With HTML login forms browsers can offer multiple choice of autocompletion with stored credentials. With Basic HTTP auth it doesn't work, it only offers the first one and you have to type both the login and the password manually for other accounts even if your browsers knows about them.
Re:Using HTTP Basic Auth in 2022 by dpweb on Saturday January 01, 2022 @09:42PM (#29765224)
Upon account creation or reset, can't the user select a password, that hashed as the private key for a keypair and just the public sent to the server? Then when logging in they just sign a challenge on the client. Only thing stored is a users public key on the server.
Re:Using HTTP Basic Auth in 2022 by alerighi on Saturday January 01, 2022 @06:21PM (#29763928)
Agree with everything beside the third point.

The argument of passing plain password over the wire doesn't make sense: every login form when you submit it passes username and password over the wire! Nobody encrypts the passwords client side.

Re:Using HTTP Basic Auth in 2022 by moltar on Sunday January 02, 2022 @02:42AM (#29766690)
* password manager support
Re:Using HTTP Basic Auth in 2022 by mmcnl on Saturday January 01, 2022 @07:22PM (#29764364)
I agree. And also deprecate basic auth over unencrypted connections.
Re:Using HTTP Basic Auth in 2022 by jstummbillig on Saturday January 01, 2022 @05:15PM (#29763423)
> It's not a massive amount of work

Oh, sweet summer child