---
layout: post
title: "XSS in ViewVC"
thumbnail: bug-in-viewvc-480.png
date: 2023-02-15
---
I found a cross-site scripting (XSS) vulnerability in ViewVC, a source code repository web frontend.
ViewVC is a Python webapp to browse code repositories. It supports CVS and SVN, which people used when git didn't exist yet. I found a simple HTML injection vulnerability in it. When browsing a source code repository, it shows filenames of files. If the filename contains HTML tags, these are not encoded correctly. The browser interprets these as HTML, and this leads to XSS.
## Getting to the source
I actually started searching for vulnerabilities in Tuleap, which is a code management suite with a repository browser and issue tracker. I found a XSS vulnerability in its page that shows Subversion repositories. However, the source code showed that they forwarded requests to ViewVC. So I tested whether I could reproduce the bug in ViewVC, and I could.
## XSS payloads
Here, I used the following payload as filename:
XSS
The most obvious XSS payload is ``. Sometimes this works a little too well, and keeps showing popups on every page you visit. This is pretty annoying when you want to test more of the application, so now I usually use a payload that needs some user interaction to trigger.
Using tags that change the layout of the page also give a visual indicator when HTML tags are interpreted, but the JavaScript is stripped from the input. I am also a big proponent of using the `