Commit ecd6844
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
900 | 912 | | |
901 | 913 | | |
902 | 914 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
197 | 238 | | |
198 | 239 | | |
199 | 240 | | |
| |||
0 commit comments