Skip to content

Commit cde2ac8

Browse files
Potential fix for code scanning alert no. 16: Uncontrolled data used in path expression
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent cd59a1a commit cde2ac8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wifite/attack/portal/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ def _serve_error_page(self):
189189
def _serve_static_file(self, path):
190190
"""Serve static files (CSS, images, etc.) with caching optimization."""
191191
try:
192-
# Remove /static/ prefix
193-
file_path = path[8:] # Remove '/static/'
192+
# Remove /static/ prefix and ensure a relative path
193+
file_path = path[8:].lstrip('/\\') # Remove '/static/' and any leading separators
194194
filename = os.path.basename(file_path)
195195

196196
# Try to get cached static file from server instance

0 commit comments

Comments
 (0)