Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: PayPal IPN and CubeCart

  1. #1
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default PayPal IPN and CubeCart

    Thought I'd drop a post in here on the off chance that someone has had experience setting up the PayPal IPN gateway on CubeCart. Or maybe for that matter experienced similar problems with other shopping carts and IPN. I have tried the same thing with the PayPal Sandbox, and real PayPal accounts.

    Paypal IPN should supposedly be accessing cubecart's ipn.php page at the end of the payment process, just before it redirects the customer back to the store.
    When this ipn.php page is accessed it should take the posted variables from paypal and update the database. Unfortunately it is not doing so at all.

    As the accesssing of this page is done behind the scenes as it were, it's hard to debug, so I came up with a cunning plan - write whatever debug info I wanted from that page to a file. The strange thing is, when I access the page myself through a browser the file is written to, when paypal accesses it, the file is not written to - so I really am a bit stumped.

    My RF access logs show the paypal IP visit to the ipn.php page is happening.


  2. #2
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    Anyone want to tell me how stupid I am?

    Been stressing over this issue for a couple of days, almost cost myself 30p in transactions. It was really really weird.

    Well, what do I tend to do when I develop a site online, I stick it in a secure folder don't I, so nobody can access it. I think you are beginning to laugh now. Yep, if something trys to access a page inside a secure folder, the access log is written to, but the page is not touched. Have taken the secure folder off and it works absolutely fine.

    How blindingly obvious.


  3. #3
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Nick, thats pretty daft
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  4. #4
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    to be fair in my naivety I would have expected something in the log file saying access denied. but yeah, was pretty stupid.

  5. #5
    Join Date
    Jun 2005
    Posts
    1,081
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    I've done something similar in last week, in that I spent two days trying to debug code that was calling a web page which returned XML. Problem was I had page tracing turned on with the output, so this was screwing up the XML.

    Funny thing is that this wasn't being caught by stepping through and viewing the XML which really has me confused.

  6. #6
    Join Date
    Mar 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Just wanted to point out a nasty load of holes found in CubeCart V2.x.

    Sign up for an account, enter into every field you want something along the lines of;

    PHP Code:
    <script>alert('document.cookie');</script> 
    Then view the users from the admin panel. Typical XSS. I'm not sure if this is the same in V3, but it's worth paying attention to, many of these systems are VERY insecure.

    On a previous hosting package (DirectAdmin), I used the installatron to install a load of the scripts (oscommerce, phpcoin etc.). 4 of us ran through them all and found a security hole in every one :S

    Worth thinking about !

  7. #7
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    Gotta love cube cart and the rest of the free e-commerce apps - so over the top in needless areas and so terrifyingly basic in essential ones.

    _____
    EDIT
    A quick test of the said flaw on version 3 shows that it has been roughly patched, sort of. The source output of the test is
    Code:
    <script>alert('document.cookie');</script>
    it is worrying that the html tags are being left in there untouched, making it extremely easy to break the markup, and I still don't think it would take a genius to compromise security.
    ps. I'm trying to change those quotes (') for & #39; - without the space and I can't manage it lol.

  8. #8
    Join Date
    Mar 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Actually, the person who created CubeCart wrote only about 30% of the entire scripts (i'm looking at V2). The rest was "borrowed" from site scripts.

    I'm lucky enough to have a few ultra-security paranoid PHP coders who'll make whatever when I need it

  9. #9
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    Well, no point in highlighting a security flaw without fixing it. There is already a cubecart function for protecting against dodgy user input data called treatGet();

    The simplest fix therefore that I can come up with off the top of my head is to add:
    PHP Code:
    foreach($_POST as $key=>$value) {
        
    $_POST[$key] = treatGet($value);

    to the top of /includes/content/profile.inc.php and /includes/content/reg.inc.php

    I've just made this up no, hence no testing of it at all - there's my warning.

    I am using version 3.0.7-pl1, so the problem may have been fixed in later versions.

  10. #10
    Join Date
    Mar 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Better not mention the other 11 holes found in V2 then

    If you ever need a few PHP freaks to audit your site - give me a shout.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Paypal Control
    By Viking in forum ASP.NET
    Replies: 10
    Last Post: 1st April 2006, 09:26 AM
  2. PayPal and IPN
    By Viking in forum ASP.NET
    Replies: 16
    Last Post: 24th March 2006, 12:48 AM
  3. 2checkout vs. Paypal
    By terraqueotenaz in forum Garble
    Replies: 0
    Last Post: 19th January 2005, 04:38 AM

Bookmarks

Posting Permissions

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