mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
When parsing json from untrusted sources, remove templating tags
This commit is contained in:
@@ -497,7 +497,7 @@ class Runner(object):
|
||||
cmd2 = conn.shell.remove(tmp, recurse=True)
|
||||
self._low_level_exec_command(conn, cmd2, tmp, sudoable=False)
|
||||
|
||||
data = utils.parse_json(res['stdout'])
|
||||
data = utils.parse_json(res['stdout'], from_remote=True)
|
||||
if 'parsed' in data and data['parsed'] == False:
|
||||
data['msg'] += res['stderr']
|
||||
return ReturnData(conn=conn, result=data)
|
||||
|
||||
@@ -43,8 +43,7 @@ class ReturnData(object):
|
||||
self.diff = diff
|
||||
|
||||
if type(self.result) in [ str, unicode ]:
|
||||
self.result = utils.parse_json(self.result)
|
||||
|
||||
self.result = utils.parse_json(self.result, from_remote=True)
|
||||
|
||||
if self.host is None:
|
||||
raise Exception("host not set")
|
||||
|
||||
Reference in New Issue
Block a user