How should the deletion range be verified for the batch deletion interface of background messages according to parameter concatenation?

📅 October 12, 2026 👁️ 14

How to verify the deletion range when the interface for deleting batch comments is parameterized, where is the answer not in the front-end transmitted numbers, but whether the range is recalculated on the server. Many background systems will submit multiple records selected on the list page along with their IDs. After the interface receives the list of IDs, it is directly added to the deletion conditions, which seems convenient, but in fact shifts the responsibility of determining what to delete to the caller. What is transmitted by the front-end can be changed, and if the server accepts it as is, the deletion range loses its constraint.

Why does the batch interface amplify the scope of impact

The single delete interface processes only one record at a time, the consequences of boundary crossing are usually limited to a single data record. The batch interface packs the IDs of multiple records into the same request, and one misjudgment can amplify it to a large area.The interaction of checking, selecting all, and deleting by filtering criteria on the list page naturally causes a request to carry a string of numbers. The more numbers, the greater the space for parameters to be tampered with or misunderstood: as long as there are no constraints on the concatenation of a segment, the statement to delete the current category may inadvertently hit other categories, other status ranges, or even data under other people's names.PbootCMS has already fixed this type of issue in the update logs of V3.2.18 - there is a parameter injection risk in the batch deletion of background messages, the fix is to strictly verify the list of ids to be deleted instead of trusting the numbers sent from the front end.This id refers to the primary key number in the database.

What kind of validation should the ID list undergo

Verify in two layers. First, verify the individual number itself: is the type correct, is it an integer primary key expected, or is it a string mixed with symbols; is the format clean, or has it been inserted with additional condition fragments?Is the amount within a reasonable range? The core of the repair in PbootCMS is also at this level, checking the id list item by item according to type and existence, and directly rejecting the illegal ones.Recheck the batch number: Each one must be confirmed to fall within the data range accessible to the current operator, belong to the same category, and be within the same status range, rather than mixed in with cross-category or cross-permission numbers.Check existence as well, if the number cannot be found in the database, it means that the request and data do not match, and the batch should be refused or removed before reporting an error, rather than concatenated and handed over to the delete statement.

Why does the deletion range need to be recalculated on the server side

The number transmitted from the front-end is just an intention, not an authorization. The server cannot take the number as a range, but should take the current session's identity, permissions, and column ownership to recalculate the set allowed to be deleted, and then intersect it with the number.The number outside the intersection, either reject it or fail the whole batch. Even if someone puts an out-of-bounds number in the parameters, this step of recalculating on the server will block it.Range validation also requires that the deletion condition not rely solely on the concatenation of the ID list, but should also include the attribution condition, so that the filtering conditions at the database level naturally enclose the rows that can be deleted.This WHERE clause refers to the filtering subclause in the delete statement.

After deleting what will you rely on?

Even if the verification is done properly, the risk of accidental deletion cannot be said to be zero: mistakes in checking, understanding bias, and script exceptions may lead to the deletion of records outside the scope. Therefore, the deletion interface needs a safety net. A common practice is not to perform physical deletion, but to move the records to a recoverable position first, and then completely clean up after confirming that there are no errors. In terms of internal practices, AnQiCMS does not perform physical deletion of formal documents, but moves them to the

Common questions

Ask: If the front-end has limited the selection range, does the server still need to check again for batch deletion?

Answer: Yes. The front-end limit is just a constraint at the experience level, the parameters can be rewritten during transmission, and the server must treat it as untrusted input and recalculate the range allowed for deletion again.

Ask: If an illegal value is mixed into the number, should the whole batch fail or skip it and continue to delete?

It is more reliable to reject the whole batch and report an error, to avoid the inconsistency of deleting half and skipping the other half; the premise of actually skipping is to clearly inform the caller which numbers have been excluded.

Ask: Can the recycle bin replace the range check?

Answer: No. The recycle bin deals with the reversibility of deleting incorrectly, and the check stops the deletion from going out of bounds, both of which play different roles at different stages and are indispensable.

Related articles

The template tag outputs the opening tag of the script, how can the content be executed as code?

PbootCMS has fixed the risk of script tag output in site tag output script and enhanced tag page parameter filtering - when editable content enters the template engine with opening tags, the data will be treated as code. This article explains where the step of data becoming code occurs, why the tag output position needs to be filtered, and why HTML, attributes, scripts, and URLs need to be escaped separately, as well as why filtering earlier saves time and has a layered closing effect.

2026-10-11

The image processing library is listed as an attack surface, what door locks should the site upload process have?

The image processing library decodes the binary content uploaded by users on the server, and remote code execution often occurs at the decoder layer rather than the business code. PbootCMS added the dangerous coder gate, input format whitelist, and resource limit to the security hardening in the V3.2.22 version record, and fixed the misjudgment of legal images. This article explains the three gates of entry for the site upload link, as well as why it would hurt normal images if it is too tight.

2026-10-11

The announcement removes the example function section to fix the resource allocation problem. Should the production site keep the demonstration code?

The rating of Drupal announcement SA-CONTRIB-2026-215 is only Less critical, but the handling method has completely removed the email example function, because the example has an issue with unbounded resource allocation. Should the demonstration code be retained on the production site, the criterion should be the exposure surface rather than the risk rating. This article analyzes the three types of risks brought out by the example code, the cleanup checklist at the deployment stage, and the restrictions when retaining the demonstration entry.

2026-10-11

After the cache expires, the old content is provided first, and then the update is performed in the background. What does this cache instruction solve?

Cache-Control's stale-while-revalidate allows the reuse of old content responses within the window period after expiration, while also revalidating with the origin server in the background, hiding the validation delay from the user's response. This article explains its division of labor with request directives max-stale, no-cache, and must-revalidate according to the MDN documentation, and provides suggestions for separating page documents and static resources for separate settings.

2026-10-11

Why does the login lock and blacklist on the website behind the proxy recognize the source address incorrectly?

When a website is behind a reverse proxy, the program often reads the connection source as the proxy address, and the content of the forwarding header is controlled by the client. Confusing the two layers can lead to login locking and incorrect objects in the blacklist. PbootCMS has fixed the issue of unconditional trust in the source forwarding header in the update records of V3.2.25. This article discusses the origin of the two layers of addresses, the practice of taking the most right可信 value in the trusted link, and which layer to use for throttling and locking.

2026-10-12

When embedding third-party videos on a page, what authorization is used for iframe's capability to pass through?

The page embeds third-party videos with two levels of restrictions: source domain names are allowed to pass based on the whitelist, and capabilities such as camera, location, and automatic playback are authorized in the minimum set item by item. In the update records of PbootCMS V3.2.18, the default source strategy for trusted video domains is retained, and the token whitelist is set for the allow attribute. This article explains why the embedded frame carries scripts and media capabilities at the same time, how to differentiate between precise domain and subdomain wildcard, and why the release and authorization should be configured separately.

2026-10-12

After the user logs out, old data still remains in the browser, how to require the response header to be cleared.

When logging out, the cache and local storage left in the browser will not disappear automatically. The Clear-Site-Data response header is a clear signal for the client, which can clear cache, credentials, storage, and execution contexts item by item, and it only takes effect in encrypted connections: credentials are cleared for the entire registration domain, and storage is only cleared for the current source. The login status within the site is carried by JWT, and the local data at this client layer relies on it to complete the cleanup. It is especially worth adding on public devices.

2026-10-12

The browser will mark whether the request is from this site or an external site, and how the server can prevent cross-site requests based on this.

The browser adds several Sec-Fetch request headers that indicate the source relationship, which frontend scripts cannot change. The values distinguish between same-origin, same-site, cross-site, and no-origin, and the server decides whether to allow or deny based on these relationships, thereby providing a complementary defense against cross-site request forgery; these headers are only sent in requests from trusted addresses. This article discusses the meanings of the four values, the way to allow based on context, and what they each manage in round-level operation approval.

2026-10-12