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.

