Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Maximum execution time exceeds while handling IPv6 Reverse Proxy IPs #3760

Closed
dobaniashish opened this issue Oct 11, 2020 · 3 comments
Closed

Comments

@dobaniashish
Copy link

Description
Maximum execution time exceeds if the request is from an IPv6 address while processing Reverse Proxy IP.

I have set cloudflare IPs for Reverse Proxy IP list and I saw a few errors today on my site. Checking the access_logs with error timestamps reveals that these requests were from IPv6 addresses and were all failing with max execution time errors.

I was only able to replicate the issue by requesting my site with http://ipv6-test.com once since I don't have an IPv6 address.

PHP error_log

[11-Oct-2020 12:54:48 UTC] PHP Fatal error:  Maximum execution time of 180 seconds exceeded in /application/system/HTTP/Request.php on line 200
[11-Oct-2020 13:43:07 UTC] PHP Fatal error:  Maximum execution time of 180 seconds exceeded in /application/system/HTTP/Request.php on line 209
[11-Oct-2020 14:28:52 UTC] PHP Fatal error:  Maximum execution time of 180 seconds exceeded in /application/system/HTTP/Request.php on line 195

CodeIgniter log

CRITICAL - 2020-10-11 12:54:48 --> Maximum execution time of 180 seconds exceeded
#0 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#1 {main}
CRITICAL - 2020-10-11 13:43:07 --> Maximum execution time of 180 seconds exceeded
#0 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#1 {main}
CRITICAL - 2020-10-11 14:28:52 --> Maximum execution time of 180 seconds exceeded
#0 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#1 {main}

Apache Access log

{IPv6 hidden} - - [11/Oct/2020:12:51:46 +0000] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36"
{IPv6 hidden} - - [11/Oct/2020:13:40:05 +0000] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36"
{IPv6 hidden} - - [11/Oct/2020:14:25:50 +0000] "GET / HTTP/1.1" 500 - "http://ipv6-test.com/validate.php" "ipv6-test.com validator"

App Config

public $proxyIPs = [
	//cloudflare https://www.cloudflare.com/ips/
	//truncated list
	//ipv4
	'173.245.48.0/20',
	'103.21.244.0/22',
	...
	//ipv6
	'2400:cb00::/32',
	'2606:4700::/32',
	...
];

CodeIgniter 4 version
CodeIgniter 4.0.4

Affected module(s)
\CodeIgniter\HTTP\Request->getIPAddress()

Expected behavior, and steps to reproduce if appropriate
Add cloudflare IPs to Reverse Proxy IP list and request the server from an IPv6 address.

Context

  • OS: CentOS 7
  • Web server: Apache
  • PHP version 7.3
@dobaniashish dobaniashish added the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 11, 2020
@lhhub
Copy link

lhhub commented Oct 13, 2020

看不懂

@dobaniashish
Copy link
Author

I have removed those IPs from $proxyIPs for now. Waiting for a response from one of the developers.

@paulbalandan
Copy link
Member

Have you checked with your ISP regarding this? This is more likely a routing issue rather than a framework error.

@paulbalandan paulbalandan removed the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants