CVE-2020-11710: Other (NVD-CWE-Other)
value: An issue was discovered in docker-kong (for Kong) through 2.0.3. The admin API port may be accessible on interfaces other than 127.0.0.1. NOTE: The vendor argue that this CVE is not a vulnerability because it has an inaccurate bug scope and patch links. “1) Inaccurate Bug Scope - The issue scope was on Kong's docker-compose template, and not Kong's docker image itself. In reality, this issue is not associated with any version of the Kong gateway. As such, the description stating ‘An issue was discovered in docker-kong (for Kong) through 2.0.3.’ is incorrect. This issue only occurs if a user decided to spin up Kong via docker-compose without following the security documentation. The docker-compose template is meant for users to quickly get started with Kong, and is meant for development purposes only. 2) Incorrect Patch Links - The CVE currently points to a documentation improvement as a “Patch” link: https://github.com/Kong/docs.konghq.com/commit/d693827c32144943a2f45abc017c1321b33ff611.This link actually points to an improvement Kong Inc made for fool-proofing. However, instructions for how to protect the admin API were already well-documented here: https://docs.konghq.com/2.0.x/secure-admin-api/#network-layer-access-restrictions , which was first published back in 2017 (as shown in this commit: https://github.com/Kong/docs.konghq.com/commit/e99cf875d875dd84fdb751079ac37882c9972949) Lastly, the hyperlink to https://github.com/Kong/kong (an unrelated Github Repo to this issue) on the Hyperlink list does not include any meaningful information on this topic.
CWE description: NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
CVSS v3 base score: 9.8
Published: 2020-04-12T17:15Z
Repository: https://github.com/Kong/docker-kong
Language: YAML
Files changed: compose/docker-compose.yml, tests.sh
Commit date: 2020-03-20 10:57:33 -0400
Commit message: chore(admin) restrict the admin port to 127 (#350)

* fix(admin) bind admin port to 127 only

* tests need to adjust the compose file for swarm vs docker-compose
Diff: diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml
index a46bf08..de946b8 100644
--- a/compose/docker-compose.yml
+++ b/compose/docker-compose.yml
@@ -69,13 +69,13 @@ services:
       - kong_postgres_password
     networks:
       - kong-net
     ports:
       - "8000:8000/tcp"
-      - "8001:8001/tcp"
+      - "127.0.0.1:8001:8001/tcp"
       - "8443:8443/tcp"
-      - "8444:8444/tcp"
+      - "127.0.0.1:8444:8444/tcp"
     healthcheck:
       test: ["CMD", "kong", "health"]
       interval: 10s
       timeout: 10s
       retries: 10
diff --git a/tests.sh b/tests.sh
index 015169a..f99363c 100755
--- a/tests.sh
+++ b/tests.sh
@@ -27,11 +27,11 @@ until docker ps | grep kong:1.5.0 | grep -q healthy;  do
   sleep 20
 done
 
 sleep 20
 curl -I localhost:8001 | grep 'Server: openresty'
-
+sed -i -e 's/127.0.0.1://g' docker-compose.yml
 KONG_DOCKER_TAG=${KONG_DOCKER_TAG} docker stack deploy -c docker-compose.yml kong
 sleep 20
 until docker ps | grep ${KONG_DOCKER_TAG}:latest | grep -q healthy; do
   docker stack ps kong
   docker service ps kong_kong
@@ -43,10 +43,11 @@ curl -I localhost:8001 | grep 'Server: openresty'
 
 docker stack rm kong
 sleep 20
 docker swarm leave --force
 docker volume prune -f
+git checkout -- docker-compose.yml
 popd
 
 # Validate Kong is running as the Kong user
 pushd compose
 docker-compose up -d

Vulnerable code:       - "8001:8001/tcp"
      - "8444:8444/tcp"

Fixed code:       - "127.0.0.1:8001:8001/tcp"
      - "127.0.0.1:8444:8444/tcp"
sed -i -e 's/127.0.0.1://g' docker-compose.yml
git checkout -- docker-compose.yml