The update record mentions that the blacklist of uploaded file extensions is not fully listed. Why would relying on a blacklist fail to block uploads?

📅 2026-10-11 👁️ 17

The upload blocking by extension black list will leak, the fundamental reason is that the black list must enumerate all malicious patterns in advance: variant of obscure suffixes, double extensions, case and encoding transformations. Any form not covered by the list will be allowed by default. The same system PbootCMS wrote such a fix in the update records of V3.2.16 - 'Fixed the risk of bypassing the whitelist caused by incomplete enumeration of the upload extension black list', which is a typical black list leak. The reliable approach to close the mouth is divided into three layers: extension whitelist in the front, file content type verification in the middle, and canceling script execution permissions in the upload directory as a bottom line.

Where are the three writing methods missing in the blacklist?

Type of leak Example form Why can't the blacklist stop?
Suffix variant Less common extension names not covered by the script file usage list The blacklist relies on enumeration, and new writing methods need to be added in advance by someone
Dual extension names After the image extension name is concatenated with the script extension name Which part of the parsing rules to take, the application and the server may have a different understanding
Case sensitivity and encoding Mixed case or URL encoded extension The comparison logic often only unifies one form

The commonality of the three types of leaks is the semantic direction: the blacklist is 'reject known', and the world outside the list is default allowed; the attacker only needs to find one form outside the list. The writing space of the upload entry is determined by multiple links such as the parser, file system, and character encoding, and it is always one step slower to rely on people to enumerate in advance.

Why the whitelist does not require prior knowledge of all attacks

The whitelist reverses the default direction: allow known, deny unknown. The types of files that the business needs to accept are limited to a few types of images and document formats, the length of the list is determined by your own function; the space for attack writing is open. It is much more stable to use a limited list to meet limited needs and to compare it with open space for open exclusion. The cost of the whitelist is to mistakenly harm rare legal formats, so the list should follow the business iteration rather than copying a 'general security configuration' once.

How many layers should the upload validation be divided into?

The first layer checks the file extension, directly rejects the suffixes outside the whitelist. The second layer does not look at the file name, reads the file header for content type verification, confirms that the declaration is consistent with the actual content, and renames the file, archives it according to the date, and stores the path, cutting off the influence of parsing the original file name. The third layer is outside the application: the script execution permission is canceled on the web server level in the upload directory, so that even if the first two layers are bypassed, the file landed will not be executed. Each layer manages a section, and no single layer is established alone.

One thing to do when deploying synchronously.

Disabling the execution permission of the upload directory belongs to server configuration and is not completed in the CMS backend. When deploying AnQiCMS using Baota panel or Docker image, this step should be written into the deployment list and configuration template, brought to the new environment out of the box, not to补 after something goes wrong. It should be clarified that: the built-in prevention of SQL injection and XSS attacks, sensitive word filtering of AnQiCMS belongs to the content security layer, which manages data and display, and cannot replace the line of file upload and directory permissions; conversely, the upload control does not cover content review, and the two responsibilities should not rely on each other.

Common questions

Have you already used the whitelist, and do you still need content verification?Yes. The whitelist manages the extension name, and content verification prevents the misplacement of 'declared as an image, actually contains something else', the two layers prevent different bypasses.

How can dual extensions be根治?Don't let the original filename participate in any parsing: rename and archive it to the rule path after uploading, so the parsing rules no longer have an opportunity to take advantage.

Will banning execution in the upload directory affect normal functionality?No, as long as the application does not depend on executing scripts in the upload directory. The standard practice is to treat the upload directory as a pure static resource service, and the functional code always runs in the program directory.

Related articles

Statistics show that about 70% of websites use PHP, PHP 8 accounts for about 65% of them, how to use these two numbers.

W3Techs statistics on October 11, 2026 show that 69.7% of known server-side language websites use PHP, and 64.6% of PHP users are already on version 8. This article explains the scope and reading of these two numbers, and provides a framework for comparing web building solutions from four aspects: ecosystem, operating cost, deployment form, and upgrade burden, to avoid taking the deployment proportion directly as a technical conclusion.

2026-10-11

There is a paper that points out that optimization of generative methods brings two types of risks, and where content stations should self-check for two places.

A paper with a stand reminds us that the risk of generative engine optimization lies on the side of the engine rather than the content side: on one hand, visibility is more likely to concentrate on a few sources, and on the other hand, the potential commercial impact that may be mixed into evidence and reasoning may not be disclosed. The two aspects that the site can self-check are: who is speaking for your page, and whether there are any unexplained impact sources in the answers.

2026-10-11

The mechanism of notifying search engines of new links in real time, which companies are currently on the support list.

In addition to submitting the sitemap, there is also a type of immediate notification mechanism that directly informs participating engines of new, updated, or deleted links. The list of supported engines is based on the official website, and engines outside the list still follow their own channels. For Chinese sites, the sitemap is responsible for full-scale, and active push is responsible for incremental, getting new links to the correct engines as soon as possible is more practical than repeated submission.

2026-10-11

In addition to the severity score, there is also a score predicting the probability of a vulnerability being exploited, how to use it.

The severity rating answers how great the impact is, and another type of score answers the probability of this vulnerability being actually exploited in the future. EPSS provides probability and percentile for each publicly disclosed vulnerability every day, and the official recommendation is to consider it along with the severity rating and the list of in-the-wild exploitation to prioritize the handling queue.

2026-10-11

The formula rendering module is found to be cross-site scripting, why do we need to check the rendering path together with rich text filtering?

The Drupal community announcement SA-CONTRIB-2026-195 labels the TeX rendering of MathJax module's unescaped JavaScript as Critical cross-site scripting, affecting versions below 4.1.2. Rich text, even with HTML tag whitelist, may still execute data as code for non-HTML parsing paths such as formulas, Markdown, and charts. This article explains how to read the version range and rating of the announcement, and provides a self-check list for escaping based on output context.

2026-10-11

What are the differences in the capabilities of the government portal and marketing website content management system?

The government portal content management system prioritizes content review, sensitive word filtering, and user group permissions, while the marketing website pays more attention to keyword libraries, anchor text, and form human verification; robots configuration and site map generation are the common foundations for both types of sites. This article breaks down the capabilities according to constraints and provides two configuration orientations within the same system to help choose based on the nature of the site rather than the length of the function list.

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

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