Post

Webverselabs Canal Cove Books Challenge XSS

Webverselabs Canal Cove Books Challenge XSS

Scenario :

Canal Cove Books is a neighborhood used-book shop with a search over 40,000 titles. The owner added “security” — strip script, strip on*= handlers. He reads Hacker News now. The one thing he didn’t account for is that not every way to run JavaScript looks like a script tag or an event handler.

Solution :

image

We first start by exploring the app and navigating it just like a normal user would, check different endpoints , submit forms , just discovering normal workflow of the app.

/Front Page :

image

This is just a static web page that is returned to us everytime we visit the Dashboard .

/Visits :

image

Another static web page, nothing to work with here .

/Staff Picked !

image

Same thing , nothing useful on it .

/Find Request :

image

This looks more interesting since we are able to submit a form , we might try to inject something into it and hope for the best :)

But first let’s send a normal request and see what we get back :

image

We don’t really get anything reflected back to us other than the name, for now let’s try injecting a simple XSS payload to see :

1
<script>alert(window.origin)</script>

image

If we submit it :

image

We get nothing back , not even the name, this is normal since most apps will block script tags ( it is also mentionned in the description : “The owner added “security” — strip script” ….)

We can try other payloads that don’t contain script :

1
<img src="" onerror=alert(window.origin)>

image

The JS code doesn’t execute but at least now we can see our comment , Progress :)

image

Looking at Burp, we see that Onerror got filtered as well .

We can try and use a different one , we can use Port Swigger XSS cheat sheet to generate a payload that doesnt contain script nor onerror , we already know img is allowed .

1
https://portswigger.net/web-security/cross-site-scripting/cheat-sheet

image

I tried them but apparently it blocks all events handlers not just onerror .

Now Searching for XSS Filter Bypasses we find Plenty that we can use :

1
https://cheatsheetseries.owasp.org/cheatsheets/XSS_Filter_Evasion_Cheat_Sheet.html

image

But the one that worked for me was this one :

1
<svg/onload=alert('XSS')>

image

Once we submit it :

image

Perfect , now upon triggering the XSS we should get our flag right after :

image

That was all for this challenge, see you in the next one :)

This post is licensed under CC BY 4.0 by the author.