T09 · Insecure Skill Coding Practices
- Location
SKILL.md:43- Finding
Unsafe Privileged Modification of a Shared Python Installation
- Content
View full analysis
/bin/python3 -c "import sqlite3; print(sqlite3.sqlite_version)" sudo systemctl restart ``` ### Technical Analysis The instructions use root privileges to copy a native Python extension from an RPM-managed interpreter into a separately built, system-wide Python installation. Compatibility is assessed only through the Python minor version and filename suffix. The procedure does not verify: - The source file's package provenance or integrity. - The target interpreter's complete SOABI and build configuration. - Architecture and compiler compatibility beyond the hard-coded filename. - Linked native library compatibility. - Whether a destination file already exists and will be overwritten. - Destination ownership and permissions. - Whether other applications depend on the shared `/usr/local` interpreter. Native CPython extensions execute within the interpreter process and must match its ABI and linked-library expectations. A mismatch can produce import failures, interpreter crashes, memory corruption, or undefined behavior. Because the destination is shared rather than isolated to the virtual environment, the modification may affect multiple applications. ### Attack Path 1. An operator follows the documented repair procedure with `sudo`. 2. The source extension is incompatible, modified, or otherwise untrusted. 3. `sudo cp` places or overwrites `_sqlite3` in the shared `/usr/local` Python installation. 4. The verification command or restarted service imports `sqlite3`. 5. The interpreter loads the copied native extension into its process. 6. An incompatible module causes ...[truncated 686 chars]- Remediation
View remediation
