Summary
The GutenBee – Gutenberg Blocks plugin for WordPress contains an arbitrary file upload vulnerability in the gutenbee_file_and_ext_json function that allows insufficiently validated files to be uploaded.
Because the filename check only verifies that the name contains .json instead of ending with .json, authenticated users with author-level access or higher may upload double-extension files (e.g., shell.json.php), potentially leading to remote code execution on the server.
Affected context
This vulnerability occurs in WordPress sites that:
- Have the GutenBee – Gutenberg Blocks plugin installed and active
- Allow users with author-level or higher roles to upload or manage Gutenberg block content
- Rely on the
gutenbee_file_and_ext_jsonfunction to validate uploaded files as JSON
The risk materializes when double-extension filenames are accepted as valid JSON files and are stored in locations where the web server may treat them as executable code.
Exploit preconditions
- Attack surface: HTTP(S) endpoints exposed by the WordPress site using GutenBee's upload functionality.
- Required access: Authenticated WordPress account with at least author-level privileges (or higher, such as editor or administrator).
- Trigger point: Uploading a crafted file through functionality that calls
gutenbee_file_and_ext_json, using a filename that includes.jsonbut ends with a different extension (e.g.,.php). - Why exploitation is possible: The plugin performs a substring check with
strpos()to see if.jsonappears anywhere in the filename, rather than confirming that the filename actually ends with the.jsonextension. This allows double-extension payloads to pass validation and be stored on the server.
Why this happens
The core issue is an insecure file type validation pattern, aligning with CWE-434: Unrestricted Upload of File with Dangerous Type.
Instead of strictly enforcing file extensions and MIME types, the vulnerable code uses a simple substring check (strpos() for .json) on the entire filename. This logic treats any filename containing .json as acceptable, even when the ultimate extension is executable (e.g., .php). Without robust validation of the final extension, MIME type, and storage location, the application accepts files that can be interpreted as code by the web server, turning a content upload feature into an unintended code deployment mechanism.
Potential impact
- Upload and execution of arbitrary server-side code in the context of the web server process
- Full compromise of the affected WordPress instance (content, configuration, and database data)
- Installation of webshells for persistent access and further manual exploitation
- Use of the compromised site for malware distribution, spam, or phishing campaigns
- Pivoting to other systems in the hosting environment, depending on server configuration and isolation
General mitigation guidance
Effective mitigation focuses on strict file validation and reducing the consequences of any malicious uploads:
- Enforce strict extension checks to ensure the filename truly ends with the expected safe extension (e.g.,
.json), rather than merely containing it. - Validate both server-side MIME type and content structure for uploaded files, rejecting files that do not conform to the expected format.
- Store uploaded files in non-executable directories or on storage backends where the web server will not interpret files as code (e.g., dedicated assets directory with disabled script execution).
- Apply principle of least privilege to WordPress roles: only grant upload capabilities to roles that genuinely require them, and consider narrowing the set of users who can access this plugin's upload features.
- Introduce defense-in-depth checks at the web server or WAF layer (for example, disallowing execution of scripts from upload directories and blocking suspicious double-extension patterns).
How teams detect issues like this
Detection usually involves a mix of source-level review and runtime monitoring:
- Static code analysis: Search for file upload handlers that:
- Use naive filename checks such as
strpos()orsubstr()without verifying the final extension - Lack MIME type verification or content validation
- Write user-controlled files into web-accessible paths
- Code review signals: During plugin/theme review, flag:
- Upload endpoints tied to editor/author roles
- Any logic that trusts client-supplied filenames or extensions
- Absence of centralized file validation utilities or policies
- Runtime monitoring and logging:
- Track creation of new files with executable extensions (e.g.,
.php,.phtml) in upload directories. - Monitor web server logs for unusual requests to recently uploaded files, especially from uncommon IPs or user agents.
- Automated tooling: Use security scanners and SAST tools tuned to identify arbitrary file upload patterns and weak filename validation, integrating them into CI/CD pipelines for ongoing coverage.

