GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — fix: validate config section delimiters by Byron · Pull Request #2176 · gitpython-developers/GitPython Conversation
|
| File | Description |
|---|---|
git/config.py |
Implements Git-grammar parsing, canonical section validation, and canonical escaping for config writes. |
test/test_config.py |
Adds/updates tests covering Git-grammar parsing, delimiter rejection, and writer round-trip behavior. |
test/fixtures/git_config_with_quotes_escapes |
Adjusts fixtures to reflect supported escape handling and remove invalid cases. |
test/fixtures/git_config_multiple |
Updates option naming in fixture to comply with stricter Git-grammar option rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
a89ad71 to
ecd6844
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
git/config.py:911
user"] [other" (quote not preceded by whitespace) would be treated as having a quoted ] and pass validation, even though they are not a valid Git quoted-subsection form (<section> "<subsection>"). Tighten the logic so ] is only allowed inside a quoted subsection that starts after whitespace, and reject quotes outside that form (or at least don’t let them suppress the ] check). elif in_quotes and char == "\\":
escaped = True
elif char == '"':
in_quotes = not in_quotes
elif char == "]" and not in_quotes:
raise ValueError("Git config section names must not contain an unquoted closing bracket")
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
9bee003 to
aa4c700
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 <[email protected]>
aa4c700 to
1ed1b92
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.