Skip to content

fix: correct process error handling and git security issues#428

Closed
ivan-aksamentov wants to merge 6 commits intomasterfrom
fix/script-bugs
Closed

fix: correct process error handling and git security issues#428
ivan-aksamentov wants to merge 6 commits intomasterfrom
fix/script-bugs

Conversation

@ivan-aksamentov
Copy link
Copy Markdown
Member

Fix bugs and security issues in the Python build scripts: process error detection no longer treats stderr output as failure, git helper functions no longer execute commands at import time, shell-interpolated values use shlex.quote() to prevent injection, a leaked file handle uses a context manager, and broken string utility functions are removed.

  • Use only returncode (not stderr presence) to determine subprocess failure
  • Defer getcwd() and git commands from default arguments to function body
  • Use shlex.quote() for all shell-interpolated values in git helpers
  • Use context manager for file handle in tree JSON minification
  • Remove broken append/prepend functions from string utilities

- Remove `or res.stderr` condition that treated any stderr output as error
- Fix unbound `message` variable in `error_if_empty` path
- `prepare_paths_args`, `git_get_dirty_files`, `git_dir_is_clean` now default to `None` and resolve `getcwd()` at call time
- `git_get_modified_files` now defaults to `None` and resolves git hashes at call time
- Prevents git commands and filesystem calls from running at module import time
- Replace manual quoting with shlex.quote() in git_commit and github_create_release
- Prevents shell injection through commit messages, version strings, repo names
@ivan-aksamentov ivan-aksamentov deployed to refs/pull/428/merge March 6, 2026 13:16 — with GitHub Actions Active
@ivan-aksamentov ivan-aksamentov deleted the fix/script-bugs branch March 6, 2026 13:21
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.

2 participants