actix / actix/actix-web

Stop responding in the case of a big size POST request and a 404 result

オープン
#2,906 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
24.8k
フォーク
1.9k
平均マージ
23時間 10分
マージ済み PR(30日)
26

説明

## Current Behavior
Using following simple web server implementation
```
use actix_web::{App, HttpServer};
use env_logger::{Builder, Target};

fn main() -> std::io::Result<()> {
let _ = Builder::from_default_env().target(Target::Stdout).try_init();

let http_server = HttpServer::new(App::new).bind(("127.0.0.1", 8080))?.run();

actix_web::rt::System::new().block_on(async move { http_server.await })
}
```
after submitting the attached big size JSON request [test_actix.postman_collection.json.txt](https://github.com/actix/actix-web/files/9746796/test_actix.postman_collection.json.txt) using [Postman](https://www.postman.com/) a 404 error occurs.
After the first 404 response the **server freezes and stop to response**.

In case of processing and 200 response everithings works.

This scenario opens up to possible DOS attacks

## Expected Behavior
Even in the case of consecutive calls with a 404 result, the server must continue to answer correctly.

## Possible Solution
Avoid freeze and stop response after the first request

## Steps to Reproduce (for bugs)
1. Run the server as reported
2. Submit a first time the attached request via Postman
3. Submit a second time the attached request via Postman

## Context

## Your Environment
WSL2 on Windows 11

- Rust Version: rustc 1.64.0 (a55dd71d5 2022-09-19)
- Actix Web Version: 4.2.1

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。