Skip to content

Commit c79a26f

Browse files
Potential fix for code scanning alert no. 6: Log Injection
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 4585adb commit c79a26f

File tree

1 file changed

+2
-1
lines changed
  • netbox-event-driven-automation-flask-app

1 file changed

+2
-1
lines changed

netbox-event-driven-automation-flask-app/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def post(self):
9090
except:
9191
webhook_json_data = {}
9292

93-
logger.info("{}".format(webhook_json_data))
93+
sanitized_data = json.dumps(webhook_json_data).replace('\n', '').replace('\r', '')
94+
logger.info("User-provided data: {}".format(sanitized_data))
9495

9596
if not webhook_json_data or "model" not in webhook_json_data or "event" not in webhook_json_data:
9697
return {"result":"invalid input"}, 400

0 commit comments

Comments
 (0)