Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

qinguoyi/tinywebserver
master @ 4bcf887
11
Fixes
3
CVEs
HIGH
Peak severity
80.0%
Coverage
Highlights
Denial of Service: 8 prior fixes. Scrutinize any change in this area.
http/http_conn.cpp: most-fixed (9 issues). Treat as high-risk during review.
5 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Denial of Service: Incomplete handling of partial writes via non-blocking writev calls under network pressure (e.g. EAGAIN) frequently resulted in infinite loops, corrupted buffer state tracking, and server stalls. Developers must implement strict bookkeeping of remaining bytes and proper iovec offset updates.
Memory Corruption: Buffer management routines using standard functions like vsnprintf and memset are prone to out-of-bounds writes and index drift when bounds tracking variables are not properly validated or when type overflows occur (e.g., connection indices needing 64-bit widening).
Authentication Bypass: Flaws in credential storage (overwriting the database file rather than appending to it) and lax parsing of the request URI path ('m_url_real') allow remote attackers to bypass identity checks.