CVE-2026-133708 in diffpy.structure
Summary
by MITRE • 11/20/2026
diffpy.structure before 3.5.1 contains a code execution vulnerability that allows attackers to run Python code by supplying crafted CIF symmetry operations passed to eval() in get_symop(). Attackers can embed expressions in the _space_group_symop_operation_xyz or _symmetry_equiv_pos_as_xyz loop to execute code with victim privileges when the CIF file is parsed locally.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/20/2026
The vulnerability identified in diffpy.structure prior to version 3.5.1 represents a critical insecure coding practice involving the direct execution of user-supplied input through Python's eval function. This flaw specifically manifests within the get_symop method, which processes Crystallographic Information File (CIF) data structures commonly used in materials science and crystallography research. When an application utilizing this library parses a CIF file containing maliciously crafted symmetry operations embedded in fields such as _space_group_symop_operation_xyz or _symmetry_equiv_pos_as_xyz, the software fails to sanitize these inputs before passing them to eval(). This lack of input validation allows attackers to inject arbitrary Python expressions that are immediately executed within the context of the running application.
From a technical perspective, this vulnerability is classified under CWE-95 as Improper Neutralization of Directives in Dynamically Evaluated Code, commonly known as code injection or command injection via eval(). The root cause lies in the assumption that CIF files contain only mathematical expressions for symmetry transformations rather than executable code. By embedding Python syntax within these fields, an attacker can bypass intended functionality and achieve remote code execution capabilities if the file is processed on a server, or local privilege escalation if parsed locally by a user with elevated permissions. The impact extends beyond simple data corruption to full system compromise depending on the privileges under which the diffpy.structure library operates during parsing operations.
This vulnerability aligns with MITRE ATT&CK technique T1059 as Command and Scripting Interpreter, specifically reflecting patterns where attackers leverage scripting languages for execution through injection vectors. The operational impact is severe because CIF files are often exchanged between researchers, institutions, or automated pipelines without rigorous security scrutiny. An adversary could distribute a maliciously crafted CIF file via email, shared drives, or download links, trusting that the recipient will open it with software using vulnerable versions of diffpy.structure. Once executed, the injected code can perform actions ranging from data exfiltration and credential theft to installing backdoors or disrupting critical research workflows involving crystallographic analysis tools.
Mitigation strategies must prioritize immediate upgrading to version 3.5.1 or later where this flaw has been addressed through proper input validation and replacement of eval() with safer alternatives such as ast.literal_eval for parsing mathematical expressions, or explicit parsing logic that restricts allowed operations strictly to arithmetic functions required by symmetry calculations. Organizations relying on diffpy.structure should audit their dependency management processes to ensure timely updates are applied across all environments where CIF files are processed. Additionally implementing strict file type validation and sandboxing mechanisms can provide defense-in-depth against similar injection vulnerabilities in other components of the software stack that handle untrusted scientific data formats.