Skip to content

Conversation

@GabrielNagy
Copy link

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

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:

confirmdeletion.html?hashes=HASH1|HASH2

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

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.[1]

For example, attempting to delete multiple torrents in the qBittorrent
WebUI results in an URL like the following:

    confirmdeletion.html?hashes=HASH1|HASH2

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.

[1] GHSA-68wm-pfjf-wqp6
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI
Copy link
Contributor

@aptalca
Copy link
Member

aptalca commented Feb 16, 2022

Thanks, but SWAG (actually our nginx baseimage) is about to go through some major restructuring so we're holding off on merging new PRs in the meantime. I believe as part of the restructuring, we'll remove that regex line as by now everyone should have updated their Authelia to a version with the proper fix. If not they likely won't update SWAG either so no issues there.

For now, you can manually edit that line in your instance.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@aptalca
Copy link
Member

aptalca commented Sep 22, 2022

should be fixed in #169

@aptalca aptalca closed this Sep 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants