[P0][security] 수작업 HTTP parser에 body size limit 및 read timeout 추가 #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
문제
crates/portal-relay/src/relay/server.rs의read_http_request()는 header size를 16 KiB로 제한하지만Content-Lengthbody는 사실상 제한 없이Vec에 누적합니다. header/body read timeout도 보이지 않습니다.위험
Content-Length로 메모리 고갈 유발 가능hyper의존성이 있는데 서버 parsing은 직접 구현되어 유지보수 부담이 큼제안
MAX_BODY_BYTES상한 추가, 초과 시 413 또는 연결 종료tokio::time::timeout적용예시 방향:
완료 기준
검토 기준: 업로드된 Rust
portal-relay코드 정적 리뷰. 리뷰 환경에서는cargo check/test/clippy를 실행하지 못했습니다.수용했습니다. PR #62에서 manual HTTP parser에 read timeout, header/body size cap, Content-Length/Transfer-Encoding 방어, 400/408/413 계열 매핑 테스트를 추가했습니다. 검증: cargo test --locked, cargo clippy --locked --all-targets -- -D warnings.