Missing cURL timeout in get_country() causes indefinite hang on slow/dead upstream #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The cURL request to
ipapi.coinget_country()sets no connection or transfer timeout:CURLOPT_CONNECTTIMEOUTandCURLOPT_TIMEOUTare never set.Location
message.php, lines 26–35Risk
If
ipapi.cois slow, unresponsive, or experiencing an outage, every call tomessage.php(i.e. every message submission) blocks the PHP worker until PHP's ownmax_execution_timeexpires (default 30 s, but often set higher or disabled). Under concurrent load this exhausts all available PHP-FPM workers, causing a denial of service for the entire application.Suggested fix direction
Add explicit timeouts:
Also consider making the geo-lookup asynchronous or falling back gracefully to
"Unknown"when the upstream is slow.Severity
moderate
Found by
Automated audit by Claude Code