Skip to content

Commit 16759a4

Browse files
author
orbisai0security
committed
fix: V-002 security vulnerability
Automated security fix generated by OrbisAI Security
1 parent e87efa6 commit 16759a4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

MC/bin/o2_dpg_workflow_runner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ def setup_logger(name, log_file, level=logging.INFO):
110110
# TODO: integrate into standard logger
111111
def send_webhook(hook, t):
112112
if hook!=None:
113-
command="curl -X POST -H 'Content-type: application/json' --data '{\"text\":\" " + str(t) + "\"}' " + str(hook) + " &> /dev/null"
114-
os.system(command)
113+
import json
114+
data = json.dumps({"text": " " + str(t)})
115+
subprocess.run(["curl", "-X", "POST", "-H", "Content-type: application/json", "--data", data, str(hook)],
116+
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
115117

116118
# A fallback solution to getting all child procs
117119
# in case psutil has problems (PermissionError).

0 commit comments

Comments
 (0)