Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: PHP PostData security

date posted 29th May 2007 11:43

Thank you Dai - nail on the head!

The original post was...

"I was informed recently of a security risk with post data submitted from
forms in PHP. I was told that if a message is displayed asking the user to
resend data when the page is refreshed then the website is potentially
insecure.

First of all does anyone know if this is really a risk and if so would the
above solution have eliminated that risk?"

Given the feedback, Dai is right in what I was attempting (rather poorly it
seems) to convey - the route from general to specific answer was rather
circuitous. The subject is both multi-faceted and complex.

In summary, what was ultimately referred to as the MVC pattern to approach
(separation of logic) was to enable most developers to kill web page
security issues, whether by URL or form field injection. At the same time it
removed the Postdata message and dealt with the page refresh and submit
problem. Yes, same page form processing can be done by programmers who are
both knowledgeable and accurate in covering all angles but that approach can
still leave the Postdata message and page refresh and submit problem.

I particularly agree with Ben's last post on the subject. All I would add is
that my processing pages always clear $_GET, $_POST, $_REQUEST variables
once parsed, if necessary instantiating an object to retain values.

It has been an interesting thread and one enabling me to take account of
some issues in a tutorial I am writing on the subject. I have learned to
emphasise and clarify definitions and differences as regards subjects like
MVC, RPC and the use of $_SESSION only for passing of return values.

I remain confident of the n-tier approach I use. Not only does it resolve
niggling issues like Postdata messages and security issues but opens doors
to use threading, efficient use of factory classes, "parallel tiers" (Web
services for example), and the building of consistently reusable libraries.
Most of all it enables me to have short, clear, object pages for specific
parts of the development thus making it easier for code maintainance and
upgrade. More of that another time!

Thanks for the thread James!

Mike A.


----- Original Message -----
From: "Dai Williams" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Monday, May 28, 2007 8:51 PM
Subject: RE: FN-FORUM: PHP PostData security


>
> Mike A wrote:
> > Given this obnoxious and unnecessary statement my part on this thread
> > ends here. My undergraduate and MSc students have a 100% pass rate in
> > both graduation and fast entry into good employment, my client
> > project portfolio is full for several months, and there are two major
> > projects on the go. The preparation, detail and delivery for students
> > far exceeds what I can provide for this forum - even on a good day!
>
> Mike,
>
> I have the greatest respect for your contributions to this forum and
offline
> to a number of members, myself included. In light of their erudition I
have
> no doubt you are extremely successful and helpful offline.
>
> However on this specific issue I do think you have confused a number of
> people by describing handling data within the same script that displays a
> form (model A) as fundamentally insecure as opposed to separating scripts
> for form presentation, processing and subsequent result display (model B).
>
> While model A may well be bad practice according to various programming
> methodologies, your own included, that is not what I and apparently
several
> other people understood by your original statement.
>
> My current understanding and correct me if I am wrong is:
>
> - It is possible to write insecure code with model A
> - It is possible to write secure code with model A
> - It is possible to write insecure code with model B
> - It is possible to write secure code with model B
> - It is more likely that a neophyte programmer would write insecure code
> with model A than model B
>
> If that is a summary of what is being proposed I would agree with it, if
not
> then I would like to understand further, as I too believe it is quite
> possible to write secure code with model A, provided you are knowledgeable
> and careful (ofc).
>
> Regards,
>
> Dai Williams
>
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
>



Messages by Day
May 31st 2007
May 30th 2007
May 29th 2007
May 28th 2007
May 27th 2007
May 26th 2007
May 25th 2007
May 24th 2007
May 23rd 2007
May 22nd 2007
May 21st 2007
May 20th 2007
May 19th 2007
May 18th 2007
May 17th 2007
May 16th 2007
May 15th 2007
May 14th 2007
May 13th 2007
May 12th 2007
May 11th 2007
May 10th 2007
May 9th 2007
May 8th 2007
May 7th 2007
May 6th 2007
May 5th 2007
May 4th 2007
May 3rd 2007
May 2nd 2007
May 1st 2007


Messages by Month
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
March 2007
January 2007


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000