Original description
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.
Affected products and versions
diffpy diffpy.structure< 3.5.1Fixed in: 3.5.1
CVSS vector, explained
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- None (no login)
- User interaction
- Required
- Scope
- Vulnerable component only
- Confidentiality
- High impact
- Integrity
- High impact
- Availability
- High impact
Weakness type (CWE)
- CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')
References
- github.com/diffpy/diffpy.structure/issues/204
- github.com/diffpy/diffpy.structure/commit/f4be1d534fa9cf488c8e83f258e59fe09b526f62 patch
- github.com/diffpy/diffpy.structure/blob/3.5.0/src/diffpy/structure/parsers/p_cif.py
- github.com/diffpy/diffpy.structure/releases/tag/3.5.1
- www.vulncheck.com/advisories/diffpy-structure-before-3.5.1-code-execution-via-eval-in-get-
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Summaries are AI-written under strict rules; always check the vendor's official advisory.