Z-BlogPHP Post-Auth Missing Authorization Allows Low-Privilege Commenters to Approve Their Own Pending Comments
Project: Z-BlogPHP
Repository: https://github.com/zblogcn/zblogphp
Affected Version: v1.7.4.3430
Vulnerability ID: VPLUS-2026-16327
Title: Post-Authentication Authorization Flaw in Z-BlogPHP Allows Commenters to Approve Their Own Pending Comments
Description: A privilege management flaw exists in Z-BlogPHP when comment moderation is enabled. Low-privilege users with the “commenter” role are expected to only view their own comments, but in practice they can directly approve their own comments while those comments are still pending review.
Code analysis shows two key issues:
Admin_CommentMng()filters the comment list bycomm_AuthorID=current_userwhen the user does not have theCommentAllprivilege. This allows low-privilege commenters to view their own pending comments in the backend moderation interface.CheckComment()incorrectly treatscmt->AuthorID == current_useras an authorized condition when the user lacksCommentAll, allowing the comment author to change theIsCheckingstatus of their own comment.
As a result, once comment moderation is enabled, a low-privilege commenter can submit a comment that is initially pending and not publicly visible, then directly invoke the moderation endpoint to approve it without administrator review.
Affected File: zb_system/function/c_system_event.php
Affected Function: CheckComment
Affected Line: 1196
Technical Root Cause: The application does not properly restrict comment moderation actions to privileged users. It incorrectly considers the comment author to be an authorized actor for changing moderation state, which breaks the intended moderation workflow.
Attack Vector: A low-privilege commenter can log in to the backend and access:
/zb_system/cmd.php?act=CommentChk&id=<comment_id>&ischecking=0&csrfToken=<token>
This changes the user’s own comment from pending review to approved.
Proof of Concept: A valid test reproduced the issue with the following sequence:
- Administrator enabled comment moderation
- Administrator created a low-privilege commenter account and a test article
- The commenter submitted a comment
- Before approval, the comment was not visible on the frontend
- The commenter directly called the
CommentChkmoderation endpoint - The comment immediately became visible on the frontend
Observed Results:
- Before self-approval: comment not visible publicly
- Self-approval request:
HTTP 200
- After self-approval: comment visible publicly
Example Verification Output:
comment_id=9before_visible=FalseHTTP 200after_visible=True
Impact: This vulnerability allows low-privilege users to bypass the site’s comment moderation workflow and publish their own comments without administrator approval. It undermines trust in moderation controls and may enable spam, abusive content, or policy-violating comments to be publicly displayed.
Severity: Medium
CVSS: 6.5
Remediation Recommendations:
- Remove the authorization branch in
CheckComment()andBatchComment()that allows the comment author to change moderation status. - Restrict comment approval actions to users with
CommentAllpermission, or other explicitly authorized moderation roles only. - Tighten
Admin_CommentMng()so low-privilege commenters cannot access moderation actions or moderation UI elements for their own comments. - Review all comment-related state-changing actions to ensure ownership does not incorrectly imply moderation privilege.