-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
topic/securitySomething leaks user information or is otherwise vulnerable. Should be fixed!Something leaks user information or is otherwise vulnerable. Should be fixed!
Description
- Gitea version (or commit ref): 1.5.0+rc1-94-g819f50ccd
- Git version: nevermind
- Operating system: nevermind
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io: probably (currently down "bad gateway")
- Yes (provide example URL)
- No
- Not relevant
- Log gist:
Description
Create README.md or other markdown file containing a link to some gitea API endpoint:
[I might be a misleading, yet harmless looking link. Click me to learn more](/user/logout)
Problem
API endpoints are normal GET requests, not protected by auth (normal session id used).
Markdown is rendered in normal (non-sandboxed) DOM.
Potential solutions
- sanitize URLs (do not allow relative or absolute links to API endpoints; if so, regex search'n'replace can for example fill with zero-width/invisible unicode whitespace, or just strike it through),
- sandbox markdown rendered DOM in iframe with sandbox attribute set (and remove session cookie from outside using JavaScript),
- Enforce CSRF for all API endpoints.
ideally all three
Metadata
Metadata
Assignees
Labels
topic/securitySomething leaks user information or is otherwise vulnerable. Should be fixed!Something leaks user information or is otherwise vulnerable. Should be fixed!