cpp-server-hardening-review
C++ Server Hardening Review
Use this skill to review or design a network server (or its options surface) for safe-by-default behavior against untrusted clients: every connection must be time-bounded, count-bounded, and reclaimed deterministically, and crypto/protocol defaults must fail closed. The recurring failure mode it prevents is a server that is correct on the happy path but exhausts file descriptors, memory, or CPU under a trivial connection flood, or silently negotiates weak TLS because a default was left to the linked library.
The governing rule: a default-configured server must survive a hostile client that opens connections and does nothing. Unbounded time, unbounded count, and unreclaimed per-connection state are defects, not tuning knobs.
WORKFLOW SKILL. INVOKES: read-only inspection of the server's accept loop, session lifetime, option defaults, and TLS context setup. This skill judges whether the server is safe-by-default; defer the underlying mechanics (async-I/O event loop, HTTP parser behavior, TLS library calls) and the lifetime/threading correctness of any proposed fix to the appropriate stack/correctness review. FOR SINGLE OPERATIONS: assess one default or one teardown path directly against the checklist.
Scope
- Use this skill for: choosing/auditing request-phase and idle timeouts, connection caps and accept backpressure, TLS minimum-version and verification defaults, guaranteed per-connection teardown notifications, and bounded per-connection/per-id caches.
- Out of scope: the protocol parsing rules themselves (an HTTP-parser concern), the async/lifetime mechanics of a fix (an async-I/O and object-lifetime concern), and application authn/authz logic. Name these when a finding depends on them, but route the mechanics elsewhere.