/

CVE-2026-34398

Severity:

HIGH RISK

(7.8)

Code Injection (CWE-95) in FreeCAD BIM Project Templates

CVE-2026-34398

Awaiting Analysis

Vulnerability type

Category:

Code Injection

CWE:

CWE-95

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

FreeCAD's BIM Project Manager can evaluate attacker-controlled metadata from a BIM project template as Python code. When a user loads a malicious template, this may allow arbitrary code execution with the permissions of the FreeCAD process.

Affected context

The issue occurs in the BIM Project Manager's Load Template flow when FCStd Meta

property values are used to construct project positioning and axis settings.

Deployments may be exposed when users open BIM project templates from untrusted

or insufficiently controlled sources and the affected metadata reaches an

evaluation operation.

Exploit preconditions

  • Attack surface: FreeCAD BIM Project Manager template-loading functionality
  • Required access: Ability to provide or influence a BIM project template that a user will open
  • Trigger point: Loading the template through the BIM Project Manager flow
  • Why exploitation is possible: Attacker-controlled FCStd Meta property values are passed directly to eval() without being restricted to expected data types or values

Why this happens

The underlying bug is the use of a general-purpose expression evaluator on

data obtained from a project file. Python's eval() can interpret supplied

content as executable expressions rather than treating it solely as inert

configuration data. This behavior maps to CWE-95: Improper Neutralization of Directives in Dynamically-Evaluated Code, because untrusted metadata can

influence code evaluation.

Potential impact

  • An attacker may execute arbitrary Python code in the FreeCAD process
  • The attacker could access or modify files available to the application
  • User data, project files, or credentials may be exposed or altered
  • The compromise could affect other systems reachable from the user's environment

General mitigation guidance

Mitigation generally focuses on removing dynamic evaluation from template

processing and reducing trust in project-file metadata.

Common defensive patterns include:

  • Replacing eval() with explicit parsing and type conversion for the expected values
  • Allowing only documented numeric, vector, or enumerated forms through strict validation
  • Rejecting unexpected types, ranges, structures, and metadata fields before use
  • Treating templates from external or user-controlled sources as untrusted input
  • Running desktop applications with least privilege and limiting access to sensitive resources
  • Applying application isolation or sandboxing where feasible

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying eval() or equivalent dynamic evaluators on file-derived data
  • Code review checks for project, archive, and document metadata flowing into interpreters
  • Tests that supply malformed, unexpected, or type-conflicting metadata and verify safe rejection
  • Repository policies that prohibit dynamic evaluation in parsers and import workflows
  • Monitoring for unusual child processes, file access, or network activity following template loading

Automated code review and software composition analysis tools may help identify

dynamic evaluation patterns, but data-flow review is still important.

Sources

SourceLink
github.comgithub.com/FreeCAD/FreeCAD/commit/871ee19b76224910332bbfbd39eebbede967998b
github.comgithub.com/FreeCAD/FreeCAD/commit/9ed351cc4700db0a94c46f020c34c58bbf1bdaba
github.comgithub.com/FreeCAD/FreeCAD/pull/28610
github.comgithub.com/FreeCAD/FreeCAD/releases/tag/1.1.1
github.comgithub.com/FreeCAD/FreeCAD/security/advisories/GHSA-8rfj-7956-6gwf

Frequently asked

questions

It is generally triggered locally when a user loads a malicious BIM project

template. A remote attacker could provide such a template through a sharing,

download, or collaboration channel, but user interaction is typically required.

The attacker needs a way to influence the contents of a template that the

target user opens. They do not necessarily need access to the target system

beforehand.

Remove dynamic evaluation from the template-loading path and use strict,

type-aware parsing for the limited values the application expects.

Treat project metadata as untrusted input, enforce schemas and value

constraints, prohibit evaluators in parsers, and test file-import workflows

with adversarial input.

Find out what's already
exploitable in your codebase.