Commit 10adcb5
[CVE-2024-9287] ensure that bracketed hosts found by urlsplit are of IPv6 or IPvFuture format
Fix urlparse incorrectly retrieves IPv4 and regular name hosts from inside of brackets
Reproducer is
python3 -c \
'from urllib.parse import urlparse; print(urlparse("https://user:some]password[@host.com"))'
This command should fail with the error "ValueError: '@host.com'
does not appear to be an IPv4 or IPv6 address". If it doesn’t and produces
ParseResult(scheme='https', netloc='user:some]password[@host.com',
path='', params='', query='', fragment='')
it is this bug.
Fixes: bsc#1233307 (CVE-2024-11168)
Fixes: gh#python#103848
Co-authored-by: JohnJamesUtley <[email protected]>
From-PR: gh#python/cpython!103849
Patch: CVE-2024-11168-validation-IPv6-addrs.patch1 parent c9571a5 commit 10adcb5
File tree
4 files changed
+65
-1
lines changed- Lib
- test
- urllib
- Misc/NEWS.d/next/Library
4 files changed
+65
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1886 | 1886 | | |
1887 | 1887 | | |
1888 | 1888 | | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
1889 | 1909 | | |
1890 | 1910 | | |
1891 | 1911 | | |
| |||
1927 | 1947 | | |
1928 | 1948 | | |
1929 | 1949 | | |
| 1950 | + | |
| 1951 | + | |
1930 | 1952 | | |
1931 | 1953 | | |
1932 | 1954 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
1038 | 1064 | | |
1039 | 1065 | | |
1040 | 1066 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
420 | 432 | | |
421 | 433 | | |
422 | 434 | | |
| |||
467 | 479 | | |
468 | 480 | | |
469 | 481 | | |
470 | | - | |
471 | 482 | | |
472 | 483 | | |
473 | 484 | | |
474 | 485 | | |
475 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
476 | 490 | | |
477 | 491 | | |
478 | 492 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments