Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix command injection #1518

Merged
merged 3 commits into from
Dec 22, 2022
Merged

Commits on Dec 21, 2022

  1. Fix command injection

    Add `--` in some commands that receive user input
    and if interpreted as options could lead to remote
    code execution (RCE).
    
    There may be more commands that could benefit from `--`
    so the input is never interpreted as an option,
    but most of those aren't dangerous.
    
    Fixed commands:
    
    - push
    - pull
    - fetch
    - clone/clone_from and friends
    - archive (not sure if this one can be exploited, but it doesn't hurt
      adding `--` :))
    
    For anyone using GitPython and exposing any of the GitPython methods to users,
    make sure to always validate the input (like if starts with `--`).
    And for anyone allowing users to pass arbitrary options, be aware
    that some options may lead fo RCE, like `--exc`, `--upload-pack`,
    `--receive-pack`, `--config` (gitpython-developers#1516).
    
    Ref gitpython-developers#1517
    stsewd committed Dec 21, 2022
    Configuration menu
    Copy the full SHA
    fbf9c7e View commit details
    Browse the repository at this point in the history
  2. Fix CI

    stsewd committed Dec 21, 2022
    Configuration menu
    Copy the full SHA
    3c51865 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2022

  1. Add test

    stsewd committed Dec 22, 2022
    Configuration menu
    Copy the full SHA
    7918fcc View commit details
    Browse the repository at this point in the history