-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Disallow control characters in user-id
and password
to be RFC-compliant.
#55
Comments
Hello, and thank you for your issue. You are correct regarding RFC 7617, although this module is written to RFC 2617, as this module was created prior to the existence of 7617. It is possible that a future version of this module can update to instead follow RFC 7617 as a breaking change, though I don't see the exact purpose to make it more strict and break existing applications. We could always add an option to the parser to choose with RFC to follow, would that be of interest to you? |
user-id
and password
.user-id
and password
.
I do see that TEXT is defined as follows, however:
which looks like it also excludes certain CTL characters. I think we can release a 2.0 that adds this restriction. I need to think about if it should returned |
That’s right: RFC 2617 forbids all control characters but linear whitespace, and its successor, RFC 7617, simply forbids all of them including linear whitespace. Hence the original title of this issue. I was just reporting it to inform you, not expecting an immediate “fix.” With this notice, you can do as you please with your package. Releasing a new version with this restriction sounds good, by the way. |
If you don’t mind, may I change the title back? |
user-id
and password
.user-id
and password
to be RFC-compliant.
And I believe it should return Lines 107 to 112 in e8a29f9
|
I also doubt the need for “an option for the parser to choose between the RFC 2617 and RFC 7617 modes,” because, compared to RFC 7617, the characters that RFC 2617 additionally supports in
which, innocent, sane users wouldn’t use in their usernames and passwords to sign in. Following the obsolete standard, RFC 2617, only benefits malicious attackers.
|
Sorry I accidentally closed this issue |
basic-auth/index.js
Line 46 in e8a29f9
basic-auth/index.js
Lines 114 to 115 in e8a29f9
Which, RFC 7617 forbids.
The text was updated successfully, but these errors were encountered: