Skip to main content

[PHP] Rujukan Untuk Penyelesaian Masalah Serangan CSRF

Setiap kali membuat projek yang membuka aksesnya kepada orang awam, pasti akan "terdedah" dengan pelbagai jenis serangan siber.

Antaranya;
Cross-site scripting dan Cross Site Request Forgery (CSRF)

Entri ini lebih kepada penyelesaian CSRF.

Hasil carian di internet, beberapa penyelesaian ini (dan penduan untuk pemahaman) mungkin sesuai untuk dirujuk.

  1.  http://shiflett.org/articles/cross-site-request-forgeries
  2.  https://gist.github.com/ziadoz/3454607
  3. http://resources.infosecinstitute.com/fixing-csrf-vulnerability-in-php-application/ 
  4. https://www.sitepoint.com/preventing-cross-site-request-forgeries/ 
  5. http://stackoverflow.com/questions/6287903/how-to-properly-add-csrf-token-using-php 

Comments

Popular posts from this blog

To list program/subchannel under a channel

--php opening-- //get all program/sub-channel function getAllProgramsUnderThisChannel($channelCodeOrID) { $ids = array(); $channel = new mxChannel; $channel->getBy(array('id' => $channelCodeOrID, 'code' => array($channelCodeOrID, '=', 'OR'))); $programs = $channel->getAllPrograms(); foreach($programs as $program) { $ids[] = $program->code; } $subchannels = $channel->getAllChildChannels(); foreach($subchannels as $subchannel) { $tids = $this->getAllProgramsUnderThisChannel($subchannel->id); $pids = array_merge($ids, $tids); $ids = $pids; } return $ids; } --php closing--

[MXAE] How to DELETE a record

Delete a record using MXAE-API function deleteOneRecord($programCodeOrID, $recId) { $delete = false; $program = new mxProgram; $program->getBy(array('id' => $programCodeOrID, 'code' => array($programCodeOrID, '=', 'OR'))); $ac = $program->getArticle($recId); $delete = $ac->del(); //echo $ac->client; return $delete; }