T09 · Insecure Skill Coding Practices
- Location
confluence-cli.sh:256- Finding
Arbitrary Python Code Execution Through Unsafely Interpolated Command Arguments
- Content
View full analysis
' + os.environ['COMMENT'] + ''} })) ") ``` #### Page title injection at lines 332–342 ```bash cmd_get_by_title() { local space_id="${1:?Usage: confluence-cli.sh get-by-title SPACE_ID \"Page Title\"}" local title="${2:?Usage: confluence-cli.sh get-by-title SPACE_ID \"Page Title\"}" local encoded_title=$(urlencode "$title") cf_get "$BASE/api/v2/spaces/$space_id/pages?title=$encoded_title&limit=1&body-format=storage" | python3 -c " import sys, json, re d = json.load(sys.stdin) results = d.get('results', []) if not results: print(json.dumps({'error': 'Page not found', 'title': '$title'})) else: ``` ### Technical Analysis The values of `labels_str`, `page_id`, and `title` originate in command-line arguments and are interpolated directly into source code supplied to `python3 -c`. Shell quoting does no ...[truncated 1722 chars]- Remediation
View remediation
