Summary
The Orphans plugin for WordPress has a stored cross-site scripting flaw in the comment parameter because input is not sufficiently sanitized and output is not properly escaped. An unauthenticated attacker may get script-bearing content published by first having a benign comment approved under the same name and email, then submitting a payload comment that WordPress auto-publishes.
Affected context
The issue affects the Orphans plugin for WordPress in versions up to and including 3.4.5. It arises in comment handling when submitted content is stored and later rendered without adequate sanitization and output escaping. The described approval behavior means exploitation depends on a benign comment being approved under the same name and email used for the subsequent payload comment.
Exploit preconditions
- Attack surface: WordPress comments handled by the Orphans plugin
- Required access: No authenticated account is described as necessary; the attacker must be able to submit comments
- Trigger point: A visitor loads a page where the attacker's comment is rendered
- Why exploitation is possible: After a benign comment is approved for a given name and email, WordPress may auto-publish a later comment with matching details, allowing the insufficiently sanitized and escaped content to be stored and displayed
Why this happens
The plugin does not adequately sanitize the comment parameter on input or escape it for the relevant output context. This is a CWE-79: Cross-Site Scripting flaw: attacker-controlled content is stored and later rendered in a way that can be interpreted as script by a browser. The comment approval behavior can allow the payload comment to be published without a separate moderation decision.
Potential impact
- A visitor's browser may execute attacker-controlled scripts when loading an affected page.
- Scripts may act with the privileges and context of the affected site visitor.
- The issue could be used to present deceptive content or perform actions available to a targeted visitor.
General mitigation guidance
Defensive approaches focus on treating comment content as untrusted throughout its lifecycle.
- Sanitize input according to the intended content policy and validate it against an explicit schema.
- Escape output at the point of rendering, using context-appropriate escaping.
- Apply secure-by-default moderation and publication rules to user-submitted content.
- Minimize the privileges available to site accounts and processes that handle comments.
- Avoid relying on comment identity or approval heuristics as a substitute for safe content handling.
How teams detect issues like this
- Use static analysis to identify comment data flowing from request parameters to rendered output without context-appropriate escaping.
- Review code paths for sanitization performed only at input time, missing output escaping, or inconsistent handling across display contexts.
- Test moderation and auto-approval policies to confirm they cannot bypass content-safety controls.
- Enforce code-review and CI policies that require safe rendering APIs for user-controlled content; automated review tools may help flag risky data flows.

