Skip to content

Commit 7d66557

Browse files
Potential fix for code scanning alert no. 8: Reflected server-side cross-site scripting
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 70f073d commit 7d66557

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

BetterMITM/tools/web/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,9 +1199,11 @@ def get(self, flow_id):
11991199
if not addon:
12001200
raise APIError(404, "Advanced interceptor addon not found")
12011201

1202+
# Only allow printable/safe string characters in flow_id
1203+
sanitized_flow_id = re.sub(r'[^a-zA-Z0-9_\-]', '', str(flow_id))
12021204
state = addon.get_flow_state(flow_id)
12031205
self.write({
1204-
"flow_id": flow_id,
1206+
"flow_id": sanitized_flow_id,
12051207
"state": state,
12061208
"intercepted": self.flow.intercepted,
12071209
"killable": self.flow.killable,

0 commit comments

Comments
 (0)