CVE-2025-31493: Kirby CMS Path Traversal Vulnerability in Collection Helper

getkirby/cms Updated 14 Dec 2025

Summary

13/05/2025
Yes i
Moderate
6.3

CVE-2025-31493: Kirby vulnerable to path traversal of collection names during file system lookup. Affects getkirby/cms across 3 version ranges.

< 3.9.8.3 >= 3.10.0, < 3.10.1.2 >= 4.0.0, < 4.7.1

Fixed in 3.9.8.3, 3.10.1.2 or 4.7.1, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Kirby is a flexible content management system (CMS) that allows developers to create websites using a file-based approach. It provides a simple and intuitive interface for managing content and supports various plugins to extend its functionality. However, a vulnerability has been identified in the collection() helper method, which can lead to unauthorized access to files on the server due to improper handling of dynamic collection names.

Vulnerability Detail

The vulnerability arises from the collection() helper in Kirby, which allows loading PHP logic files from the site/collections directory. When called with a dynamic collection name, the method does not adequately validate the input, allowing attackers to exploit path traversal techniques. By using sequences like '../', an attacker can navigate outside the intended directory, potentially accessing sensitive files on the server. This could lead to unauthorized file access, execution of malicious scripts, and compromise of server integrity.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 3.9.8.3 3.9.8.3
    composer require getkirby/cms:3.9.8.3
  • >= 3.10.0, < 3.10.1.2 3.10.1.2
    composer require getkirby/cms:3.10.1.2
  • >= 4.0.0, < 4.7.1 4.7.1
    composer require getkirby/cms:4.7.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, avoid using dynamic collection names in the collection() helper. Instead, use fixed collection names that do not depend on user input or request data. For example, replace collection('tags-' . get('tags')) with a static collection name like collection('tags-default').

Conclusion

The CVE-2025-31493 vulnerability in Kirby CMS poses a significant risk due to improper handling of dynamic collection names, allowing for path traversal attacks. It is crucial to update to the patched versions to mitigate this risk and ensure the security of your application.

See every vulnerability recorded for getkirby/cms →

Share this vulnerability

FAQ

The vulnerability allows attackers to access arbitrary files on the server, potentially leading to data leakage, unauthorized access to sensitive information, and execution of malicious code.

If your site uses the collection() helper with dynamic collection names, it may be vulnerable. Check your code for such instances and update to a patched version.

The patched versions are Kirby 3.9.8.3, 3.10.1.2, and 4.7.1. Updating to any of these versions will resolve the vulnerability.

Yes, Vulert can monitor your project for open-source vulnerabilities using the composer.lock file. You can check if your application is affected by this vulnerability using the Vulert playground.

If an immediate update is not possible, implement the suggested workaround by avoiding dynamic collection names in your code until you can apply the patch.

Related vulnerabilities

Recent vulnerabilities recorded for getkirby/cms.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 3.9.8.3 3.9.8.3
    composer require getkirby/cms:3.9.8.3
  • >= 3.10.0, < 3.10.1.2 3.10.1.2
    composer require getkirby/cms:3.10.1.2
  • >= 4.0.0, < 4.7.1 4.7.1
    composer require getkirby/cms:4.7.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback