Skip to content

[refactor] emit_mcp_error_response — tighten PID regex to disallow leading zeros #93

Description

@kiki830621

Problem

che-telegram-all-mcp-wrapper.sh:121 ^[0-9]+$ accepts 0123. JSON number with leading zeros violates RFC 8259 §6. jq lenient, but spec-conformant clients may reject.

Reachability: echo $$ never produces leading-zero PIDs; only manual file corruption.

Surfaced by Codex (P3 #5), Logic Reviewer (Finding 1 LOW).

Expected

Tighten regex:

if [[ "$owner_pid" =~ ^[1-9][0-9]*$ ]] && [ "$owner_pid" != "0" ]; then

Priority

P3 — unreachable from realistic input.

Source: surfaced during /idd-verify che-msg#31 (sister bug from verify ensemble — Codex + Devil's Advocate flagged convergently)

Verify report: #90 (comment)
Related issue: PsychQuant/che-msg#31
Related PR: psychquant-claude-plugins#90 (PR-1 ships v1.3.2)

🤖 Filed by /idd-verify Step 5b follow-up triage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions