<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     >
        <channel>
                <title>Monika Mathé's Amazon Blog</title>
                <link>http://www.amazon.com/gp/blog/A1WS4REWYG71CY</link>
                <description>Monika Mathé's Amazon Blog</description>
                <language>en-us</language>
                <copyright>Copyright 2005-2007 Amazon.com</copyright>
                <pubDate>Mon, 13 Aug 2007 04:31:37 -0700</pubDate>
                <lastBuildDate>Mon, 13 Aug 2007 04:31:37 -0700</lastBuildDate>
                <docs>http://blogs.law.harvard.edu/tech/rss</docs>
                <generator>Amazon.com Blogs</generator>
                <ttl>60</ttl>
  
                <item>
                        <title>Speed Optimizing</title>
                        <link>http://www.amazon.com/gp/blog/post/PLNK361VDNZVOFJ7N</link>
                        <dc:creator>
                          Monika Mathé
                        </dc:creator>
                        <description>
                          <![CDATA[<div>Dear readers,</div><br /><div>If your store&#160;has been&#160;running a bit slow recently, it's time to whip up the following tuning potion:</div><br /><div><strong>Change indexing of products_to_categories + specials tables</strong></div><br /><div>I had excellent speed optimization results by removing the combined primary key of the products_to_categories table and replacing it by 2 single indexes.</div><div><br /><font color="#ff0000">ALTER TABLE `products_to_categories` DROP PRIMARY KEY;</font></div><div><font color="#ff0000">ALTER TABLE `products_to_categories` ADD INDEX `idx_p2c_categories_id` ( `categories_id` );</font></div><div><font color="#ff0000">ALTER TABLE `products_to_categories` ADD INDEX `idx_p2c_products_id` ( `products_id` );</font></div><br /><div>I also added an index on the products_id column for the specials table with great success.</div><div><br /><font color="#ff0000">ALTER TABLE `specials` ADD UNIQUE `idx_s_products_id` ( `products_id` );</font></div><br /><div>Bon Appetit!</div><br /><br /><div>BTW: you can now find me handing out tips, tricks &amp; recipes as a Moderator on this osCommerce related forum: <a href="http://www.amazon.com/gp/redirect.html/ref=cm_plog_item_link/178-7612951-4056207?ie=UTF8&location=http%3A%2F%2Fforums.oscanswers.com%2F&token=7D7B529A6A2138DEB5EF13979367C30A086D1FA8"  target="_blank">osC Answers</a>&#160; - see you there!</div><br /><div>kind regards</div><div>Monika</div>]]>
                        </description>
                        <pubDate>Mon, 13 Aug 2007 04:31:37 -0700</pubDate>
                        <guid isPermaLink="false">
                          PLNK361VDNZVOFJ7N
                        </guid>
                        <source url="http://www.amazon.com/gp/blog/A1WS4REWYG71CY" />
                </item>
   
  
                <item>
                        <title>Process Logic Flaw affecting several payment modules</title>
                        <link>http://www.amazon.com/gp/blog/post/PLNK17BJEOSWYY3VQ</link>
                        <dc:creator>
                          Monika Mathé
                        </dc:creator>
                        <description>
                          <![CDATA[<div><font color="#cc0000">Dear Readers,</font></div><br /><div><font color="#cc0000">this one is important to check out! It was brought up to me by a fellow osCommerce geek&#160; - Bobby, aka chemo - who cares for you shop owners. Read carefully through the issue he has found and apply the suggested fixes - both. I have copied his post directly from the osCommerce forum where you may have overlooked it ...</font></div><br /><div><font color="#cc0000">Watch out, and always keep up on security!</font></div><br /><div><font color="#cc0000">kindly</font></div><div><font color="#cc0000">Monika</font></div><br /><div><font color="#999999">DESCRIPTION<br />The checkout process logic relies on redirect headers to handle transaction failure (decline, fraud, stolen card, etc.). This does not secure the store from purpose created bots from submitting arbitrary valid CC numbers from bypassing this check and as a result continues processing as if it were a valid transaction.</font></div><div><font color="#999999"></font></div><div><font color="#999999">PROCESS LOGIC FLAW<br />The checkout_process.php script calls the before_process() method from the respective payment module. However, on failure the only action taken is a header redirect to the checkout_payment.php script.</font></div><div><font color="#999999">There is no additional security checks performed beyond the initial header redirect. If the client is using a purpose built bot or script (using cURL for example) that does not obey headers this will effectively bypass the accept/decline logic and allow checkout_process.php to continue execution.</font></div><div><font color="#999999"></font></div><div><font color="#999999">POSSIBLE FIXES<br />Modify the payment module to return boolean value for the before_process() method and incorporate this into the checkout_process.php script like this:<br />CODE<br />// load the before_process function from the payment modules<br />&#160;&#160;&#160; $approved = $payment_modules-&gt;before_process();<br />&#160;&#160;&#160; /**<br />&#160;&#160;&#160;&#160; * The customer should have redirected already if before_process fails<br />&#160;&#160;&#160;&#160; * However, some might bypass the simple security check<br />&#160;&#160;&#160;&#160; * by disabling header codes.&#160; If this is the case let's kill the script<br />&#160;&#160;&#160;&#160; */<br />&#160;&#160;&#160; if ( $approved !== true ){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Try to redirect one more time<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('Exception'), 'SSL', true, false));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; /** <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * Apparently the customer is not going anywhere<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * At this point it's safer to destroy the session and kill the script<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; session_destroy();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; exit('Exit -&gt; Exception(3)');<br />&#160;&#160;&#160; }</font></div><div><font color="#999999">Modify the tep_redirect() function to exit() after header call like this:<br />CODE<br />////<br />// Redirect to another page or site<br />&#160; function tep_redirect($url) {<br />&#160;&#160;&#160; if ( (strstr($url, &quot;\n&quot;) != false) || (strstr($url, &quot;\r&quot;) != false) ) { <br />&#160;&#160;&#160;&#160;&#160; tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));<br />&#160;&#160;&#160; }</font></div><div><font color="#999999">&#160;&#160;&#160; if ( (ENABLE_SSL == true) &amp;&amp; (getenv('HTTPS') == 'on') ) { // We are loading an SSL page<br />&#160;&#160;&#160;&#160;&#160; if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL<br />&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }</font></div><div><font color="#999999">&#160;&#160;&#160; header('Location: ' . $url);<br />&#160;&#160;&#160; /**<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * Exit if client does not obey headers<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; exit();<br />&#160; }</font></div><font color="#cc0000"><div><br /><font color="#999999">INITIAL DISCOVERY AND PROOF OF CONCEPT<br />Client noticed several orders that were accepted but upon comparison with AuthorizeNET (using AIM method) noticed that they were declined. Since the site was processing several thousand orders daily they were detected only through the random quality assurance checks.</font></div><div><font color="#999999">Upon closer investigation the flaw was discovered and subsequently replicated using cURL for requests. The vulnerability was verified on 6 other sites (with the cooperation of the respective store owners) using the same script. In addition, 4 were osC 2.2 platforms, 1 was CRE Loaded standard, and the other was CRE Pro.</font></div><div><font color="#999999">This script is available to the osC / CRE project developers first and then will be released for public consumption. However, the description of the vulnerability should be enough to guide an intermediate level coder to produce the same functionality using whatever programming language they are most comfortable with.</font></div><br /><div><font color="#999999">SCOPE OF VULNERABILITY<br />This report affects all stable versions of osCommerce. This report affects all stable versions of CRE Loaded. Other fork projects were not inspected, tested or verified.</font></div><div><font color="#999999">This report affects all AIM or SIM payment modules and excludes IPN types (such as PayPal).</font></div><br /><br /><br /></font>]]>
                        </description>
                        <pubDate>Sun, 14 Jan 2007 04:13:05 -0800</pubDate>
                        <guid isPermaLink="false">
                          PLNK17BJEOSWYY3VQ
                        </guid>
                        <source url="http://www.amazon.com/gp/blog/A1WS4REWYG71CY" />
                </item>
   
  
                <item>
                        <title>Getting to know ya ....</title>
                        <link>http://www.amazon.com/gp/blog/post/PLNK102VI3P9ARA0K</link>
                        <dc:creator>
                          Monika Mathé
                        </dc:creator>
                        <description>
                          <![CDATA[<div>Hello dear readers,</div><br /><div>a few weeks ago, a long&#160;interview with me was posted at webXadmin with tons of info about my background and plans in general. Should you be interested in it, please click on the link below.</div><br /><div>Hope your holiday cooking goes well this week ;-). Enjoy!!!</div><br /><div>kindly</div><div>Monika</div><br /><div><a href="http://www.amazon.com/gp/redirect.html/ref=cm_plog_item_link/178-7612951-4056207?ie=UTF8&location=http%3A%2F%2Fwebxadmin.free.fr%2Farticle%2Fa-cookbook-for-oscommerce-666.php&token=62AA1F11622B2D701C3515D312621C448A675553"  target="_blank">http://webxadmin.free.fr/article/a-cookbook-for-oscommerce-666.php</a></div>]]>
                        </description>
                        <pubDate>Sun, 19 Nov 2006 23:14:57 -0800</pubDate>
                        <guid isPermaLink="false">
                          PLNK102VI3P9ARA0K
                        </guid>
                        <source url="http://www.amazon.com/gp/blog/A1WS4REWYG71CY" />
                </item>
   
  
                <item>
                        <title>Hacking the hack :-)</title>
                        <link>http://www.amazon.com/gp/blog/post/PLNK39SQU44IN70UV</link>
                        <dc:creator>
                          Monika Mathé
                        </dc:creator>
                        <description>
                          <![CDATA[<div>Hi dear readers,</div><br /><div>this week and last, I was asked to modify recipe 59 that tackles product placement banners to allow for any page to be used in this new banner tool.</div><br /><div>This is such a great hack I decided not to have you wait for my new book but show you here how to do it. So if you liked the product placement banners so much you want to use it for any page on his site use this variation. The code only needs to be modified a little bit to allow for non-product-related pages as well (and you can place SEO URLs in your banner manager now too!):</div><br /><div>add the following function to catalog/includes/functions/general.php</div><div><font color="#000099">function InStr($String,$Find,$CaseSensitive = false)&#160; {<br />&#160;$i=0;&#160; <br />&#160;while (strlen($String)&gt;=$i)&#160; <br />&#160;{&#160; <br />&#160;&#160; unset($substring);&#160; <br />&#160;&#160; if ($CaseSensitive)&#160; <br />&#160;&#160; {&#160; <br />&#160;&#160;&#160; $Find=strtolower($Find);&#160; <br />&#160;&#160;&#160; $String=strtolower($String);&#160; <br />&#160;&#160; }&#160; <br />&#160;&#160; $substring=substr($String,$i,strlen($Find));&#160; <br />&#160;&#160; if ($substring==$Find) return true;&#160; <br />&#160;&#160; $i++;&#160; <br />&#160; }&#160; <br />&#160; return false;&#160; <br />&#160;}&#160; </font></div><br /><div>then open your file catalog/includes/functions/banner.php and find this code:</div><br /><div><font color="#0000cc">tep_update_banner_click_count($banner['banners_id']);<br />$banner_string = '&lt;a href=&quot;' . tep_href_link(before ('?', $banner['banners_url']), after ('?', $banner['banners_url'])) . '&quot;&gt;' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '&lt;/a&gt;';</font></div><br /><div>replace by this:</div><div><font color="#0000cc">tep_update_banner_click_count($banner['banners_id']);<br />if (instr($banner['banners_url'], '?') &gt; 0) {<br />&#160;$banner_string = '&lt;a href=&quot;' . tep_href_link(before ('?', $banner['banners_url']), after ('?', $banner['banners_url'])) . '&quot;&gt;' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '&lt;/a&gt;';<br />} else {<br />&#160;$banner_string = '&lt;a href=&quot;' . tep_href_link($banner['banners_url']) . '&quot;&gt;' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '&lt;/a&gt;';<br />}</font></div><br /><div>Happy Cooking, and bon appetit!</div><br /><div>kindly</div><div>Monika</div>]]>
                        </description>
                        <pubDate>Sat, 28 Oct 2006 01:41:36 -0700</pubDate>
                        <guid isPermaLink="false">
                          PLNK39SQU44IN70UV
                        </guid>
                        <source url="http://www.amazon.com/gp/blog/A1WS4REWYG71CY" />
                </item>
   
  
                <item>
                        <title>Welcome and thanks for reading this Blog!</title>
                        <link>http://www.amazon.com/gp/blog/post/PLNK1GM82I1PX04BS</link>
                        <dc:creator>
                          Monika Mathé
                        </dc:creator>
                        <description>
                          <![CDATA[<div>Hi,</div><br /><div>compiling recipes and chapters for this book was one of the most enjoyable tasks in my coding career ... wondering which one would be most fun, most wanted or most of a lesson teaching cooking abilities for new osCommerce hacks :-).</div><br /><div>Here is the full list of recipes from the Deep Inside osCommerce Cookbook to tantalize your tastebuds and make your fingers itch to dig into your own code:</div><br /><div><strong>Chop And Cream The Basic Design</strong></div><div><font color="#666666">01. Add easy top category driven stylesheets<br />02.&#160;Create flexible column definitions</font></div><div><strong>Serve Them New Menus</strong></div><div><font color="#666666">03. Show active subcategories only in your categories box<br />04. Create separate boxes for each top category<br />05. Simplify category box navigation by defining specific colors for each level<br />06. Add extra links to your category box</font></div><div><strong>Spice Up Your Infoboxes</strong></div><div><font color="#666666">07. Move your infobox header closer to content<br />08. Make your infobox header taller<br />09. Add a pop-up page from an infobox link<br />10. Add images to infoboxes<br />11. Add extra images to your columns without framing boxes<br />12. Hide or show boxes driven by language choice<br />13. Add boxes dedicated to specified countries<br />14. Define box image size independent of product thumbs<br />15. Show manufacturers' logos in Manufacturers infobox<br />16. Add double borders to boxes with background matting</font></div><div><strong>Stuff Your Product Display</strong></div><div><font color="#666666">17. Add parent category in product listing<br />18. Add top category in product listing<br />19. Add a separator line in product listing<br />20. Add a cell background and image border to product listing<br />21. Sort product listing by date added<br />22. Prepare a quick 'n easy review system for product listing<br />23. Whip up a top category driven product listing<br />24. Restrain manufacturer image size<br />25. Call a pop-up from product description in product info<br />26. Call unique code for a single product in product info<br />27. Show a pop-up with shipping options in product info<br />28. Add an anchor for options in product info<br />29. Integrate Tell A Friend into product info<br />30. Offer Ask A Question About A Product link on product info<br />31. Sell affiliate products from your catalog<br />32. Fill up Also Purchased Products search result<br />33. Limit New Products to those with an image<br />34. Set column count for New Products</font></div><div><strong>Dish Up Better Search</strong></div><div><font color="#666666">35. Add help text to your search box input field<br />36. Set the search result value independent of admin listings<br />37. Add an All Manufacturers page to Manufacturers infobox<br />38. Create your custom product listing with individual boxes for each manufacturer</font></div><div><strong>Grill That Checkout Process</strong></div><div><font color="#666666">39. Make removing products from the cart more intuitive<br />40. Remove Delivery Address modification from your Shipping page<br />41. Modify Shipping Method display for Confirmation page<br />42. Add a sophisticated gift wrapping option to Shipping page<br />43. Add the option to donate during checkout<br />44. Personalize your Order Confirmation email<br />45. Add your customers' email &amp; phone to your Order Confirmation email<br />46. Add your customers' fax number to your Order Confirmation email<br />47. Add the products' manufacturers to your Order Confirmation email<br />48. Add the products' category tree to your Order Confirmation email</font></div><div><strong>Whip Up New Shipping Options</strong></div><div><font color="#666666">49. Add multiple Flat Rate Shipping Modules<br />50. Add percentage and base price support to Table Rate<br />51. Allow Free Postage for free items<br />52. Limit Flat Rate shipping to a specific top category only<br />53. Hide Shipping Modules driven by weight<br />54. Create a Per Item Shipping Module with two price levels</font></div><div><strong>Season Your Payment Modules</strong></div><div><font color="#666666">55. Hide Payment Modules from public eyes<br />56. Create dependencies between Shipping and Payment Modules<br />57. Offer customized payment options for selected customers</font></div><div><strong>Cook Up A Multiple Banner System</strong></div><div><font color="#666666">58. Set up category driven banners<br />59. Create rotating banners that link within your own shop</font></div><div><strong>Throw Together Dessert - Extra Treats For You!</strong></div><div><font color="#666666">60. Display a dynamic shipping table for Table Rate shipping<br />61. Restructure and Customize your file download module<br />62. Create a dual website combining Shopping Cart and Showroom features</font></div><div><strong>Beef Up Your Admin</strong></div><div><font color="#666666">63. Reset date added for products<br />64. Set an expiry date for products<br />65. Limit Also Purchased Products selection by date<br />66. Display full info for customer, delivery and billing address at a glance<br />67. Highlight orders according to their order status<br />68. Sort your administration menu configuration box entries<br />69. Allow entering products in an additional currency</font></div><br /><br /><div>That's it, that's all, there is no more ...</div><br /><div>I keep track of errata on the publisher's support site <a href="http://www.amazon.com/gp/redirect.html/ref=cm_plog_item_link/178-7612951-4056207?ie=UTF8&location=http%3A%2F%2Fwww.packtpub.com%2Fsupport%2Fbook%2Finside%5Foscommerce&token=516BD8744D95CE4699E9F6DE0320CBA67B988DB8"  target="_blank">here</a>&#160;- so be sure to take a swift look over there before you <strong>roll up your sleeves and start your cooking</strong>.</div><br /><div>I'm very interested to see new ideas come from my recipes; hacking the hack is so much fun as I'm sure you agree. Please<strong> share clever modifications</strong> you have made to have the code work for YOUR shop! I'd love to hear from you.</div><br /><div>Happy cooking!</div>]]>
                        </description>
                        <pubDate>Thu, 12 Oct 2006 17:01:59 -0700</pubDate>
                        <guid isPermaLink="false">
                          PLNK1GM82I1PX04BS
                        </guid>
                        <source url="http://www.amazon.com/gp/blog/A1WS4REWYG71CY" />
                </item>
   
  
                <item>
                        <title>I'm a Plogger, too!</title>
                        <link>http://www.amazon.com/gp/blog/post/PLNKMCA3U7WGHKN5</link>
                        <dc:creator>
                          Monika Mathé
                        </dc:creator>
                        <description>
                          <![CDATA[<div>Hi,</div><div><br />what a cool new feature ... give me a sec to familiarize myself with it, and then off I go and post all recipe chapter names from my book Deep Inside osCommerce!</div>]]>
                        </description>
                        <pubDate>Thu, 12 Oct 2006 05:08:06 -0700</pubDate>
                        <guid isPermaLink="false">
                          PLNKMCA3U7WGHKN5
                        </guid>
                        <source url="http://www.amazon.com/gp/blog/A1WS4REWYG71CY" />
                </item>
   
        </channel>
</rss>
