Mage's terminal WebSocket could connect to a known existing PTY and replay buffered output before authenticating the connecting client, according to the research and patch proposal. A setting that prevented later command input did not necessarily protect bytes already emitted by the server. This is a read-before-authorization problem: exposure could occur…
Inspect the ClaimsCase · DiggingBeagle record
Mage terminal WebSocket replayed PTY output before authentication
A reachable terminal WebSocket could replay a named PTY output buffer before verifying its client token, making output secrecy different from command-input blocking.
Mage AI terminal PTY WebSocket; proposed PR #6206; unauthenticated named-session output replay.
Assessment profile
Assessment method- Setting
- research demonstration
- Exploitation
- demonstrated
- Evidence
- Grade C
- Remediation
- mitigation available
- AI role
- AGAINST AI
Basis and provenance
PR #6206 documents a tested pre-authentication replay path and proposed regression tests, but the visible GitHub page remains open as of inspection. No confirmed merged package fix or actual victim secret exposure is established. Network and terminal feature restrictions are available provisional mitigations, not proof of repaired code.
Assessed Oct 18, 2026 using diggingbeagle.assessment/1.
Evidence basis: CLM-CP13-MAGE-PTY-READ · CLM-CP13-MAGE-PTY-STATUS · CLM-ENRICH-MAGE-PTY-OPEN · Mage AI PR #6206: check terminal WS auth before output replay
At a glance
Control over terminal input and secrecy of terminal output are independent properties. A read-only buffer can contain earlier commands or secret-bearing output even if the client is prevented from writing new commands. This bug does not require the OAuth session flaw, but it requires the named terminal and reachable WebSocket.
Read the implicationsNo confirmed exposed real secret or exploited remote customer. Patch merge and packaged deployment status remain unverified at this snapshot.
Limits and uncertaintyFull account
Mage's terminal WebSocket could connect to a known existing PTY and replay buffered output before authenticating the connecting client, according to the research and patch proposal. A setting that prevented later command input did not necessarily protect bytes already emitted by the server. This is a read-before-authorization problem: exposure could occur even if an attacker could not type a new shell command.
PR #6206 proposes verifying a valid Editor-authorized session before PTY attachment and replay, checking terminal-disable and project restrictions, then revalidating rights before later output. The local regression described by its author uses synthetic output, not confirmed production secret theft. At the inspected October 18 snapshot, this pull request remained open. It must not inherit the merged status of Mage's other October fixes, and no released patched version is established by that open proposal.
The attack still requires access to the WebSocket and knowledge or discovery of a terminal name. The evidence supports a potentially sensitive output disclosure path, not automatically remote code execution or proof that a real user's credentials were stolen. A complete fix needs to test initial attachment, buffered replay, continuing output, mid-session revocation and privilege changes separately.
Mechanism and trust boundary
- 01
Step
- 02
Step
- 03
Step
Claims & evidence
CLM-CP13-MAGE-PTY-READAccording to Mage PR #6206, initial terminal output replay could occur before token validation, exposing buffered output under the reproduced path.supported
Basis: reported finding
- supportsMage AI PR #6206: check terminal WS auth before output replaypatch commit artifact
PR #6206 security description and before-patch regression
CLM-CP13-MAGE-PTY-STATUSThe proposed change moves Editor-token authorization ahead of attachment/replay; the accessible PR is not verified as a published fixed package.supported
Basis: reported finding
- supportsMage AI PR #6206: check terminal WS auth before output replaypatch commit artifact
PR #6206 diff and merge status
CLM-ENRICH-MAGE-PTY-OPENAs inspected, Mage PR #6206 remained open, and its proposed terminal authentication changes cannot be described as a merged production patch.supported
Basis: reported finding
- supportsMage AI PR #6206: check terminal WS auth before output replaypatch commit artifact
Pull request #6206 header showing Open, discussion of preauthentication PTY replay
Implications
Control over terminal input and secrecy of terminal output are independent properties. A read-only buffer can contain earlier commands or secret-bearing output even if the client is prevented from writing new commands. This bug does not require the OAuth session flaw, but it requires the named terminal and reachable WebSocket.
Controls and mitigations
- Until the proposed fix is merged and deployed, restrict terminal WebSocket reachability and treat PTY buffers as privileged output rather than harmless session metadata.
- After patch deployment, test that unauthenticated clients cannot attach, receive prior bytes, or continue receiving output after a token is revoked.
Unknowns and contradictions
- No confirmed exposed real secret or exploited remote customer.
- Patch merge and packaged deployment status remain unverified at this snapshot.
Sources and citation
Material revision history
- Oct 18, 2026 · Canonical change recorded · new in release · revision 171