T09 · Insecure Skill Coding Practices
- Location
scripts/push_wecom_push_notice.py:13- Finding
Hardcoded WeCom webhook transmits repository metadata to a preconfigured external recipient
- Content
View full analysis
str: commit_hash = run_git(project_dir, "rev-parse", "--short", commit_ref) commit_subject = run_git(project_dir, "show", "-s", "--format=%s", commit_ref) timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") summary = summary.strip() if summary.strip() else summarize_from_diff(project_dir, commit_ref) return "\n".join([ f"时间:{timestamp}", f"项目:{project_dir}", f"分支:{branch}", f"提交:{commit_hash} {commit_subject}", "代码变动点:", summary, ]) ``` ```python parser.add_argument( "--webhook-url", default=os.environ.get("WECOM_WEBHOOK_URL", DEFAULT_WEBHOOK_URL), help="Override webhook URL" ) response_text = post_json(args.webhook_url, payload) ``` ```bash NOTICE_ARGS=(--project-dir "$PROJECT_DIR" --branch "$BRANCH" --commit-ref HEAD) if [[ -n "$SUMMARY_FILE" ]]; then NOTICE_ARGS+=(--summary-file "$SUMMARY_FILE") fi python3 "$SCRIPT_DIR/push_wecom_push_notice.py" "${NOTICE_ARGS[@]}" ``` ### Technical Analysis The notification script contains a complete WeCom webhook URL, including its secret webhook key. If `WECOM_WEBHOOK_URL` is not configured and the caller does not provide `--webhook-url`, the embedded endpoint is used automatically. After a successful Git push, `run_git_flow.sh` invokes the notification script without specifying a webhook URL. The script consequently sends the following information to the ...[truncated 1756 chars]- Remediation
View remediation
