Answer the question
In order to leave comments, you need to log in
XSS bypassing sprintf (Assignment from CTF, no bullshit)?
DISCLAIMER: Quest from CTF. There is no bullshit or malicious intent here.
There is a line of PHP code with the following content
echo sprintf('<form action="%s" method="post">', $_SERVER['PHP_SELF']).PHP_EOL;
Answer the question
In order to leave comments, you need to log in
Just append to the URL
Man, sprintf stupidly inserts the value into the string. It doesn't escape in any way. It would be possible to make simply concatenation. Nothing would have changed.
/"><script>alert(1);</script>
sprintf - a function for formatting strings, what does data filtering have to do with it? it can be omitted altogether.
echo "<form action=\"$_SERVER['PHP_SELF']\" method=\"post\">";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question