Skip to content

Potential fix for code scanning alert no. 12: Uncontrolled command line - #732

Merged
mrzt721010 merged 1 commit into
mainfrom
Security
Sep 2, 2026
Merged

Potential fix for code scanning alert no. 12: Uncontrolled command line#732
mrzt721010 merged 1 commit into
mainfrom
Security

Conversation

@mrzt721010

@mrzt721010 mrzt721010 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Use strict allowlisting for user-selectable file arguments before appending to cmd.
Best fix here (without changing behavior materially): normalize to basename and only allow known-safe .txt names from a predefined set (or at minimum from a tight pattern plus basename enforcement). This blocks path tricks and arbitrary file selection while preserving existing API behavior for valid values.

In web/app.py, in start_attack():

  • Add a constant allowlist (e.g., ALLOWED_LIST_FILES) near other constants.
  • For proxylist, amp_file, and proxy_file, accept only values present in this allowlist; otherwise use safe defaults / skip optional arg.
  • Keep existing numeric/method/target validation and Popen(..., shell=False) behavior unchanged.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@mrzt721010
mrzt721010 marked this pull request as ready for review September 2, 2026 15:19
@mrzt721010
mrzt721010 merged commit af116ec into main Sep 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant