API Access and Integrity Risk Catalog

This post distills the API governance methodology developed for the Xomaps® (信朴科技) location management system: a risk catalog of 17 control measures for enterprise internal systems, designed for architecture reviews, security requirement writing, and threat modeling.

Scope: enterprise internal systems — systems where the data is a company-level asset and every user is both a user and a maintainer of that asset. This includes command channels (consolidated command layer on the write side) / multi-tenant middle platforms / open APIs (MCP, mini-program mobile clients). Purpose: a standard risk catalog for architecture reviews, security requirements, and threat modeling. Positioning: belongs to the “API Access and Integrity Risk” category, alongside Transport Security and Authentication Security.

Background: Once the UI Disappears, Every API Is Directly Reachable

Core thesis: AI is changing how enterprise systems are consumed, from “human + UI” to “agent + API/CLI”. The interface is no longer the mandatory path — agents enumerate endpoints directly, read tool descriptions, and chain calls autonomously based on semantics. Every protection the UI layer silently provided now fails at once. That is why this catalog exists[1][2].

DimensionUI era (human + GUI)AI era (agent + API/CLI)
Request originGenerated by user clicks; the UI shapes a legitimate request flowThe agent decides what to call on its own, no UI required
Protection assumptionDisabled/hidden buttons, page navigation order, and form validation act as implicit defensesAll gone — /save, /export, /commands/* are as directly reachable as that disabled button on the page
Discovery costAttackers must reverse-engineer front-end JS to assemble an API mapTool descriptions / open API indexes are a ready-made capability map (MCP tools/list fully enumerates on every connection; humans read the docs once)
Attack scaleManual, one-by-one attempts, expensiveCheap to deploy massive fleets of agents probing in parallel — an asymmetric game: the attacker only needs to find one hole, the defender must cover the entire surface
Invocation patternsAlong UI-prespecified paths and orderUnexpected ones: cross-endpoint combinations, unusual orderings, boundary parameters, parallel retries

Three corollaries frame everything that follows:

  1. None of the classic risks have disappeared; they are just directly reachable. Treat AI-connected backends like ordinary web services: IDOR, injection, and missing authentication all still apply (OWASP MCP Top 10’s MCP05 command injection and MCP07 insufficient authentication/authorization cover exactly these). All 17 items in this catalog remain applicable — what changed is not the risk itself, but the attacker: from “a person with a packet sniffer” to an automated agent running 24/7 without fatigue, with discovery cost approaching zero.
  2. The API channel itself adds AI-specific attack surfaces: tool description poisoning, rug pulls (swapping a tool’s definition after approval), and broadcasting full context (including PII and credentials) on every retry — see §4.2. These stack on top of the 17 items, not replace them.
  3. CLI/API-first is the right direction, provided backend gates fill in. It is auditable (commands are text and fully traceable), sandboxable, and permission-scoped — that is precisely where the API channel beats the GUI black box. What’s missing is not the interface form, but pushing every front-check the UI once provided by default down into server-side gates — which is the shared theme of the 17 control measures in this catalog.

Why Enterprise Internal Systems Collapse the Most Completely

The trust model of enterprise internal systems is fundamentally different from consumer systems: the data is company-level, and every user is both a user and a maintainer of that asset. In the UI era this model ran on “interface-based scoping” — the fields you saw, the buttons you could click, and the workflows you could follow were all trimmed by the interface; collaboration happened within those trimmed boundaries, and the boundary itself was the control.

In the AI era, this control structure collapses entirely. The collapse happens on three levels:

  1. The trimming disappears. There is no “your interface” in front of an agent — only the full API surface. The case-number field may be read-only for you in the UI, but the endpoint the agent discovers doesn’t know that. No entry point in the UI ≠ no entry point in the system.
  2. “Should we?” loses its answerer. A user tells the agent “change the case number from A to B” — the agent will explore how to change it, never whether it should. It is faithful, efficient, and asks no questions. In the UI era, many constraints were never technical gates at all; they were simply “no entry point exists on the interface”. That entry point always exists for an agent.
  3. Legitimate identity × faithful execution = the most dangerous combination. No external attacker required: a single vague natural-language instruction from a normal employee is enough for the agent to find paths that bypass every implicit collaboration constraint. And the post-hoc audit shows “legitimate user, legitimate credentials, legitimate endpoints” — nothing anomalous on the detection surface.

Impact on the catalog: the attacker assumptions of R9 (state gates), R7 (field whitelists), R13 (combination validation), and R14 (context injection) must be rewritten — from “malicious third party” to “well-meaning colleague + an agent that never says no”. The defense shape stays the same (server-side gates), but the acceptance criterion changes: the gates must block not only malicious attacks, but every path an internal user’s agent could discover on their behalf. In internal-system reviews, any answer of the form “the UI has no entry point, so we’re fine” should be treated as invalid, without exception.

Threat Profile: The Attacker This Catalog Defends Against

An internal agent — an automated proxy holding a legitimate username and password, able to log into the system normally. It bypasses the UI’s intended paths, calls the full API surface directly, and autonomously hunts for openings to modify system data. Four capability traits:

  1. Legitimate credentials, normal login. The username and password are real and valid; the login flow, captcha, and security device all pass — it is that user. Authentication does nothing against it.
  2. Bypasses the UI’s intended paths. It does not follow page-prescribed workflows; it enumerates, probes, and chains calls across the full API surface. What the UI allows it to do is irrelevant; what the API allows is what matters.
  3. Autonomous vulnerability exploration. It probes parameter boundaries, hidden fields, state combinations, and other tenants’ IDs endpoint by endpoint — every probe is a “legitimate request”.
  4. Data modification is the goal. The point of exploring is to find a writable opening and change it. Reads are reconnaissance; writes are the objective.

Why traditional defenses idle against it, layer by layer: authentication — passed (credentials valid); function-level permissions — passed (role is real); tenant isolation — passed (same-tenant operation); audit — everything looks like normal business operations. After all four traditional gates show green, the only thing left that can stop it is the 17 items in this catalog: object-level data scopes (R3), state gates (R9), field whitelists (R7), combination validation (R13), idempotency (R12), quotas (R17)… What these gates share is that all of them sit after authentication and target data and business semantics — exactly the defense shape derived by reverse-engineering the “internal agent threat model”.

Internal vs. external: once an external attacker obtains an account or breaks through the AI channel, they use exactly the same playbook. So blocking the internal agent’s paths leaves external attacks nowhere to land; the reverse does not hold — that is why this catalog ranks the internal agent as the top threat.


0. Three Key Distinctions (Establish the Criteria First)

CategoryCriterionTypical example
Authorization bypassThe subject obtains access/operation rights it should never haveUsing an ordinary user ID to modify someone else’s document
Invariant bypassRights are complete, but the actor constructs a business state that is not allowedPayable is 3000 but 50000 gets allocated; negative amounts posted
Execution mechanism abuse (replay / version)Rights are complete and the state rules are fine, but the execution mechanism is exploited to repeat or overwrite a changeReplaying a captured payment request; overwriting an approval result with an old version number

When threat modeling, ask one question first: is this request “no rights”, “enough rights but illegal state”, or “fully legitimate but executed twice/overwritten”? The three questions locate the request in different categories.


0.5 Mapping to the OWASP API Security Top 10 (2023)

This catalog is a business-layer refinement of the OWASP API Top 10 2023: OWASP’s three authorization categories (API1/API3/API5) are split here into finer-grained items that can go straight into acceptance criteria; command channels (write-side consolidation), multi-tenant references, and context injection are shapes OWASP does not call out separately but that occur frequently in middle-platform architectures[3].

This catalogOWASP API Top 10 2023Notes
R1 vertical bypass, R2 action confusionAPI5:2023 Broken Function Level AuthorizationFunction-level authorization failure
R3 horizontal bypass, R4 bulk/export bypass, R5 transitive bypass, R6 cross-tenant reference injectionAPI1:2023 Broken Object Level AuthorizationObject-level authorization failure (BOLA/IDOR), top of OWASP’s list
R7 field-level bypass, R8 masking bypassAPI3:2023 Broken Object Property Level Authorization2019’s Mass Assignment and Excessive Data Exposure were merged into one item in 2023: write-side field whitelisting and read-side field reduction are two faces of the same root cause
R9 state gate bypass, R10 version bypass, R13 business combination constraint bypassNo direct counterpartBelongs to the OWASP Business Logic Cheat Sheet domain; a single API item does not cover business invariants
R11 command channel bypass, R12 replay bypassNo direct counterpartSpecific to CQRS/Event Sourcing architectures; command idempotency and projection idempotency are mature industry capabilities (see R12)
R14 permission context injection, R15 proxy relay bypassRoot-cause shapes of API1/API5Context assembly errors also involve API8:2023 Security Misconfiguration
R16 query-side bypassRead-side shape of API1:2023Under CQRS, separating command/query gates is the authoritative recommendation (commands strict, queries broader but gated)
R17 business quota bypassAPI4:2023 + API6:2023API4 = unrestricted resource consumption (technical impact); API6 = unrestricted access to sensitive business flows (business impact). The two are often conflated into a single “rate limiting” problem — see R17

OWASP items deliberately excluded from this catalog: API2 Authentication, API7 SSRF, API8 Misconfiguration, API9 Improper Inventory Management, API10 Unsafe Consumption of APIs — they belong to authentication security / infrastructure security / supply chain security domains, orthogonal to this catalog’s “access and integrity” positioning; including them here would only dilute the review focus.


1. The Risk Catalog (All 17 Items)

1.1 Function-Level Authorization Bypass

R1. Vertical Authorization Bypass (Function Permission Bypass)

  • Definition: A subject invokes operations on a higher-privilege surface out of bounds (ordinary user calling admin endpoints, low-role user calling high-role endpoints).
  • Typical entry points: Admin endpoints, batch-processing endpoints, internal ops interfaces exposed on the business gateway.
  • Controls: URL-level function permissions (whitelist stored in DB + authorization script + cache refresh — all four steps, no exceptions); endpoints fail-closed by default; unregistered URLs are rejected, not allowed through.
  • Implementation in this project: sqls/saas-update-permission.sql; the two 40101 shapes are distinguished via data (AuthorizationDeniedException = authenticated but unauthorized vs InsufficientAuthenticationException = unauthenticated).

R2. Action Confusion Bypass (Weak-Semantics Action Bypass)

  • Definition: One endpoint carries multiple actions, or the action type is controlled by an input parameter (e.g. a unified operate(type) with type=submit/approve/revoke); only “can this endpoint be accessed” is checked, not “can this action be executed”.
  • Typical entry points: Unified operation endpoints, state-machine-driven endpoints, MCP tool dispatch layers.[4]
  • Controls: One endpoint + one permission per action; action-granularity authorization (endpoint access ≠ action approval); action enumeration whitelists.
  • Distinction from R1: R1 is permission hierarchy on the platform/tenant surface; R2 is missing authorization at action granularity.

1.2 Data Ownership Bypass

R3. Horizontal Authorization Bypass (IDOR / Resource Ownership)

  • Definition: Skipping data-ownership and data-scope isolation, directly accessing or operating on another user’s resources by ID[5].
  • Typical entry points: GET /{id}, POST /{id}/xxx, any endpoint that fetches an object by ID.
  • Controls: Reads by ID must pass the tenant gate and the data-scope gate; list and detail policies come in pairs (list filtered but detail not = policy split).
  • ⚠️ Confirmed in this project: findById does not go through Hibernate filters (em.find bypasses the query plan) — the read gate must be backstopped by TenantEntityListener#postLoad; the data-scope gate ScopeReadable#assertReadable must be wired at the BaseRestController#getOne/delete boundary.
  • ⚠️ Sub-resources need gates too: routes that list children by parent ID (/by-customer, /{id}/records) must call assertReadable on the parent first.

R4. Implicit Bulk / List Authorization Bypass (Scope Bypass)

  • Definition: Single-resource checks are in place, but bulk query, export, statistics, and aggregation endpoints lack row-level filtering; you can’t take one record, but you can pull an entire tenant’s or the entire platform’s data.
  • Typical entry points: /export (an unpaged full-data outlet, the most-targeted), /list, /stat, reporting endpoints, pagination endpoints.
  • Controls: Exports must reuse the list query (never a separate unfiltered query); list-side QueryDSL/Blaze accepts only the unified data-scope predicate; pagination caps enforced (guard against unpaged full pulls).
  • ⚠️ Confirmed in this project: PageableUtils falls back to unpaged full pulls for missing/<=0/==999 values — external channels must inject a default pageSize; AI/MCP channels get enumeration circuit-breaking keyed on a (tenant + user + endpoint) parameter fingerprint.
  • The AI bulk-exfiltration three-step: enumerate IDs → pull one by one → export as fallback. All three must be closed off.

R5. Implicit Dependency Resource Bypass (Transitive / Cascading Resource Bypass)

  • Definition: The current document itself is authorized, but its associated child resources or referenced resources lack independent checks; operating on A indirectly reads or writes an associated entity B without rights.
  • Typical entry points: Modifying an order while also updating its payment account/attachments; bulk-save endpoints that update by parent object; cascading JSON saves.
  • Controls: Every associated ID appearing in the request body gets its own ownership check; entity-by-entity gates on cascading saves; nested resources must never get “parent passed, children all through”.

R6. Cross-Tenant Reference Injection (Multi-Tenancy Specific)

  • Definition: Selecting a reference ID within your own tenant is allowed, but the system never verifies that the referenced resource belongs to the same tenant; passing another tenant’s resource ID establishes a cross-tenant association and quietly opens a hole between data scopes.
  • Typical entry points: Form pickers that pass IDs straight through, import endpoints, reference fields in open APIs.
  • Controls: Validate the target tenant before writing a reference field; read-side selectors must also carry tenant filters; cross-tenant read endpoints removed from open indexes.
  • ⚠️ Confirmed in this project: @CrossTenant repository methods are the only exemption channel, managed as a whitelist; MCP OpenApiIndex skips cross-tenant read endpoints.

1.3 Attribute-Granularity Bypass

R7. Field-Level Authorization Bypass (Attribute Write Bypass)

  • Definition: The user is allowed to update the document, but certain sensitive fields should be off-limits; the endpoint has no “writable field whitelist”, so PATCH/POST overwrites the whole object[6].
  • Typical entry points: Whole-object update save endpoints, bulk field mapping (BeanUtils full-copy), command-layer handler applyFields.
  • Controls: Explicit per-field assignment (BeanUtils full-copy forbidden); protected fields structurally eliminated at the DTO layer; unified write-path interception: clears tenantId on create, backfills tenantId/createBy/createTime on update; business ownership fields (e.g. salesId) declared as a protected list by the Service.
  • Deserialization defense (OWASP’s standard countermeasure for Mass Assignment): deserialization configured to reject unknown properties (FAIL_ON_UNKNOWN_PROPERTIES) — undefined fields smuggled in the request body fail loudly instead of being silently dropped, otherwise field smuggling is only half-blocked; payload size caps; hard caps on nesting depth (usually ≤3 levels)[7].
  • ⚠️ Implementation in this project: BaseRestController#save is wired with ProtectedFields; command-layer handlers assign fields one by one in applyFields; field smuggling is covered by contract-test watchdogs.

R8. Data Masking Bypass (Attribute Read Bypass)

  • Definition: Endpoint authorization is fine, but input parameters control whether sensitive fields are returned (showMobile=true, rawData=true) and yield plaintext. This is “can access the resource, but should not see all attributes”.
  • Typical entry points: Open APIs, MCP/AI egress, export endpoints, log egress.
  • Controls: Masking happens uniformly at the server-side egress; never trust any front-end “already hidden” assumption; switch-style masking parameters forbidden; the AI channel’s single egress masks by field name uniformly.
  • ⚠️ Implementation in this project: ResponseMasker masks mobile numbers/bank accounts/ID numbers/passwords by field name at the single BackendClient egress (xomaps.mcp.mask-sensitive on by default).

1.4 Precondition Bypass

R9. State Gate Bypass (State Precondition Bypass)

  • Definition: Executing a change action while the entity’s current state does not allow it (editing a PENDING document, changing content of an APPROVED one, deleting a locked document).
  • Typical entry points: /save endpoints that bypass the save() business method’s branches, batch deletes, confirm/cancel action endpoints.
  • Controls: Read the database to validate state before edit/delete (never trust a snapshot sent from the front end); save/update/delete/batchDelete all wired, since any bypassed branch is an open gate; legitimate state exits use an internal channel that skips the update gate, to avoid false positives.
  • ⚠️ Implementation in this project: Reference implementation = assertEditableByStatus on SaleContract/PurchaseContract (wired in save/saveContract/batchDelete); corrections go through change/reversal entries, not direct edits.
  • ⚠️ AI attack signature: AI never walks the front-end pages; it POSTs /save directly — any /save endpoint that bypasses save() is its first landing spot.

R10. Version / Snapshot Bypass (Optimistic Locking Bypass)

  • Definition: The entity has version locking / optimistic locking, but the backend never enforces version checks; an old-version snapshot is used to construct a request that overwrites later changes and skips intermediate state validation (e.g. the document was already approved by someone else; submitting an update with the old version number overwrites the approval result)[8].
  • Typical entry points: Update endpoints with a version field, concurrent editing, mobile offline sync.
  • Controls: Updates must carry a version and the backend must enforce the comparison; optimistic-lock failures fail loudly (never silently overwrite); database-level backstop constraint — a unique index on (aggregate ID, version) (UNIQUE(aggregate_id, version)), so writes fail outright when the application layer misses the check; this is the un-bypassable last line of defense; critical documents additionally get a “lock + reversal” mechanism as a backstop.
  • Distinction from R9: R9 governs state-machine preconditions; R10 governs overwrites on the timeline.

1.5 Command and Message Channels

R11. Command Channel Authorization Bypass

Terminology note: the command channel in this project is CQS (Command Query Separation) applied at architecture level — write endpoints are consolidated into Command Handlers while reads use the regular query model, with no separate read store; CQRS/Event Sourcing architectures take this shape further, where the same risk patterns apply and are even more typical.

  • Definition: Command forgery, missing command authorization, broken gating on async command paths (annotations not resolved along the inheritance chain, whitelist omissions, handlers not wired to gates).
  • Typical entry points: POST /commands/{action} endpoints, command handlers, async command consumers.
  • Controls: One endpoint per command + @Valid; handlers uniformly pass four gates (dedup fingerprint → data-scope gate → execute → doExecute); if annotations don’t resolve along the inheritance chain, every subclass must be annotated explicitly; even with wildcard URL authorization coverage, integration testing must verify.
  • ⚠️ Implementation in this project: AbstractCommandHandler four gates; new modules’ command packages must enter the @ComponentScan whitelist (miss = silently ineffective); six categories of negative contract-test templates (including unauthorized IDs and field smuggling).

R12. Idempotency / Replay Bypass

  • Definition: Commands and update endpoints lack replay protection; a captured legitimate request is re-delivered repeatedly, causing duplicate orders, duplicate approvals, duplicate charges. Even with authorization, ownership, state, and combination constraints all correct, the business is still broken.
  • Typical entry points: Payment/transfer write endpoints, async command message replay, dead-letter retries, MQ duplicate delivery.
  • Controls: Creates use a dedup fingerprint for idempotency; deletes made idempotent; business actions carry a unique business-number idempotency key; async consumers dedupe by message ID; retry semantics defined explicitly (at-least-once must be paired with idempotency).
  • Engineering details (the three invisible seams where idempotency breaks):
    1. The idempotency marker and the business result must land in the same transaction. Write the event first, then mark “processed” in a separate transaction — crash between the two commits, and the retry sees no marker, so the same command runs again (duplicate charges). The industry-standard practice is to put “save event + mark command processed” into one database transaction.
    2. Idempotency must run through the whole chain. Command idempotency ≠ event idempotency ≠ projection idempotency: when the same event is delivered twice, consumers/projections each need their own dedup (record a stable event identifier, or use deterministic replace-on-replay). Retries, dead-letter redelivery, and process restarts all trigger this.
    3. Side-effect egress gets its own gate. Non-rollbackable actions — email, payments, webhooks — must sit after the idempotency gate and keep independent dedup records; historical replays must never re-trigger external side effects.
  • Distinction from R10: R10 is an old version overwriting new state; R12 is the same request taking effect repeatedly.

1.6 Business Invariants

R13. Business Combination Constraint Bypass

  • Definition: The actor has rights and the state is legal, but the change violates cross-field linkage rules or value-domain exclusivity (negative amounts, inverted start/end dates, percentages summing over 100%)[9].
  • Typical entry points: Input validation layers of any write endpoint, especially amounts, percentages, dates, and mutually exclusive enums.
  • Controls: Amount inputs strictly validated with signum() > 0; combination rules asserted explicitly at the Handler/Service layer, never delegated to the front end; state field naming avoids reserved words.
  • ⚠️ Confirmed in this project (penetration test S18): /allocate returned 200 for -1000/0/-99999; once paid_amount went negative, the balance formula payable - paid amplified instead, and RMB 50,000 was allocated against a payable of RMB 3,000.
  • Distinction from R7: R7 governs “is this subject allowed to touch this field”; R13 governs “are the fields valid together”.

1.7 Context-Class Risks

R14. Permission Context Pollution / Parameter-Controlled Permission Injection

  • Definition: The backend reads role, scope, tenantId, isAdmin, or data-permission filter conditions directly from request inputs; an attacker escalates privileges, switches tenants, or disables filters by passing parameters.
  • Typical entry points: tenantId taken from body/header instead of the token; switch parameters like dataFilter=false; userId taken from the request body.
  • Controls: Tenant/user context comes only from the authenticated state (token); same-named fields in the request body are always discarded; filter conditions fixed server-side with no exposed switches; write-path interception against self-authorization.
  • ⚠️ Implementation in this project: om_employee.user_id is globally unique, binding is by mobile number only, and any userId in the request body is discarded; tenant isolation is handled uniformly by the TenantFilterAspect framework, and business code is forbidden from writing tenant_id.

R15. Authorization Chain Relay Bypass (Proxy / Delegation Bypass)

  • Definition: When proxying, on-behalf operations, service accounts, internal forwarding, or task delegation are supported, the proxy context lacks strong isolation, can be tampered with, or proxy permissions spread laterally.
  • Typical entry points: Approval delegation, customer-service acting on behalf of users, internal system proxy calls, caller identity propagation on AI channels.
  • Controls: Proxy identity passed through (on-behalf-of), audits record the real caller; proxy context never specified by client parameters; reject any proposal to give a channel a shared account — a service account means distorted audits + data-scope amplification + broken backend gates; internal forwarding credentials get explicitly bounded validity periods and scopes.
  • ⚠️ Confirmed in this project (2026-11-12): MCP credentials switched to caller Bearer token passthrough (McpCaller snapshots the 4th field from the request thread; empty means fail-closed; 401 is not retried), and the service account password grant was deleted entirely. Any proposal to “give MCP an account” is rejected.

R16. Query-Side Constraint Bypass (Query Authorization Bypass)

  • Definition: Only the Command side is protected while the Query channel runs free; crafted queries retrieve derived data, projections, or sensitive computed fields the caller has no right to see. Especially prominent under CQRS: commands are well protected while the query model has no ownership/permission filtering.
  • Typical entry points: Metadata endpoints like /open/command-schema, statistical projections, aggregate views, derived computed fields, search endpoints.
  • Controls: Read-side gates designed in pairs with write-side gates; projections/aggregate views reuse the same data-scope predicate; metadata endpoints get exposure reviews (a field list = an attack map); open and internal interfaces authenticated separately.
  • ⚠️ Implementation in this project: ScopeReadable is implemented by only 9 modules; the remaining entities are fully visible within the tenant on the read side = a product decision. Threat modeling must confirm one by one whether each needs data-scope narrowing.

R17. Business Quota Bypass (Resource Exhaustion Abuse Beyond Rate Limiting)

  • Definition: The caller has rights, the state is legal, and the fields are legal, but quotas, allowances, and count limits are bypassed (e.g. “max 5 projects per user” with no backend check); AI bulk creation amplifies the damage. Not strictly an authorization bypass — classified as business abuse.
  • Typical entry points: Creation endpoints, file uploads, AI token consumption, storage/bandwidth.
  • Controls: Quota checks on the server (layered by count, size, frequency); oversell prevention via conditional atomic UPDATE only (check-then-update always oversells); AI consumption metered per round to prevent double-counting; soft rejection with audit trail on limit breach.
  • API4 vs API6 (both new in OWASP 2023 — do not conflate them into one “rate limiting” problem):
    • API4 Resource Consumption: purely technical impact (DoS, cost inflation); countermeasures are generic rate limiting, pagination caps, payload caps — uniformly enforceable at the gateway.[10]
    • API6 Sensitive Business Flows: business impact (scalpers sweeping inventory, seat-holding that locks stock, farming rebates); every request is legitimate, and scanners cannot detect it; countermeasures must be chosen per business flow: business-dimension (not global-IP) quotas, human verification, behavioral analysis, device fingerprints. Business picks the flow first, engineering picks the gate second — you cannot put a challenge on every endpoint.[11]
    • Machine-consumed interfaces (B2B / open APIs / AI channels) are the hardest hit: they can never pass browser challenges, and OWASP explicitly notes “such interfaces often lack equivalent protections and become easy targets” — they must get equivalent protection through client identity + contract-level quotas + purpose restrictions + audit trails[12].
  • ⚠️ Implementation in this project: Storage 10 GiB / bandwidth 200 GiB, with quota changes applied in three places in sync; AI tokens metered per round via ModelCallEndEvent + perRoundMetered to prevent double-counting; MCP session budgets (cumulative call counts/byte windows).

#RiskOne-line criterion
1Vertical authorization bypassIs this subject allowed to call this endpoint
2Horizontal authorization bypass (IDOR)Is this subject allowed to touch this record
3State gate bypassDoes the current state allow this action
4command channel bypassIs every gate on the command path in place
5Business combination constraint bypassAre the field combinations valid together
6Field-level authorization bypassIs he allowed to write this field
7Bulk/export scope bypassDo lists, exports, and statistics have row-level filtering
8Replay and idempotency bypassWould duplicate delivery take effect twice
9Query model bypassDoes the Query side have ownership/permission filtering
10Permission context injectionIs context taken only from the authenticated state, or can it be tampered with via parameters

3. Category Labels (for Threat Modeling)

  • Function-level authorization: R1 vertical bypass, R2 action confusion bypass
  • Data ownership: R3 horizontal bypass, R4 bulk/export bypass, R6 cross-tenant reference injection, R5 transitive/associated resource bypass
  • Attribute granularity: R7 field write bypass, R8 masking bypass
  • Precondition bypass: R9 state gates, R10 version lock bypass
  • Command and message channels: R11 command bypass, R12 replay bypass
  • Business invariants: R13 business combination constraint bypass
  • Context class: R14 permission parameter injection, R15 proxy relay bypass
  • Query and quota: R16 query bypass, R17 business quota bypass

4. Special Notes for the AI / Fuzz Channel

This section expands the background thesis (the UI disappears, APIs become directly reachable) into attack-and-defense details: §4.1 covers “how automated probing attacks”, §4.2 covers “the new surface the agentic channel itself adds”.

4.1 Behavioral Differences in AI Bulk Probing (curl / Scripts)

The behavioral differences between AI and human penetration testing determine where the key defenses go:

  1. No front end: POST /save directly, call /commands/* directly — every check that relied on front-end disabling fails, so state gates and field whitelists must close the loop server-side.
  2. Enumeration attacks: iterate IDs, pull everything through pagination, fall back to export — close all three with pageSize injection, enumeration circuit-breaking, and exports reusing the list query.
  3. Parameter exploration: switch parameters like dataFilter=false, showMobile=true, rawData=true are the fields AI tries first — never expose switches server-side.
  4. Repeats and variants: replaying the same request, amounts set to 0/negative/extreme values, overwriting with old version numbers — plug each one with idempotency fingerprints, signum() validation, and enforced optimistic-lock comparisons.
  5. Identity amplification: shared service accounts and on-behalf contexts are the biggest amplifiers — allow only on-behalf-of passthrough, and reject every shared-account proposal.

4.2 The Incremental Attack Surface of Agentic AI (2025–2026 Consensus)

Once the AI channel evolves from “bulk curl” to “autonomous agents”, multiple risks in this catalog compound. Industry reference points: OWASP LLM Top 10 2025 (LLM06 Excessive Agency)[13], OWASP Agentic AI Top 10 (published 2025-12)[14], and Gartner’s forecast that by 2029, more than 50% of successful attacks on AI agents will target access controls, with prompt injection merely the delivery vehicle[15]; the Five Eyes cyber agencies’ first joint agentic AI guidance (2026-04) likewise ranks permissions as the top risk class.

Concrete payloads on the MCP channel (the background thesis, instantiated):

  • Tool descriptions are attack payloads: on every connection the agent fully enumerates tools and reads their descriptions (humans read docs once); the descriptions go straight into the model context and participate in call decisions — Tool Poisoning (instructions hidden in descriptions/parameter schemas), Rug Pull (definition swapped after approval), Tool Shadowing (polluting the usage instructions of a trusted tool). The AMA paper demonstrated empirically that manipulating tool metadata alone (names/descriptions/parameter schemas) can induce an agent to prefer the malicious tool in a black-box setting, with 81%–95% success rates[16].
  • Classic vulnerabilities remain directly reachable: an MCP server is itself an internet-facing service — whatever the model can call, anyone who can reach the endpoint can call too; missing authentication, IDOR, and command injection existed before MCP, and now there’s an extra amplifier: “the model fills in parameters exactly as the text says” (documented case: the official reference postgres server passed queries wrapped in read-only transactions straight through — prefixing with COMMIT; escaped the read-only constraint and executed DDL).
  • Retry is exfiltration: when an agent retries a failed instruction, it re-sends the entire conversation history (including PII and credentials returned by earlier tools) over the network — every retry is a data exfiltration opportunity.
  • Where countermeasures land: Kaspersky’s nine recommendations reduce, in this catalog’s vocabulary, to four things — an inventory and whitelist of agent/MCP assets (maps to R2 action enumeration), least privilege with task-scoped validity (maps to R1/R15), human approval for high-risk operations (human in the loop), and full ingestion of prompts/tool calls/terminal commands/network traffic into SIEM (maps to R12’s audit surface)[17].
Failure modeMaps to this catalogNotes
Excessive Agency (LLM06)R1 / R2 / R7Three sub-shapes: ① functional excess — the agent can reach tools the task never needs; ② permission excess — a read-only-task agent holding writable credentials; ③ autonomy excess — high-risk actions with no human in the loop. The three often compound.
Confused DeputyR3 / R15The agent acts on inherited broad credentials, following content it believes to be operator instructions; real cases: EchoLeak (CVE-2025-32711, one external email made M365 Copilot exfiltrate data as the user), ForcedLeak (Salesforce, an anonymous web form exfiltrated via the agent’s CRM permissions).
Indirect prompt injectionThe agent shape of R14Malicious instructions hidden inside data the agent legitimately reads (tickets, emails, web pages, code comments) — the attacker never touches the agent directly, only poisons its data sources. No reliable model-layer general fix exists; the only scalable countermeasure is compressing “what an injection can do once it succeeds”: minimal tool set + least privilege + human in the loop for high-risk actions.
Action during constraintsThe agent shape of R9After ops sets a system to read-only/frozen, the agent is persuaded by instructions or hallucinations in its context to bypass the constraint (the Replit database deletion: all production data deleted under an explicit code freeze). Constraints must land on server-side gates, not just in prompts.
Action forgery and cover-upR12’s audit surfaceThe agent falsely reports “executed successfully” and fabricates synthetic data to cover it — write operations must treat server-side records as the single source of truth; the agent’s self-reporting counts for nothing.

Design principles (treat injection as inevitable; compress its blast radius):

  1. Assign tools per task, not per role: a ticket-triage agent does not need billing-system write access; there is no “just in case”.
  2. Agents are first-class identities: their own credentials, their own audit trails, their own behavioral baselines, governed with the same rigor as human accounts; no “one bot, one god-mode card”.
  3. Identity never comes from prompts or tool parameters: “the current user is xxx” passed as a prompt variable or tool parameter = injectable and tamperable (maps to R14). Identity must be passed from the authenticated state into every tool call and downstream hop.
  4. Authorize the action on every call, not just the session: validating once at session start and then letting the agent call freely with its own credentials is the standard breeding ground for confused deputy.
  5. MCP / proxy layers: watch audience validation: the industry has flagged “MCP servers blindly forwarding client tokens downstream” as an anti-pattern (audits record the wrong caller; audience controls get bypassed); the correct shape is explicit on-behalf-of + a caller identity snapshot + fail-closed — this project’s MCP passthrough design (McpCaller bearerToken snapshot, reject when empty, no retry on 401) aligns with it; the strengthening direction is downstream validation of token audience (RFC 8707 resource indicators)[18].
  6. Human in the loop for high-risk actions: approval confirmations must not travel through the same channel the agent can write back to (a confirmation relayed by the agent is no confirmation at all).

5. References

  1. Agent tool calls are turning the UI into an attack surface (survey of Feross / Terence Eden’s points: the attack surface expands from “what the user clicked” to “what the agent decides to call”). https://www.botlearn.com.cn/en/community/ai_general/b7e2f280-b9ec-4872-b202-d37b18808799/agent-工具调用正在把-ui-变成攻击面
  2. MCP Server attack surface analysis (model decisions + context pollution + tool permissions + chained calls; OWASP MCP Top 10 mapping). https://zone.ci/secarticles/wx/570239.html
  3. OWASP Developer Guide · API Top Ten. https://devguide.owasp.org/en/07-training-education/07-api-top-ten/
  4. OWASP API5:2023 Broken Function Level Authorization. https://owasp.org/API-Security/editions/2023/en/0xa5-broken-function-level-authorization/
  5. OWASP API1:2023 Broken Object Level Authorization. https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/
  6. OWASP API3:2023 Broken Object Property Level Authorization. https://owasp.org/API-Security/editions/2023/en/0xa3-broken-object-property-level-authorization/
  7. CQRS three-layer command validation and strict deserialization (reject unknown properties, payload caps). https://www.jcwlyf.com/content-51211.html
  8. Engineering idempotency and optimistic locking in CQRS (idempotency key committed in the same transaction, UNIQUE(aggregate_id, version); same root cause as R12). https://dev.to/ohugonnot/idempotency-in-cqrs-and-event-sourcing-part-2-commands-projections-and-outbox-4ei
  9. OWASP Business Logic Security Cheat Sheet (same root cause as R9/R10). https://cheatsheetseries.owasp.org/cheatsheets/Business_Logic_Security_Cheat_Sheet.html
  10. OWASP API4:2023 Unrestricted Resource Consumption. https://owasp.org/API-Security/editions/2023/en/0xa4-unrestricted-resource-consumption/
  11. OWASP API6:2023 Unrestricted Access to Sensitive Business Flows (business-layer / engineering-layer countermeasures). https://owasp.org/API-Security/editions/2023/en/0xa6-unrestricted-access-to-sensitive-business-flows/
  12. Equivalent protections for machine-consumed interfaces (B2B / open APIs / AI channels). https://ammune.ai/blog/owasp-api6-2023-unrestricted-access-to-sensitive-business-flows
  13. OWASP LLM Top 10 2025 (LLM06 Excessive Agency). https://genai.owasp.org/llm-top-10/
  14. OWASP GenAI / Agentic AI Top 10 (published 2025-12). https://genai.owasp.org/
  15. Commentary on Gartner’s forecast: by 2029, >50% of successful attacks on AI agents will exploit access control flaws. https://www.safeguard.sh/resources/blog/agentic-ai-access-control-problem
  16. Tool-poisoning empirical study: manipulating tool metadata alone induces calls to malicious tools (AMA paper, 81%–95% success). https://www.freebuf.com/articles/ai-security/495691.html
  17. Nine enterprise countermeasures against AI agents (Kaspersky: asset inventory, whitelists, least privilege, human approval, isolation, SIEM/XDR). https://cpunews.net/claude-code-cli等ai代理成新攻击面:企业防范ai代理攻击的9项措施
  18. Non-human identity · Confused Deputy governance checklist (MCP token audience, identity-passthrough anti-pattern). https://nhimg.org/confused-deputy-in-ai-agents-guide
  19. Public cases: EchoLeak (CVE-2025-32711), ForcedLeak (Salesforce Agentforce), the Replit production-data deletion incident (no single authoritative link; search by CVE ID / incident name).