Summary
GeoDirectory for WordPress has a stored cross-site scripting vulnerability involving the post_content parameter, caused by insufficient input sanitization and output escaping. An unauthenticated attacker may be able to store script content that runs in a visitor's browser when they view an affected page.
Affected context
The issue occurs in the GeoDirectory – WP Business Directory Plugin and Classified Listings Directory plugin for WordPress, in handling content that includes nested shortcodes. The described weakness affects versions up to and including 2.8.200 when crafted post_content is accepted and later rendered. The shortcode-stripping guard may be bypassed because WordPress processes registered shortcodes in a single pass, while HTML-entity-encoded shortcode attributes can remain after wp_kses_post() filtering.
Exploit preconditions
- Attack surface: WordPress content handling and rendering through GeoDirectory.
- Required access: The vulnerability description indicates that authentication is not required.
- Trigger point: A visitor accesses a page containing the stored content.
- Why exploitation is possible: Nested shortcode content can evade the plugin's shortcode-removal check, and entity-encoded attribute values may not be handled as HTML tags by the subsequent HTML filtering.
Why this happens
The underlying issue is inadequate validation and context-aware output encoding of content passed through shortcode processing. The plugin's guard relies on a single-pass shortcode removal step, which can leave nested shortcode structures for later processing; HTML sanitization does not necessarily neutralize shortcode attribute values. This is a stored cross-site scripting flaw mapped to CWE-79, where untrusted content can be interpreted as executable script in a user's browser.
Potential impact
- Attacker-controlled script execution may occur in the context of a visitor's browser.
- Scripts could access or manipulate page content and perform actions as the affected visitor, subject to the site's browser and application controls.
- Site integrity and visitor trust could be affected if malicious content is stored and displayed.
General mitigation guidance
Defensive approaches generally focus on treating submitted content as untrusted throughout parsing and rendering.
- Use context-appropriate sanitization and output escaping at the point content is rendered.
- Avoid relying on a single shortcode-stripping pass as a security boundary; use parsing and validation that account for nested or recursively processed content.
- Restrict accepted shortcode structures and attribute values to explicitly allowed forms.
- Prefer secure-by-default rendering paths that do not interpret user-controlled content as executable markup or shortcode instructions.
- Limit permissions for content submission where practical, while recognizing that access controls alone may not address unauthenticated paths.
How teams detect issues like this
- Use static analysis to identify user-controlled content reaching shortcode parsers or HTML output without context-appropriate escaping.
- Review code that combines shortcode removal, recursive or multi-stage parsing, and HTML sanitization.
- Test rendering paths with nested shortcode structures and encoded attribute values in controlled environments.
- Apply content-security policies and security review checks as defense-in-depth measures; these do not replace correct sanitization and escaping.
- Automated code review tools may help flag unsafe output and parsing patterns.

