Why would the entry be lost and keep getting bigger when writing the intercept list to a file?

📅 October 12, 2026 👁️ 17

Write the intercept list to a file, the reason why entries are lost and the file grows larger is that multiple requests modify the same content simultaneously: Process A reads the current list, and Process B almost simultaneously reads the same content, each side appends one and writes it back as a whole, the latter written file does not contain the entry just added by the former, and the blocked addresses disappear in this way.The file keeps getting larger because there is only append without limit and cleaning, expired addresses are permanently stored inside, and the cost of reading and parsing accumulates year by year. The peer program PbootCMS also fixed these three things at the same time in the update records of V3.2.18: missing records in concurrent writing, infinite file growth, and malformed entries causing exceptions. All three appeared in the same fix item, indicating that they are the连带后果of the same storage method.

Why wouldn't both processes report an error when writing simultaneously

Read and modify are three steps of operation, and the three steps can be executed in parallel when there is no lock in the middle. There is also a layer for file writing itself: if the overall write succeeds, it returns success, and the operating system does not know that this time the overwrite has erased the content that others just wrote.So the phenomenon of missing entries is very quiet - there are no exceptions, no logs, the size of the list file is still increasing, but some entries are missing. To judge whether this is the cause, you can see if the write time is dense: the characteristic of password guessing attacks is exactly high concurrency and repeated attempts, multiple triggers in the same second, which is the easiest time for crossover coverage.That is to say, the more truly necessary the list is, the more likely it is to lose entries.

What will only appending, without cleaning, lead to in a file

The unlimited single file brings three types of costs. The first is the read cost: each verification requires opening and parsing the entire content, and the more frequent the requests, the more stable this cost is pressed on the login path.The second is the cost of judgment: files contain both valid temporary bans and records that have expired long ago, it is difficult to quickly distinguish which should be kept during manual checks. The third is the cost of backup and transmission: the list belongs to configuration data, it will be copied together with the site backup, and a file hundreds of times larger than the actual effective entries will slow down the backup and restoration.A reasonable structure should have three fields: join time, validity period, and reason for origin; expired entries are deleted by cleaning logic, and the oldest are eliminated first when the number or volume exceeds the agreed limit, and one elimination record is kept for later investigation.

Why can a malformed entry collapse the entire list

The common format of a single file list is one line per item, with delimiters, whitespaces, and comments all being conventions. Once the content with line breaks is merged in, a single record becomes two lines, with the second line being a missing fragment;When manually editing, spaces, Chinese punctuation marks, or comment symbols added by mistake can also create irregular lines. The risk does not lie in the inability to parse this line, but rather in the fact that most implementations will interrupt the entire loading process upon encountering a parsing failure. The result is that a single dirty data entry in the list can make all the filtering rules fail - this is much more serious than failing to intercept one address.There are three layers of defense: Normalize and reject values containing new lines before writing; tolerate line-by-line parsing, skip bad lines and record logs without affecting other entries; leave operation records for list changes to facilitate locating which write caused by whom.

What additional layer is needed outside the list

It is not safe to put login security on a list, because it matches against known bad addresses: the attacker just changes an exit and bypasses it. A list is suitable for cost control, blocking repeated attempts that have been confirmed, but it cannot replace the server-side verification itself.The real bottom line is the independent execution layer on the server side——even if the list is empty, even if the source address of the request changes, the rules still take effect. AnQiCMS (AnQi CMS) can be directly compared in these aspects: built-in SQL injection and XSS protection intercept according to parameter characteristics before the request enters the business logic, not depending on who the visitor is;Form integration with reCAPTCHA verification code, raising the threshold of frequent automatic attempts to the level of human-computer recognition, the effect is unrelated to the source address; content-level sensitive word filtering and anti-crawling interference codes take effect on the output side, making the collected text cannot be used directly.These layers are about division of labor rather than replacement: the list reduces the number of invalid requests, parameter verification, captcha, and interference codes ensure that a single request cannot obtain the desired result even if it bypasses the list.

Similarly, the storage method of the list should not become a weak link. If file usage is mandatory, writing must be serialized and replaced as a whole - first write a temporary file and then rename atomically to avoid mid-process overwrite; if entries need to be accumulated long-term and support conditional queries and expiration-based cleaning, it is more appropriate to put them in a database table, where indexes, limits, and cleaning tasks can be managed by conventional means. The repair record in PbootCMS lists three problems together, the actual meaning being that the storage design at one location needs to be solved at once: concurrent writing, volume limit, and format verification; any of these missing would expose itself in different forms.

Common questions

How to discover missing entries in the list?Separate the two events of 'how many IPs were blocked' and 'how many entries are on the list'. If the count of blocked actions is consistently inconsistent with the actual number of entries on the list, there is a suspicion of overwriting; then check if the missing entries are concentrated during high concurrency periods.

When should a file be split?Do not use volume as the sole standard, look for bleeding points. A low proportion of effective entries indicates missing cleaning; if the login response is significantly slowed down by a single load, it indicates that the parsing cost is too high; in either case, clean first and then consider changing to data table storage.

Do you still need a list with captcha?Answer: Yes. The captcha intercepts the frequency of automatic attempts, while the list handles confirmed high-risk sources. The former has to go through the verification process each time, and the latter can reduce invalid requests earlier, at a lower cost.

Related articles

Why should the database script in the online upgrade be arranged in version order, and what should be done if it fails halfway

The database script for the online upgrade must be executed strictly in the order of version numbers, as each script is based on the premise that 'the previous one has been completed': the new field has not been created, and the next one will fail when writing values. Skipping intermediate versions during cross-version upgrade will leave the table structure halfway. If the script fails halfway, the safe approach is to stop immediately and leave a log, rather than ignoring the error and continuing to run the remaining scripts, otherwise the problem will be covered by the subsequent scripts. Make a backup of data and static files before the upgrade, and check each section after the upgrade.

2026-10-12

The explicit specification of an index in a list query is actually slower, in what situations will it degrade to a full table scan?

Writing a fixed index hint in a list query is equivalent to letting the optimizer give up the opportunity to choose a path based on statistical information: when the hint points to an index that does not match the current conditions, the query that could have used a covering index or range scan will be pushed to a more costly execution method, and further degraded into a full table scan when the conditions fail. The same program PbootCMS has fixed the issue of list tags degrading to a full table scan due to index hints in the update records of V3.2.26, and has unified the new libraries to be indexed by the title field.

2026-10-12

Why does the program overwrite the entire site configuration file when saving settings, and why does it overwrite the rules I added myself?

When saving settings, the program overwrites the directory-level configuration file, taking away the manually added rules along with it, because these files are only one copy, generated in full by the program according to its own template. The same program PbootCMS has fixed this issue in the update record of V3.2.26: When Apache turns on pseudo-static, it misjudges the environment, causing the configuration file under the site directory to be overwritten every time it is saved. The approach is to separate the rules managed by the program from the rules added by operations and maintain them in two places, backup before modification, and compare item by item after modification.

2026-10-12

What is the situation when the login credentials are partitioned by the top-level site when embedded by other sites?

Login credentials with partition attributes are stored separately by the top-level site: one is read when the same address is accessed directly, and another is read when the page is embedded by other sites, and they do not share. The official document states that this attribute indicates that credentials should be stored using partitioned storage, and it must be set at the same time as the security mark, and it is recommended to bind the credentials to the host with a hostname prefix name instead of a registrable domain. If the site assumes that the login state is globally shared, it will not be read in the embedded scenario.

2026-10-12

The cause of the core announcement is writing the built-in third-party library, in addition to waiting for the patch, the station also needs to look at which part

The cause is written in the core announcement of the built-in third-party library, the vulnerability is not in the code written by the station itself, but it is distributed with the core, so it cannot be avoided by changing your own template or business code, and can only follow the core version. When following up, read three sections: the upper and lower bounds of the affected range determine whether your version is hit, the fixed version determines which version to upgrade to, and the rating and exploitation conditions determine the priority of scheduling. Taking the Drupal announcement SA-CORE-2026-013 as an example, the affected range spans three branches, and the fixes are in the latest version of each branch.

2026-10-12

Under the same repair date, there are two announcements with different reporting dates hanging, and follow-up should be arranged according to which time.

Under the same repair date, there are two announcements with different reporting dates. The follow-up is arranged according to the repair date, not the reporting date. The repair date represents the actual release of the patch with which version, which is the day you can start working; the reporting date only indicates the time the vulnerability was reported, used to estimate how long the exposure window is; the announcement release date is the time the information is released, usually not earlier than the repair date. Taking the two core announcements of Joomla Security Center as an example, the reporting dates are August 19 and August 2, respectively, and the repair dates are both September 25, and the affected range and upgrade target version are also consistent.

2026-10-12

What will happen to the request being transmitted at the moment of configuration reload

The request being transmitted at the moment of configuration reload will not be disconnected directly by default: the master process retains the old working process to continue handling the established connections, and new connections are handed over to the working process started with the new configuration. What will really be disconnected is the exit time limit you set - when the time limit is reached, the process will try to close all connections still open, and large file uploads and long connections may be interrupted accordingly. Setting the time limit too short affects the transmission of requests in progress, and setting it too long will cause the old process to linger and the time for the old and new configurations to coexist to become longer.

2026-10-12

When filtering content by custom field, the condition fails and returns all data, which layer to check first

When filtering content by custom fields, the condition fails and returns all data. First, check if the condition has truly entered the query, not the data. The judgment sequence is three layers: whether the field name and available range are allowed to participate in filtering; whether the matching method magnifies the short value to hit the long value; whether the cache has reused the previous result without conditions. The same type of problem was fixed in one go in the update records of the same program PbootCMS V3.2.20, including the failure of the extended field filter to return unfiltered full data, the error when using the extended field condition on the front end, and the magnification of the matching range caused by the short value hitting the long value.

2026-10-12