Root cause
Validation & fail-open logic
This setter validates the value before passing section and option names through unchanged.
How AI contributed: Flawed AI-written codePublished May 6, 2026 in
gitpython-developers/gitpythonAll 8 findings in this repository
Provisional finding. Full causal and release verification remains incomplete.
Root cause
This setter validates the value before passing section and option names through unchanged.
Fix
The repaired setter validates both section and option names before writing configuration.
Case facts
@@ -885,5 +895,13 @@+ section: str,+ option: str,+ value: Union[str, bytes, int, float, bool, None] = None,+ ) -> None:+ if value is not None:+ value = self._value_to_string_safe(value)+ return super().set(section, option, value)+ @needs_values @set_dirty_and_flush_changes def set_value(self, section: str, option: str, value: Union[str, bytes, int, float, bool]) -> "GitConfigParser": """Set the given option in section to the given value. @@ -894,10 +902,12 @@ self, section: str, option: str, value: Union[str, bytes, int, float, bool, None] = None, ) -> None:+ self._assure_config_name_safe(section, "section")+ self._assure_config_name_safe(option, "option") if value is not None: value = self._value_to_string_safe(value) return super().set(section, option, value) @needs_valuesAI-assisted change e4e0f238db6f6504f0cf2c93d3baa55d245c44090cf93ce016aa0b878ac5c177 · Fix c374aca795beb615895e583f35b8cc1fd7343e6b48ea021528d1b5fb2c3c5227