Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Yes, absolutely! Don't trust any $_GET or $_POST values anytime!</strong></p> <p>Suppose a third party site posts the form. It may post whatever address.</p> <p>A simple solution would be not to include the address, but a <strong>md5() hash of the address</strong> into the form. Once the form gets posted, it's the task of your script to map the hash to an actual address and then emit the <code>Location</code> header.</p> <p>My <a href="https://stackoverflow.com/questions/6783575/best-method-to-verify-multi-level-relational-dependencies">other post</a> might be of interest.</p> <p><em>You might argue, that your app is bullet-proof. Why shouldn't I pass an URL directly?</em></p> <p><strong>In fact, even well-designed applications aren't that bullet-proof.</strong> Step back and try to remember your last 'Ah, I forgot something. Let's fix it' event.</p> <p>Did you check at each point control each and any condition?</p> <ul> <li>User clicks on a web-form submit-button twice. Thus controller runs twice. </li> <li>User presses F5 an resubmits the last updating controller twice.</li> <li>User somehow manipulated parameters and a controller gets called with off values passed in.</li> </ul> <p><strong>Therefore, I propose to not pass links or other parameters directly or unprotected / unvalidated</strong>. </p> <p><strong>@Col. Shrapnel</strong>: I'm fully aware, that any URL at any point could be submitted to a web-app. That's trivial.</p> <p>Nevertheless, at a given point of control flow, there are certain acceptable next states of control flow.</p> <p>To ensure, that only those next control-flow states get reached, I propose to validate.</p> <p><strong>A more general approach</strong></p> <p>In fact, my recently updated <a href="https://stackoverflow.com/questions/8002956/does-this-conform-to-a-certain-pattern">internal framework</a> <strong>never passes any parameters as GET or POST parameters from request to request</strong>. All parameters are saved and retrieved from a user session [inside a so called Flow, a part of a bigger control flow]. </p> <p>Using the framework, only one single parameter - the FlowID - gets passed around. If the framework doesn't find the FlowID in the session's flow-store, the framework throws an exception and the dispatcher emits an error message.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload