Biannual sales, tax-free days, Black Friday, the holidays—the seasons of crazy deals, endless wish lists, and maybe a bit of shopping chaos. But behind the scenes, businesses hustle to keep up, and sometimes, they hit a few snags with what we call “business logic flaws.”
These flaws show up in various ways, from inaccuracies in pricing calculations and discounts to vulnerabilities in payment processing or inventory management. They happen when the designers and developers haven’t quite predicted all the scenarios that users might throw at their creation. And unlike a traditional security vulnerability, business logic flaws aren’t a one-time thing—they stick around, causing ongoing headaches for businesses through the loss of money and data until a fix is found.
Let’s look at how testing, a little coding wizardry, and a watchful eye can keep the busiest retail seasons merry and bright for shoppers and businesses.
THE LANDSCAPE OF BUSINESS LOGIC FLAWS
Business logic flaws are nothing new; I’ve been writing about them for more than 20 years. My first web hacking book mentioned countless examples, and a 2012 study from the Ponemon Institute found that 90% of IT professionals interviewed reported revenue losses due to business logic abuse. Two-thirds said their organizations lost between 1% and 4% in revenue, while some 25% said their organizations lost more than 5%.
Qwiet AI’s Chetan Conikee wrote a series on discovering these flaws in 2019. One example he cited was the use of a self-serve kiosk at McDonald’s to place an order for an enormous Big Mac. By maxing out all the ingredients available, the order exceeded the time quoted to prepare, making the meal free.
In another example involving McDonald’s kiosks, two people ordered 10 hamburgers for one dollar each. They then requested to remove the patties, which caused the kiosk to credit back one dollar and eleven cents. The pair were able to use the additional credits to get an 11th hamburger, with a patty, for free. While both these examples seem more silly than serious, they demonstrate the ripple effect these flaws can have on a business, from the cost of product to wait times.
So why are companies still fighting against these business logic flaws? There are many reasons, including a lack of testing, resource constraints, the evolution of business systems, and the rapid pace of development, leading to shortcuts or oversights in security practices. Some organizations may also not fully grasp the importance of addressing business logic flaws or lack awareness of potential vulnerabilities.
SECURITY TESTING LIMITATIONS
Business logic flaws thrive in the back-and-forth of user actions and system responses, otherwise known as data flows, making them challenging to pinpoint through conventional testing methods. An exploiter attempts to explore these flows in the application to figure out ways to bypass, circumvent, and repeat, with the goal of breaking the system. Common security testing tools, while effective at catching certain vulnerabilities, are oriented toward looking for faults rather than flows, because it’s difficult to account for all direct and indirect flows in and out of the application. Business logic flaws are also unique to every business and there’s no database of flaws that security tools can reference and scan for.
Finding a solution to these flaws requires more than just discovering the glitch. It’s about grasping the whole story behind the code and crafting solutions that outsmart these sneaky digital adversaries. This means acting like both a detective and an expert developer, tracing the flow of data, controls, and context to see if the application is doing what it’s supposed to be doing—or if there are any deviations from the plan.
These business logic flaws cannot be fixed with a simple patch or a quick workaround. Organizations must address the root causes and intricacies of business logic flaws throughout the entire software development lifecycle.
PREVENTION VERSUS DETECTION AND RESPONSE
All business logic flaws are preventable at the code level with the right controls and monitoring. The code property graph is a tool that can be used to extract and visualize all the flows within the application. By doing so, security analysts can assess the degrees of risk by identifying gaps or vulnerabilities in the logical flow of the application. This also allows for the monitoring of specific flows related to each business category. If an app starts acting a bit odd, analysts can raise the alarm, ensuring that any unexpected behavior gets noticed and investigated.
Other ways businesses can address business logic flaws is through strengthening input validation and making sure the data that comes into an application is squeaky clean. Adding access controls will help determine who gets access to various parts of the application, keeping sensitive data protected.
Finally, businesses should improve error handling to anticipate unexpected situations and address them without causing additional chaos.
As we head into the new year, now is the time for businesses to be proactive in protecting against business logic flaws. By embracing the power of comprehensive solutions, businesses can ensure every retail season remains prosperous and secure.
Stuart McClure is the CEO of Qwiet AI and the founding author of the #1 cyber security hacking book, Hacking Exposed.