Skip to content

fix: Control UI Insecure Auth Bypass Allows Token-Only Auth Over HTTP#20684

Merged
mbelinky merged 1 commit intoopenclaw:mainfrom
coygeek:codex/aa-02
Feb 20, 2026
Merged

fix: Control UI Insecure Auth Bypass Allows Token-Only Auth Over HTTP#20684
mbelinky merged 1 commit intoopenclaw:mainfrom
coygeek:codex/aa-02

Conversation

@coygeek
Copy link
Copy Markdown
Contributor

@coygeek coygeek commented Feb 19, 2026

Fix Summary

The gateway.controlUi.allowInsecureAuth configuration option allows the Control UI to authenticate using only a token over unencrypted HTTP, bypassing both device identity verification and the device pairing requirement. This enables man-in-the-middle attacks where an attacker can intercept the token and gain full administrative access to the gateway.

Issue Linkage

Fixes #20683

Security Snapshot

  • CVSS v3.1: 8.3 (High)
  • CVSS v4.0: 8.7 (High)

Implementation Details

Files Changed

  • src/gateway/server.auth.e2e.test.ts (+24/-4)
  • src/gateway/server/ws-connection/message-handler.ts (+6/-2)

Technical Analysis

When gateway.controlUi.allowInsecureAuth: true is set, the allowControlUiBypass flag is set to true inside the WebSocket handshake handler. This flag suppresses two distinct security checks: (1) the HTTPS/localhost enforcement block that normally rejects non-secure Control UI connections, and (2) the device pairing requirement that gates new devices. The result is that any client presenting a valid shared secret (token or password) is granted full operator-level scopes over an unencrypted HTTP connection. No device identity is registered or verified. Tokens in transit are fully plaintext-exposed.

Validation Evidence

  • Command: pnpm build && pnpm check && pnpm test
  • Status: passed

Risk and Compatibility

non-breaking; no known regression impact

AI-Assisted Disclosure

  • AI-assisted: yes
  • Model: GPT-5.3-Codex

Greptile Summary

This PR fixes a critical security vulnerability where gateway.controlUi.allowInsecureAuth: true allowed Control UI to bypass both HTTPS/localhost enforcement and device pairing requirements, enabling man-in-the-middle attacks over unencrypted HTTP.

Changes Made

  • Modified allowControlUiBypass calculation to exclude allowInsecureControlUi flag, ensuring allowInsecureAuth no longer bypasses secure-context or device-auth checks
  • Updated tests to verify Control UI now correctly rejects token-only auth over HTTP and enforces pairing requirements even when allowInsecureAuth is enabled
  • Added telemetry to track when insecureAuthConfigured is set during failed handshake attempts

Issues Found

  • The security audit message in src/security/audit.ts:352 still describes the old insecure behavior and needs updating to reflect that allowInsecureAuth no longer bypasses security checks

Confidence Score: 4/5

  • This PR is safe to merge after updating the security audit message - it fixes a critical vulnerability without introducing new security issues
  • The fix correctly addresses the security vulnerability by preventing allowInsecureAuth from bypassing security checks. Tests comprehensively verify the new behavior. One minor issue: the security audit message needs updating to reflect the fixed behavior
  • src/security/audit.ts needs the audit message updated to reflect that allowInsecureAuth no longer bypasses security

Last reviewed commit: b228890

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security audit message outdated - allowInsecureAuth no longer skips device identity or pairing after this fix

Suggested change
"gateway.controlUi.allowInsecureAuth is deprecated and no longer bypasses security checks.",
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/security/audit.ts
Line: 352

Comment:
security audit message outdated - allowInsecureAuth no longer skips device identity or pairing after this fix

```suggestion
        "gateway.controlUi.allowInsecureAuth is deprecated and no longer bypasses security checks.",
```

How can I resolve this? If you propose a fix, please make it concise.

@mbelinky mbelinky merged commit 40a2926 into openclaw:main Feb 20, 2026
13 checks passed
@mbelinky
Copy link
Copy Markdown
Contributor

Merged via squash.

Thanks @coygeek!

rodrigogs pushed a commit to rodrigogs/openclaw that referenced this pull request Feb 20, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
Hansen1018 added a commit to Hansen1018/openclaw that referenced this pull request Feb 21, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
vincentkoc pushed a commit that referenced this pull request Feb 21, 2026
…#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
dgarson pushed a commit to dgarson/clawdbot that referenced this pull request Feb 21, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
mmyyfirstb pushed a commit to mmyyfirstb/openclaw that referenced this pull request Feb 21, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
obviyus pushed a commit to guirguispierre/openclaw that referenced this pull request Feb 22, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
xianfeng92 pushed a commit to xianfeng92/openclaw that referenced this pull request Feb 24, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky

(cherry picked from commit 40a2926)
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky

(cherry picked from commit 40a2926)

# Conflicts:
#	CHANGELOG.md
#	src/gateway/server.auth.e2e.test.ts
#	src/gateway/server/ws-connection/message-handler.ts
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky

(cherry picked from commit 40a2926)

# Conflicts:
#	CHANGELOG.md
#	src/gateway/server.auth.e2e.test.ts
#	src/gateway/server/ws-connection/message-handler.ts
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…openclaw#20684)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: ad9be4b
Co-authored-by: coygeek <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Control UI Insecure Auth Bypass Allows Token-Only Auth Over HTTP

2 participants