Severity:

HIGH RISK

(7.5)

Local File Inclusion (CWE-22) in WP User Manager Profile Template Scope

CVE-2026-9290

Deferred

Vulnerability type

Category:

Local File Inclusion

CWE:

CWE-22

Impact:

Arbitrary File Inclusion and Remote Code Execution

Severity:

HIGH RISK

(7.5)

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

A Local File Inclusion (LFI) vulnerability in the WP User Manager – User Profile Builder & Membership plugin allows arbitrary PHP files on the server to be included and executed via the profile template scope functionality.

When an attacker can influence the file path parameter, they may bypass access controls, expose sensitive data, or execute PHP code in uploadable .php files, potentially leading to full site compromise.

Affected context

This issue occurs in WordPress sites using the WP User Manager – User Profile Builder & Membership plugin where the profile template scope function dynamically builds or resolves a PHP file path based on user-controlled input.

The vulnerability is present when:

  • The plugin loads PHP templates from disk using a path that is directly or indirectly influenced by request parameters
  • The resolved path is not constrained to an expected directory or vetted against a whitelist
  • The web server has readable or executable PHP files that an attacker can point the inclusion mechanism at, including potentially uploaded .php files

Exploit preconditions

  • Attack surface: Public-facing WordPress endpoints that trigger profile template rendering.
  • Required access: None; the vulnerable functionality is reachable by unauthenticated users.
  • Trigger point: A request parameter controlling or affecting the "profile template scope" used to determine which PHP file is included.
  • Why exploitation is possible:
  • User-controllable input is used to build file paths without sufficient normalization, directory restriction, or validation.
  • The plugin includes files using PHP constructs (e.g., include/require) that will execute any PHP code in the targeted file.
  • In environments that allow PHP file upload or already contain sensitive PHP scripts, an attacker can direct inclusion to these resources.

Why this happens

The underlying bug class is improper restriction of pathnames used in file operations (CWE-22). The plugin's profile template scope logic takes user-influenced input and uses it to construct a filesystem path that is then passed to PHP's file inclusion mechanisms.

Without enforcing a strict, canonical base directory, validating against an allowlist of known template names, or normalizing and rejecting path traversal sequences, the application inadvertently trusts external input to decide which PHP file is executed. This pattern turns a flexible template system into a powerful primitive for local file inclusion and, where attacker-controlled PHP files exist, remote code execution.

Potential impact

  • Inclusion and execution of attacker-controlled PHP files, leading to arbitrary code execution under the web server's privileges
  • Bypass of application-level access controls by directly loading internal template logic or protected scripts
  • Disclosure of sensitive data present in locally stored PHP or configuration files, where error messages or logic leak information
  • Escalation from a simple file read to full site takeover when combined with an upload or file-write primitive
  • Lateral movement within the hosting environment if credentials or keys are exposed via included files

General mitigation guidance

Effective mitigation focuses on constraining and validating all file paths used for template inclusion and reducing trust in runtime file selection:

  • Replace direct use of user input in file paths with a strict mapping from simple identifiers (e.g., slugs or IDs) to preconfigured template filenames.
  • Enforce a fixed, canonical base directory for all includes and ensure paths are resolved and normalized before use; reject any path that escapes this directory.
  • Implement allowlists of valid templates instead of dynamically including arbitrary filenames; disallow any characters or sequences not needed for legitimate template selection.
  • Avoid allowing upload or storage of executable PHP files in web-accessible directories; prefer non-executable formats (e.g., HTML fragments, JSON, or database-backed templates).
  • Run the web server and PHP with least-privilege file system rights so that even if an inclusion flaw exists, the range of accessible files is limited.
  • Centralize file inclusion logic into a small, well-reviewed helper that consistently enforces these constraints, instead of duplicating ad hoc inclusion code.

How teams detect issues like this

Detection typically combines code-level analysis with runtime monitoring:

  • Static analysis and code review:
  • Search for include, require, include_once, or require_once where arguments are derived from $_GET, $_POST, $_REQUEST, or other external inputs.
  • Flag any file inclusion that uses concatenated or interpolated paths without explicit allowlist checks or canonicalization.
  • Review template systems that support "dynamic template names" to confirm they only accept safe identifiers mapped to known paths.
  • Automated tooling:
  • Configure SAST tools to detect path traversal and LFI patterns, particularly user-controlled variables flowing into file-related functions.
  • Use dependency and plugin security scanners to surface known LFI issues in WordPress components.
  • Runtime and log-based detection:
  • Monitor web server and application logs for suspicious patterns such as ../, unexpected template names, or repeated access to profile-related endpoints with unusual parameters.
  • Enable application-level error logging and review stack traces that show unexpected file inclusion paths.

Sources

SourceLink
github.comgithub.com/WPUserManager/wp-user-manager/pull/445
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.15/includes/functions.php#L955
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.15/includes/permalinks.php#L133
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.15/templates/profile.php#L52
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.15/vendor-dist/brain/cortex/src/Cortex/Router/Router.php#L183
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.15/vendor-dist/gamajo/template-loader/class-gamajo-template-loader.php#L226
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.17/includes/functions.php#L955
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.17/includes/permalinks.php#L133
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.17/templates/profile.php#L52
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.17/vendor-dist/brain/cortex/src/Cortex/Router/Router.php#L183
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-user-manager/tags/2.9.17/vendor-dist/gamajo/template-loader/class-gamajo-template-loader.php#L226
plugins.trac.wordpress.orgplugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3554574%40wp-user-manager&new=3554574%40wp-user-manager&sfp_email=&sfph_mail=
wordfence.comwordfence.com/threat-intel/vulnerabilities/id/7a5e08d8-c6ef-42a3-9599-28c3bfb35017?source=cve

Frequently asked

questions

It is remotely exploitable; attackers can target the vulnerable profile template scope endpoint over HTTP without local server access, as long as the endpoint is exposed and reachable.

No. The described vulnerability is reachable by unauthenticated users, which means any external user who can send requests to the affected WordPress site may attempt exploitation.

The most robust fix is to remove direct user control over file paths and replace it with an allowlist-based template system: accept only simple identifiers, map those to a predefined set of template filenames, and include files exclusively from a fixed, canonical directory. All other values should be rejected before any file system interaction occurs.

Preventing LFI centers on treating all external input as untrusted: never feed raw user input into file paths, enforce strict directory boundaries, normalize and validate any dynamic paths, avoid deploying executable templates where possible, and rely on security-focused code review and static analysis to catch unsafe inclusion patterns before release.

Find out what's already
exploitable in your codebase.