PHP GET or POST security -


good morning. i'm taking exam later today on web development. pretty confident of exam, looking on past paper came across question:

b) developer decides use http get send user message message board system. explain potential security threats , discuss how overcome them. note should consider two situations:

  1. http must used.
  2. http changed. (15 marks)

i know post , get, i'm not sure able discuss in enough detail achieve 15 marks.

this attempt of me answering question, if suggestions can made in attempt direct me in correct direction, appreciated:

get insecure, if message private message data sensitive , therefore should not used unless added security included. display user message in url allowing view this, looking on shoulder etc. post nature more secure, not show message in url , instead adds http header, secure if http protocol secure , encryption should considered sensitive data.

if suggest written in response question, appreciated!

thanks

when talking security there several levels. using or post not live or dead type of choice, definitly usefull make distinction between two.

as name suggests, get ment retrieve information , post used send information. if keep in mind, it's not hard know method use.

in case user posting new message message board. post right answer. reason post more secure this, requires specific action user or javascript. cannot send link via email , directly make post new message. if use get send link http://www.example.com/postmessage.php?message=post%20me , if click it, post it.

now if message board secured username password, , logged in, have posted on behalve get request , nobody know wasnt realy you. potential security risk.

now if send mail link, still need click it. consider allowed post images on same message forum. post image myself <img src='/postmessage.php?message=post%20me' width='0' height='0'/> , every user visits post post message, since your/their browser tries get image , have again posted on behalf.

now if post javascript, make post request. posting javascript lot less common.

another side effect of get request searchengines spider , potentially create messages aswell.

and last: request limited. if want post large message, need post. see what maximum possible length of query string? lot of detail query string length. reach maximum get.

now these security issues cannot solved using post instead of get , require more effort on serverside code. first step use proper method.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -