PDA

View Full Version : CSRF protection error when security token is being submit.


Kyojii
04-06-2012, 01:05 AM
My form below is giving me a CSRF protection error but the security key is being submit with the form, so it shouldn't. I've checked the DOM and the security key is being put in the value field correctly.

<form action="newindex.php?do=submit" method="post">
Subject:<br>
<input type="text" id="subject" name="subject"><br>
<textarea id="article" id="article" name="article"><?php echo $_POST['article'] ?></textarea><br>
<div class="sliderimage"><h2 class="blockhead">Slider Image:</h2>
<table><tr><td><b>Image:</b><br>Dimensions should be 640x360.</td><td>
<input type="file" id="image" name="image"></td></tr>
<tr><td><b>Transition:</b></td><td>
<select id="transition" name="transition">
<option value="">Random</option>
<option value="sliceDown">slideDown</option>
<option value="sliceDownLeft">sliceDownLeft</option>
<option value="sliceUp">sliceUp</option>
<option value="sliceUpLeft">sliceUpLeft</option>
<option value="fold">fold</option>
<option value="fade">fade</option>
<option value="slideInRight">slideInRight</option>
<option value="slideInLeft">slideInLeft</option>
<option value="boxRandom">boxRandom</option>
<option value="boxRain">boxRain</option>
<option value="boxRainReverse">boxRainReverse</option>
<option value="boxRainGrow">boxRainGrow</option>
<option value="boxRainGrowReverse">boxRainGrowReverse</option>
</select></td></tr>
<tr><td><b>Caption:</b></td><td>
<input type="text" id="caption" name="caption"></table><br></div>
<input type="hidden" name="securitytoken" value="<?php echo $bbuserinfo[securitytoken] ?>" />
<div class="center"><input type="button" value="Preview" class="preview"><input type="submit" name="submit"></div>
</form>

Zachery
04-06-2012, 02:03 AM
CSRF is not directly related to the security token. It sounds like you're submitting data from a domain that isn't the same as the domain vbulletin is on.

Kyojii
04-06-2012, 02:38 AM
This page is submitting to itself...

Zachery
04-06-2012, 03:04 AM
Is your page, within the same domain as vBulletin though?

Pandemikk
04-06-2012, 03:08 AM
Is your page, within the same domain as vBulletin though?
Come on Zach...

He's missing the security token hidden field.

nvm no he's not :D

Kyojii
04-06-2012, 03:15 AM
Is your page, within the same domain as vBulletin though?

Yes.

Fixed it, thanks anyway. ^^