summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/StoredUserConfig.java
Commit message (Collapse)AuthorAgeFilesLines
* fix: Fix StoredUserConfig not escaping control charactersFlorian Zschocke2022-03-131-3/+42
| | | | | | | | | | | | | | | | | The `StoredUserConfig` only escaped the escape character, i.e. backslash. But it does not escape control characters like tab or newline. This introduces a vulnerability where an attacker can create new entries in their user account and create new accounts. In addition, other characters are also not properly handled. Field values with a comment character need to be quoted. This only happens for the `#` character and only when the value starts with it. Also the quote is note escaped in values. This change completely rewrites the `escape` method of `StoredUserConfig`. It takes care of properly escaping characters that need escaping for the git configuration file format. This fixes #1410
* fix: Fix StoredUserConfig handling null subsectionsFlorian Zschocke2022-03-131-2/+7
| | | | | | | | | | Te `StoredUserConfig` did not handle sections without a subsection. When the subsection did not exist, i.e. was `null`, then the subsection name would be set to the string "null". This is not how the config file format works. It should create a `[SECTIONNAME]` entry instead. This fix handles a `null` subsection correctly, by handling it as a section without a subsection.
* Fix: Make CPU hog fix Java 7 compatibleFlorian Zschocke2021-07-141-7/+22
| | | | | | | | The last fix for the stored config merged from Curly060 used Java8-isms. In order to be able to include this fix in the next release, which will be for 1.9, I have converted this to be compatible with Java 7. Also, a file header was added to place it under APL.
* bugfix: fix CPU hog bug in config saveIngo Lafrenz2021-07-051-0/+172