Thank you Dave for an excellent answer. Clear as crystal.

As the coward I am I will implement the check instead of the hash.

Peace in return,
Malin

On 9/6/06, David Harkness <[EMAIL PROTECTED]> wrote:

Malin Ljungh wrote:
> This means I will have to check on the details page that the item to be
> shown is indeed owned by the current user.
> OK, I can do that, but is there maybe a better way to perform the link?

Hi Malin,

If you don't enforce the rule by checking on the server, no matter what
you do malicious users will be able to bypass client-side security.
However, you can at least make it more difficult.

One method is to not expose your object identifiers to the client.
Instead, create a hash of the ID (or some other unique attribute) along
with some secret "salt" value (i.e. you hash the ID appended to an
internal secret value). Use this hash to generate your links.

Thus, instead of linking to "...&id=45" you link to
"...&id=472b891c7a7d21f2". The likelihood that a user will be able to
guess a hash value will be much less than a that of guessing a valid ID
which is probably a sequence. While incredibly small, the probably is
not zero. This is known as "security through obfuscation" and is not
truly secure. It's like hiding your spare house key under your
*neighbor's* mat -- unlikely for a robber to look there, but not
impossible.

Peace,
Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to