Can anonymous visitors read the comments under the unposted articles?
Can the comments under an unpublished article be read by anonymous visitors, regardless of whether this article has been published or not, and whether the interface for reading comments has judged visibility separately? A common misconception is that 'the main text is not visible to the public, so the comments are also not visible'—on the contrary, the main text and its attached comments and messages are two independent layers of data. The visibility of the parent object does not automatically make the child object invisible. A mainstream program specifically fixed an issue in its security version in October 2026, which was a typical example of this missed judgment: 'private and unpublished article comments being read without authorization.'
Why is this kind of question appearing in comments instead of in the main text
The visibility of the main text is the easiest to handle: list queries are naturally filtered by status, drafts and pending publications never appear in the external list, and direct access to the address of an unpublished main text is usually blocked by the status verification. The trouble lies in the fact that comments are a separate set of records, with their own list interfaces and detail interfaces. The list interface often filters with 'only comments under published main texts', while the detail interface usually retrieves data based on the comment's own ID, without checking the status of the article it belongs to at the moment. An anonymous visitor can bypass the main text gate by simply obtaining a comment ID.
When the parent object is not visible, who should the child object follow?
The principle is only one sentence: the child object does not inherit the visibility of the parent object, it must check the status of the parent object again at the moment of reading. When it comes to the order of judgment, reading a comment should first locate which document it belongs to, and then see if the document is a draft, pending publication, official, or recycling bin, and only when the main text is visible to the outside, the comment content will be returned accordingly. Reversing this order will result in contradictory results such as 'Main text 403, comment 200'.
What will happen if the details of the verification list are omitted?
List and detail are two code paths, the vulnerability is almost always on the one written later.
| Read path | Whether to check the status of the main text | Anonymous visible | Consequences |
|---|---|---|---|
| Comment list (hanging under the published article) | Is | Only published | As expected |
| Single comment detail (by ID) | Commonly missed | May read comments under the main text that has not been published | Access violation |
| Pending review messages | Yes + review status | No | Content review required |
| Preview of draft text | With preview parameters | Within the authorized session | Preview parameters are not passed to the message interface |
The critical line is the second line: The detail interface only recognizes comment ID, and when the parent document status is not checked back, the comments under the unissued article become public detours. The same fix also includes a stored XSS triggered by the pending review comments on the comment management page, which reminds us of another thing - messages not only can be read, but may also be written back to the management interface for execution, so content review and sensitive word filtering should take effect on the write side.
How to express visibility in the document status model within the site
The Aanqi CMS divides documents into four states: formal documents, drafts, pending release, and recycle bin. The draft link with preview parameters can be previewed in authorized sessions. Deleting a formal document is moved to the recycle bin instead of being physically deleted. This set of states itself is the basis for visibility judgment: any read interface should take the current status of the target document as a prerequisite before returning content, rather than assuming that the caller will only enter from the external list.
How should the message and comment interface be divided into three layers
Refer to the API call surface, interfaces such as comments and reviews need to pass three stages: the first is the parent document status (whether formal, whether visible to the public), the second is the child record's own status (whether reviewed, whether marked as spam), and the third is the role and permission (unlogged-in users can see approved ones, authors can see their own related ones, pending ones are only given to review roles). The most easily overlooked is the reuse of the second and third layers for detail interfaces.
Self-check in three steps
First, create a document to be published, leave a reviewed comment below it; then, use an unlogged session to directly request the details interface of the comment, to see if the result is empty or complete; finally, check whether the same interface rejects reading for the recycling bin and unreviewed comments. If the second step returns content, it means that the visibility check is missing in the details path.
Common questions
Question: Can't we just hide the draft content address?Answer: Not enough. Comments have an independent reading entry, even if no one knows the content address, the comment ID will be exposed when enumerated, and the closure should be on the interface status verification.
Ask: Can't we just preview the parameters to see the comments?Answer: The preview parameters are for the main content preview, and the comment interface does not recognize this parameter, which is the point to check - if it recognizes it, it will expand the scope, and not recognizing it is in line with 'determine according to the document status'.
Ask: Can the content review prevent this kind of overstepping?Answer: The review manages whether the comment content can be published externally, while overstepping manages whether the article it belongs to can be published externally. These two things should be judged separately, and cannot rely on the review to cover all aspects.