Logic Scan: find business logic and access control flaws in codeBeta
Logic Scan reads your routes, middleware and database calls, then reports checks that are missing or in the wrong place. For example, one user can open another user's invoice, a new account picks its own role, or two requests redeem the same gift card.
Status: beta, version 0.1.0Planned release: Ultimate plan, January 2027Not included in the Free plan or Premium trial
Why SAST misses these flaws
A SAST rule follows untrusted input to a dangerous function, such as an SQL query. A logic flaw usually has no such path. The query is safe and the route requires a login. What is missing is a check that the record belongs to the caller, or that a balance cannot change between the check and the update.
A money transfer endpoint
6app.post('/transfer', requireAuth, async (req, res) => { 7 const { to, amount } = req.body; 8 const sender = await User.findById(req.user.id); 9 if (sender.balance < amount) return res.status(400).json({ error: 'Not enough funds' }); 10 await User.updateOne({ _id: sender.id }, { $inc: { balance: -amount } }); 11 await User.updateOne({ _id: to }, { $inc: { balance: amount } }); 12 res.json({ ok: true }); 13});
JavaScript (Express), written for the white paper. No string concatenation, no shell command, no output to a page.
What Logic Scan reports, with all 344 rules
| Rule | Title | Severity | Line |
|---|---|---|---|
| LS066 | Amount can be negative | Critical | 10 |
| LS068 | Balance check and update can race | High | 10 |
| LS102 | Money can leave the account without extra verification | High | 10 |
| LS070 | Related money changes are not in one transaction | High | 11 |
| LS001 | Application has no rate limiting | Medium | 4 |
| LS103 | Transfers have no maximum or daily limit | Medium | 10 |
| LS071 | Users can transfer to themselves | Medium | 11 |
A negative amount moves money from the recipient to the sender. Two transfers sent at the same moment both pass the balance check on line 9.
One finding, as the scanner prints it
Each finding says who could use the flaw, how, and what to change. It also gives the route, the related lines, the CWE and a confidence level.
HIGH LS068 Balance check and update can race
app.js:10:9
Route: POST /transfer
await User.updateOne({ _id: sender.id }, { $inc: { balance: -amount } });
Problem: `balance` was read and checked earlier, then changed here in a separate step. Parallel
requests can all pass the check, so the same money can be spent more than once.
- app.js:9: the value is checked here
Who: Any signed-in user.
How: Send `POST /transfer` many times at the same moment. All requests see the same balance and
pass the check before it goes down.
Impact: Parallel requests can all pass the check before any of them subtracts, so the same money is
spent several times.
Fix: Use one conditional update (`WHERE balance >= amount`) or lock the row in a transaction.
payments | CWE-362 | confidence: medium
Text report for the race condition above. JSON and SARIF 2.1.0 reports carry the same fields plus a fingerprint that does not depend on line numbers.
What it checks
344 rules in 24 categories: 63 critical, 149 high, 102 medium and 30 low. Each rule is mapped to a CWE, 109 CWE types in all.
Identity, sign-in and sessions 72 rules
Login, multi-factor authentication, password reset, sessions, OAuth, API keys and other tokens.
Access control and data ownership 73 rules
Access to other users' records (IDOR), missing role and tenant checks, request fields that override trusted values.
Organisations, membership and plans 39 rules
Roles across organisations, invited and removed members, cancelled plans, trials and licences.
Payments and commerce 28 rules
Prices, quantities, balances, coupons, refunds, payment webhooks and order totals.
Workflow, business controls and abuse 74 rules
Status changes, approvals, skipped or repeated steps, race conditions and rate limits.
Integrations, AI and exposed data 58 rules
Outside services, output from AI models, and some injection and data exposure checks that overlap with SAST.
Eight flaws it reports
Each example in the white paper was scanned as printed, with only the rule concerned enabled. The links show the code, the scanner's output and the fix.
LS039Reading another customer's invoiceA record loaded by the id in the URL, with no owner check.CWE-639LS031Choosing a role at registrationrolecopied from the request body into the new account.CWE-269LS146Checking the role in a different organisationRole checked in the team from a header, update made to the team in the URL.CWE-639LS013Signing in without the second factorA full token issued after the password check alone.CWE-304LS022Reusing a password-reset linkThe password changes but the reset token stays valid.CWE-640LS093Redeeming one gift card twiceChecked in one step, marked as used in another.CWE-367LS088Approving your own expense claimThe approver is never compared with the person who submitted it.CWE-840LS213Keeping a paid plan after cancellingA billing webhook saves the old plan again when a subscription ends.CWE-841
How it works
The engine is deterministic. It does not use a machine learning model, does not run your application and makes no network requests, so the same code always gives the same findings.
- Each file is parsed into a syntax tree and converted to a common form, so most rules are written once for every language.
- Routes, the middleware that runs before them, and database operations are found. Function calls are linked across files.
- For each route, checks, database operations and responses are put in order. Each value is traced to the client, the signed-in user or the database.
- The rules look for one missing, broken or misordered step, such as a record loaded without its owner.
| Data-flow SAST | Logic Scan | |
|---|---|---|
| Question asked | Can untrusted data reach a dangerous function without being made safe? | Can someone do something the application should not allow? |
| What is modelled | Sources, sinks and the paths between them | Routes, middleware, the signed-in user, roles, organisations, record owners, state, and the order of steps in each request |
| Typical findings | SQL and command injection, cross-site scripting, path traversal, unsafe deserialisation | Access to other users' records, privilege escalation, second-factor bypass, reusable reset links, race conditions on balances, self-approval |
| Across endpoints | Each path is usually checked on its own | Compares endpoints, for example an owner filter or admin check present on one and missing from another |
Use both. Logic Scan does not replace SAST, and DAST and pentests find things that static analysis cannot see.
OWASP API Security Top 10 coverage
Examples of rules for the authentication, authorisation and business flow risks in the 2023 list. A rule covers particular forms of a risk, not all of it.
| Risk | Examples of rules |
|---|---|
| API1:2023 Broken Object Level Authorization | LS039 Any user can read another user's recordLS040 Any user can change another user's recordLS041 Any user can delete another user's recordLS054 List endpoint returns everyone's records |
| API2:2023 Broken Authentication | LS002 Login has no brute-force protectionLS010 Token is decoded but never verifiedLS013 Login can complete without the second factorLS022 Password-reset token can be reused |
| API3:2023 Broken Object Property Level Authorization | LS031 New users can choose their own privilegesLS048 Entire request body is saved to the databaseLS049 Request body overrides a trusted fieldLS063 Complete user record is returned to the client |
| API5:2023 Broken Function Level Authorization | LS037 Admin endpoint does not check for an admin roleLS043 Permission decision uses a role sent by the clientLS050 Roles can be changed without an admin check |
| API6:2023 Unrestricted Access to Sensitive Business Flows | LS073 Coupon can be used without limitLS085 Reward can be claimed repeatedlyLS093 One-time item can be redeemed twice in parallel |
Languages and scan time
Coverage is widest for JavaScript and TypeScript. Most rules run on every language, but not every rule has been tested in every language yet.
| Language | Frameworks |
|---|---|
| JavaScript, TypeScript | Express, Koa, Fastify, Hapi, Hono, Next.js, NestJS, TypeGraphQL, Socket.IO |
| Python | Flask, FastAPI, Django, Django REST Framework, Connexion, Graphene |
| Go | net/http, Gin, Echo, Chi, Gorilla, Fiber |
| PHP | Laravel, Slim, Symfony, plain PHP |
| Java | Spring, JAX-RS |
| Ruby | Rails, Sinatra |
| Perl | Mojolicious, Dancer, CGI |
| Project | Lines | Routes | Seconds |
|---|---|---|---|
| BookStack (PHP) | 216,091 | 348 | 0.90 |
| Bugzilla (Perl) | 116,067 | 11 | 0.46 |
| WebGoat (Java) | 63,048 | 249 | 0.30 |
| OWASP Juice Shop (TS) | 31,205 | 279 | 0.60 |
| Healthchecks (Python) | 24,445 | 132 | 0.13 |
| RailsGoat (Ruby) | 3,384 | 47 | 0.03 |
All 344 rules, measured in December 2026 on an Apple M3 (8 cores, 16 GB). Median of five scans after one warm-up. All nine projects.
Limitations
- It does not know what your application is meant to do. It finds violations of common rules such as ownership, roles, payments and one-time use. Flaws specific to one business still need a reviewer.
- It does not run code, so it can miss routes, queries or checks chosen at runtime.
- It cannot see controls outside the code, such as rate limits in an API gateway. You can turn off the rules those controls cover.
- Fields and functions are mostly recognised by common English names, such as
ownerorbalance. Unusual or non-English names can hide flaws. - Values stored in one request and read back in a later one are not followed.
- Some findings will be false positives and some flaws will be missed. A scan with no findings does not show that an application is secure.
Read the white paper online Business logic vulnerabilities explained All scanners
Questions and answers
What is a business logic vulnerability?
A flaw that lets a user do something the application should not allow, using requests that look normal. Examples are reading another customer's invoice by changing the id in the URL, registering with "role": "admin", or redeeming one gift card twice with two requests sent at the same moment.
Can SAST find IDOR and other access control flaws?
Usually not. A data-flow SAST rule looks for untrusted input reaching a dangerous function. An IDOR often has no such path: the query is safe, and what is missing is a check that the record belongs to the caller. Logic Scan models the signed-in user and record owners, so it can report that missing check.
Does Logic Scan use AI?
No. The engine is deterministic. It does not use a machine learning model, does not run the application and makes no network requests, so the same code always produces the same findings.
Which languages and frameworks does it support?
JavaScript and TypeScript (Express, Koa, Fastify, Hapi, Hono, Next.js, NestJS, TypeGraphQL, Socket.IO), Python (Flask, FastAPI, Django, Django REST Framework, Connexion, Graphene), Go (net/http, Gin, Echo, Chi, Gorilla, Fiber), PHP (Laravel, Slim, Symfony, plain PHP), Java (Spring, JAX-RS), Ruby (Rails, Sinatra) and Perl (Mojolicious, Dancer, CGI). Coverage is widest for JavaScript and TypeScript.
Can I run it in a CI pipeline?
Reports are produced as text, JSON or SARIF 2.1.0, and a pipeline can be set to fail when a finding at or above a chosen severity is reported. JSON and SARIF findings carry a fingerprint that does not depend on line numbers, so a finding can be tracked as the code around it changes.
Does it replace a penetration test?
No. It does not know what your application is meant to do, so flaws specific to one business, such as a payment attached to the wrong order, still need a person. Running it before a pentest clears the common flaws so the testers can spend their time on the rest.
How many false positives should I expect?
Some. 38 rules are rated high confidence, 298 medium and 8 low, and confidence levels are still being adjusted during the beta. Every finding should be reviewed by someone who knows the application.
When is it available and which plan includes it?
Logic Scan is in beta, at version 0.1.0. It is planned for the Ultimate plan in January 2027. The date and plan may change. It is not part of the Free plan or the Premium trial. Contact us to ask about the beta.
See how Logic Scan handles your code
The white paper has eight examples with the scanner's real output. To try the beta on your own repository, talk to us. A technical sheet listing all 344 rules is available on request.
Logic Scan is planned for the Ultimate plan in January 2027. The date and plan may change.