Expand description
Building messages.
The threat this module exists for is header injection: a caller puts a user-supplied
string into a display name or a Call-ID, the string contains CRLF, and one header becomes
three — or a body becomes a second request. Every SIP stack has a story about this.
The usual defence is a validate() function the caller is supposed to remember. sipx does
not have one, because “supposed to remember” is not a security property. Instead there is
no way to build a message from unvalidated bytes: every constructor here is fallible
and checks its input, and the only unchecked path into a Header is the parser’s, which
is crate-private and operates on bytes that were already framed.
The test that keeps this true is table-driven over every field a caller can populate, so a newly added field with no guard fails it.
Structs§
- Request
Builder - Builds a request.
- Response
Builder - Builds a response.