Why would the routing and permissions of a batch interface carrying multiple groups of sub-requests go wrong?
Why would an interface with multiple sub-requests in a single request go wrong: The root cause is usually in the same place - the outer layer has already completed route determination and authentication, and the inner layer directly uses this conclusion when assigning sub-requests. As a result, the sub-requests are neither treated as independent requests for re-routing nor re-verified according to their own action type, resulting in confusion of 'one entry, multiple capabilities'.
At what step did the mistake occur
The journey of an outer request is originally divided into four stages: entering the route, parsing identity, determining permissions, and executing processing. The batch endpoint only made a judgment in **section and the third section, and then executed the sub-requests one by one. The problem lies in this asymmetry:
- At the routing level: the target capability of the child request is described by parameters, the outer route does not recognize it, but the processing function calls it according to the target capability;
- At the permission level: the outer layer goes through the batch entry reading or submission permissions, while the actual execution of the child request is the permissions of each automatic action, which are not equivalent;
- The context level: The child request inherits the outer request context, including the parsed path, content type, and identity conclusion.
When a flaw can confuse these two layers into the entry point of the concatenated query, the consequence is upgraded from unauthorized access to remote code execution. One of the publicly disclosed core flaw announcements was written directly as batch routing confusion leading to remote code execution, and the official thanked it along with another injection issue, and it was fixed in subsequent versions.
The three aspects that the content system needs to receive from the outside interface.
- The child request should be re-evaluated independently. At least go through once more the 'Is the target capability allowed to be called in bulk' and 'Does the current identity have permission for this action', do not take the outer conclusion as a default pass.
- Whitelist the list of capabilities. The actions that can be accessed through the batch entry should be condensed into a clear table, rather than 'All internal functions can be described.' Directly reject the targets outside the table and record the reason for rejection.
- Parameters are bound by type. Sub-request parameters cannot participate in structural splicing when entering the query conditions, sorting and filtering fields all follow enumeration; this rule has nothing to do with batch processing or not, batch processing just concentrates the risk surface into a single request.
How to match the approval interface
If the interface of the built-in server subsystem allows external client orchestration calls, the permission design needs to consider the case of 'one call with multiple write actions' extra. Taking the practice of the content management system as an example, the tool interface converges on the intent directory, the write operation goes through round-level approval and merging confirmation, and the high-risk areas are closed by default and need to be explicitly opened. The effect of these three together exactly blocks two weak points in the batch scenario: the ability list is enumerable, and the write action will not be automatically approved due to the outer level judgment.'
It should be reminded that in a multi-site scenario, an additional layer is required: the data and permission boundaries of different sites cannot be visible to each other due to the shared background, and batch requests should be reviewed according to the site affiliation in particular.
Common questions
Can limiting the size of batch requests avoid this problem?No. It only reduces throughput and does not change the mechanism of sub-requests following the conclusions of the outer layer.
Does the read-only interface need to be re-evaluated?Yes. The batch entry for read-only access may also expose unauthorized content scope, and the cost of judgment is much lower than that of data leakage disposal.
Is JWT enough for authentication?Authentication and action authorization are two different things. The token proves who you are, but does not prove that the action corresponding to this sub-request is allowed to be executed.