Skip to content

fix: sanitize shell/subprocess call in analyze_git_stats.py (CWE-78) - #2593

Open
anupamme wants to merge 1 commit into
didi:masterfrom
anupamme:fix-repo-mpx-cwe-78-git-stats-arg-validation
Open

anupamme wants to merge 1 commit into
didi:masterfrom
anupamme:fix-repo-mpx-cwe-78-git-stats-arg-validation

Conversation

@anupamme

Copy link
Copy Markdown

The analyze_git_stats.py script constructs a git command using subprocess.Popen with user-controlled arguments (--since and --until) passed directly to the command list. While the code uses shell=False (list form), the values from argparse are inserted directly into the command array without validation. An attacker can inject shell metacharacters or command separators through these arguments, which could be interpreted by git if the values contain special characters that git interprets as part of its own command parsing. The affected code is analyze_git_stats.py:35. This change is the fix I would apply.

Reference: CWE-78

What changed

  • analyze_git_stats.py

Verification

No automated check could be run against this repository, so this change is unverified beyond review. Please treat it as a suggestion.


Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security

This branch has not been deployed

No deployments
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