T09 · Insecure Skill Coding Practices
- Location
http_retry.h:96- Finding
HTTP API Fabricates Successful Responses Without Performing Requests
- Content
View full analysis
Vulnerability Details
File Location:
http_retry.h:96-101
Vulnerability Type: Fabricated network response and fail-open behavior
Risk Level: Highc // 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_funcis commented out, the URL is unused, and the function unconditionally sets the error state toHTTP_SUCCESSand the status code to200.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
- An application uses
http_request_with_retry()for an operation that must be confirmed by a remote service. - The operation could involve authorization validation, webhook delivery, audit-event submission, remote state synchronization, or another security-sensitive request.
- No HTTP request is sent because the configured callback is never invoked.
- The function returns
status_code == 200and reports success after one attempt. - 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]
- An application uses
- Remediation
View 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.
