Will the data files in the site directory be directly downloaded, and at which layer should it be blocked during deployment?

📅 October 9, 2026 Eye 10

Will the database file or data directory under the website directory be directly downloaded if there is no access restriction? Yes. And where should it be blocked, the answer is both at the deployment layer and the application layer. The reason is not mysterious: when the web server processes requests, as long as the path matches a file on the disk, it will return it as static content by default, without asking 'Is this the data of the program itself'. A version fix of an open-source program has made this very clear - a new default access denial rule for the data directory has been added to prevent the SQLite database file from being directly downloaded under the default deployment.

Which files should not be accessed via the public network

Ranked from high to low risk:

File type Why is it in the directory Consequences after being downloaded Who should block
Database files or data directory The program stores data in the site directory Full database structure, account hashes, content taken away all at once Add rejection rules at the deployment layer
Backup package Manual or scheduled backup written in the same directory Equivalent to the direct repository and often contains configuration Program layer change storage path
configuration file Original copy left during deployment Connection information and key leakage Directory permissions at the deployment layer
Operation log Turn on when troubleshooting Request path and parameter leakage, which can be used to understand the interface Deployment layer denial
Temporary upload and decompression residue Batch import interrupted and not cleaned up Content exposure in advance Program cleaning strategy

The key judgment here is:Anything that can be returned as a static file is on the public network. Directory existence does not equal access, directory parseability equals access.

Why is the default deployment easy to miss this one

There are various pitfalls with the three common deployment methods. When deploying with a panel one-click, the root directory of the site is directly mapped to the Web server, and the program's data directory is naturally within the mapping range; when deploying with command line and reverse proxy, it is easy to only configure the main site's rules and forget the temporary directory written by the backup task; when deploying with Docker images, it is very common to mount the data volume for convenience and directly into the site's accessible path.

AnQiCMS is developed based on Go language, the program listens on port 8001 by default. When it goes online, if this layer of port is directly exposed to the public network without going through a reverse proxy, it is equivalent to skipping the step of 'adding interception rules at the reverse proxy layer', and the exposure surface is taken over by the program itself.

How to block at the web server layer

The approach at this layer is to add rejection rules to the directory, granularity to the path rather than to the file extension:

  • The entire data directory is rejected, do not just block a certain suffix, because the backup product may change the extension name;
  • Place the rejection rules in the position of matching first to avoid being hit by the general static rules first;
  • After proxying, confirm that the rules have not been transmitted through - some paths only take effect when proxying to the program port;
  • After adding the rules, make a request to the real address once, to see if the return is a rejection or file content, just looking at the configuration file is not enough.

What can the program layer supplement?

The deployment layer is external reinforcement, and the program layer is the root cause. Three things are worth checking:

The first, the backup location. The backup and recovery of data and static files within the site, it is necessary to confirm that the directory where the backup products are written is not accessible by the site, or it will be overwritten immediately by the rules. The second, the intermediate files of import and collection. The temporary files of bulk import unpacking and content collection, need to have a consistent cleaning time. The third, error output. When debugging is enabled, write the path information into the page, which is equivalent to drawing a map for the scanner——this is why the absolute path of the local machine should never appear in the public answers.

The directory self-inspection checklist before going online.

Go through the steps in this order: List all subdirectories under the root directory of the site, request a real filename from each one using a public network address; confirm that the returned status is a rejection rather than content; check the actual output location of the backup and temporary directories; confirm whether the default port can be directly connected; finally, store this result in the operation and maintenance records, and refer to it when deploying the next change.

Common questions

Question: Isn't it enough to rename the data directory?Answer: No. Renaming only increases the cost of guessing, any scan that can enumerate directories will cover it, and the rejection rules are the control.

Question: Is it okay to set the directory as non-listable only?Answer: No. It is forbidden to list directories only to block 'seeing what files there are', as you can still download by knowing the filenames.

Question: The panel has already added cross-site protection and directory protection, do we still need program layer protection?Answer: Yes. The panel rules only cover the directory of the site it manages, and the paths of the backup and temporary files written by the program are not within its knowledge.

Related articles

Can the deletion and status switching interfaces on the back-end be accessed directly through the browser to trigger?

If the interface for deleting data and switching states in the background is allowed to be triggered directly through the browser's address, it has the risk of being misused by cross-site request forgery: when a malicious link is opened by a visitor while still logged in, the action of changing the state will be executed. The solution is to use two methods together - limiting the action of changing the state to a submission method and attaching a one-time form verification; the usage boundary of long-term login credentials should be stricter than that of one-time tickets.

2026-10-09

When submitting links in bulk to search engines, how many can be sent at one time and how often can they be resubmitted

When submitting links in bulk to search engines, the cross-engine submission channel allows for the inclusion of tens of thousands of addresses in a single request, while the site map is split according to the single-file limit; when a link is frequently updated, a minimum retransmission interval should be left, usually in minutes, to queue. Before submission, confirm that the domain ownership verification has passed, and place the key or verification file in the root directory of the site or a publicly accessible location on the same host, otherwise the entire batch will not be accepted.

2026-10-09

Why is the order of handling different for two vulnerabilities that are both 9 points?

Two high-risk vulnerabilities with the same rating, the order of handling is different because the score is calculated from the combination of indicators, the same score can correspond to completely different trigger thresholds and impact ranges. When reading the rating, you should look at how the score is calculated, whether you need to log in, and whether it affects confidentiality or availability, and combine it with the order in which your own uses it to decide.

2026-10-09

Announcement title mentioned maintenance and security, where to check the security part on which page

When the title of the version announcement mentions maintenance and security at the same time, the specific content of the security repair is usually not in the main text of the news homepage. You need to go to the corresponding release page according to the classification column to verify the repair items and affected versions; the follow-up actions are divided into three steps: confirming the version range, judging whether to use related capabilities, scheduling the maintenance window and rotating the credentials as suggested.

2026-10-09

The authorization signal between content and AI, to what extent can it be expressed now?

The site expresses the scope of authorization for AI crawling at present, which has two layers of signals: exclusion rules based on paths and authorization statements based on purpose. The exclusion rules can specify which paths should not be crawled, but cannot clarify whether the same content can be used for training; the signals split by purpose can express separately for search, proxy access, and training, with granularity fine enough to set default values based on page conditions. The robots settings and the generation of explanatory documents for models are responsible for these two configurations inside the site.

2026-10-09

In one day, more than twenty module-level announcements are released simultaneously, what should be the order of handling?

When releasing more than twenty module-level security announcements at the same time, the handling order cannot be solely based on the rating. The available methods are to multiply the rating by 'whether I have installed this module or not': uninstalled modules can be closed directly, and for installed modules, you need to look at whether the exposed surface is a public web page or an internal background page, and then consider the rating level and whether there are available patches. The default operation interface at the site level is closed, which naturally excludes the capabilities that need to be explicitly enabled from the list of targets that can be attacked on that day.

2026-10-09

Why is the remote screenshot interface used to probe the internal network, and what should be blocked when importing images

The function of fetching remote images by address is essentially for the program to access an address on behalf of the initiator. If the target address is not constrained, it can point to an internal network service, which is the cause of server-side request forgery. The reinforcement needs to be done in four restrictions: connection timeout, response size limit, verification of the parsed address and internal network address interception, and re-verification after following the jump; the two links of batch import and content collection are only effective when using the same set of value boundaries.

2026-10-09

Who should write the title, keywords, and description, and how should handwritten and automatic generation be coordinated

The automation risks for the title, keywords, and description are different: the title is recommended to be finalized manually, with candidates provided by the system; keywords are suitable for semi-automatic reclassification to the keyword library; the description can be generated automatically first and then reviewed by humans to ensure consistency, as it will be independently displayed by search engines. The common division of labor is for the system to produce the initial draft, humans to manage facts and tone, and the automatically generated results to be advanced to draft or pending publication status, and then released after acceptance.

2026-10-09