
In this article
What Are Business Logic Flaws?
Business logic flaws are vulnerabilities that occur when an application's business logic is not properly implemented or validated. Unlike traditional security vulnerabilities, these flaws exploit the intended functionality of an application in ways that the developers never anticipated. They're particularly dangerous because they often bypass traditional security measures and automated testing tools.
The Top 5 Business Logic Flaws
1. Discount Stacking
The Flaw: An eCommerce platform permits multiple discount codes to be applied simultaneously without adequate checks, enabling users to combine discounts and potentially acquire products at no cost.
Real-World Impact: Attackers can exploit this to obtain expensive items for free or at heavily discounted rates, causing significant financial losses to the business.
Prevention: Implement proper validation to ensure only one discount code can be applied per transaction, or set maximum discount limits.
2. Broken Authentication Flow
The Flaw: A password reset feature sends a temporary link to the user but fails to invalidate it after use, allowing continuous access to the account.
Real-World Impact: Attackers who intercept reset emails can gain persistent access to user accounts, even after the legitimate user has changed their password.
Prevention: Ensure reset tokens are single-use and expire after a reasonable time period. Invalidate all existing sessions when a password is changed.
3. Race Conditions in Banking Transactions
The Flaw: A banking application does not properly manage concurrent transactions, allowing a user to withdraw more funds than available by initiating simultaneous requests.
Real-World Impact: Users can overdraw accounts or make purchases exceeding their available balance, leading to financial discrepancies and losses.
Prevention: Implement proper transaction locking mechanisms and atomic operations to prevent concurrent access to the same resources.
4. Insufficient Authorization Checks
The Flaw: An application permits users to access or modify data belonging to other users by manipulating request parameters.
Real-World Impact: Attackers can access sensitive information, modify other users' data, or perform actions on behalf of other users without authorization.
Prevention: Implement proper authorization checks on every request and validate that users can only access resources they own or have explicit permission to access.
5. Spotify Royalty Manipulation Incident
The Flaw: In 2017, Spotify identified a flaw that allowed artists to artificially inflate their streaming numbers and royalty payments by creating playlists with their songs and using bots or fake accounts to stream them continuously.
Real-World Impact: Artists could manipulate the royalty system to receive payments they hadn't legitimately earned, affecting the platform's financial integrity and fairness to other artists.
Prevention: Implement sophisticated fraud detection algorithms and monitor for unusual patterns in user behavior and data consumption.
Why Traditional Testing Misses These Flaws
Business logic flaws are particularly challenging because:
Automated tools often miss them: These vulnerabilities don't follow standard patterns that automated scanners look for
They require domain knowledge: Understanding the business context is crucial to identifying these flaws
They exploit intended functionality: The application works as designed, but the design itself is flawed
They're context-specific: What's a vulnerability in one application might be intended behavior in another
How to Protect Against Business Logic Flaws
Protecting against business logic flaws requires a multi-faceted approach, covered more in more depth in our guide to finding and preventing business logic flaws:
Manual Security Testing: Employ security experts who understand your business logic
Threat Modeling: Map out potential attack scenarios specific to your application
Code Reviews: Have security-minded developers review business logic implementations
Continuous Monitoring: Implement monitoring for unusual patterns and behaviors
Regular Security Assessments: Conduct periodic reviews of your business logic security
Conclusion
Business logic flaws represent some of the most dangerous vulnerabilities in modern applications because they're often invisible to traditional security measures. By understanding these common patterns and implementing proper testing and validation procedures, organizations can better protect themselves against these sophisticated attacks.
Remember: the key to preventing business logic flaws is understanding your application's intended behavior and thinking like an attacker who wants to exploit that behavior in unintended ways.
Frequently Asked Questions
What is discount stacking?
Discount stacking is a business logic flaw where an application lets several discount codes or offers combine on one order when the business only intended one. Attackers apply codes in an unexpected order, or send requests in parallel, until the total drops far below the intended price, sometimes to zero. Each code is valid on its own. The flaw is that the server never checks the combined result against the rule the business set.
Why must password reset links be single-use?
A reset link is effectively a temporary key to the account. If it keeps working after it has been used, anyone who obtains it later, from a forwarded email, a shared device or a compromised inbox, can take the account over again, even after the owner has changed their password. Reset tokens should work once and expire quickly, and changing a password should end every other active session.
What is a race condition in a financial transaction?
A race condition happens when an application checks a condition and then acts on it as two separate steps. In a withdrawal, the system checks the balance and then deducts the money. If several requests arrive at the same moment, each can pass the balance check before any deduction is recorded, so the account is overdrawn. The fix is to make the check and the deduction a single locked, atomic operation.
Is insufficient authorisation a business logic flaw?
It can be. When an application lets a user view or change another user's data simply by editing an ID in a request, the technical controls may all be working. What is missing is a rule that each request belongs to the person making it. This is often classed as broken access control, which the OWASP Top 10 for Business Logic Abuse also includes. The fix is to check ownership or permission on the server for every request.








