Skip to content

mcpx(logging): PR #1737's Redact mangles URL values under a sensitive keyword — port printed as an elided password, rest of URL dropped #2463

Closed

Description

@dezren39

mcpx(logging): PR #1737's Redact mangles URL values under a sensitive keyword — a port is printed as an elided password and the rest of the URL is dropped

Finding

PR #1737 (merged, fixes #1710) taught Redact to elide URL userinfo passwords. Its replacement function (pkgs/mcpx/internal/logging/trace.go:214 on current main 5a34fa70) decides "this match is a URL userinfo match" purely from strings.Index(m, "://") — but the KEY=VALUE alternative of sensitiveValue (trace.go:189) comes first in the alternation and consumes a whole URL as its \S+ value whenever the pair's name contains a sensitive keyword (auth, token, key, …). For such a match the function:

  • mistakes the URL's port colon (or the userinfo colon) for the marker it wants, and
  • reconstructs only prefix + user + ":" + "<elided>@", silently discarding the remainder of the match — host, port and path for a userinfo URL; the path (plus a fabricated @) for a credential-free URL.

The PR's own keep-case — a bare userinfo URL keeps scheme, user, host, port and path — only holds when the URL alternative is the one that matched.

Evidence

  • PR: mcpx(logging): fix Redact leaks — full JWT elision, reconciled KEY=VALUE keywords, URL userinfo passwords (#1710) #1737 — merge ee07ac6cad82ec5ee0484d8545b15a76a71791ee, commit 2d5da5a7.
  • Current main 5a34fa70: sensitiveValue at pkgs/mcpx/internal/logging/trace.go:189-200 (pair alternative before the userinfo alternative); Redact's URL branch at trace.go:214-220.
  • Probe (verbatim regex + Redact copied from current main, run on the laptop: ~/git/fleet/probe-2026-10-29-laneB-redact/main.go):
    • Redact("MCPX_SCRIPT_ENV", "AUTH_URL=https://auth.example.com:8443/callback") → "AUTH_URL=https://auth.example.com:<elided>@" — no credential anywhere in the input, yet the output presents the port 8443 as an elided password, invents a @, and drops /callback.
    • Redact("MCPX_SCRIPT_ENV", "TOKEN_URL=https://deploy:s3cr3tpw@example.com:8443/path") → "TOKEN_URL=https://deploy:<elided>@" — password elided, but host, port and path are lost (the bare-URL control below keeps all of them).
    • Controls behave: bare https://deploy:s3cr3tpw@example.com:8443/path → https://deploy:<elided>@example.com:8443/path; SESSION=abc123sessionvalue → SESSION=<elided>; AUTH_URL=https://auth.example.com/callback (no port) → AUTH_URL=<elided>.

Why it matters

Redact is the logging safety boundary for mcpx: its outputs are what operators read when diagnosing from traces. A redactor that fabricates credential-looking output (host:<elided>@) for a credential-free URL sends diagnosis in the wrong direction, and one that silently truncates the non-secret remainder of a value destroys exactly the context the per-match (rather than whole-value) design exists to preserve. Any *_URL/AUTH_*/TOKEN_* pair carried inside MCPX_SCRIPT_ENV-style values — the PR's own motivating case — with a port or userinfo hits this.

Acceptance criteria

Found by pr-diff-review lane B reviewing PR #1737. Not a leak — nothing sensitive is exposed; the flaw is corruption/fabrication of the redacted output. #1710 (closed) covered the leak direction only.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  3. added
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 29, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Oct 30, 2026
  6. 4 remaining items

  7. added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Oct 30, 2026
  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 30, 2026
  9. dezren39 commented on Oct 30, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  10. dezren39 commented on Oct 30, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions