--- layout: post title: "XSS in username in Sakai" thumbnail: sakai-xss-480.png date: 2019-12-04 --- Sakai is educational software, to keep track of classes, students and test marks. ## Introduction Some applications are riddled with XSS, because they don't have a structural prevention in place. If you have to call `htmlentities` for every output, you are going to forget a couple of places, which directly leads to XSS. A better solution is to have a templating system that escapes content by default. Sakai does have such a templating system, so in most places the user input is correctly escaped. However, I found one place that doesn't correctly escape input. ## XSS in first name The username or given name of the user is always an interesting place to try XSS payloads, since it is displayed on many places and is often considered "trusted" by the application developers. Sakai prevents the most straightforward XSS payloads through input sanitation. HTML tags are removed from the user input. So when inputting `