Skip to content

fix(desktop): finish VncAuth before readiness probes close - #193487

Merged
RomneyDa merged 9 commits into
openclaw:mainfrom
SebTardif:fix/host-desktop-vncauth-probe
Nov 16, 2026
Merged

RomneyDa merged 9 commits into
openclaw:mainfrom
SebTardif:fix/host-desktop-vncauth-probe

Conversation

@SebTardif

@SebTardif SebTardif commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #193444. Host Desktop readiness closed password-protected RFB connections before VncAuth finished. TigerVNC counted those probes as failed clients, blacklisted loopback, and rejected the subsequent desktop connection.

Fix

Finish VncAuth using the existing configured password and the server's challenge, then complete shared ClientInit/ServerInit before closing the probe. Status, acquisition, and managed Linux readiness share the existing preauth negotiator. Disabled setup discovery remains credential-free. No new credential storage or configuration is introduced.

Sebastien Tardif's seven commits are preserved. The maintainer repair consolidates duplicate tests and removes the allocation file while preserving the contributor's authentication-specific errors. No pre-existing test case was removed; production delta is +178 lines and test delta is zero.

Evidence

  • Real TigerVNC 1.12.0 Xvnc with an isolated Gateway in a secretless node:24.22.1 Linux container, synthetic password, and task-owned HOME/config/state (source, Node + tsx).
  • Baseline 3c72c9a twice: repeated Gateway status requests end before VncAuth; TigerVNC logs Connections: blacklisted: 127.0.0.1; Host Desktop fails with the existing unsupported-security error. These four production files are unchanged on main 41b339b.
  • Candidate c823ca4 twice: readiness reaches ClientInit, no blacklist is logged, and Host Desktop completes real VncAuth, receives 64×64 ServerInit, and remains connected until the fixture closes it. Final head d85ae19 changes only rejection diagnostics, not these successful authentication paths.
  • Controls on both baseline and candidate: the no-password server is refused with the same existing error; a wrong VNC password is rejected during candidate readiness. The final-head wrong-password replay returns VNC authentication failed; check desktop.host.passwordFile and retry. No control logs a blacklist.
  • The consolidated password-file regression fails on the baseline (zero completed handshakes, expected one). Focused checks pass: 81 tests across four Desktop suites (vitest-source, 43.79 seconds including wrapper), plus the 29-test Host Desktop suite rerun after restoring guidance (40.61 seconds), focused lint, and formatting.
  • Final-head full build with declarations passed. The canonical tarball installed with package scripts enabled in Linux; its CLI --version reports d85ae19 and --help passes.

Coverage now lives in the existing password-file source case, disabled-setup table, host reconfiguration cases, and shared preauth revocation/DES/SecurityResult tests. The DES table includes RFB 3.8; the shared rejection case uses 1,280 bytes; the managed fallback case includes an unreadable attach password file.

The PR changes no package manifests, lockfiles, install scripts, hooks, or patches. Builds ran through ocx on the host; all runtime proof, tests, and tarball execution stayed in the secretless container.

Two-way door: reverting restores the previous probe behavior; there is no new persisted state. Blast radius: configured Host Desktop VncAuth readiness and managed Linux desktop startup.

Host desktop status, acquire, and managed Linux readiness closed the
RFB socket after reading the security offer. TigerVNC treats that
half-handshake as a failed client and blacklists 127.0.0.1, so the
later desktop stream dies with an unsupported-security error.

When a password is available, the same socket now selects VncAuth,
checks the security result, and reads ServerInit before it closes.
A wrong password is reported once instead of being dropped early.
A missing password file still classifies the offer, because there is
no credential that can finish the handshake.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

✅ Maintainer security changes approved

A maintainer approved this revision with an explicit security approval comment.

A later push requires a fresh approval comment for an external contributor's PR.

The VncAuth response helper stays in the probe. rfb-preauth already
imports that module, so sharing the helper from the auth file would
cycle. Readiness does not change Gateway authentication.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR completes configured VNC authentication and desktop initialization before readiness probes disconnect.

Example: Repeated Host Desktop status requests target password-protected TigerVNC on 127.0.0.1:5901.

  • Before: Incomplete probes accumulate failed attempts, blacklist loopback, and prevent the viewer from connecting.
  • After: Probes complete authentication and initialization before closing, allowing the subsequent viewer to connect.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with real entry-point proof, independent protocol expectations, and no outstanding code findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The supplied isolated Linux Gateway and real TigerVNC traces exercise status, desktop.observe, and the RFB-over-WebSocket viewer: baseline blacklisting disappears with completed authentication and ServerInit, while wrong credentials remain rejected; the final diagnostic-only changes are covered by a final-head rejection replay.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Host Desktop disconnects or reports unsupported security after readiness checks cause TigerVNC to blacklist the Gateway's loopback address.
Reason: Repairs a documented official-release failure within existing configuration and authentication contracts.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR: it fixes a confirmed Host Desktop failure still present on main, and the prior recovery-guidance finding is resolved.

Priority: P2
Reviewed head: d85ae1987a86ee1c168a81a7fc335ce175651b7a

Before merge

  • Await maintainer action - A maintainer must review the authentication changes and approve security-sensitive head d85ae19.

Findings

None.

Agent review details

How this fits together

Gateway status, Host Desktop acquisition, and managed Linux startup use the RFB probe to turn loopback server responses and existing credentials into desktop readiness results.

flowchart TD
  A[Gateway status and desktop acquisition] --> B[Host Desktop source]
  C[Managed Linux startup] --> D[RFB readiness probe]
  B --> D
  D --> E[Shared RFB authentication negotiator]
  E --> F[Loopback VNC server]
  F --> G[ClientInit and ServerInit]
  G --> H[Close probe and report readiness]
Loading

Technical review

Best possible solution:

Complete configured readiness handshakes through the existing RFB negotiator while preserving credential-free discovery, interactive passwords, and managed fallback.

Do we have a high-confidence way to reproduce the issue?

Yes: current-main source closes probes before authentication, and the linked official-release report plus supplied real Gateway/TigerVNC baseline traces establish the resulting blacklist failure; this review executed no target code.

Is this the best way to solve the issue?

The patch repairs the responsible probe using the existing authentication owner, retains supported discovery and fallback behavior, and resolves the prior diagnostic defect without unnecessary parallel machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 33d26e441f91.

Provenance checked

  • Host Desktop inspection and acquisition changes intended behavior with a stated reason (df707a9: Discover and attach an existing loopback desktop behind the Host Desktop toggle, with supported authentication and operator guidance.)
  • Retained RFB transport and shared negotiation keeps the original intent (6549b0a: Keep streaming authentication on one retained connection; standalone Gateway-host readiness was explicitly deferred.)
  • Managed Linux readiness keeps the original intent (28a5889: Lazily supervise a loopback-only TigerVNC desktop with an ephemeral password while preserving existing-server precedence.)
  • Live Host Desktop configuration authority keeps the original intent (052d26e: Apply Labs configuration changes without restarting the Gateway and retire superseded runtime ownership.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 052d26e adds src/gateway/desktop/host-source.ts:435 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 052d26eec0b9; files: src/gateway/desktop/host-source.ts)
  • Holger Gruenhagen: Raw commit fa69741 adds src/gateway/desktop/managed-linux.ts:147 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: fa6974144403; files: src/gateway/desktop/managed-linux.ts)

PR surface

Source +178, Tests 0. Total +178 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 258 80 +178
Tests 2 37 37 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 295 117 +178

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test LOC Production +258/-80; tests +37/-37. Production growth completes bounded readiness authentication through the existing owner; regression coverage extends existing cases without net test growth.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #193444
Summary: This PR addresses the canonical Host Desktop readiness report; the earlier streaming fix explicitly deferred this standalone-probe contract.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: The confirmed failure prevents configured Host Desktop connections when repeated readiness probes trigger TigerVNC blacklisting.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (7 earlier review cycles)
  • reviewed 2026-11-05T13:31:26.886Z sha c3ecc42 :: needs real behavior proof before merge. :: [P2] Keep disabled setup discovery credential-free | [P1] Revalidate live desktop authority before authentication writes | [P2] Preserve managed fallback when the attach password file is unavailable | [P2] Reuse the existing RFB authentication owner
  • reviewed 2026-11-05T13:48:25.608Z sha 14bdc0e :: needs real behavior proof before merge. :: [P1] Pass live desktop authority into credentialed status probes | [P2] Reuse the existing upstream RFB negotiation implementation
  • reviewed 2026-11-05T15:52:49.664Z sha 4e5a6bf :: blocked before merge. :: [P2] Reuse the existing upstream RFB negotiation implementation
  • reviewed 2026-11-05T16:02:20.833Z sha 4e5a6bf :: blocked before merge. :: [P2] Reuse the existing upstream RFB negotiation implementation
  • reviewed 2026-11-06T17:54:47.370Z sha 5b2fd74 :: blocked before merge. :: [P2] Remove scaffolding left behind by the negotiation cutover
  • reviewed 2026-11-08T22:06:01.721Z sha 81a81cf :: blocked before merge. :: none
  • reviewed 2026-11-16T08:49:50.097Z sha c823ca4 :: blocked before merge. :: [P2] Preserve authentication-specific recovery guidance

Reviewed November 16, 2026, 4:25 AM ET / 09:25 UTC (Revision 8).

Enabled readiness still finishes VncAuth before the probe closes.
Setup discovery does not read the password file. Acquire checks the
live desktop immediately before the credential write. An unreadable
attach password no longer blocks managed mode when no server is
listening. The DES response lives in one helper used by preauth and
the probe.

Signed-off-by: Sebastien Tardif <[email protected]>
@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Nov 5, 2026
service.status now passes the live desktop guard into inspection.
A credential response is not sent when the operator disables Host
Desktop or replaces its port or password file while the VNC challenge
is still outstanding.

Signed-off-by: Sebastien Tardif <[email protected]>
@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Nov 5, 2026
Core lint rejects createDeferred<void> because void is already the default.

Signed-off-by: Sebastien Tardif <[email protected]>
The negotiation cutover left the DES helper in its own module and
returned protocol metadata no caller reads. The helper is private
again, and connectRfbServer returns the stream and security types only.

Signed-off-by: Sebastien Tardif <[email protected]>
@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Removed the scaffolding left by the negotiation cutover. Head 81a81cf. The DES helper is private in rfb-preauth.ts again, rfb-vnc-auth.ts is gone, and connectRfbServer returns only the stream and security types. The DES vector and the loopback VncAuth handshake still match.

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 8, 2026
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Updated TigerVNC proof for final head d85ae19 (source, Node + tsx; real Xvnc 1.12.0 inside secretless node:24.22.1). Each run used a separate HOME/config/state and a synthetic password; no live Gateway or operator credentials. The successful c823 traces remain applicable: the final revision only restores the contributor's reviewed authentication-rejection diagnostics.

Repeated real Gateway status calls, then desktop.observe and the real RFB-over-WebSocket viewer handshake:

baseline 3c72c9ae174b / run 1: closes before VncAuth; blacklist log entries=3; Host Desktop unsupported-security failure
baseline 3c72c9ae174b / run 2: closes before VncAuth; blacklist log entries=3; Host Desktop unsupported-security failure
candidate c823ca427795 / run 1: probes reach ClientInit; blacklist entries=0; viewer SecurityResult=0; ServerInit=64x64; stays connected=true
candidate c823ca427795 / run 2: probes reach ClientInit; blacklist entries=0; viewer SecurityResult=0; ServerInit=64x64; stays connected=true
no-password control, baseline and candidate: same existing unauthenticated-server refusal; blacklist entries=0
wrong-password control, baseline: viewer SecurityResult=1; VNC authentication rejected; connected=false
wrong-password control, final d85ae1987a86: TigerVNC rejects authentication during readiness; no viewer granted; blacklist entries=0; error="VNC authentication failed; check desktop.host.passwordFile and retry"

The server's baseline logs contain Connections: blacklisted: 127.0.0.1; candidate logs reach SConnection: reading client initialisation without a blacklist. Successful candidate viewers are closed by the fixture only after recording the connected outcome. Controls wait for the Gateway's published readiness before issuing requests.

The consolidated password-file regression fails on the baseline with expected +0 to be 1; focused tests pass (81 tests, four files, 43.79 seconds including wrapper). The 29-test Host Desktop suite was rerun after restoring guidance and passed in 40.61 seconds. Focused Desktop lint and formatting pass. Final d85ae19 full build with declarations passes; the canonical tarball installs with package scripts enabled, reports OpenClaw 2026.11.1 (d85ae19), and passes CLI --help inside Linux. The final wrong-password replay's container production-file hashes match the pushed commit.

All seven contributor commits remain. Production: +178 lines (258 added / 80 removed); tests: net 0 (37 added / 37 removed); no allocation file. Existing test-case coverage is consolidated as described in the PR body. CODEOWNERS has no matching Desktop rule; the separate maintainer authentication-review gate remains required.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Nov 16, 2026
@RomneyDa

Copy link
Copy Markdown
Member

/allow-security-sensitive-change

@RomneyDa
RomneyDa merged commit 8af7148 into openclaw:main Nov 16, 2026
129 of 133 checks passed
RomneyDa added a commit that referenced this pull request Nov 16, 2026
* fix(desktop): finish VncAuth before a readiness probe closes

Host desktop status, acquire, and managed Linux readiness closed the
RFB socket after reading the security offer. TigerVNC treats that
half-handshake as a failed client and blacklists 127.0.0.1, so the
later desktop stream dies with an unsupported-security error.

When a password is available, the same socket now selects VncAuth,
checks the security result, and reads ServerInit before it closes.
A wrong password is reported once instead of being dropped early.
A missing password file still classifies the offer, because there is
no credential that can finish the handshake.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): leave the preauth module unchanged

The VncAuth response helper stays in the probe. rfb-preauth already
imports that module, so sharing the helper from the auth file would
cycle. Readiness does not change Gateway authentication.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): keep discovery and managed fallback credential-free

Enabled readiness still finishes VncAuth before the probe closes.
Setup discovery does not read the password file. Acquire checks the
live desktop immediately before the credential write. An unreadable
attach password no longer blocks managed mode when no server is
listening. The DES response lives in one helper used by preauth and
the probe.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): stop status probes after the desktop configuration changes

service.status now passes the live desktop guard into inspection.
A credential response is not sent when the operator disables Host
Desktop or replaces its port or password file while the VNC challenge
is still outstanding.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): reuse upstream RFB negotiation for readiness probes

Configured VncAuth probes call negotiateServer on the retained socket.
Security selection, the challenge response, and the security result use
that owner, including its 64 KiB rejection limit. The probe keeps
ClientInit and ServerInit, and still checks the live desktop guard
before the credential write.

The new rejection test fails on the previous probe, which dropped
reasons longer than 1 KiB. rfb-probe, rfb-preauth, and host-source
passed (64 tests).

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): drop default deferred type arguments

Core lint rejects createDeferred<void> because void is already the default.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): keep VncAuth DES beside the preauth negotiator

The negotiation cutover left the DES helper in its own module and
returned protocol metadata no caller reads. The helper is private
again, and connectRfbServer returns the stream and security types only.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): consolidate VncAuth readiness coverage

* fix(desktop): preserve password rejection guidance

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 8af7148)

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…193487)

* fix(desktop): finish VncAuth before a readiness probe closes

Host desktop status, acquire, and managed Linux readiness closed the
RFB socket after reading the security offer. TigerVNC treats that
half-handshake as a failed client and blacklists 127.0.0.1, so the
later desktop stream dies with an unsupported-security error.

When a password is available, the same socket now selects VncAuth,
checks the security result, and reads ServerInit before it closes.
A wrong password is reported once instead of being dropped early.
A missing password file still classifies the offer, because there is
no credential that can finish the handshake.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): leave the preauth module unchanged

The VncAuth response helper stays in the probe. rfb-preauth already
imports that module, so sharing the helper from the auth file would
cycle. Readiness does not change Gateway authentication.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): keep discovery and managed fallback credential-free

Enabled readiness still finishes VncAuth before the probe closes.
Setup discovery does not read the password file. Acquire checks the
live desktop immediately before the credential write. An unreadable
attach password no longer blocks managed mode when no server is
listening. The DES response lives in one helper used by preauth and
the probe.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): stop status probes after the desktop configuration changes

service.status now passes the live desktop guard into inspection.
A credential response is not sent when the operator disables Host
Desktop or replaces its port or password file while the VNC challenge
is still outstanding.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): reuse upstream RFB negotiation for readiness probes

Configured VncAuth probes call negotiateServer on the retained socket.
Security selection, the challenge response, and the security result use
that owner, including its 64 KiB rejection limit. The probe keeps
ClientInit and ServerInit, and still checks the live desktop guard
before the credential write.

The new rejection test fails on the previous probe, which dropped
reasons longer than 1 KiB. rfb-probe, rfb-preauth, and host-source
passed (64 tests).

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): drop default deferred type arguments

Core lint rejects createDeferred<void> because void is already the default.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): keep VncAuth DES beside the preauth negotiator

The negotiation cutover left the DES helper in its own module and
returned protocol metadata no caller reads. The helper is private
again, and connectRfbServer returns the stream and security types only.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): consolidate VncAuth readiness coverage

* fix(desktop): preserve password rejection guidance

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
RomneyDa pushed a commit that referenced this pull request Nov 19, 2026
* fix(desktop): finish VncAuth before a readiness probe closes

Host desktop status, acquire, and managed Linux readiness closed the
RFB socket after reading the security offer. TigerVNC treats that
half-handshake as a failed client and blacklists 127.0.0.1, so the
later desktop stream dies with an unsupported-security error.

When a password is available, the same socket now selects VncAuth,
checks the security result, and reads ServerInit before it closes.
A wrong password is reported once instead of being dropped early.
A missing password file still classifies the offer, because there is
no credential that can finish the handshake.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): leave the preauth module unchanged

The VncAuth response helper stays in the probe. rfb-preauth already
imports that module, so sharing the helper from the auth file would
cycle. Readiness does not change Gateway authentication.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): keep discovery and managed fallback credential-free

Enabled readiness still finishes VncAuth before the probe closes.
Setup discovery does not read the password file. Acquire checks the
live desktop immediately before the credential write. An unreadable
attach password no longer blocks managed mode when no server is
listening. The DES response lives in one helper used by preauth and
the probe.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): stop status probes after the desktop configuration changes

service.status now passes the live desktop guard into inspection.
A credential response is not sent when the operator disables Host
Desktop or replaces its port or password file while the VNC challenge
is still outstanding.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): reuse upstream RFB negotiation for readiness probes

Configured VncAuth probes call negotiateServer on the retained socket.
Security selection, the challenge response, and the security result use
that owner, including its 64 KiB rejection limit. The probe keeps
ClientInit and ServerInit, and still checks the live desktop guard
before the credential write.

The new rejection test fails on the previous probe, which dropped
reasons longer than 1 KiB. rfb-probe, rfb-preauth, and host-source
passed (64 tests).

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): drop default deferred type arguments

Core lint rejects createDeferred<void> because void is already the default.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): keep VncAuth DES beside the preauth negotiator

The negotiation cutover left the DES helper in its own module and
returned protocol metadata no caller reads. The helper is private
again, and connectRfbServer returns the stream and security types only.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(desktop): consolidate VncAuth readiness coverage

* fix(desktop): preserve password rejection guidance

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 8af7148)

Co-authored-by: RomneyDa <[email protected]>

Release adaptation: none; source change applies to the pinned beta baseline.

Follow-up disposition: bounded pinned-main same-path audit recorded in the lane report; cross-lane changes remain parent-owned.

(cherry picked from commit dcc60e1648971367620d3f73f0d30da55c1ba657)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. security-sensitive-changed size: M status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Host Desktop readiness probes leave VncAuth handshakes incomplete and trigger TigerVNC loopback blacklisting

3 participants