CVE-2021-40540
Description
ulfius_uri_logger in Ulfius HTTP Framework before 2.7.4 omits con_info initialization and a con_info->request NULL check for certain malformed HTTP requests.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
3- Ulfius/Ulfius HTTP Frameworkdescription
- Range: <2.7.4
Patches
Vulnerability mechanics
Root cause
"Missing zero-initialization of the con_info structure and missing NULL check on con_info->request in ulfius_uri_logger allows dereferencing uninitialized memory."
Attack vector
An attacker sends a malformed HTTP request to a server running an affected version of Ulfius. Because `con_info` is not zero-initialized and `con_info->request` is not checked for NULL before being passed to `ulfius_init_request`, the framework may dereference an uninitialized or NULL pointer, causing a denial of service (crash). The attack requires only network access to send a crafted HTTP request.
Affected code
The vulnerability is in the `ulfius_uri_logger` function in Ulfius HTTP Framework before version 2.7.4. The function omitted initialization of the `con_info` structure via `memset` and lacked a NULL check for `con_info->request` before using it, leading to a crash when malformed HTTP requests are processed.
What the fix does
The patch adds `memset(con_info, 0, sizeof(struct connection_info_struct))` to ensure the structure is zero-initialized before use, and removes the `NULL == con_info->request` check, instead directly calling `ulfius_init_request` and checking its return value. This prevents undefined behavior from uninitialized memory and ensures proper error handling when the request object is missing or invalid.
Preconditions
- configThe server must be running Ulfius HTTP Framework before version 2.7.4.
- networkThe attacker must be able to send HTTP requests to the server over the network.
- inputThe request must be malformed in a way that triggers the uninitialized path in ulfius_uri_logger.
Generated on May 30, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3- packetstormsecurity.com/files/164152/Ulfius-Web-Framework-Remote-Memory-Corruption.htmlmitrex_refsource_MISC
- github.com/babelouest/ulfius/commit/c83f564c184a27145e07c274b305cabe943bbfaamitrex_refsource_MISC
- github.com/babelouest/ulfius/compare/v2.7.3...v2.7.4mitrex_refsource_MISC
News mentions
0No linked articles in our index yet.