/

CVE-2025-13374

Severity:

CRITICAL RISK

(9.8)

Unrestricted File Upload in Kalrav AI Agent WordPress Plugin

CVE-2025-13374

Awaiting Analysis

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution and Server Compromise

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The Kalrav AI Agent plugin for WordPress allows arbitrary file uploads via the kalrav_upload_file AJAX action without proper file type validation.

An unauthenticated attacker can upload arbitrary files to the server, which can in turn enable remote code execution if executable code is placed in a web-accessible location and interpreted by the server.

Affected context

This vulnerability affects WordPress sites that have the Kalrav AI Agent plugin enabled in versions up to and including 2.3.3.

The issue occurs in the AJAX handler responsible for processing file uploads, where user-supplied files are accepted without robust validation of type or content.

It is most risky in environments where uploaded files are stored in web-accessible directories and can be interpreted or executed by the underlying server (e.g., PHP-enabled upload paths).

Exploit preconditions

  • Attack surface: Public-facing WordPress site exposing the admin-ajax.php endpoint with the Kalrav AI Agent plugin active.
  • Required access: No authentication required; any remote user can access the vulnerable AJAX action.
  • Trigger point: Issuing a crafted HTTP request to the kalrav_upload_file AJAX action that includes a malicious file as the upload payload.
  • Why exploitation is possible: The upload handler lacks strict server-side validation of file type, extension, and content, allowing arbitrary files (including potentially executable code) to be stored on the server in locations that may be processed by the web server or application runtime.

Why this happens

The core issue is an unrestricted file upload pattern, aligning with CWE-434.

The kalrav_upload_file AJAX action accepts user-controlled file uploads and stores them without enforcing strict checks on MIME type, file extension, content, or destination path.

This breaks the assumption that uploaded content is benign media or documents and instead allows attackers to introduce server-side resources (such as scripts) that can later be executed or leveraged for further compromise.

The absence of layered validation and safe storage semantics (e.g., limiting to non-executable directories) transforms a simple upload feature into a code deployment channel.

Potential impact

  • Remote code execution on the WordPress server if uploaded files are interpreted as executable code.
  • Complete compromise of the WordPress installation, including database contents and configuration secrets.
  • Use of the compromised site as a foothold for lateral movement within the hosting environment.
  • Defacement of the website or injection of malicious content (e.g., phishing pages, SEO spam).
  • Deployment of web shells or backdoors enabling persistent unauthorized access.
  • Abuse of server resources for malware hosting, phishing campaigns, or botnet participation.

General mitigation guidance

Addressing unrestricted file upload vulnerabilities generally involves constraining what can be uploaded and how those files are handled:

  • Enforce a strict allowlist of permitted file types at the server side, validating both MIME type and extension and rejecting anything outside the expected set.
  • Implement content-level validation for supported formats (e.g., verifying image headers) rather than trusting client-supplied metadata.
  • Store uploaded files in directories that are not executable and not mapped to script handlers (e.g., disabling PHP execution in upload paths).
  • Normalize and sanitize file names, removing user-controlled path elements and avoiding direct use of user input in filesystem paths.
  • Apply least privilege to the web server and file system permissions so that uploaded content cannot modify application code or sensitive directories.
  • Introduce centralized upload handling utilities within the application to standardize validation and storage behavior across all upload features.

How teams detect issues like this

Organizations can approach detection of this class of issue and its potential exploitation with multiple layers:

  • Static analysis and code review:
  • Look for AJAX or HTTP handlers that process $_FILES or equivalent upload structures without explicit validation and allowlisting.
  • Flag file operations where user-controlled content is written into web-accessible or executable directories.
  • Check for missing checks around MIME type, file extension, and content inspection in upload logic.
  • Runtime and log-based monitoring:
  • Monitor web server and application logs for unusual POST requests to admin-ajax.php that include uploads to the vulnerable action.
  • Track creation of new files in upload directories or plugin directories, especially those with executable extensions.
  • Use file integrity monitoring to detect unexpected changes or additions in webroot and plugin paths.
  • Policy and tooling:
  • Apply security scanning tools tailored to WordPress plugins to flag unrestricted upload endpoints.
  • Incorporate automated checks in CI/CD pipelines that search for unvalidated file upload patterns and enforce secure upload policies.

Sources

SourceLink
github.comgithub.com/d0n601/CVE-2025-13374
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/kalrav-ai-agent/tags/2.3.3/kalrav-ai-agent.php#L967
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/kalrav-ai-agent/trunk/kalrav-ai-agent.php#L967
ryankozak.comryankozak.com/posts/cve-2025-13374
wordfence.comwordfence.com/threat-intel/vulnerabilities/id/5dc8feae-fc89-4152-b9b2-2b70e6ccb30b?source=cve

Frequently asked

questions

Yes. The vulnerable upload action can be reached over the network via the public admin-ajax.php endpoint on affected WordPress sites, and exploitation does not inherently require local access.

No. The vulnerability is present in an unauthenticated AJAX action, meaning any remote user can attempt to upload arbitrary files without logging in.

The most robust fix is to implement a centralized, strict upload mechanism that enforces an allowlist of safe file types, validates file content, normalizes file names, and stores uploads in non-executable locations with restricted permissions, then ensure all upload endpoints use this common, hardened path.

Treat any file upload feature as a high-risk surface: design upload handling as a reusable secure component, require code review for any new upload endpoints, incorporate automated checks for unvalidated uploads, and ensure deployment environments are configured so that uploaded content cannot be executed as code.

Find out what's already
exploitable in your codebase.