Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-34398

CVE-2026-34398: FreeCAD BIM Project Manager RCE Vulnerability

CVE-2026-34398 is a remote code execution vulnerability in FreeCAD that allows attackers to execute arbitrary Python code through malicious BIM project templates. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2026-34398 Overview

CVE-2026-34398 is a code injection vulnerability [CWE-95] in FreeCAD, the open-source multiplatform 3D parametric modeler. The flaw affects the BIM Project Manager Load Template flow implemented in src/Mod/BIM/bimcommands/BimProjectManager.py. Attacker-controlled FCStd Meta property values for wpposition, wpu, wpv, and wpaxis are passed directly to Python's eval(). Loading a malicious BIM project template triggers arbitrary Python code execution in the user's FreeCAD process. The issue affects versions from 0.19 up to and including 1.1.0 and is fixed in 1.1.1.

Critical Impact

A crafted FCStd template file executes arbitrary Python code with the privileges of the FreeCAD user, resulting in full compromise of confidentiality, integrity, and availability on the local system.

Affected Products

  • FreeCAD versions 0.19 through 1.1.0
  • FreeCAD BIM workbench (src/Mod/BIM/bimcommands/BimProjectManager.py)
  • FreeCAD BIM Layers module (src/Mod/BIM/bimcommands/BimLayers.py)

Discovery Timeline

  • 2026-08-17 - CVE-2026-34398 published to NVD
  • 2026-08-19 - Last updated in NVD database

Technical Details for CVE-2026-34398

Vulnerability Analysis

The vulnerability resides in the BIM Project Manager Load Template code path. When a user loads a BIM project template packaged as an FCStd file, the loader reads Meta properties describing the working-plane geometry. Four of these string values, wpposition, wpu, wpv, and wpaxis, are typically formatted as Vector(x, y, z) expressions. Instead of parsing these tokens as data, the code passes them to Python's eval() to reconstruct the corresponding FreeCAD.Vector objects. Because eval() executes any Python expression, an attacker who controls the Meta value achieves arbitrary code execution inside the FreeCAD interpreter. Execution occurs in the same process context as the user, granting access to the file system, network, and any subprocess the interpreter can spawn.

Root Cause

The root cause is unsafe use of eval() on untrusted input from a file format that is expected to be shared between users. The template loader assumed Meta values were benign geometric expressions but never restricted the grammar. Any Python expression, including imports and function calls, is accepted and executed.

Attack Vector

Exploitation requires an attacker to deliver a malicious FCStd template and convince a victim to load it through the BIM Project Manager. The CVSS vector indicates a local attack path with required user interaction, but the impact on confidentiality, integrity, and availability is high because arbitrary Python code runs immediately upon template load.

python
# Conceptual illustration of the vulnerable pattern (pre-patch)
# Meta value read from an attacker-controlled FCStd template:
#   wpposition = "__import__('os').system('calc.exe') or Vector(0,0,0)"
vector = eval(meta["wpposition"])  # arbitrary code executes here

Detection Methods for CVE-2026-34398

Indicators of Compromise

  • FCStd or template files containing Meta properties wpposition, wpu, wpv, or wpaxis whose values contain tokens other than a plain Vector(x, y, z) literal, such as __import__, os., subprocess, open(, or backticks.
  • Unexpected child processes spawned by the FreeCAD interpreter (python, sh, cmd.exe, powershell.exe) shortly after opening a template.
  • Outbound network connections initiated by the FreeCAD process to unfamiliar destinations following a template load.

Detection Strategies

  • Statically scan FCStd archives and template repositories for the four Meta keys and validate that values match a strict Vector\(\s*[-0-9.eE+]+\s*,\s*[-0-9.eE+]+\s*,\s*[-0-9.eE+]+\s*\) regex.
  • Alert on process-lineage events where FreeCAD or freecadcmd creates a shell, scripting interpreter, or LOLBIN.
  • Correlate file-open telemetry for .FCStd files with subsequent anomalous behavior from the FreeCAD process.

Monitoring Recommendations

  • Log FreeCAD process launches and command-line arguments, and retain the parent-child process tree for at least 30 days.
  • Monitor user download directories and shared drives for newly introduced FCStd template files from untrusted sources.
  • Track outbound connections from CAD workstations and baseline expected destinations for FreeCAD.

How to Mitigate CVE-2026-34398

Immediate Actions Required

  • Upgrade FreeCAD to version 1.1.1 or later on all endpoints where the BIM workbench is available.
  • Block or quarantine FCStd templates received from external or untrusted sources until they can be inspected.
  • Notify BIM and architecture teams to avoid loading third-party project templates until patching is complete.

Patch Information

The fix is delivered in FreeCAD release 1.1.1 via pull request #28610. The patch removes eval() from the template loader in BimProjectManager.py and introduces a strict regex-based _parse_vector() helper. BimLayers.py is updated to use ast for safe literal parsing. See commits 871ee19 and 9ed351c, and the GHSA-8rfj-7956-6gwf advisory.

python
# Post-patch: safe Vector parser from BimProjectManager.py
import re

def _parse_vector(text):
    """Parse a Vector(x,y,z) string safely without eval()."""
    match = re.match(
        r"^\s*Vector\s*\(\s*([^,]+)\s*,\s*([^,]+)\s*,\s*([^,)]+)\s*\)\s*$",
        text,
    )
    if not match:
        raise ValueError("Invalid Vector string: " + text)
    return FreeCAD.Vector(
        float(match.group(1)),
        float(match.group(2)),
        float(match.group(3)),
    )

Source: FreeCAD commit 871ee19

Workarounds

  • Only open FCStd project templates from trusted, internally maintained repositories until the patched version is deployed.
  • Run FreeCAD under a least-privilege user account without administrative rights or credential material.
  • Apply application allowlisting to prevent FreeCAD from spawning shells or scripting interpreters on engineering workstations.
bash
# Verify FreeCAD is patched
freecad --version | grep -E "1\.1\.1|1\.[2-9]|[2-9]\."

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.