fix: validate config section delimiters · gitpython-developers/GitPython@ecd6844 · GitHub
Skip to content

Commit ecd6844

Browse files
codexByron
andcommitted
fix: validate config section delimiters
GHSA-3rp5-jjmw-4wv2 identified that configuration section names could alter the structure of serialized config despite the existing control-character checks. Reject unquoted closing section delimiters across all writer entry points while preserving valid delimiters inside quoted subsections and the existing option-name behavior. Add regression coverage for unsafe plain and quoted-subsection-shaped names as well as a valid quoted subsection. Git baseline: a23bace963d508bd96983cc637131392d3face18. Git config parsing treats an unquoted closing bracket as the end of a basic section header, while its extended form permits brackets inside a quoted subsection and requires a final bracket after the closing quote. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
1 parent 5bc2560 commit ecd6844

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

git/config.py

Lines changed: 12 additions & 0 deletions

test/test_config.py

Lines changed: 41 additions & 0 deletions

0 commit comments

Comments
 (0)