/

CVE-2026-35174

Severity:

CRITICAL RISK

(9.1)

Path Traversal and Arbitrary File Write in Chyrp Lite

CVE-2026-35174

Analyzed

Vulnerability type

Category:

Path Traversal and Arbitrary File Write

CWE:

CWE-22, CWE-73, CWE-434

Impact:

Remote Code Execution and Sensitive Data Exposure

Severity:

CRITICAL RISK

(9.1)

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

Chyrp Lite versions prior to 2026.01 contain a path traversal issue in the administration console that allows privileged users to set the uploads path to arbitrary directories on the server.

When abused by an administrator or a user with Change Settings permission, this misconfiguration can be used to download sensitive files (such as config.json.php with database credentials) and overwrite critical application files, potentially resulting in remote code execution.

Affected context

The vulnerability occurs within the Chyrp Lite administration console where the uploads directory path is configured.

It affects deployments where:

  • Users with administrative or Change Settings privileges can modify the uploads path without strong server-side validation, and
  • The web server process has read access to sensitive files (e.g., configuration files) and write access to application directories.

In these conditions, the uploads mechanism can be redirected to arbitrary locations on the filesystem, blurring the boundary between user-controlled content and internal application or system files.

Exploit preconditions

  • Attack surface: Administrative web interface for Chyrp Lite (settings / configuration screens).
  • Required access: Valid authenticated account with either:
  • Administrator role, or
  • Specific "Change Settings" permission.
  • Trigger point: Changing the uploads path setting in the admin console to a path outside the intended uploads directory (e.g., using relative traversal such as ../ or an absolute path).
  • Why exploitation is possible:
  • The application trusts the configured uploads path without adequately normalizing and constraining it to an allowed base directory (CWE-22, CWE-73).
  • Subsequent file upload and file access operations rely on this path, enabling reading of arbitrary files and overwriting of files in writable locations, which can be turned into remote code execution (CWE-434) when executable files or PHP scripts are replaced or created.

Why this happens

The core issue arises from improper validation of filesystem paths supplied via the administration settings.

Instead of restricting the uploads directory to a predefined, application-controlled subtree, the code accepts user-provided paths and passes them directly into file handling routines (read/write) at the OS level.

This pattern maps to:

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory, due to inadequate canonicalization and enforcement of a safe base path, allowing directory traversal.
  • CWE-73: External Control of File Name or Path, because a configuration field lets a user influence where the application reads from and writes to on the filesystem.
  • CWE-434: Unrestricted Upload of File with Dangerous Type, in the sense that the attacker can redirect uploads or writes into locations where uploaded/managed files become executable server-side code.

By combining these issues, a privileged but potentially malicious or compromised admin account can turn routine content management operations into a means of accessing sensitive configuration data and achieving code execution.

Potential impact

  • Disclosure of sensitive configuration files, including config.json.php and embedded database credentials.
  • Unauthorized access to other application files or logs that may contain secrets, tokens, or user data.
  • Overwriting of critical system or application files within web-accessible directories.
  • Deployment of backdoored PHP or other executable scripts, enabling persistent remote code execution.
  • Complete compromise of the Chyrp Lite instance and potentially the underlying server, depending on process privileges.
  • Use of the compromised application as a pivot point for further lateral movement within the hosting environment.

General mitigation guidance

Effective mitigation focuses on strict control and validation of filesystem paths and the separation of user-controlled content from application code and configuration.

Common defensive patterns include:

  • Constrain uploads to a fixed base directory: Hard-code or server-configure a root uploads directory and reject any configured path that attempts to escape this directory after canonicalization.
  • Normalize and validate paths: Resolve relative elements (. and ..), convert to absolute paths, and verify that the resulting path remains under an approved directory before using it for file operations.
  • Separate privileges and directories: Store application code, configuration files, and uploads in distinct locations, with the web server and application having only the minimal read/write permissions necessary.
  • Disallow executable uploads in executable locations: Ensure user-uploaded content is served from non-executable directories, with appropriate web server configuration to prevent script execution.
  • Defense in depth around configuration: Treat configuration values that influence filesystem access as high risk; apply additional validation, default-safe values, and possibly disallow arbitrary reconfiguration for non-root administrators.
  • Apply least privilege at the OS level: Run the web server and application with restricted filesystem permissions so that even if path controls are bypassed, critical system files remain non-writable and, where possible, non-readable.

How teams detect issues like this

Detection typically combines code-centric reviews with runtime monitoring:

  • Static analysis: Configure rules to flag:
  • Direct use of user-controlled or configuration-derived paths in file APIs (open, read, write, unlink, include/require).
  • Concatenation of configuration settings with filesystem paths without canonicalization and base-path checks.
  • Code review cues:
  • Settings that allow admins to specify arbitrary paths or filenames.
  • File operations performed on paths derived from application settings without calls to path normalization or enforcement of a restricted root directory.
  • Upload handlers that can be pointed at different directories via configuration.
  • Policy and configuration checks:
  • Automated tests or CI checks that verify that configured upload paths remain under an allowed directory.
  • Security linting that warns when configuration options effectively move trust boundaries (e.g., toggles that relocate upload directories).
  • Runtime/log monitoring:
  • Alerts on unusual paths being used as upload directories (e.g., paths outside the expected uploads tree).
  • Detection of unexpected changes to core application files or configuration files, via file integrity monitoring.

Sources

SourceLink
github.comgithub.com/xenocrat/chyrp-lite/security/advisories/GHSA-p6pf-2grm-8257

Frequently asked

questions

No. Exploitation requires an authenticated account with administrative or Change Settings privileges. However, if an attacker compromises such an account through other means (e.g., credential theft), they can leverage this vulnerability for full application compromise.

The attacker must be able to log into the Chyrp Lite administration console with sufficient privileges to modify the uploads path configuration. There is no requirement for shell or file-level access to the server; the exploit can be carried out entirely through the web interface once the appropriate permissions are obtained.

The safest approach is to remove or tightly restrict any configuration that lets users choose arbitrary filesystem paths, and instead enforce a fixed, application-controlled uploads directory. Any remaining path configuration should be normalized, validated against a whitelist of allowed directories, and rejected if it attempts to traverse outside the permitted area.

Adopt a secure-by-default design for any feature touching the filesystem: treat all paths influenced by users or configuration as untrusted, canonicalize them, and enforce that they stay within pre-defined safe directories. Combine this with principle of least privilege for filesystem permissions, thorough code review focused on file handling, and static analysis rules that highlight external control of file paths and uploads into executable locations.

Find out what's already
exploitable in your codebase.