WebServer: Fix OOB write (#4088)
Successful exploitation could lead to arbitrary code execution.
The bug can be reproduced by running the following in a browser:
```
const formData = new FormData();
for (let i = 0;i < 33;++i) { formData.append("foo", i.toString()); }
await fetch("http://esp.local", { method: 'POST', body: formData });
```
			
			
This commit is contained in:
		
							parent
							
								
									2fd3d042b2
								
							
						
					
					
						commit
						494061af26
					
				| @ -413,6 +413,9 @@ bool WebServer::_parseForm(WiFiClient& client, String boundary, uint32_t len){ | |||||||
|             if (line == ("--"+boundary+"--")){ |             if (line == ("--"+boundary+"--")){ | ||||||
|               log_v("Done Parsing POST"); |               log_v("Done Parsing POST"); | ||||||
|               break; |               break; | ||||||
|  |             } else if (_postArgsLen >= WEBSERVER_MAX_POST_ARGS) { | ||||||
|  |               log_e("Too many PostArgs (max: %d) in request.", WEBSERVER_MAX_POST_ARGS); | ||||||
|  |               return false; | ||||||
|             } |             } | ||||||
|           } else { |           } else { | ||||||
|             _currentUpload.reset(new HTTPUpload()); |             _currentUpload.reset(new HTTPUpload()); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user