/

CVE-2026-120349

Severity:

HIGH RISK

(7.3)

Code Injection (CWE-94) in XunRuiCMS Mobile Site Directory

CVE-2026-120349

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-74, CWE-94

Impact:

Potential Server-Side Code Execution

Severity:

HIGH RISK

(7.3)

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

XunRuiCMS has a code injection flaw in the Mobile Site Directory, where remote manipulation of the dirname argument used by str_replace can affect application code handling. If the affected code path is reachable, an attacker may be able to cause server-side code execution.

Affected context

The issue is reported in XunRuiCMS versions up to 4.7.4, in the Mobile Site Directory component's /var/www/html/zzmob/index.php file. The affected path involves the str_replace function and its dirname argument. The description indicates that the attack can be launched remotely; the exact deployment and access conditions may affect exposure.

Exploit preconditions

  • Attack surface: A remotely reachable path in the Mobile Site Directory
  • Required access: The description does not specify whether authentication is required.
  • Trigger point: Handling of the dirname argument in the affected str_replace code path
  • Why exploitation is possible: Manipulation of this argument is reported to result in code injection; the precise implementation details are not provided.

Why this happens

The reported behavior maps primarily to CWE-94: Improper Control of Generation of Code ('Code Injection'). It also relates to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component. At a general level, the flaw occurs when attacker-influenced input can alter content that is subsequently interpreted as code, rather than being constrained to ordinary data.

Potential impact

  • An attacker may be able to execute code in the application server's context.
  • The application or its data could be compromised.
  • The server may be used to access other resources available to the application.
  • Depending on the server's privileges and network access, the impact could extend to connected systems.

General mitigation guidance

Defensive approaches focus on preventing untrusted input from influencing executable code.

  • Keep user-controlled values as data; avoid incorporating them into generated or evaluated code.
  • Apply strict allowlist validation to directory-related inputs and reject unexpected values.
  • Use safe APIs and fixed mappings for directory selection instead of constructing code or paths from raw input.
  • Run the application with least-privilege access to files, processes, and connected services.
  • Limit remote exposure of sensitive administrative and site-management functionality.

How teams detect issues like this

  • Use static analysis to identify user-controlled values that flow into code-generation, evaluation, or sensitive string-processing paths.
  • Review the dirname handling and nearby data flows for validation, escaping, and use in downstream interpreters.
  • Add tests and policy checks that reject unexpected directory values and prevent input from becoming executable content.
  • Monitor application and server logs for unusual requests targeting the Mobile Site Directory or repeated errors in the affected code path.
  • Automated code review tools may help identify risky input-to-code flows.

Sources

SourceLink
github.comgithub.com/tiranbge/disclosure-xunruicms-4.7.2/blob/master/reports/2.md
vuldb.comvuldb.com/cve/CVE-2026-120349
vuldb.comvuldb.com/submit/1016299
vuldb.comvuldb.com/vuln/429673
vuldb.comvuldb.com/vuln/429673/cti

Frequently asked

questions

The report says an attack can be launched remotely. Actual exposure depends on whether the affected Mobile Site Directory path is reachable in a given deployment.

The available description does not state whether authentication is required. Review access controls around the affected path rather than assuming it is unauthenticated.

Ensure that input such as dirname remains data: validate it against a strict allowlist and do not let it influence generated or evaluated code.

Use safe APIs, constrain input at trust boundaries, review input-to-code data flows, and run the application with least privilege.

Find out what's already
exploitable in your codebase.