DoS on wiki page: uneditable pages
A wiki page title containing a tilde character was expanded to an absolute filesystem path, causing the page to be stored outside the normal wiki directory. The page could then not be edited or deleted through the web interface, creating a denial of service.
GitLab
Originally disclosed on GitLab
- Fixed in 2 months
- Disclosed after 2 months
HackerOne report #907260 by yvvdwf on 2020-06-24:
Dear team,
I found a similar bug as the one in being reported here with the same impact: once being created, the page cannot be modified or deleted via website's interface.
Steps to reproduce
- Create a new wiki page.
- In the Title filed, fill
~/test - Content can be anything
- Click
Create pagebutton
The page being created has the path var/opt/gitlab/test (instead of ~/test). The page cannot be neither modified, nor deleted via web's interface.
Impact
What is the current bug behavior?
The tile character ~ is translated into /var/opt/gitlab
What is the expected correct behavior?
The tile character should not be translated
Output of checks
This bug happens on GitLab.com
Impact
Once being created, the wiki page cannot be neither modified, nor deleted via web's interface.
Todo
- Security fix in Gitaly: https://gitlab.com/gitlab-org/security/gitlab/-/issues/207
- Fix in upstream
gollum-libgem: https://github.com/gollum/gollum-lib/pull/385 - Fix in forked
gitlab-gollum-libgem
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the wiki library expanded the tilde character in the page title to the user's home directory path, allowing the page to be written outside the intended wiki storage location.
Impact
Once created, the wiki page cannot be modified or deleted through the web interface, causing a denial of service for that page.
What the attacker needed
Access to create wiki pages
The fix
The tilde character should not be translated to a filesystem path; a security fix was applied in Gitaly and an upstream fix was made in the gollum-lib gem, with a fix in the forked gem still pending.
How it was found
- Create a new wiki page.
- In the Title field, enter a title starting with a tilde.
- Enter any content.
- Click the Create page button.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you create a wiki page, the title is used to decide where the page file is saved. If the title contains a special character like a tilde, the system may treat it as a shortcut to a folder on the server. This report shows that a page could be saved in an unexpected place, making it impossible to edit or delete later.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.