2021-01-08 13:41:50 +01:00
|
|
|
From 731a53bd241240e08c455a8cb3a59e4d65a6abb5 Mon Sep 17 00:00:00 2001
|
2019-01-17 10:18:02 +01:00
|
|
|
From: Erik Johnson <palehose@gmail.com>
|
|
|
|
Date: Fri, 24 Aug 2018 10:35:55 -0500
|
|
|
|
Subject: [PATCH] Fixes: CVE-2018-15750, CVE-2018-15751
|
|
|
|
|
|
|
|
Ensure that tokens are hex to avoid hanging/errors in cherrypy
|
|
|
|
|
|
|
|
Add empty token salt-api integration tests
|
|
|
|
|
|
|
|
Handle Auth exceptions in run_job
|
|
|
|
|
|
|
|
Update tornado test to correct authentication message
|
|
|
|
---
|
2019-04-12 11:57:21 +02:00
|
|
|
salt/netapi/rest_cherrypy/app.py | 7 -------
|
2021-01-08 13:41:50 +01:00
|
|
|
tests/integration/netapi/rest_tornado/test_app.py | 8 ++++++--
|
|
|
|
2 files changed, 6 insertions(+), 9 deletions(-)
|
2019-01-17 10:18:02 +01:00
|
|
|
|
|
|
|
diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index e7641ccbc5..5dfbadf759 100644
|
2019-01-17 10:18:02 +01:00
|
|
|
--- a/salt/netapi/rest_cherrypy/app.py
|
|
|
|
+++ b/salt/netapi/rest_cherrypy/app.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -1181,13 +1181,6 @@ class LowDataAdapter:
|
2019-04-12 11:57:21 +02:00
|
|
|
except (TypeError, ValueError):
|
2021-01-08 13:41:50 +01:00
|
|
|
raise cherrypy.HTTPError(401, "Invalid token")
|
2019-04-12 11:57:21 +02:00
|
|
|
|
2021-01-08 13:41:50 +01:00
|
|
|
- if "token" in chunk:
|
2019-04-12 11:57:21 +02:00
|
|
|
- # Make sure that auth token is hex
|
|
|
|
- try:
|
2021-01-08 13:41:50 +01:00
|
|
|
- int(chunk["token"], 16)
|
2019-04-12 11:57:21 +02:00
|
|
|
- except (TypeError, ValueError):
|
2021-01-08 13:41:50 +01:00
|
|
|
- raise cherrypy.HTTPError(401, "Invalid token")
|
2019-04-12 11:57:21 +02:00
|
|
|
-
|
2019-01-17 10:18:02 +01:00
|
|
|
if client:
|
2021-01-08 13:41:50 +01:00
|
|
|
chunk["client"] = client
|
2019-01-17 10:18:02 +01:00
|
|
|
|
|
|
|
diff --git a/tests/integration/netapi/rest_tornado/test_app.py b/tests/integration/netapi/rest_tornado/test_app.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index e3ad8820d3..4e5e741f1d 100644
|
2019-01-17 10:18:02 +01:00
|
|
|
--- a/tests/integration/netapi/rest_tornado/test_app.py
|
|
|
|
+++ b/tests/integration/netapi/rest_tornado/test_app.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -326,8 +326,12 @@ class TestSaltAPIHandler(_SaltnadoIntegrationTestCase):
|
|
|
|
self.assertIn("jid", ret[0]) # the first 2 are regular returns
|
|
|
|
self.assertIn("jid", ret[1])
|
|
|
|
self.assertIn("Failed to authenticate", ret[2]) # bad auth
|
|
|
|
- self.assertEqual(ret[0]["minions"], sorted(["minion", "sub_minion"]))
|
|
|
|
- self.assertEqual(ret[1]["minions"], sorted(["minion", "sub_minion"]))
|
|
|
|
+ self.assertEqual(
|
|
|
|
+ ret[0]["minions"], sorted(["minion", "sub_minion", "localhost"])
|
|
|
|
+ )
|
|
|
|
+ self.assertEqual(
|
|
|
|
+ ret[1]["minions"], sorted(["minion", "sub_minion", "localhost"])
|
|
|
|
+ )
|
2019-04-12 11:57:21 +02:00
|
|
|
|
2021-01-08 13:41:50 +01:00
|
|
|
@slowTest
|
2019-04-12 11:57:21 +02:00
|
|
|
def test_simple_local_async_post_no_tgt(self):
|
2019-01-17 10:18:02 +01:00
|
|
|
--
|
2021-01-08 13:41:50 +01:00
|
|
|
2.29.2
|
2019-01-17 10:18:02 +01:00
|
|
|
|
|
|
|
|