T09 · Insecure Skill Coding Practices
- Location
http_retry.h:96- Finding
Fabricated HTTP Success Responses Cause Fail-Open Behavior
- Content
View full analysis
request_func(url, config->user_context); // For demo purposes, simulate success HttpErrorCode error = HTTP_SUCCESS; response.status_code = 200; if (error == HTTP_SUCCESS) { ``` ```c HttpResponse http_post_retry(const char* url, const char* data) { // Similar to GET, but with POST method return http_get_retry(url); // Placeholder } ``` ### Technical Analysis The HTTP request callback is commented out and never invoked. Instead, the implementation unconditionally assigns `HTTP_SUCCESS` and status code `200`, irrespective of the URL, network state, server response, or configured callback. Consequently, the function does not perform an HTTP request but reports success to its caller. The POST wrapper also discards the `data` argument and delegates to the same stubbed GET implementation. The documented timeout, retry, connection-pool, rate-limit, and transient-error behavior is therefore not implemented. This is a fail-open integrity vulnerability. Software using this component may treat a required remote operation as completed even though no data was transmitted and no response was received. ### Attack Path 1. An application uses `http_request_with_retry()` or `http_post_retry()` for a security-relevant remote operation. 2. The operation may involve authentication, authorization, notification delivery, data upload, payment processing, audit logging, or another required server-side action. 3. The implementation does not invoke `config->request_func` and discards POST data. 4. It sets `error` to `HTTP_SUCCESS` and `status_code` to `200`. 5. The calling application receives a fabricated succes ...[truncated 773 chars]- Remediation
View remediation
