bWAPP - Cross Site Scripting Stored (Blog)

bWAPP – Cross Site Scripting Stored (Blog)

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.

Cross Site Scripting Stored (Blog)

Security: Low

  • Setting the security level to Low.

Security level 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.

XSS - Stored (Blog)

  • 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>

HTML Injection confirmed

  • 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")>

Payload

Hacked pop up alert

Security: Medium

  • Setting the security level to Medium.

Security level Medium

  • I used the below payload and it confirmed the XSS vulnerability.

<h1> Test </h1>

HTML Injection

  • 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")>

Payload

Page Source Code

  • Next, i used the below payload to pop-up an alert.

<img src='x' onerror=alert(1)>

Payload

XSS pop up alert

  • Not working in high level due to HTML addslashes.

Also Read: bWAPP – Cross Site Scripting Reflected (Login Form)

Conclusion:

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”.

Leave a Comment

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

Scroll to Top