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 just found another case making the program crash where idna.decode() raise a UnicodeError (due to punycode).
In the same way as #108, this could be problematic if users of the library are dealing with untrusted data since this issue will lead to a DoS. This should be detected and an idna.IDNAError should be triggered as detailed in the Readme Exception section.
python3 replay_crash2.py
Traceback (most recent call last):
File "/usr/lib/python3.8/encodings/punycode.py", line 134, in decode_generalized_number
char = ord(extended[extpos])
IndexError: string index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/encodings/punycode.py", line 207, in decode
res = punycode_decode(input, errors)
File "/usr/lib/python3.8/encodings/punycode.py", line 194, in punycode_decode
return insertion_sort(base, extended, errors)
File "/usr/lib/python3.8/encodings/punycode.py", line 164, in insertion_sort
newpos, delta = decode_generalized_number(extended, extpos,
File "/usr/lib/python3.8/encodings/punycode.py", line 137, in decode_generalized_number
raise UnicodeError("incomplete punicode string")
UnicodeError: incomplete punicode string
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "replay_crash2.py", line 3, in<module>
idna.decode(b'A.A.0.a.a.A.0.a.A.A.0.a.A.0A.2.a.A.A.0.a.A.0.A.a.A0.a.a.A.0.a.fB.A.A.a.A.A.B.A.A.a.A.A.B.A.A.a.A.A.0.a.A.a.a.A.A.0.a.A.0.A.a.A0.a.a.A.0.a.fB.A.A.a.A.A.B.0A.A.a.A.A.B.A.A.a.A.A.a.A.A.B.A.A.a.A.0.a.B.A.A.a.A.B.A.a.A.A.5.a.A.0.a.Ba.A.B.A.A.a.A.0.a.Xn--B.A.A.A.a')
File "/home/scop/.local/lib/python3.8/site-packages/idna/core.py", line 402, in decode
s = ulabel(label)
File "/home/scop/.local/lib/python3.8/site-packages/idna/core.py", line 315, in ulabel
label = label_bytes.decode('punycode')
UnicodeError: decoding with 'punycode' codec failed (UnicodeError: incomplete punicode string)
Happy to help if you have any questions ;)
The text was updated successfully, but these errors were encountered:
Hey,
I just found another case making the program crash where
idna.decode()
raise aUnicodeError
(due to punycode).In the same way as #108, this could be problematic if users of the library are dealing with untrusted data since this issue will lead to a DoS. This should be detected and an
idna.IDNAError
should be triggered as detailed in the Readme Exception section.Reproduction
Traceback
Happy to help if you have any questions ;)
The text was updated successfully, but these errors were encountered: