Skip to main content

LMFDB CVE-2026-123198

| EUVDEUVD-2026-117643 CRITICAL
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-11-05 VulnCheck
9.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send unauthenticated GET to /knowledge/render/<ID>
  2. Delivery
    Inject Jinja via crafted query-string parameter
  3. Exploit
    Escape expression and traverse __class__ to __builtins__/os
  4. Execution
    Execute OS commands as lmfdb service account
  5. Impact
    Exfiltrate credentials or pivot to internal systems

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
Exploitation Conditions

No special conditions - remote unauthenticated exploitation against the default configuration of LMFDB's /knowledge/render/<ID> (render_knowl) endpoint, which requires no login, no CSRF token, and no prior interaction. The description and advisory confirm the endpoint splices request data (every query-string key/value via kw_params, or 'content') directly into the Jinja template source and renders it with the default unsandboxed jinja2.Environment. The only practical limiter is exposure: the LMFDB web application's knowledge-rendering endpoint must be internet-reachable (as on the public lmfdb.org site); the separate editor/save path (render_knowl_in_template, main.py:246) requires a logged-in user, but the render endpoint does not.

Impact

All severity signals align on high urgency with no internal contradictions. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H, score 9.3) describes the easiest possible exploitation profile: network-reachable, low complexity, no authentication, no user interaction, with high confidentiality, integrity and availability impact - consistent with the description of unauthenticated server-side template injection yielding OS command execution. The vuln.today decision label is 'act_now', and the GHSA advisory documents a working proof-of-concept executed end-to-end against the live production instance (lmfdb.org), returning 'uid=1300(lmfdb)' from an OS-level 'id' command, so the RCE is demonstrated rather than theoretical. This is a genuine priority, not a high-CVSS-but-low-real-risk item: trivial unauthenticated RCE on an internet-facing endpoint. Two signals are missing and should be stated explicitly: there is NO CISA KEV listing in the input, so active in-the-wild exploitation is not confirmed, and NO EPSS score was provided, so predicted exploitation probability cannot be weighed. The main tempering factor is deployment footprint (see prevalence) - the product is niche academic software, so this is more likely to manifest as targeted exploitation of specific instances than internet-wide mass exploitation.

Exploit ScenarioDerived

A remote, unauthenticated attacker sends a single crafted HTTP GET request to /knowledge/render/<ID> on a live LMFDB instance, placing a Jinja payload in a query-string parameter that breaks out of the surrounding template expression. The default unsandboxed Jinja environment evaluates it server-side, letting the attacker walk the Python object model to __builtins__, import os, and run operating-system commands as the lmfdb service account. The GHSA advisory includes a confirmed PoC (with screenshot) demonstrating this against the production lmfdb.org site in one request; given AV:N/AC:L/PR:N/UI:N, exploitation needs nothing beyond curl or a browser.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.8% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 05, 2026

Unauthenticated server-side template injection in LMFDB's knowledge-rendering endpoint (/knowledge/render/<ID>) lets any remote attacker execute operating-system commands as the account running the web application. The render_knowl function splices request-controlled data - every query-string key and value assembled into kw_params, plus the 'content' parameter - directly into Jinja template source and renders it with the default, unsandboxed jinja2.Environment, so injected Jinja expressions can traverse Python's object model to __builtins__ and invoke modules such as os. The vendor advisory documents a working proof of concept executed end-to-end against the live lmfdb.org site via a single HTTP GET, returning the output of an OS-level id command; active exploitation in the wild is not confirmed, but VulnCheck reporting, the act_now priority decision, and a 9.3 severity score all point to immediate patching.

RemediationAI

Upgrade to commit 01829bd09b692c720aad30c952758a20630573d4 or any later commit (upstream fix: https://github.com/LMFDB/lmfdb/pull/7231, commit https://github.com/LMFDB/lmfdb/commit/01829bd09b692c720aad30c952758a20630573d4); the fix is tracked in advisory GHSA-6jw3-pmcx-2xww. No tagged release version is identified in the available data, so pin the deployment to that commit or newer and confirm afterwards that /knowledge/render/<ID> is GET-only, that /preview/<ID> requires login, and that query parameters no longer reach the template source. If patching cannot be applied immediately, the most direct compensating control is to deny external access to the /knowledge/render/ path at the reverse proxy or WAF (return 403/404 or allow only authenticated sessions) - this breaks knowl permalink and inline-knowl rendering on public pages, so it is a temporary measure only. Additionally run the LMFDB service account with least privilege and no access to unrelated credentials or internal network paths, since successful exploitation yields code execution as that account and exposes database credentials and configuration files. Verify any instance previously exposed to the internet for injected knowl records or unexpected outbound activity, as the advisory reports exploitation was demonstrated against the live production site.

Affected VersionsENISA

LMFDB 0 <01829bd09b692c720aad30c952758a20630573d4

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

LMFDB is a Flask web application whose 'knowl' knowledge-base entries are stored as Jinja template fragments and rendered at request time with flask.render_template_string() against the default jinja2.Environment, which is not sandboxed. This is classic server-side template injection (CWE-1336, also tracked by the vendor as CWE-94): untrusted input reaches the template source rather than the template context. Two sinks exist. The unauthenticated path, render_knowl at /knowledge/render/<ID>, built a python-style keyword-argument string from every query-string key/value pair and interpolated it verbatim into the template text, along with the knowl ID and title, then rendered the result; the separate editor/save flow in render_knowl_in_template (lmfdb/knowledge/main.py:246) exposes the same primitive but requires a logged-in user. Because Jinja evaluates {%, {{ and expression syntax in template source, an attacker can close the surrounding string and expression and open a new expression, then chain __class__/__init__/__globals__/__builtins__ to import and call arbitrary Python modules - equivalent to remote code execution given the privileges of the service account. The upstream fix (PR #7231) stops treating request data as template source: the permalink is now built with url_for plus urllib.parse.urlencode, headers are escaped with markupsafe.escape, request parameters are passed only as template variables (with 'source' filtered out because it collides with render_template_string's own argument), the 'content' override is moved to a new POST-only /preview/<ID> route guarded by @login_required, and /render/<ID> becomes GET-only with knowl content as its sole template source.

Know when Lmfdb gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 9.3 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 9.8 CRITICAL

A single unauthenticated remote GET with no user interaction yields OS command execution as the service account, so AV:N/AC:L/PR:N/UI:N with full C/I/A; scope unchanged as impact stays within the service account's authority.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

LMFDB before commit 01829bd contains a server-side template injection vulnerability in the render_knowl function that allows unauthenticated attackers to inject Jinja expressions via request parameters. Attackers can supply crafted query-string values or 'content' data to /knowledge/render/<ID> to reach Python builtins and execute operating system commands as the web application account.

Technical POC Analysis

The bug is CWE-1336: improper neutralization of template-engine metacharacters.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A critical unauthenticated vulnerability in LMFDB's knowledge-rendering endpoint allows any remote attacker to execute operating-system commands on the server hosting the application, potentially compromising sensitive mathematical data and user trust. Leadership should care because this flaw affects the integrity and availability of a public-facing service used by researchers and the broader community, and exploitation could lead to data breaches or service disruption.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.8%
Top 42% exploitable
Prevalence
Low
niche academic number-theory research platform, few production instances
Social Media
3
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.8%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Total

Priority Score

47
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy