Mutillidae - Cascading Style Injection (Set Background Color)

Mutillidae – Cascading Style Injection (Set Background Color)

In this walk through, we will be going through the Cascading Style Injection (Set Background Color) vulnerability section from Mutillidae Labs. We will be exploring and exploiting CSS Injection in Set Background color utility and learn how application are affected because of it. So, let’s get started with the Hacking without any delay.

Cascading Style Injection (Set Background Color)

Security Level: 0 (Hosed)

  • Setting the security level to 0 or Hosed.

Security level 0

  • The application has a set background color functionality which uses CSS and requires a color code in Hex to set it in the background of container. Below that it also shows the current color which has been set.

Set Background color

  • I used the below payload to save our script in the current background color value. Whenever a user visit this page, the payload will be executed automatically and a pop-up will be generated.

<img src=x onerror=alert("Hacked")>;

Injecting payload

Hacked pop up alert

Also Read: Mutillidae – Blind SQL via Timing (User Lookup)



So, we finally completed all the security levels for the Cascading Style Injection (Set Background Color) Vulnerability. We looked into the various ways how application has been set up in various levels and how we can bypass the security controls implemented. Next, we can mitigate the potential CSS Injection attacks by performing input sanitization and using CSP Header (Content-Security-Policy) which prevent browsers from executing malicious code on the website. On that note, i will take your leave and will meet you in next one with another Mutillidae vulnerability writeup, till then “Keep Hacking”.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top