You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand this is open source software provided for free and that I might not receive a timely response.
I am positive I am NOT reporting a (potential) security
vulnerability, to the best of my knowledge. (These must be shared by
submitting this report form instead, if
any hesitation exists.)
I am willing to submit a pull request with reporoducers as xfailing test cases or even entire fix. (Assign this issue to me.)
Describe the bug
We were fuzzing yarl url quoting. We assumed that input string shouldn't change after url quotinq and unquoting. But using _quoting_py module input string is not equal to output string after quoting and unquoting. If it's not safe to assume that string will not be changed after quoting and unquoting please let us know.
To Reproduce
Install atheris and yarl 1.18.3:
pip install --force-reinstall -v "yarl==1.18.3"
Run our test url_quoter_test.py:
from yarl._quoting_py import _Quoter
from yarl._quoting_py import _Unquoter
data = '%%1111'
quote = _Quoter()
unquote = _Unquoter()
text_quoted = quote(data)
text_output = unquote(text_quoted)
assert data == text_output
python3 url_quoter_fuzz.py crash.raw
See assertion error that input string is not equal to output string.
Expected behavior
input string shouldn't change after url quotinq and unquoting
Logs/tracebacks
Traceback (most recent call last):
File "/home/fuzzer/fuzz/reproduce.py", line 10, in <module>assert data == text_output
AssertionError
Python Version
$ python --versionPython 3.9.20
multidict Version
$ python -m pip show multidictName: multidictVersion: 6.1.0Summary: multidict implementationHome-page: https://github.com/aio-libs/multidictAuthor: Andrew SvetlovAuthor-email: andrew.svetlov@gmail.comLicense: Apache 2Location: /usr/local/lib64/python3/site-packagesRequires: typing-extensionsRequired-by: yarl
propcache Version
$ python -m pip show propcacheName: propcacheVersion: 0.3.0Summary: Accelerated property cacheHome-page: https://github.com/aio-libs/propcacheAuthor: Andrew SvetlovAuthor-email: andrew.svetlov@gmail.comLicense: Apache-2.0Location: /usr/local/lib64/python3/site-packagesRequires: Required-by: yarl
yarl Version
$ python -m pip show yarlName: yarlVersion: 1.18.3Summary: Yet another URL libraryHome-page: https://github.com/aio-libs/yarlAuthor: Andrew SvetlovAuthor-email: andrew.svetlov@gmail.comLicense: Apache-2.0Location: /usr/local/lib64/python3/site-packagesRequires: idna, multidict, propcacheRequired-by:
OS
alt:p10
Additional context
We have found it by fuzzing yarl with atheris. So you can see the full fuzz test:
import atheris
import sys
with atheris.instrument_imports():
from yarl._quoting_py import _Quoter
from yarl._quoting_py import _Unquoter
def TestOneInput(input_bytes):
fdp = atheris.FuzzedDataProvider(input_bytes)
data = fdp.ConsumeUnicodeNoSurrogates(sys.maxsize)
print(data)
try:
quote = _Quoter()
unquote = _Unquoter()
text_quoted = quote(data)
text_output = unquote(text_quoted)
assert data == text_output
except ValueError as e:
pass
def main():
atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz()
if __name__ == "__main__":
main()
The text was updated successfully, but these errors were encountered:
Please confirm the following
vulnerability, to the best of my knowledge. (These must be shared by
submitting this report form instead, if
any hesitation exists.)
Describe the bug
We were fuzzing yarl url quoting. We assumed that input string shouldn't change after url quotinq and unquoting. But using _quoting_py module input string is not equal to output string after quoting and unquoting. If it's not safe to assume that string will not be changed after quoting and unquoting please let us know.
To Reproduce
url_quoter_test.py
:Expected behavior
input string shouldn't change after url quotinq and unquoting
Logs/tracebacks
Python Version
multidict Version
propcache Version
yarl Version
OS
alt:p10
Additional context
We have found it by fuzzing
yarl
withatheris
. So you can see the full fuzz test:The text was updated successfully, but these errors were encountered: