T09 · Insecure Skill Coding Practices
- Location
SKILL.md:59- Finding
Environment Variables Injected Directly into Executable Python Source
- Content
View full analysis
read_ts else 0 print(f'Application-level replication lag: {lag:.3f}s') print(f'Assessment: {\"HEALTHY\" if lag < 1 else \"WARNING\" if lag < 10 else \"CRITICAL\"}') " ``` ### Technical Analysis The shell expands `PRIMARY_HOST`, `REPLICA_HOST`, `DB_NAME`, and `DB_USER` directly inside Python string literals before passing the resulting source to `python3 -c`. These values are treated as executable source text rather than as data. If an attacker can influence one of these environment variables, a single quote can terminate the intended Python literal. Additional Python expressions or statements can then be introduced. Because the generated source is executed by `python3`, successful exploitation can run arbitrary local commands with the privileges of the user executing the Skill. This behavior is unnecessary for replication assessment. Python can safely read ...[truncated 1441 chars]- Remediation
View remediation
