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

HTTP basic authentication may violate spec #52

Closed
jlabue-viewpoint opened this issue Jul 12, 2024 · 3 comments
Closed

HTTP basic authentication may violate spec #52

jlabue-viewpoint opened this issue Jul 12, 2024 · 3 comments
Assignees

Comments

@jlabue-viewpoint
Copy link

jlabue-viewpoint commented Jul 12, 2024

When a token is requested using Basic as the authentication type, it is possible for no realm be indicated in the resulting HTTP response. This causes unpredictable behavior in applications that are attempting to process the response.

With Basic authentication, a realm value is required.

Found using Apache, but may occur on NGINX as well (did not verify)

@codespearhead
Copy link

This behavior indeed violates the specification.

Appendix A from rfc7235 says;

The "realm" parameter is no longer always required on challenges; consequently, the ABNF allows challenges without any auth parameters.

That specification, which updates rfc2617, is from June 2014.

Section 2 of rfc7617, which was released in September 2015 and supersedes rfc2617, says:

The 'Basic' Authentication Scheme
[...]
In challenges:
[...]
The authentication parameter 'realm' is REQUIRED.

@zandbelt zandbelt added bug Something isn't working enhancement New feature or request labels Jul 12, 2024
@zandbelt zandbelt self-assigned this Jul 12, 2024
@zandbelt
Copy link
Member

zandbelt commented Jul 13, 2024

this can be configured on the server level, independent of liboauth2 i.e. in Apache

AuthName <realm>

see: https://github.com/OpenIDC/liboauth2/blob/v1.6.3/src/server/apache.c#L378-L380

@zandbelt zandbelt removed bug Something isn't working enhancement New feature or request labels Jul 13, 2024
@jlabue-viewpoint
Copy link
Author

I totally missed that. Thank you for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants