Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-ezdxf for openSUSE:Factory checked in at 2026-11-28 23:24:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ezdxf (Old) and /work/SRC/openSUSE:Factory/.python-ezdxf.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ezdxf" Sat Nov 28 23:24:19 2026 rev:11 rq:1401181 version:1.4.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ezdxf/python-ezdxf.changes 2026-07-15 17:12:10.464705271 +0200 +++ /work/SRC/openSUSE:Factory/.python-ezdxf.new.1340718/python-ezdxf.changes 2026-11-28 23:25:10.916383665 +0100 @@ -1,0 +2,16 @@ +Fri Nov 27 15:26:29 UTC 2026 - Markéta Machová <[email protected]> + +- Update to 1.4.5 + * added PyPI package deployment for Python 3.15 and removed PyPI + package deployment for Python 3.10 (end of life) + * add support for control code %%% for % + * add support for PLANESURFACE entity + * fixed numpy v2.5 deprecation warning for using ndarray.shape + property + * many bugfixes, see upstream changelog +- Convert to libalternatives on SLE-16-based and newer systems +- CVE-2026-137506: Arbitrary code execution via crafted DXF table + entry names (bsc#1292112) + * CVE-2026-137506.patch + +------------------------------------------------------------------- Old: ---- ezdxf-1.4.4.tar.gz New: ---- CVE-2026-137506.patch ezdxf-1.4.5.tar.gz ----------(New B)---------- New: entry names (bsc#1292112) * CVE-2026-137506.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ezdxf.spec ++++++ --- /var/tmp/diff_new_pack.g63YFF/_old 2026-11-28 23:25:12.216438016 +0100 +++ /var/tmp/diff_new_pack.g63YFF/_new 2026-11-28 23:25:12.218438099 +0100 @@ -17,27 +17,39 @@ %define packagename ezdxf +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif Name: python-ezdxf -Version: 1.4.4 +Version: 1.4.5 Release: 0 Summary: Python package for manipulating DXF drawings License: MIT URL: https://ezdxf.mozman.at/ Source: https://github.com/mozman/ezdxf/archive/v%{version}.tar.gz#/%{packagename}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM CVE-2026-137506 bsc#1292112 https://github.com/mozman/ezdxf/commit/8cde125a7370afb5988f73b978599172c05f53fd +Patch0: CVE-2026-137506.patch BuildRequires: %{python_module fonttools} BuildRequires: %{python_module numpy} -BuildRequires: %{python_module pyparsing >= 2.0.1} +BuildRequires: %{python_module pyparsing >= 3.0.0} BuildRequires: %{python_module typing_extensions >= 4.6.0} Requires: python-fonttools Requires: python-numpy -Requires: python-pyparsing >= 2.0.1 +Requires: python-pyparsing >= 3.0.0 Requires: python-typing_extensions >= 4.6.0 -Requires(post): update-alternatives -Requires(postun): update-alternatives Recommends: python-Pillow Recommends: python-PyMuPDF >= 1.20.0 Recommends: python-matplotlib Recommends: python-qt5 +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif # SECTION setup requirements BuildRequires: %{python_module Cython} BuildRequires: %{python_module pip} @@ -77,9 +89,13 @@ %postun %python_uninstall_alternative ezdxf +%pre +%python_libalternatives_reset_alternative ezdxf + %check # text2path: some tests only work with the presence of Arial font family -%pytest_arch -k "not test_814_text2path" +# test_distance_from_start: precision error on i586 +%pytest_arch -k "not (test_814_text2path or test_distance_from_start)" %files %{python_files} %license LICENSE ++++++ CVE-2026-137506.patch ++++++ >From 8cde125a7370afb5988f73b978599172c05f53fd Mon Sep 17 00:00:00 2001 From: mozman <[email protected]> Date: Thu, 26 Nov 2026 07:16:25 +0100 Subject: [PATCH] fix: dxf2code, table names can contain single quotes --- src/ezdxf/addons/dxf2code.py | 131 +++++------------- .../test_803_entities_to_code.py | 9 ++ 2 files changed, 46 insertions(+), 94 deletions(-) diff --git a/src/ezdxf/addons/dxf2code.py b/src/ezdxf/addons/dxf2code.py index 0188254c2..19bc9a0de 100644 --- a/src/ezdxf/addons/dxf2code.py +++ b/src/ezdxf/addons/dxf2code.py @@ -120,9 +120,7 @@ def block_to_code( return code.code -def table_entries_to_code( - entities: Iterable[DXFEntity], drawing="doc" -) -> Code: +def table_entries_to_code(entities: Iterable[DXFEntity], drawing="doc") -> Code: code = _SourceCodeGenerator(doc=drawing) code.translate_entities(entities) return code.code @@ -261,9 +259,7 @@ def cleanup(values: Iterable) -> Iterable: yield fmt.format(str(v)) -def _fmt_api_call( - func_call: str, args: Iterable[str], dxfattribs: dict -) -> list[str]: +def _fmt_api_call(func_call: str, args: Iterable[str], dxfattribs: dict) -> list[str]: attributes = dict(dxfattribs) args = list(args) if args else [] @@ -474,12 +470,13 @@ def new_table_entry(self, dxftype: str, dxfattribs: dict) -> Iterable[str]: """ table = f"{self.doc}.{TABLENAMES[dxftype]}" dxfattribs = _purge_handles(dxfattribs) + # single quotes ' are allowed in table names name = dxfattribs.pop("name") s = [ - f"if '{name}' not in {table}:", - f" t = {table}.new(", - f" '{name}',", - " dxfattribs={", + f'if "{name}" not in {table}:', + f' t = {table}.new(', + f' "{name}",', + ' dxfattribs={', ] s.extend(_fmt_mapping(dxfattribs, indent=12)) s.extend( @@ -504,9 +501,7 @@ def _point(self, entity: DXFEntity) -> None: def _circle(self, entity: DXFEntity) -> None: self.add_source_code_lines( - self.api_call( - "add_circle(", ["center", "radius"], entity.dxfattribs() - ) + self.api_call("add_circle(", ["center", "radius"], entity.dxfattribs()) ) def _arc(self, entity: DXFEntity) -> None: @@ -524,38 +519,26 @@ def _text(self, entity: DXFEntity) -> None: ) def _solid(self, entity: DXFEntity) -> None: - self.add_source_code_lines( - self.generic_api_call("SOLID", entity.dxfattribs()) - ) + self.add_source_code_lines(self.generic_api_call("SOLID", entity.dxfattribs())) def _trace(self, entity: DXFEntity) -> None: - self.add_source_code_lines( - self.generic_api_call("TRACE", entity.dxfattribs()) - ) + self.add_source_code_lines(self.generic_api_call("TRACE", entity.dxfattribs())) def _3dface(self, entity: DXFEntity) -> None: - self.add_source_code_lines( - self.generic_api_call("3DFACE", entity.dxfattribs()) - ) + self.add_source_code_lines(self.generic_api_call("3DFACE", entity.dxfattribs())) def _shape(self, entity: DXFEntity) -> None: self.add_source_code_lines( - self.api_call( - "add_shape(", ["name", "insert", "size"], entity.dxfattribs() - ) + self.api_call("add_shape(", ["name", "insert", "size"], entity.dxfattribs()) ) def _attrib(self, entity: DXFEntity) -> None: self.add_source_code_lines( - self.api_call( - "add_attrib(", ["tag", "text", "insert"], entity.dxfattribs() - ) + self.api_call("add_attrib(", ["tag", "text", "insert"], entity.dxfattribs()) ) def _attdef(self, entity: DXFEntity) -> None: - self.add_source_code_lines( - self.generic_api_call("ATTDEF", entity.dxfattribs()) - ) + self.add_source_code_lines(self.generic_api_call("ATTDEF", entity.dxfattribs())) def _ellipse(self, entity: DXFEntity) -> None: self.add_source_code_lines( @@ -580,27 +563,21 @@ def _viewport(self, entity: DXFEntity) -> None: def _insert(self, entity: Insert) -> None: self.code.blocks.add(entity.dxf.name) self.add_source_code_lines( - self.api_call( - "add_blockref(", ["name", "insert"], entity.dxfattribs() - ) + self.api_call("add_blockref(", ["name", "insert"], entity.dxfattribs()) ) if len(entity.attribs): for attrib in entity.attribs: dxfattribs = attrib.dxfattribs() - dxfattribs[ - "layer" - ] = entity.dxf.layer # set ATTRIB layer to same as INSERT + dxfattribs["layer"] = ( + entity.dxf.layer + ) # set ATTRIB layer to same as INSERT self.add_source_code_lines( - self.generic_api_call( - "ATTRIB", attrib.dxfattribs(), prefix="a = " - ) + self.generic_api_call("ATTRIB", attrib.dxfattribs(), prefix="a = ") ) self.add_source_code_line("e.attribs.append(a)") def _mtext(self, entity: MText) -> None: - self.add_source_code_lines( - self.generic_api_call("MTEXT", entity.dxfattribs()) - ) + self.add_source_code_lines(self.generic_api_call("MTEXT", entity.dxfattribs())) # MTEXT content 'text' is not a single DXF tag and therefore not a DXF # attribute self.add_source_code_line("e.text = {}".format(json.dumps(entity.text))) @@ -630,9 +607,7 @@ def _spline(self, entity: Spline) -> None: ) if len(entity.knots): - self.add_list_source_code( - entity.knots, prolog="e.knots = [", epilog="]" - ) + self.add_list_source_code(entity.knots, prolog="e.knots = [", epilog="]") if len(entity.weights): self.add_list_source_code( @@ -648,9 +623,7 @@ def _polyline(self, entity: Polyline) -> None: attribs = _purge_handles(v.dxfattribs()) location = attribs.pop("location") if "layer" in attribs: - del attribs[ - "layer" - ] # layer is automatically set to the POLYLINE layer + del attribs["layer"] # layer is automatically set to the POLYLINE layer # each VERTEX can have different DXF attributes: bulge, start_width, end_width ... self.add_source_code_line( @@ -661,17 +634,13 @@ def _leader(self, entity: Leader): self.add_source_code_line( "# Dimension style attribute overriding is not supported!" ) - self.add_source_code_lines( - self.generic_api_call("LEADER", entity.dxfattribs()) - ) + self.add_source_code_lines(self.generic_api_call("LEADER", entity.dxfattribs())) self.add_list_source_code( entity.vertices, prolog="e.set_vertices([", epilog="])" ) def _dimension(self, entity: Dimension): - self.add_import_statement( - "from ezdxf.dimstyleoverride import DimStyleOverride" - ) + self.add_import_statement("from ezdxf.dimstyleoverride import DimStyleOverride") self.add_source_code_line( "# Dimension style attribute overriding is not supported!" ) @@ -693,9 +662,7 @@ def _image(self, entity: Image): "# Image requires IMAGEDEF and IMAGEDEFREACTOR objects in the " "OBJECTS section!" ) - self.add_source_code_lines( - self.generic_api_call("IMAGE", entity.dxfattribs()) - ) + self.add_source_code_lines(self.generic_api_call("IMAGE", entity.dxfattribs())) if len(entity.boundary_path): self.add_list_source_code( (v for v in entity.boundary_path), # just x, y axis @@ -719,9 +686,7 @@ def _wipeout(self, entity: Wipeout): ) def _mesh(self, entity: Mesh): - self.add_source_code_lines( - self.api_call("add_mesh(", [], entity.dxfattribs()) - ) + self.add_source_code_lines(self.api_call("add_mesh(", [], entity.dxfattribs())) if len(entity.vertices): self.add_list_source_code( entity.vertices, prolog="e.vertices = [", epilog="]" @@ -748,9 +713,7 @@ def _mesh(self, entity: Mesh): def _hatch(self, entity: Hatch): dxfattribs = entity.dxfattribs() dxfattribs["associative"] = 0 # associative hatch not supported - self.add_source_code_lines( - self.api_call("add_hatch(", ["color"], dxfattribs) - ) + self.add_source_code_lines(self.api_call("add_hatch(", ["color"], dxfattribs)) self._polygon(entity) def _mpolygon(self, entity: MPolygon): @@ -799,12 +762,8 @@ def _polygon(self, entity: DXFPolygon): add_line(arg.format("flags", str(path.path_type_flags))) add_line(")") else: # EdgePath - add_line( - f"# {count}. edge path: associative hatch not supported" - ) - add_line( - f"ep = e.paths.add_edge_path(flags={path.path_type_flags})" - ) + add_line(f"# {count}. edge path: associative hatch not supported") + add_line(f"ep = e.paths.add_edge_path(flags={path.path_type_flags})") for edge in path.edges: if edge.type == EdgeType.LINE: add_line(f"ep.add_line({edge.start}, {str(edge.end)})") @@ -846,40 +805,28 @@ def _polygon(self, entity: DXFPolygon): ) ) if edge.knot_values: - add_line( - arg.format("knot_values", str(edge.knot_values)) - ) + add_line(arg.format("knot_values", str(edge.knot_values))) if edge.weights: add_line(arg.format("weights", str(edge.weights))) add_line(arg.format("degree", edge.degree)) add_line(arg.format("periodic", edge.periodic)) if edge.start_tangent is not None: add_line( - arg.format( - "start_tangent", str(edge.start_tangent) - ) + arg.format("start_tangent", str(edge.start_tangent)) ) if edge.end_tangent is not None: - add_line( - arg.format("end_tangent", str(edge.end_tangent)) - ) + add_line(arg.format("end_tangent", str(edge.end_tangent))) add_line(")") # simple table entries def _layer(self, layer: DXFEntity): - self.add_source_code_lines( - self.new_table_entry("LAYER", layer.dxfattribs()) - ) + self.add_source_code_lines(self.new_table_entry("LAYER", layer.dxfattribs())) def _ltype(self, ltype: Linetype): self.add_import_statement("from ezdxf.lldxf.tags import Tags") self.add_import_statement("from ezdxf.lldxf.types import dxftag") - self.add_import_statement( - "from ezdxf.entities.ltype import LinetypePattern" - ) - self.add_source_code_lines( - self.new_table_entry("LTYPE", ltype.dxfattribs()) - ) + self.add_import_statement("from ezdxf.entities.ltype import LinetypePattern") + self.add_source_code_lines(self.new_table_entry("LTYPE", ltype.dxfattribs())) self.add_tags_source_code( ltype.pattern_tags.tags, prolog="tags = Tags([", @@ -889,9 +836,7 @@ def _ltype(self, ltype: Linetype): self.add_source_code_line(" t.pattern_tags = LinetypePattern(tags)") def _style(self, style: DXFEntity): - self.add_source_code_lines( - self.new_table_entry("STYLE", style.dxfattribs()) - ) + self.add_source_code_lines(self.new_table_entry("STYLE", style.dxfattribs())) def _dimstyle(self, dimstyle: DXFEntity): self.add_source_code_lines( @@ -899,6 +844,4 @@ def _dimstyle(self, dimstyle: DXFEntity): ) def _appid(self, appid: DXFEntity): - self.add_source_code_lines( - self.new_table_entry("APPID", appid.dxfattribs()) - ) + self.add_source_code_lines(self.new_table_entry("APPID", appid.dxfattribs())) diff --git a/tests/test_08_addons/test_803_entities_to_code.py b/tests/test_08_addons/test_803_entities_to_code.py index 7401150fe..0c70f47cd 100644 --- a/tests/test_08_addons/test_803_entities_to_code.py +++ b/tests/test_08_addons/test_803_entities_to_code.py @@ -422,6 +422,15 @@ def test_layer_entry(): assert layer.dxf.color == 3 +def test_layer_name_contains_single_quote(): + from ezdxf.entities.layer import Layer + + layer = Layer.new("LAYER", dxfattribs={"name": "Test'Test", "color": 3}) + code = table_entries_to_code([layer], drawing="doc") + exec(str(code), globals()) + layer = doc.layers.get("Test'Test") + assert layer.dxf.color == 3 + def test_ltype_entry(): from ezdxf.entities.ltype import Linetype ++++++ ezdxf-1.4.4.tar.gz -> ezdxf-1.4.5.tar.gz ++++++ /work/SRC/openSUSE:Factory/python-ezdxf/ezdxf-1.4.4.tar.gz /work/SRC/openSUSE:Factory/.python-ezdxf.new.1340718/ezdxf-1.4.5.tar.gz differ: char 12, line 1
