CVE-2024-28335
Critical · 9.1CVSS
9.1
EPSS
0.8%
Published
Mar 27, 2024
CISA due date
—
Cloudanix analysis
Running the local Lektor server while visiting a harmful website could allow attackers to run programs on your computer.
- Exploitation
- Requires User Interaction
- Attacker needs
- None
- Complexity
- Moderate
- Impact
- Full Compromise
- Component
- Application
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Path traversal in DB path handling permits unsanitized input to write attacker-controlled files into the templates directory, resulting in arbitrary shell command execution when those templates are processed by the running lektor server.
Why it matters to the business
Developers and teams using Lektor locally face risk of remote code execution on their workstations when browsing untrusted sites, potentially leading to credential theft or further compromise; low ecosystem prevalence and stable low EPSS reduce immediate widespread urgency but patching remains essential for any users of the affected versions.
How an attack unfolds
An attacker prepares a malicious website containing JavaScript that issues requests to localhost:5000. A victim running 'lektor server' visits the site in the same browser session; the requests exploit the unsanitized DB path to place a malicious file in the templates directory, after which template access triggers shell command execution on the victim's machine.
How to fix it
Upgrade lektor/lektor to the version containing commit 495b3f48feb1c1d9f43a7059473a55b404a1435a (corresponding to release 3.3.11). Verify the fix is present before resuming local server use.
How to confirm the fix worked
Confirm the running Lektor version is 3.3.11 or newer, or inspect the source for presence of commit 495b3f48feb1c1d9f43a7059473a55b404a1435a. Reproduce path traversal attempts in a test environment to verify sanitization now blocks template injection.
Typical attack path
- Victim starts lektor server listening on localhost port 5000
- Victim's browser visits attacker-controlled website
- Website JavaScript issues crafted requests exploiting path traversal
- Malicious file is written into the templates directory
- Template processing executes attacker-supplied shell commands
How to detect it
Review Lektor access and error logs for unexpected path traversal patterns or template writes originating from localhost requests. Examine the templates directory for recently added or modified files lacking legitimate provenance.
What your security team should do
- Apply the fixed commit or upgrade to 3.3.11 across all Lektor installations immediately
- Instruct developers to avoid running the lektor server while accessing untrusted websites
- Add Lektor version checks to dependency scanning and build pipelines
- Review any custom templates or DB path handling for similar unsanitized inputs
The record
Lektor before 3.3.11 does not sanitize DB path traversal. Thus, shell commands might be executed via a file that is added to the templates directory, if the victim's web browser accesses an untrusted website that uses JavaScript to send requests to localhost port 5000, and the web browser is running on the same machine as the "lektor server" command.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | lektor | 0 | 3.3.11 |
| PyPI | lektor | 3.4.0b1 | 3.4.0b11 |
| Ubuntu:20.04:LTS | lektor | 0 | No fix |
| Ubuntu:22.04:LTS | lektor | 0 | No fix |
| Ubuntu:24.04:LTS | lektor | 0 | No fix |
| Ubuntu:24.10 | lektor | 0 | No fix |
| Ubuntu:25.04 | lektor | 0 | No fix |
| Ubuntu:25.10 | lektor | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | lektor | 0 | No fix |
| pypi | Lektor | 3.4.0b1 | No fix |
Related vulnerabilities
- CVE-2026-81163 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')… CWE-22
- CVE-2026-112049 Vita3K before build 4187 contains a path traversal (zip slip) vulnerability in… CWE-22
- CVE-2026-112005 WhoDB 0.104.0 before 0.135.0 contains a path traversal vulnerability that allows remote… CWE-22
- CVE-2026-61702 OpenPrinting CUPS is an open source printing system for Linux and other Unix-like… CWE-22
- CVE-2026-104871 The Angular SSR is a server-rise rendering tool for Angular applications. CWE-22
- CVE-2026-102991 Mako is a template library written in Python. CWE-22
- CVE-2026-101894 The decompress package for Node.js extracts archives. CWE-22
- CVE-2026-100689 GitPython before 3.1.62 does not validate the `path` field read from an untrusted… CWE-22