Results 1 to 10 of 10

Thread: forms and hidden elements

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337

    forms and hidden elements

    ok this may sound stupid but bare with me or explain how it can't happen.

    ok you have a user, they cruise to some site and look through the shopping cart and find what they want. now they go to sign up and the page the generates the form is for paypal.

    what is stopping the user from coping that page and saving it to there hard drive and editing the hidden form elements and adjusting the price, or anything else for that matter, then send it along like nothing happened???

    is there a way to hide the forms hidden elements? because some of the hidden elements are needed to complete the process of signing up through paypal.

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    No, the problem goes beyond just HTML. I have a VB program I wrote that can change any form field, hidden or not, on a page in any running instance of IE. And you can still just open a raw TCP connection to the web server and submit and arbitrary data you want anyway.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    so how is this safe? I can't believe that people really trust forms as much as they do. thanks Josh fo rthat insight, stay away from my site j/k

  4. #4
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    Do people use PHP or JSP or ASP to 'hide' the information from the user?

    HD

  5. #5
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Originally posted by phpman
    so how is this safe? I can't believe that people really trust forms as much as they do. thanks Josh fo rthat insight, stay away from my site j/k
    You assume all user supplied data is malicious until proven otherwise, thru regular expressions or some other means.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    HD, how do you hide a forms hidden element with serverside code? I don't believe you can.

    so nothing is stopping a user from changing the amount of a product if the products amount is a hidden form value?

    has to be another way.

  7. #7
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    What I mean is that any JSP (I only really know JSP) code is hidden from the user - all they see is the actual output (HTML). Therefore info could be stored in the JSP then validated.

    I dont know - I'm just throwing some ideas into the pot!

    HD

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    yeah but the froms elements can't be hidden like that.

    I see what you are trying to say and I hope there is a way to do that.

    and it is a good idea to throw stuff into the pot.

  9. #9
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    Except for money which should be thrown into my pocket

    Hidden form elements cannot be 'hidden' through JSP as they are HTML elements.

    Surely there would be some server side validation anyway - database etc. Editing the price would then make no difference - the element ordered would have a database price - if you sent back a new price it would just use the 'global' price.

    Wouldn't it be foolish to store all the information about a purchase on 1 page - items, price, user etc. Isn't that why you have to become a member of this sort of places - stored in db?

    Again I really don't know how this works - but that's nothing new

    HD

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    well yeah sort of. there are somethings that paypal needs to be sent with the form and one of these is the price, or course you have to be a member and if it is a set price then no problem, but if the price varies then it could be altered.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width