Welcome Guest, Not a member yet? Register   Sign In
multiple csrf token in one page using jquery codeigniter 3.x
#1

(This post was last modified: 02-14-2024, 09:00 AM by nasakh.)

Hello everyone,
i read about csrf problem with ajax or even jquery forms but i did not found anything relative about this
i have a website witch uses like 10 jquery post like this in one page
Code:
                $.post("/controller_api/add_video_to_playlist",{video_id:'<?=$details[0]->id;?>',playlist_id:$("#selected_playlist_id").val(),<?php echo $this->security->get_csrf_token_name(); ?>:'<?php echo $this->security->get_csrf_hash(); ?>'}).done(function(result){


its doing just fine when there is only one form in the page
but in pages that there are like 10 of them for saving actions that user makes, there is only one token for all of them and none of them gets done like every time i get 403 but like in my login page its doing just fine
so here is the question

Quote:how should i create multiple csrf tokens in one page and why none of them works while i think one of them should work at least for one time, and why in the page witch has only one form it works fine, also if you are thinking about getting new csrf in response and updating other forms with new one there is a security problem with that, attackers can get one csrf and spam it with no problem bcuz they get new csrf after submitting first one and on and on ...
Reply


Messages In This Thread
multiple csrf token in one page using jquery codeigniter 3.x - by nasakh - 02-14-2024, 12:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB