CVE-2025-30159CWE-22CWE-23

Kirby vulnerable to path traversal of snippet names in the `snippet()` helper

Medium · published May 13, 2025

CVSS v4.0
6.3
EPSS
1%
Percentile
53.1
In the wild
Unconfirmed
What it is

⚠️ A sneaky path traversal vulnerability lurks in Kirby! This flaw affects all sites using dynamic snippet names, potentially giving attackers a backstage pass to your server. 🔍 Think of it like a restaurant where the chef can take any order based on a customer’s request, but doesn’t check whether the ingredients are actually in stock. If the menu isn’t tightly controlled, the chef might just whip up a dish using whatever’s in the back, including some not-so-safe items! 🍽️ An attacker could exploit this oversight to navigate the server, accessing and executing any file they please, which could lead to devastating data leaks or unauthorized changes. Imagine someone walking into the kitchen and swapping out your secret sauce with something nasty — that’s the risk here! 😱

Put simply

Think of it like a restaurant where the chef can take any order based on a customer’s request, but doesn’t check whether the ingredients are actually in stock. If the menu isn’t tightly controlled, the chef might just whip up a dish using whatever’s in the back, including some not-so-safe items! 🍽️ This vulnerability arises from a missing path traversal check in the `snippet()` helper, allowing attackers to manipulate snippet paths and execute arbitrary PHP code within files located outside of the specified directory. Essentially, it opens the door for unwanted access to sensitive server files.

What to do

An attacker could exploit this oversight to navigate the server, accessing and executing any file they please, which could lead to devastating data leaks or unauthorized changes. Imagine someone walking into the kitchen and swapping out your secret sauce with something nasty — that’s the risk here! 😱 Update your Kirby installation to versions 3.9.8.3, 3.10.1.2, or 4.7.1 to patch this vulnerability and secure your site. Ensure that all dynamic snippet names are thoroughly validated to prevent unauthorized file access. Regularly audit your snippet usages to eliminate any potential risk! 🔒 You've got this! Follow these steps and you’ll fortify your Kirby installation like a pro! 🛡️

The record
Technical detail
CVSS v4.0
6.3 · MEDIUM
Vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
EPSS
0.00714 · 53.1th percentile
Weaknesses
CWE-22 · Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'); CWE-23 · Relative Path Traversal
Published
2025-05-13T15:07Z
EPSS history
Timeline
  • 13 MAY 15:07Z
    Kirby vulnerable to path traversal of snippet names in the `snippet()` helper
    cvelistv5