<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yusif Mammadzada</title>
    <description>The latest articles on DEV Community by Yusif Mammadzada (@yusif_mammadzada_eab0c7a8).</description>
    <link>https://dev.to/yusif_mammadzada_eab0c7a8</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4204937%2F23cc2e7f-4148-4bb4-9c7c-7f5f2a525a5f.png</url>
      <title>DEV Community: Yusif Mammadzada</title>
      <link>https://dev.to/yusif_mammadzada_eab0c7a8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yusif_mammadzada_eab0c7a8"/>
    <language>en</language>
    <item>
      <title>Why Scanners Miss Flaws: Understanding Business Logic Vulnerabilities”</title>
      <dc:creator>Yusif Mammadzada</dc:creator>
      <pubDate>Sat, 24 Oct 2026 15:22:25 +0000</pubDate>
      <link>https://dev.to/yusif_mammadzada_eab0c7a8/why-scanners-miss-flaws-understanding-business-logic-vulnerabilities-473p</link>
      <guid>https://dev.to/yusif_mammadzada_eab0c7a8/why-scanners-miss-flaws-understanding-business-logic-vulnerabilities-473p</guid>
      <description>&lt;p&gt;Automated security scanners are useful. They can identify many common vulnerabilities, detect outdated dependencies, and highlight suspicious behavior.&lt;/p&gt;

&lt;p&gt;But there is one important problem: not every security vulnerability is caused by a coding mistake that a scanner can recognize.&lt;/p&gt;

&lt;p&gt;Sometimes, the application works exactly as programmed — but the underlying business rules are wrong.&lt;/p&gt;

&lt;p&gt;These are known as business logic vulnerabilities.&lt;/p&gt;

&lt;p&gt;In this article, we will explore what business logic vulnerabilities are, why they are difficult to detect, and how security researchers can identify and prevent them using controlled, authorized testing environments.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What Is a Business Logic Vulnerability?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A business logic vulnerability occurs when an application's workflow, rules, or assumptions can be manipulated to produce an unintended result.&lt;/p&gt;

&lt;p&gt;Consider an online store with the following rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customers can purchase products.&lt;/li&gt;
&lt;li&gt;Discounts are applied to eligible orders.&lt;/li&gt;
&lt;li&gt;Orders must be paid for before shipment.&lt;/li&gt;
&lt;li&gt;Refunds are issued only for eligible transactions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the application fails to enforce one of these rules correctly, a user might obtain an unintended benefit.&lt;/p&gt;

&lt;p&gt;For example, imagine a checkout system that trusts a discount value submitted by the browser instead of calculating the discount on the server.&lt;/p&gt;

&lt;p&gt;The problem is not necessarily a SQL injection or cross-site scripting vulnerability. It is a failure to enforce a business rule at a trusted boundary.&lt;/p&gt;

&lt;p&gt;The key principle: a client request is input, not proof that an operation is permitted.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why Automated Scanners Often Miss These Bugs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Automated scanners are good at testing known vulnerability patterns. Business logic testing, however, often requires understanding how an application is supposed to behave.&lt;/p&gt;

&lt;p&gt;A scanner might identify an exposed endpoint, but it may not know that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A user must complete verification before withdrawing funds.&lt;/li&gt;
&lt;li&gt;A coupon can only be redeemed once per customer.&lt;/li&gt;
&lt;li&gt;An order cannot be refunded after a specific state transition.&lt;/li&gt;
&lt;li&gt;One account must never access another account's private resources.&lt;/li&gt;
&lt;li&gt;A workflow must be completed in a particular sequence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These rules are application-specific.&lt;/p&gt;

&lt;p&gt;Finding violations often requires a researcher to understand the intended workflow, formulate a hypothesis, and test whether the server enforces the expected restrictions.&lt;/p&gt;

&lt;p&gt;This does not mean scanners are useless. They are one part of a broader testing process.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start by Understanding the Application's Workflow&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before testing, map the application's normal behavior.&lt;/p&gt;

&lt;p&gt;For a fictional online store, a simplified checkout workflow might look like this:&lt;/p&gt;

&lt;p&gt;Browse products&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Add product to cart&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Calculate total on server&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Complete payment&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Verify payment status&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Confirm order&lt;/p&gt;

&lt;p&gt;For each step, ask four questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What conditions must be satisfied before this action is allowed?&lt;/li&gt;
&lt;li&gt;Which component enforces those conditions?&lt;/li&gt;
&lt;li&gt;Can the action be performed out of order?&lt;/li&gt;
&lt;li&gt;Does the server independently verify the result of the previous step?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Document the expected behavior before attempting to find deviations.&lt;/p&gt;

&lt;p&gt;This makes testing more systematic and helps distinguish a genuine security issue from an ordinary application error.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Example: Trusting a Client-Supplied Price&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Consider a deliberately simplified and vulnerable checkout implementation:&lt;/p&gt;

&lt;p&gt;from flask import Flask, request, jsonify&lt;/p&gt;

&lt;p&gt;app = Flask(&lt;strong&gt;name&lt;/strong&gt;)&lt;/p&gt;

&lt;p&gt;@app.post("/checkout")&lt;br&gt;
def checkout():&lt;br&gt;
    data = request.get_json()&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;price = data.get("price", 0)
quantity = data.get("quantity", 1)

total = price * quantity

return jsonify({
    "message": "Order created",
    "total": total
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This example has a fundamental design problem: the server accepts the product price directly from the client.&lt;/p&gt;

&lt;p&gt;A browser request might contain:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "price": 1,&lt;br&gt;
  "quantity": 2&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;The server calculates the total using the supplied value rather than looking up the authoritative price.&lt;/p&gt;

&lt;p&gt;If the intended product price is 100, the application has no reliable way to distinguish the legitimate price from a manipulated one.&lt;/p&gt;

&lt;p&gt;The core issue is not that JSON is insecure. It is that the server trusts a value the client is allowed to control.&lt;/p&gt;

&lt;p&gt;Also note that this example does not implement a real payment system. Returning an order confirmation is not equivalent to processing and verifying a payment.&lt;/p&gt;

&lt;p&gt;How to Test This Safely&lt;/p&gt;

&lt;p&gt;In a local lab you control:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a product with a known server-side price.&lt;/li&gt;
&lt;li&gt;Submit a normal checkout request.&lt;/li&gt;
&lt;li&gt;Inspect which fields the client sends.&lt;/li&gt;
&lt;li&gt;Change the submitted price in your test request.&lt;/li&gt;
&lt;li&gt;Observe whether the server uses the authoritative product price or the client-supplied value.&lt;/li&gt;
&lt;li&gt;Verify that the server's final order record contains the correct amount.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The important evidence is not simply that the response changes. It is whether the application violates its intended pricing rule.&lt;/p&gt;

&lt;p&gt;A Safer Implementation&lt;/p&gt;

&lt;p&gt;The server should accept a product identifier and quantity, retrieve the price from a trusted data source, validate the quantity, and calculate the total itself.&lt;/p&gt;

&lt;p&gt;from decimal import Decimal&lt;br&gt;
from flask import Flask, request, jsonify&lt;/p&gt;

&lt;p&gt;app = Flask(&lt;strong&gt;name&lt;/strong&gt;)&lt;/p&gt;

&lt;p&gt;PRODUCTS = {&lt;br&gt;
    "product-1": Decimal("100.00")&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;@app.post("/checkout")&lt;br&gt;
def checkout():&lt;br&gt;
    data = request.get_json(silent=True) or {}&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;product_id = data.get("product_id")
quantity = data.get("quantity")

if product_id not in PRODUCTS:
    return jsonify({"error": "Unknown product"}), 400

if type(quantity) is not int or not 1 &amp;lt;= quantity &amp;lt;= 100:
    return jsonify({"error": "Invalid quantity"}), 400

total = PRODUCTS[product_id] * quantity

return jsonify({
    "product_id": product_id,
    "quantity": quantity,
    "total": str(total)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This version demonstrates the essential principle: the client chooses the product and quantity, but the server determines the price.&lt;/p&gt;

&lt;p&gt;A production implementation would also need persistent product records, inventory validation, proper order creation, transaction handling, authorization, and trusted payment-provider verification.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Example: Testing Workflow and State Transitions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Another common category involves actions that are valid individually but invalid in a particular sequence.&lt;/p&gt;

&lt;p&gt;Imagine an application with these order states:&lt;/p&gt;

&lt;p&gt;PENDING_PAYMENT&lt;br&gt;
       |&lt;br&gt;
       v&lt;br&gt;
     PAID&lt;br&gt;
       |&lt;br&gt;
       v&lt;br&gt;
   SHIPPED&lt;br&gt;
       |&lt;br&gt;
       v&lt;br&gt;
   DELIVERED&lt;/p&gt;

&lt;p&gt;A secure application must validate every state transition on the server.&lt;/p&gt;

&lt;p&gt;For example, an order should not become "PAID" merely because a browser sends:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "status": "PAID"&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;The server should verify the payment using trusted payment-provider information and enforce the permitted transition.&lt;/p&gt;

&lt;p&gt;A security researcher can test a local implementation by checking whether:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Invalid transitions are rejected.&lt;/li&gt;
&lt;li&gt;Repeated requests create duplicate transactions.&lt;/li&gt;
&lt;li&gt;Concurrent requests cause inconsistent state.&lt;/li&gt;
&lt;li&gt;An unauthorized user can modify another user's order.&lt;/li&gt;
&lt;li&gt;The server relies on client-provided status values.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For financial workflows, use test accounts and a payment provider's sandbox. Never test by manipulating real transactions without explicit authorization.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Example: Business Logic and Access Control&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Business logic vulnerabilities can overlap with broken access control.&lt;/p&gt;

&lt;p&gt;Consider an application where users can view their own invoices.&lt;/p&gt;

&lt;p&gt;A secure endpoint should verify both that the invoice exists and that the authenticated user is permitted to access it.&lt;/p&gt;

&lt;p&gt;A vulnerable design might check only whether an invoice identifier is valid.&lt;/p&gt;

&lt;p&gt;The correct authorization rule is conceptually:&lt;/p&gt;

&lt;p&gt;def can_view_invoice(user, invoice):&lt;br&gt;
    return invoice.owner_id == user.id&lt;/p&gt;

&lt;p&gt;This is only a simplified illustration. Real applications need a trustworthy authentication mechanism and authorization checks appropriate to their roles and resource-sharing rules.&lt;/p&gt;

&lt;p&gt;When testing an authorized lab, compare the behavior of two separate test accounts. Confirm that one account cannot access private invoices belonging to the other.&lt;/p&gt;

&lt;p&gt;Do not access real users' records to prove a vulnerability.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A Practical Business Logic Testing Checklist&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use this checklist when assessing an application you own or are explicitly authorized to test.&lt;/p&gt;

&lt;p&gt;Input and trust boundaries&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are prices, discounts, balances, and permissions calculated or verified on the server?&lt;/li&gt;
&lt;li&gt;Does the server validate client-supplied identifiers and quantities?&lt;/li&gt;
&lt;li&gt;Are security-sensitive values derived from trusted sources?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Workflow integrity&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can actions be performed out of sequence?&lt;/li&gt;
&lt;li&gt;Are invalid state transitions rejected?&lt;/li&gt;
&lt;li&gt;Are repeated operations handled safely?&lt;/li&gt;
&lt;li&gt;Can concurrent requests violate a business rule?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Authorization&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is access checked for every sensitive resource?&lt;/li&gt;
&lt;li&gt;Are permissions verified on every relevant server-side operation?&lt;/li&gt;
&lt;li&gt;Can one test account modify another account's resources?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Evidence&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can the behavior be reproduced consistently?&lt;/li&gt;
&lt;li&gt;Is there a clear expected-versus-actual result?&lt;/li&gt;
&lt;li&gt;Can the issue be demonstrated without accessing other people's data?&lt;/li&gt;
&lt;li&gt;Is the security impact supported by evidence rather than speculation?&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;How to Report a Business Logic Vulnerability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A useful vulnerability report should explain the security failure, not merely describe unusual behavior.&lt;/p&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Summary: A concise description of the violated business rule.&lt;/li&gt;
&lt;li&gt;Affected component: The relevant endpoint or workflow.&lt;/li&gt;
&lt;li&gt;Prerequisites: Required account roles, state, or test conditions.&lt;/li&gt;
&lt;li&gt;Reproduction steps: Minimal, repeatable steps in the authorized environment.&lt;/li&gt;
&lt;li&gt;Expected behavior: What the application should enforce.&lt;/li&gt;
&lt;li&gt;Actual behavior: What the server does instead.&lt;/li&gt;
&lt;li&gt;Impact: The realistic consequence supported by the evidence.&lt;/li&gt;
&lt;li&gt;Remediation: The server-side validation or workflow change that addresses the root cause.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Avoid claiming that a vulnerability enables financial theft, account takeover, or other serious consequences unless the evidence actually supports that conclusion.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Final Thoughts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Business logic vulnerabilities remind us that application security is about more than detecting suspicious strings or known technical patterns.&lt;/p&gt;

&lt;p&gt;A secure application must enforce the rules that define who can perform an action, under which conditions, and in what order.&lt;/p&gt;

&lt;p&gt;The most useful questions a researcher can ask are often straightforward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the application supposed to allow?&lt;/li&gt;
&lt;li&gt;What does the server actually enforce?&lt;/li&gt;
&lt;li&gt;Which assumptions can a client influence?&lt;/li&gt;
&lt;li&gt;What evidence demonstrates a violation of the intended rule?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By combining workflow analysis, controlled testing, clear evidence, and sound remediation advice, security researchers can uncover problems that automated scanning alone may overlook.&lt;/p&gt;

&lt;p&gt;Security is not only about whether the code runs correctly. It is also about whether the application enforces the right rules.&lt;/p&gt;




&lt;p&gt;Further Reading&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"OWASP Web Security Testing Guide" (&lt;a href="https://owasp.org/www-project-web-security-testing-guide/" rel="noopener noreferrer"&gt;https://owasp.org/www-project-web-security-testing-guide/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"OWASP Application Security Verification Standard" (&lt;a href="https://owasp.org/www-project-application-security-verification-standard/" rel="noopener noreferrer"&gt;https://owasp.org/www-project-application-security-verification-standard/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"OWASP API Security Project" (&lt;a href="https://owasp.org/www-project-api-security/" rel="noopener noreferrer"&gt;https://owasp.org/www-project-api-security/&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>cybersecurity</category>
      <category>programming</category>
      <category>azerbaijan</category>
    </item>
  </channel>
</rss>
