Skip to content

Commit 04f141d

Browse files
authored
Merge pull request #11 from BetterMint/alert-autofix-8
Potential fix for code scanning alert no. 8: Reflected server-side cross-site scripting
2 parents 70f073d + 7d66557 commit 04f141d

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)