In this walk through, we will be going through the Cross Site Scripting Stored (Blog) vulnerability section from bWAPP Labs. We will be exploring and exploiting Stored Cross Scripting vulnerability in Blog implementations and learn how application are affected because of it. So, let’s get started with the Hacking without any delay.

Table of Contents
Security: Low
- Setting the security level to Low.

- The application has a typical blog comments structure where users can submit entries to the blog. It uses a Post request for this to xss_stored_1.php file.

- I test the application for the XSS vulnerability with the below payload. As per the output it confirms that the application is parsing our HTML heading tag instead of taking as literal string and then saving it to its DB.
<h1> Test </h1>

- Next to exploit the vulnerability, i used the below payload. It saves into the DB and executes automatically whenever a user visit the entry page.
<img src='x' onerror=alert("Hacked")>


Security: Medium
- Setting the security level to Medium.

- I used the below payload and it confirmed the XSS vulnerability.
<h1> Test </h1>

- I used the below payload to exploit the XSS like the previous level but it didn’t worked as the application is adding slashes to the strings.
<img src='x' onerror=alert("Hacked")>


- Next, i used the below payload to pop-up an alert.
<img src='x' onerror=alert(1)>


- Not working in high level due to HTML addslashes.
Also Read: bWAPP – Cross Site Scripting Reflected (Login Form)
Conclusion:

So, we finally completed all the security levels for the bWAPP Cross Site Scripting Stored (Blog) 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. Stored-XSS attacks can be mitigated by performing input sanitization on endpoints, whitelist the allowed characters in the input and using a WAF. Along with that, we can prevent data from any untrusted source to be dynamically written to the HTML document. On that note, i will take your leave and will meet you in next one with another bWAPP vulnerability writeup, till then “Keep Hacking”.