Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Deprecate HTTP Digest authentication #24325

Closed
javiereguiluz opened this issue Sep 26, 2017 · 13 comments
Closed

[RFC] Deprecate HTTP Digest authentication #24325

javiereguiluz opened this issue Sep 26, 2017 · 13 comments
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed) Security

Comments

@javiereguiluz
Copy link
Member

Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? yes
Symfony version 3.4

We've been discussing this internally and we want to know the opinion of the community. In short, "HTTP Basic" is better because you can hash the password with Bcrypt ... but "HTTP Digest" sends the HA1=MD5(username:realm:password). Even if it's not the password in clear, if you get access to the HA1 value, you can log in in the application. So, "HTTP Digest" is generally considered less secure than any other authentication mechanism.

@javiereguiluz javiereguiluz added RFC RFC = Request For Comments (proposals about features that you want to be discussed) Security labels Sep 26, 2017
@stof
Copy link
Member

stof commented Sep 26, 2017

And the HA1 cannot be stored hashed, because it is used in a second hash involving the expiry time

@lyrixx
Copy link
Member

lyrixx commented Sep 26, 2017

👍

@javiereguiluz
Copy link
Member Author

@damienalexandre given the importance of this change, could you please add a comment about your downvote? Is this authentication something that you or your company or some project you know need? Thanks!

@dunglas
Copy link
Member

dunglas commented Sep 26, 2017

👍, it may cause some interoperability issues with legacy systems, but the modern web must use HTTPS and not this kind of strategies.

@damienalexandre
Copy link
Contributor

damienalexandre commented Sep 26, 2017

@javiereguiluz just removed my 👎 because I read too fast and mixed up HTTP Basic and HTTP Digest 😋 😬

@chalasr
Copy link
Member

chalasr commented Sep 26, 2017

👍

@ogizanagi
Copy link
Member

See #24335

@raziel057
Copy link
Contributor

raziel057 commented Sep 26, 2017

It would be great to explain to security audit firm why Basic Authentication is better. On the last project that have been audited they considered that HTTP Basic needed to be changed to Digest...

Even if you arguments are exact and understood from technical guys it can be disturbing for Project Managers or other people that just read this kind of articles: https://en.wikipedia.org/wiki/Digest_access_authentication

I think it would be important to document the fact that Basic used with Bcrypt is better and illustrate with an example as a best practice.

@dunglas
Copy link
Member

dunglas commented Sep 26, 2017

I think it would be important to document the fact that Basic used with Bcrypt is better and illustrate with an example as a best practice.

In HTTP (without HTTPS), Digest is better. But with Let's Encrypt and CloudFlare, there is no point using Digest anymore.

fabpot added a commit that referenced this issue Sep 26, 2017
…uth (ogizanagi)

This PR was merged into the 3.4 branch.

Discussion
----------

[Security][SecurityBundle] Deprecate the HTTP digest auth

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | yes <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #24325  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

See #24336 for the removal PR on master.

Commits
-------

11fe79d [Security][SecurityBundle] Deprecate the HTTP digest auth
@fabpot fabpot closed this as completed Sep 26, 2017
@stof
Copy link
Member

stof commented Sep 27, 2017

@raziel057 the way Digest works forces you to store the password or the HA1 in clear. A leak of them allows to forge a valid digest auth (if the HA1 is stored, it would require a custom client side implementation as browsers are taking the password as input and compute a HA1, but attackers can afford this, especially given that this may simply mean using a custom build of their browser changing the digest auth to bypass the HA1 computation itself and treat the input as HA1 directly).
Security audit firms should not accept a storage in clear, meaning they should not consider Digest auth as acceptable.

HTTP Basic over HTTP is indeed not safe against MitM, but the same argument applies for form login (which is why browsers are pushing towards HTTPS btw)

@raziel057
Copy link
Contributor

@stof Thanks for your explanations which could be used as a reply for Security Auditors. In my case it was obviously authentication over HTTPS.

@markussc
Copy link

I know this is a rather old conversation. Nevertheless, I came across the need for Digest authentication in my SmartHome automation project. Some control devices (wifi switches, heating control units) still require this authentication scheme and updates on their side are not to be expected. As the symfony software component is only communicating with these devices over a secure home network, there are no security concerns to be taken into account. Is there a way to re-include the client-side DigestAuthenticationListener again, maybe in the form of a plugin?

@dunglas
Copy link
Member

dunglas commented Nov 15, 2021

Yes you can easily create a plugin ("bundle") for that: https://symfony.com/doc/current/security/custom_authenticator.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed) Security
Projects
None yet
Development

No branches or pull requests

10 participants