Storage XSS appears on the comment management page, how did the script get into the background in the pending review comments.

📅 2026-10-13 👁️ 14

A stored XSS appears on the comment management page, relying on the

Why unreviewed content can trigger

Many people think that 'review' is a wall: content that does not pass the review will not take effect externally. This wall blocks the front-end display, but not the back-end rendering. The role of the comment management page is precisely to let administrators preview the content to be reviewed so that they can decide whether to allow it or not. Since previewing, the system must display it, and if the 'display' step is not escaped, it is equivalent to executing the user's submitted content as part of the interface.

So the triggering path is: a visitor submits a comment with a script, the status is pending review, and it quietly lies in the list; the administrator opens the comment management page to deal with the backlog, and the browser executes the script when rendering this record. Throughout the process, the comment is always 'pending review', but XSS has already occurred. 'Pending review' describes whether the content can be published, not whether it will be read and displayed by the background - these two things have been confused, leaving a gap.

The danger lies in the background treating it as trustworthy data.

The same comment data has different trust levels in the foreground and background. The foreground is controlled by the review status, and the ones not passed will not appear; the background must be displayed exactly for people to be able to judge. The danger lies in the default display in the background, where it is directly stitched into the page as 'This is my own management interface, and the data is reliable.'

The feature of storage is here: the script is first stored in the database, and then executed again each time someone opens the relevant page, not triggered once. To close the mouth, it cannot only be checked at the moment of submission, but also to ensure that no matter which interface this data is opened later or by whom, it is not treated as executable content when output.

The two layers of closing the mouth: check-in verification and output escaping

The truly stable approach is to stack the two checkpoints, any one of which is not enough when used alone

Level What is done What to prevent
Check-in verification Filter out dangerous tags and script fragments at the time of submission, and refuse obvious malicious structures Block most direct attacks and reduce dirty data falling into the database
Output escaping Escape content as plain text when displaying, and the background list should also be handled in the same way Even if dirty data has been stored, it will not be executed on the page

Relying solely on storage validation will still leak, because there are always new ways to bypass filtering; relying solely on output escaping is also not enough, because once dirty data is concatenated in other scenarios, it may still cause problems. Only by doing both together can the 'storage-rendering' chain be truly cut off. Methods like front-end pop-up interception cannot be counted as this layer, as what it intercepts cannot be replaced by server-side and template escaping.

Where are the three layers of protection placed within the site

Compare the design of AnQiCMS, and you can see that similar problems are divided into three sections with each section responsible for a part of the protection, rather than piled together.

**The process of filtering sensitive words and keyword replacement,配合内容审核,to control whether the content can enter and whether it needs to be processed when entering. This is the implementation of the entry inspection. The second line is the built-in XSS protection and SQL injection defense, which controls that the data is not executed as code during storage and query, and belongs to a lower-level input control. The third line is the reCAPTCHA verification code integrated into the form, which does not judge whether the content is dangerous, but raises the cost of batch submission, making it difficult for attackers to inject a large number of comments to be reviewed by scripts.

Three different positions are stuck at submission, storage, and rendering, and there is still a backup for any one that is bypassed. This is much more stable than relying on the assumption that 'since it hasn't been reviewed, it won't be displayed'.

Common questions

Q: The comments have always been in the review state, not displayed on the front end, does that count as being affected? A: Yes. The back-end comment management page will render the pending review content, and the script can be executed when the administrator opens it.

Q: Can it be considered as completed if only the malicious comment is deleted? A: No. Storage XSS needs to be upgraded to the official fixed version, and deleting a single comment does not solve the root cause of the unescaped rendering.

Ask: Is the front-end intercept enough? Answer: Not enough. Both the server-side check-in and template output escaping need to be done, and the front-end can be bypassed.

Ask: Is sensitive word filtering and content review redundant? Answer: No. Filtering deals with the surface words, and review decides whether to allow or not, both of which are responsible for XSS output escaping.

Related articles

Can WordPress minor versions be directly updated automatically with 11 security fixes in one go?

This is a minor security update for WordPress 7.1.1 that includes 11 security fixes. The official recommendation is to update immediately, and sites that support automatic background updates will start updating automatically. This article explains which steps of the automatic update can be covered, and which situations require manual scheduling of the upgrade window, as well as the backup and credential rotation confirmation to be done before and after the update.

2026-10-13

The backend user deletion has been changed to POST submission and form credential verification, preventing which type of attack?

The content system has changed the user deletion and status switching to POST submission and form security credential verification in the version announcement to prevent cross-site request forgery from causing users to be mistakenly deleted or their status changed. This change blocks cross-site request forgery - attackers take advantage of the browser automatically carrying the login state. Moving the status change from GET to POST is just a **layer, and the real barrier to forgery is the credential verification that comes with the form.

2026-10-12

Before the release of the major version, how many weeks of security support are left for the old branch, and how should the upgrade window be arranged?

At the same time, only a few branches usually receive security fixes, and there will be no official patches for new vulnerabilities from the day the support is discontinued. Taking the release plan of a certain content system as an example, the security release window covers only a few specific branches, and the old branches will end support in the week of the new major version release. The upgrade window should be arranged in reverse order: first determine the day of discontinuing support, then leave time for verification and rollback, data backup must be done within the window, and login credentials must be processed as described in the upgrade instructions for the home version.

2026-10-12

After the site is written to an abnormal PHP file, why does the official investigation sequence prioritize checking the runtime directory?

The security upgrade announcement for the PHP class content system provides the following handling order: first upgrade to the fixed version, delete the running directory, check the pseudo-static rewrite rules, then investigate the abnormal files, and explain that the problem is related to vulnerabilities in previous versions. The running directory should be checked first because it is the most common landing point and also resembles renewable content, deleting it will not damage the data; after cleaning up, you still need to confirm that the backup time is earlier than the intrusion time.

2026-10-12

Why should the validation of reading and writing data be separated when a second injection occurs in the exported file?

WordPress 7.1.3 fixed a second SQL injection in the WXR export process. The characteristic of secondary injection is that it appears harmless when the data is stored, but becomes harmful when used again in the query. This article explains why import and verification should be considered separately, what to check during storage verification and output verification, and how to implement the two checkpoints of batch import within the site and content collection.

2026-10-13

Comments on private articles are read without authorization, and the permissions should be blocked at the list level or the detail level.

WordPress 7.1.3 fixed the issue where unauthorized users could read private and unpublished article comments. Unauthorized access often occurs in附属资源 such as comments and attachments, because the visibility of the main object does not automatically pass to the child set. This article explains that permissions must be checked at both the list and detail levels, and how the scope of visibility is implemented within the site based on document status and user groups.

2026-10-13

One update fixes seven security issues, should you upgrade first or check if you have been hacked first?

WordPress 7.1.3 brings 7 security fixes and recommends an immediate update. The sequence of handling depends on whether there are any signs of intrusion: if there are no signs, directly proceed to the upgrade window, if there are signs, only close the entry during the upgrade, and also handle the sessions and credentials that the attacker has obtained. This article takes the upgrade prompt of AnQiCMS v3.6.6 as an example to explain why it is necessary to rotate the keys and change the password together.

2026-10-13

Fixing only one severe vulnerability also requires a separate release, how does reading a local file escalate to remote code execution?

WordPress 7.1.2 is a separate release just to fix a severe level vulnerability: An unauthenticated attacker can allow the page template to parse any local PHP file outside the theme directory under certain conditions, and it becomes remote code execution when the server and theme prerequisites are met. This article analyzes the few steps from reading the file to executing the code, and corresponds to the on-site prevention of injection, backup, and credential rotation after upgrade.

2026-10-13