-
-
Notifications
You must be signed in to change notification settings - Fork 977
Comparing changes
Open a pull request
base repository: gitpython-developers/GitPython
base: 3.1.48
head repository: gitpython-developers/GitPython
compare: 3.1.49
- 8 commits
- 8 files changed
- 2 contributors
Commits on Apr 28, 2026
-
reject control chars in written values in configuration
Reject CR, LF, and NUL in GitConfigParser values before writing them to git config files (which also is a deviation from Git which escapes them). GitConfigParser._write() serializes embedded newlines as indented continuation lines by replacing "\n" with "\n\t". Git itself skips leading whitespace before parsing config tokens, so an injected value such as: foo [core] hooksPath=/tmp/hooks is written in a form where the indented "[core]" line is still parsed by Git as a real section header. This lets attacker-controlled input passed to config_writer().set_value() poison repository config, including core.hooksPath, and redirect hook execution for later Git operations. Fail closed instead of stripping or normalizing these characters. Silent normalization can hide unsanitized caller input, and GitPython does not currently round-trip Git-style escaped values such as "\n" as embedded newlines. Apply the validation to set_value(), add_value(), and the public set() path so callers cannot bypass the safer helper API. Add regression tests for the advisory payload and for CR, LF, NUL, and bytes values. This preserves existing read behavior for config files that already contain multiline values while preventing GitPython from writing new unsafe values. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>Configuration menu - View commit details
-
Copy full SHA for c417af4 - Browse repository at this point
Copy the full SHA c417af4View commit details -
avoid duplicate validation in set_value
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Configuration menu - View commit details
-
Copy full SHA for 8e24503 - Browse repository at this point
Copy the full SHA 8e24503View commit details -
Improve pure Python rev-parse coverage and behavior (#2135)
Port object-resolving revspec cases inspired by gix-revision into deterministic GitPython tests, without shelling out to Git or Gix at runtime. Refactor rev_parse handling around anchors, navigation, peeling, reflog selectors, path/index lookups, describe-style names, and commit-message searches. Document observed Git/Gix behavior differences and the GitPython choices made for user-facing compatibility. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Configuration menu - View commit details
-
Copy full SHA for d7ce6fc - Browse repository at this point
Copy the full SHA d7ce6fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for bdbdf4b - Browse repository at this point
Copy the full SHA bdbdf4bView commit details -
Merge pull request #2137 from gitpython-developers/fix-config-injection
reject control chars in written values in configuration
Configuration menu - View commit details
-
Copy full SHA for b049a13 - Browse repository at this point
Copy the full SHA b049a13View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6cf7ac3 - Browse repository at this point
Copy the full SHA 6cf7ac3View commit details
Commits on Apr 29, 2026
-
Merge pull request #2136 from gitpython-developers/copilot/create-rep…
…roducing-test-fix Improve pure Python rev-parse coverage and behavior
Configuration menu - View commit details
-
Copy full SHA for 1c4ea96 - Browse repository at this point
Copy the full SHA 1c4ea96View commit details -
Configuration menu - View commit details
-
Copy full SHA for aee2fd5 - Browse repository at this point
Copy the full SHA aee2fd5View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 3.1.48...3.1.49