Commit 861bded
[3.14] pythongh-119452: Fix a potential virtual memory allocation denial of service in http.server (pythonGH-119455)
The CGI server on Windows could consume the amount of memory specified
in the Content-Length header of the request even if the client does not
send such much data. Now it reads the POST request body by chunks,
so that the memory consumption is proportional to the amount of sent
data.
(cherry picked from commit 29c657a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>1 parent a183a11 commit 861bded
File tree
3 files changed
+57
-1
lines changed- Lib
- http
- test
- Misc/NEWS.d/next/Security
3 files changed
+57
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
| |||
1218 | 1222 | | |
1219 | 1223 | | |
1220 | 1224 | | |
1221 | | - | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1222 | 1235 | | |
1223 | 1236 | | |
1224 | 1237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
698 | 712 | | |
699 | 713 | | |
700 | 714 | | |
| |||
728 | 742 | | |
729 | 743 | | |
730 | 744 | | |
| 745 | + | |
| 746 | + | |
731 | 747 | | |
732 | 748 | | |
733 | 749 | | |
| |||
782 | 798 | | |
783 | 799 | | |
784 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
785 | 806 | | |
786 | 807 | | |
787 | 808 | | |
| |||
803 | 824 | | |
804 | 825 | | |
805 | 826 | | |
| 827 | + | |
| 828 | + | |
806 | 829 | | |
807 | 830 | | |
808 | 831 | | |
| |||
875 | 898 | | |
876 | 899 | | |
877 | 900 | | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
878 | 916 | | |
879 | 917 | | |
880 | 918 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments