T09 · Insecure Skill Coding Practices
Error
- Location
- http_retry.h:96
- Finding
- HTTP API Fabricates Successful Responses Without Performing Requests## Vulnerability Details **File Location**: `http_retry.h:96-101` **Vulnerability Type**: Fabricated network response and fail-open behavior **Risk Level**: High ```c // Execute request (placeholder - integrate with actual HTTP library) // HttpErrorCode error = config->request_func(url, config->user_context); // For demo purposes, simulate success HttpErrorCode error = HTTP_SUCCESS; response.status_code = 200; ``` ### Technical Analysis The implementation does not execute an HTTP request. The call to the configured `request_func` is commented out, the URL is unused, and the function unconditionally sets the error state to `HTTP_SUCCESS` and the status code to `200`. This is a fail-open design: callers receive an authoritative-looking success response even when no remote operation occurred. It also makes the retry, timeout, connection-error, rate-limit, and server-error handling paths unreachable. The behavior directly contradicts the documented purpose of the API. ### Attack Path 1. An application uses `http_request_with_retry()` for an operation that must be confirmed by a remote service. 2. The operation could involve authorization validation, webhook delivery, audit-event submission, remote state synchronization, or another security-sensitive request. 3. No HTTP request is sent because the configured callback is never invoked. 4. The function returns `status_code == 200` and reports success after one attempt. 5. The caller trusts the fabricated response and proceeds as though the remote operation succeeded. This path does not directly grant operating-system privileges. Its security consequence is an integrity and control-flow failure in applications that rely on the result. ### Impact Assessment Affected callers can incorrectly commit local state, approve workflows, suppress retry or alert mechanisms, or record nonexistent remote transactions as successful. The scope i ...[truncated 483 chars]
- Remediation
- ## Remediation Suggestions - Require a valid transport callback or integrate a real HTTP client implementation. - Invoke `config->request_func(url, config->user_context)` and propagate its actual result. - Return an explicit configuration or transport error when no request function is available; never default to success. - Populate `status_code`, response data, and error information only from the actual transport result. - Map real timeout, connection, rate-limit, and server errors to `HttpErrorCode`. - Enforce the configured timeout rather than merely storing `timeout_ms`. - Add tests proving that no callback, callback failure, timeout, HTTP 429, and HTTP 5xx responses cannot produce fabricated success. - Document ownership and lifetime rules for `response_body`.
