Summary
MoguBlog through version 6.2 contains an authorization bypass in the comment deletion endpoint because ownership is checked using user-supplied request fields rather than the authenticated user identity. An attacker who can obtain comment and author identifiers from publicly accessible listings may delete comments and their replies belonging to other users.
Affected context
The vulnerability occurs in MoguBlog deployments where the comment deletion endpoint accepts comment and author identifiers in the request body and uses those values for ownership decisions. Risk is higher when comment listing endpoints expose the identifiers without authentication and the deletion endpoint does not independently verify ownership against the authenticated principal.
Exploit preconditions
- Attack surface: Comment deletion functionality exposed by the application - Required access: A valid application session or other ability to invoke the
deletion endpoint, depending on deployment-specific access controls
- Trigger point: A deletion request containing selected comment and author
identifiers
- Required information: Comment and author identifiers obtainable from
unauthenticated listing responses
- Why exploitation is possible: The endpoint trusts request-body identity
fields instead of deriving authorization from the authenticated principal
Why this happens
The underlying bug is an object-level authorization failure, mapped to CWE-639: Authorization Bypass Through User-Controlled Key. The deletion logic treats identity or ownership fields supplied by the requester as authoritative instead of comparing the target object's owner with the authenticated principal established by the server. This creates an insecure direct object-reference pattern in which knowledge of an object's identifier can be sufficient to perform an action without proving authorization.
Potential impact
- An attacker may delete comments belonging to other users.
- Replies associated with targeted comments may also be deleted.
- The application could experience loss of user-generated content and reduced data integrity.
- Moderation records or discussions could be disrupted.
- Repeated unauthorized deletions could affect availability and user trust.
General mitigation guidance
Mitigation generally focuses on enforcing authorization from trusted server context rather than request-controlled identity fields. Deletion operations should resolve the authenticated principal server-side, verify ownership or an explicitly delegated moderation privilege against the target record, and use deny-by-default authorization policies. Resource identifiers should not be treated as proof of permission, and listing endpoints should minimize unnecessary exposure of identifiers. Deletion behavior should be explicit about cascading effects, while application roles and database permissions should follow least privilege. Centralized authorization middleware and consistent object-level policy checks can reduce similar inconsistencies.
How teams detect issues like this
Detection can include static analysis and code review for handlers that accept owner IDs, author IDs, or account IDs from request bodies and compare them directly with target resources. Reviewers can look for deletion or update paths that do not call a centralized authorization policy or that trust client-supplied ownership attributes. Dynamic tests should attempt access to objects owned by another account and verify consistent denial, including checks for cascading child records. API policy enforcement can require server-derived principals and object-level authorization for every mutating endpoint. Automated security testing and code-review tools may help identify these patterns.

