Skip to content

Potential fix for code scanning alert no. 9: Uncontrolled command line - #4

Merged
Rootless-Ghost merged 1 commit into
masterfrom
alert-autofix-9
Apr 13, 2026
Merged

Potential fix for code scanning alert no. 9: Uncontrolled command line#4
Rootless-Ghost merged 1 commit into
masterfrom
alert-autofix-9

Conversation

@Rootless-Ghost

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/Rootless-Ghost/AtomicLoop/security/code-scanning/9

Use strict input normalization right before building ps_args in core/event_collector.py:

  • Validate/normalize start_time_iso by parsing as ISO8601 datetime (accepting Z), then re-serializing to canonical UTC ISO format.
  • Constrain max_per_channel and timeout to safe integer ranges.
  • Keep the existing allowlist for log_sources (already good).
  • Pass only normalized values into ps_args.

Best single fix without changing functionality: update _query_wel(...) in core/event_collector.py to sanitize all runtime parameters used in the subprocess argument vector. No new dependencies are required; use existing datetime import and built-in casting/range checks.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Rootless-Ghost
Rootless-Ghost marked this pull request as ready for review April 13, 2026 14:49
@Rootless-Ghost
Rootless-Ghost merged commit 43355e1 into master Apr 13, 2026
6 checks passed
@Rootless-Ghost Rootless-Ghost self-assigned this Apr 13, 2026
@Rootless-Ghost
Rootless-Ghost deleted the alert-autofix-9 branch April 13, 2026 14:50
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