Skip to content

Commit 3a50bf6

Browse files
authored
Add CSRF warning to HTTP Basic Auth security section (fixes mdn#40267) (mdn#40569)
1 parent 89d9418 commit 3a50bf6

File tree

1 file changed

+8
-1
lines changed
  • files/en-us/web/http/guides/authentication

1 file changed

+8
-1
lines changed

files/en-us/web/http/guides/authentication/index.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,13 @@ The "Basic" HTTP authentication scheme is defined in {{rfc(7617)}}, which transm
111111

112112
### Security of basic authentication
113113

114-
As the user ID and password are passed over the network as clear text (it is base64 encoded, but base64 is a reversible encoding), the basic authentication scheme **is not secure**. HTTPS/TLS should be used with basic authentication. Without these additional security enhancements, basic authentication should not be used to protect sensitive or valuable information.
114+
As the user ID and password are passed over the network as clear text (it is base64 encoded, but base64 is a reversible encoding), the basic authentication scheme is not secure.
115+
HTTPS/TLS should be used with basic authentication to prevent credential interception.
116+
117+
In addition, sites that use HTTP Basic Auth are particularly vulnerable to [Cross-Site Request Forgery (CSRF)](/en-US/docs/Glossary/CSRF) attacks because the user credentials are sent in all requests regardless of origin (this differs cookie-based credential mechanisms, because cookies are commonly blocked in cross site requests).
118+
Sites should always use the POST requests when changing data, and include [CSRF tokens](/en-US/docs/Web/Security/Attacks/CSRF).
119+
120+
Without these security enhancements, basic authentication should not be used to protect sensitive or valuable information.
115121

116122
### Restricting access with Apache and basic authentication
117123

@@ -162,3 +168,4 @@ This syntax is no longer allowed in modern browsers; the username and password a
162168
- {{HTTPHeader("Proxy-Authorization")}}
163169
- {{HTTPHeader("Proxy-Authenticate")}}
164170
- {{HTTPStatus("401")}}, {{HTTPStatus("403")}}, {{HTTPStatus("407")}}
171+
- [HTTP Security Best Practices](/en-US/docs/Web/Security)

0 commit comments

Comments
 (0)