Can hidden storage XSS be found in pending reviews, and how to converge injection points on the background page?
Can. Pending comments are not displayed externally, but they are read and rendered on the background list page - the moment the administrator opens the review queue, this content has already entered the page. The key to stored XSS is never about 'whether the content is public', but whether the content is interpreted as code somewhere'. One of the items fixed in WordPress 7.1.3 security version is the stored XSS in the comment management backend page, which can be triggered explicitly by pending comments.
Why can content that has not been published trigger?
A common misconception is that the front-end is the only rendering scenario. In fact, there are at least three rendering surfaces: the front-end article page and comment section, the back-end comment list and article editing page, and notification or summary pages. The back-end list page often displays the submitter's nickname, email, and comment content to varying degrees. As long as one place concatenates the stored original text into HTML, malicious fragments that have not been reviewed can be executed there.
The second misconception is that 'not displaying the full content' is safe. Even if the list page only truncates the first few characters, the script fragments before the truncation point can still be interpreted and executed by the browser.
| Rendering location | Who is watching | Trigger condition | Control means |
|---|---|---|---|
| Front-end comment area | All visitors | Only show content that has passed the review | Output escaping, review release |
| Background comment list | Administrators and editors | Pending review content will also be rendered | Review the escaping and field truncation method |
| Notification and Summary | Administrator | Title or Nickname Concatenated into Template | Unified Escape, Not Parsed at the Template Level |
Three Common Positions of Injection Points
The first category is the submission field that directly enters HTML: nickname, website, comment content, these three items usually allow longer text and are less checked. The second category is the structured field used as attributes or style values: image address, color value, URL parameters, the dot often appears in special character processing and protocol prefix judgment. The third category is the export and secondary processing path: another set of splicing logic is used when writing content to reports, exporting files, or statistical pages, and most of the problems in front-end security and back-end issues belong to this category.
AnQiCMS in the README factual aperture has attributed the defense of XSS and SQL injection to built-in mechanisms: JWT authentication is responsible for sessions, content sensitive word filtering is responsible for入库side governance, anti-crawling interference code is responsible for content protection. These three are not equal to output escaping, escaping must be completed in the rendering layer.
Storage filtering and rendering escaping division
Both have different responsibilities and cannot be substituted for each other. AnQiCMS's content security settings provide sensitive word filtering and keyword replacement, content review, which belongs to the side governance of entry, dealing with whether the content should be retained or replaced. Injection prevention relies on context-based escaping during the rendering stage: entity escaping at the position of HTML text, quotation wrapping at the attribute position, and whitelist verification at the link protocol position.
There are two typical failures when only viewing the入库 filtering: the filtering rules hit the keywords, bypassing uppercase, encoding, and blank variants; the content after replacement still contains executable structure, just in a different form. Conversely, only output escaping cannot handle compliance and quality requirements, both levels need to exist simultaneously.
The hierarchical permissions on the review chain.
The content to be reviewed itself is sensitive data. In the same WordPress announcement, there is another fix: there is an unauthorized visibility issue with comments on private and unpublished posts. This indicates that the risk is not only script execution, but also unauthorized reading.
Suggested order of convergence: First confirm which roles can read comments on unpublished content, narrow the scope to the minimum necessary; then confirm whether the review action requires independent permissions, do not let 'see' be equivalent to 'approve'; then tighten the session and token side, AnQiCMS built-in JWT authentication, the validity period and rotation should be included in the background account management; finally, use the reCAPTCHA captcha on the form side to reduce the amount of machine submissions - the number of malicious samples in the review queue decreases, and the probability of human mistakes decreases accordingly.
Common questions
Is it safe to turn off the comment function?Eliminated this type of entry, but comments, registration, and submission forms belong to the same form, any path that allows external text to be stored and then displayed must be checked according to the same standard.
Should we clean up historical data after patching?Yes. Malicious fragments of storage-type issues should remain in the library, the escaping repair only changes the rendering result, historical data will still appear with suspicious structures in exports and statistics.
Can the captcha replace the review?No. The captcha blocks the amount of automated submission in this section, content risk depends on filtering and review clearance.
How to verify if your site's backend is affected?Submit a comment with a tag text that does not contain a script, do not go into the background, just view the background list page display results of angle brackets and quotes, and be able to judge whether the escaping occurs in the rendering layer.