/

CVE-2026-34399

Severity:

HIGH RISK

(7.8)

Code Injection (CWE-95) in FreeCAD SVG BIM Workbench

CVE-2026-34399

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 Workbench evaluates untrusted data from SVG template files when creating TechDraw pages. If a user opens a malicious template, arbitrary Python code may execute with the privileges of the FreeCAD process.

Affected context

The vulnerability occurs in FreeCAD versions from 0.19 through 1.1.1 when the BIM Workbench processes SVG templates for TechDraw pages. Risk depends on a user importing or opening a template that contains data reaching the vulnerable evaluation logic.

Exploit preconditions

  • Attack surface: FreeCAD's BIM Workbench and TechDraw template processing
  • Required access: Ability to provide or cause a user to open a malicious SVG template
  • Trigger point: Creation of a TechDraw page from the SVG template
  • Why exploitation is possible: Untrusted template data reaches an eval() call, allowing embedded expressions to be interpreted as Python code

Why this happens

The underlying bug is the evaluation of untrusted SVG template data as executable Python expressions. This insecure pattern treats file content as code rather than as constrained presentation data, mapping to CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code. The absence of a strict data-only parsing boundary allows crafted template content to influence interpreter behavior.

Potential impact

  • Arbitrary Python code may execute in the FreeCAD process
  • Local files or project data could be read, modified, or deleted
  • The user's desktop session could be compromised
  • Malicious code could affect connected systems or shared project assets

General mitigation guidance

Mitigation generally focuses on removing dynamic evaluation from template processing and reducing trust in imported document content.

Common defensive patterns include:

  • Replacing eval() with data-only parsing and explicit, allowlisted template substitutions
  • Treating SVG templates as untrusted input until validated
  • Enforcing strict schemas and rejecting unexpected expressions or directives
  • Separating rendering data from executable application logic
  • Running desktop modeling workflows with least-privilege operating system accounts
  • Restricting access to sensitive files and connected services from the application process
  • Applying the vendor's security fix or an equivalent code-level remediation

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules identifying eval() or equivalent dynamic execution APIs on file-derived data
  • Code review checks for template engines that interpolate or execute expressions
  • Tests using untrusted SVG fixtures containing unexpected directives or expression syntax
  • Repository policies that prohibit dynamic evaluation of imported document content
  • Monitoring application behavior for unusual child processes, file access, or network activity after template imports

Automated security scanning and code review tools may help identify similar unsafe evaluation paths.

Sources

SourceLink
github.comgithub.com/FreeCAD/FreeCAD/releases/tag/1.1.1
github.comgithub.com/FreeCAD/FreeCAD/security/advisories/GHSA-chv4-vm6r-wjqj

Frequently asked

questions

It is generally not a direct network-service vulnerability. Exploitation typically depends on a user opening or importing a malicious SVG template in an affected FreeCAD workflow.

An attacker must be able to supply the template or persuade a user to obtain and process one. The resulting code executes with the permissions of the FreeCAD process.

Avoid evaluating template content as code. Use data-only parsing, strict allowlists, and explicit rendering substitutions for supported template fields.

Treat imported design files as untrusted, prohibit dynamic evaluation of file-derived values, add malicious-file tests, and use least-privilege application accounts.

Find out what's already
exploitable in your codebase.