authelia-server.conf: allow pipe character in URI #213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
The characters in the regex used for mitigating CVE-2021-32637 are not exhaustive since query strings seem to not always conform to the RFC3986, this is also mentioned in the security advisory for the CVE.
For example, attempting to delete multiple torrents in the qBittorrent WebUI results in an URL like the following:
This URL is valid and parsable by Authelia, but due to the regex it gets redirected infinitely.
To fix this, also allow pipe characters in the request URI.
Benefits of this PR and context:
The regex was introduced in 224abb6 to work around a CVE. The security advisory notes that the regex is not exhaustive, and there are projects (such as qbittorrent) that use pipe characters in URIs, which are valid and parsable by Authelia.
How Has This Been Tested?
After the regex modification, URLs with pipe characters in them are no longer redirected to the auth endpoint.
Source / References:
Original PR: #130
CVE: http://cve.mitre.org/cgi-bin/cvename.cgi?name=2021-32637