T09 · Insecure Skill Coding Practices
- Location
scripts/region_discover.sh:229- Finding
Arbitrary Python Code Execution Through Shell-to-Python String Interpolation
- Content
View full analysis
/dev/null) ``` In `scripts/region_discover.sh:343-362`, a community name obtained from remote page content is inserted into another generated Python program: ```bash python3 -c " import json with open('$ALL_CANDIDATES_JSON') as f: data = json.load(f) for x in data: if x['name'] == '$name': x['xiaoqu_id'] = '$XID' x['detail_file'] = '${name}_xiaoqu.json' # 补充详情数据 try: with open('$DETAIL_DIR/${name}_xiaoqu.json') as f2: detail = json.load(f2) x['building_type'] = detail.get('building_type', '') x['total_units'] = detail.get('total_units', '') x['far'] = detail.get('far', '') x['green_rate'] = detail.get('green_rate', '') x['mgmt_company'] = detail.get('mgmt_company', '') x['mgmt_fee'] = detail.get('mgmt_fee', '') x['views_30d'] = detail.get('views_30d', '') except: pass break with open('$ALL_CANDIDATES_JSON', 'w') as f: json.dump(data, f, ensure_ascii=False, indent=2) " 2>/dev/null ``` In `scripts/fetch_xiaoqu.sh:205-213`, user-controlled `NAME` and `OUTD ...[truncated 3713 chars]- Remediation
View remediation
