oauthlib
Affected
- introduced
3.1.1, fixed3.2.2(ecosystem)
Fixed versions
3.2.2
Fix
- Fixed version
3.2.2pip install --upgrade oauthlib==3.2.2
Advisory
Also known as: CVE-2022-36087, PYSEC-2022-269
OAuthLib vulnerable to DoS when attacker provides malicious IPV6 URI
Impact
uri_validate functions depending where it is used._What kind of vulnerability is it? Who is impacted?_
Oauthlib applications using OAuth2.0 provider support or use directly uri_validate function.
Patches
_Has the problem been patched? What versions should users upgrade to?_
Issue fixed in 3.2.2 release.
Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_
The redirect_uri can be verified in web toolkit (i.e bottle-oauthlib, django-oauth-toolkit, ...) before oauthlib is called. A sample check if : is present to reject the request can prevent the DoS, assuming no port or IPv6 is fundamentally required.
References
Attack Vector:
https://github.com/oauthlib/oauthlib/blob/d4bafd9f1d0eba3766e933b1ac598cbbf37b8914/oauthlib/oauth2/rfc6749/grant_types/base.py#L232
uri_validate functions:https://github.com/oauthlib/oauthlib/blob/2b8a44855a51ad5a5b0c348a08c2564a2e197ea2/oauthlib/uri_validate.py
PoC
is_absolute_uri("http://[:::::::::::::::::::::::::::::::::::::::]/path")
Acknowledgement
Special thanks to Sebastian Chnelik - PyUp.io
Medium Basis: The source's own band: MODERATE
3.1.1, fixed 3.2.2 (ecosystem)3.2.2
3.2.2pip install --upgrade oauthlib==3.2.2Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0