CVE-2025-30159: Kirby Path Traversal Vulnerability in Snippet Helper

getkirby/kirby Updated 14 Dec 2025

Summary

13/05/2025
Yes i
Moderate
6.3

CVE-2025-30159: Kirby vulnerable to path traversal of snippet names in the snippet() helper. Affects getkirby/kirby 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Kirby is a flexible content management system that allows users to create and manage websites using a file-based approach. It provides a simple way to load PHP snippet files through its snippet() helper, which is designed to enhance modularity and reusability of code. However, a vulnerability exists in this helper when dynamic snippet names are used, allowing potential attackers to exploit the system.

Vulnerability Detail

The vulnerability arises from the lack of proper path traversal checks in Kirby's snippet() helper. When called with a dynamic snippet name, the helper does not validate the path, allowing attackers to use special sequences like '../' to navigate outside the designated snippets directory. This could lead to unauthorized access to sensitive files on the server, execution of arbitrary PHP code, and compromise of the server's confidentiality and 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/kirby:3.9.8.3
  • >= 3.10.0, < 3.10.1.2 3.10.1.2
    composer require getkirby/kirby:3.10.1.2
  • >= 4.0.0, < 4.7.1 4.7.1
    composer require getkirby/kirby: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

If you have deliberately used path traversal in your projects, these uses will break after updating to a patched version. Instead of using path traversal, consider using the following robust alternatives:

  1. For aliasing a template, use: require __DIR__ . '/other-template.php';
  2. To override the template method in the page model, implement:
    class AnotherPage extends Page
    {
      public function template(): Template
      {
        return $this->kirby()->template('other-template');
      }
    }
    
  3. Restructure your project to have a shared snippets root for multisite setups, or use symbolic links to include shared directories.

Conclusion

The path traversal vulnerability in Kirby's snippet() helper poses significant risks to server security. It is crucial for developers using Kirby to update to the latest patched versions and to implement safer coding practices to prevent exploitation. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for getkirby/kirby →

Share this vulnerability

FAQ

The vulnerability allows attackers to access and execute arbitrary files on the server, potentially leading to data breaches and server compromise.

You can use Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without needing to sign up.

All versions of Kirby that use the snippet() helper with dynamic snippet names are affected. Ensure you update to at least version 3.9.8.3, 3.10.1.2, or 4.7.1.

If immediate updating is not possible, review your code for any dynamic snippet calls and replace them with safer alternatives to mitigate the risk.

The vulnerability was reported by Bruno Meilick, with contributions from Tobias Möritz regarding its effects on site code.

Related vulnerabilities

Recent vulnerabilities recorded for getkirby/kirby.

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/kirby:3.9.8.3
  • >= 3.10.0, < 3.10.1.2 3.10.1.2
    composer require getkirby/kirby:3.10.1.2
  • >= 4.0.0, < 4.7.1 4.7.1
    composer require getkirby/kirby: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