EasyEngine / EasyEngine/easyengine
Serious issue on IPv6 enabled systems
- Dominant language
- PHP
- Stars
- 2.2k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
There seems to be a serious issue with IPv6 enabled systems using EE. The nginx proxy seems to convert any source IPv6 address into a LOCAL IPv4 which then makes any hacking/login/whatever attacks seem like they are coming from the local machine and thus be unable to be blocked by security mechanisms or plugins (like wordfence). I initially reported this as a support request (https://github.com/EasyEngine/easyengine/discussions/1620) but now believe this to be a bug in EE.
System Information
- [x] ee cli info:
```
| OS | Linux 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021 x86_64 |
| Shell | /bin/bash |
| PHP binary | /usr/bin/php7.4 |
| PHP version | 7.4.3 |
| php.ini used | /etc/php/7.4/cli/php.ini |
| EE root dir | phar://ee.phar |
| EE vendor dir | phar://ee.phar/vendor |
| EE phar path | /root |
| EE packages dir | |
| EE global config | /opt/easyengine/config/config.yml |
| EE project config | |
| EE version | 4.3.1 |
```
- [x] lsb_release -a
```
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
```
- [x] docker version
```
Client: Docker Engine - Community
Version: 20.10.9
API version: 1.41
Go version: go1.16.8
Git commit: c2ea9bc
Built: Mon Oct 4 16:08:29 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.9
API version: 1.41 (minimum version 1.12)
Go version: go1.16.8
Git commit: 79ea9d3
Built: Mon Oct 4 16:06:37 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
```
- [x] docker-compose version
```
docker-compose version 1.25.0, build unknown
docker-py version: 4.1.0
CPython version: 3.8.10
OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020
```
I found the problem, and if I am correct it is a quite serious one for EE, pointing either to some problem with off the shelf, default ee setup or somehow something I have missed. But here it is in a nutshell:
- On machines that have IPv6 enabled, an IPv6 request will get translated by the proxy to internal local IPv4
- This allows all number of attempted hacks to bypass security mechanisms, BECAUSE THEY APPEAR TO BE LOCAL
Here is how I figured it out and tested it:
- Ran an ipv6 reachability test (https://ipv6-test.com/validate.php) on a couple of my sites (one ee, one manual setup on another machine) which both passed.
- When i check the logs on the ee machine (in the logs in /opt/easyengine/services/nginx-proxy/logs/access.log) that test shows up as coming from 172.19.0.1
- When I check the logs on the manually configured apache machine, that test shows up as coming from 2001:41d0:701:1100::29c8
So clearly either my machine (although I setup a fresh ee machine to test just this from scratch with only one site) or the proxy setup for ee does not properly forward or deal with IPv6, and it really needs to if we are to avoid hacking attempts like this. For now I have disabled ipv6 on my ee machine and I am watching for further attacks, but so far there have not been any. That said this has only been in place for an hour, so it is possible I missed something and will be monitoring closely.
Contributor guide
Assessment
This issue has not been assessed yet.