Skip to content

(3/8) fix(setup): gate DB port exposure, login lockout, forwarded headers, pair args - #146

Merged
dizys merged 3 commits into
dizys:mainfrom
0libote:fix/setup-front-door
Nov 14, 2026
Merged

dizys merged 3 commits into
dizys:mainfrom
0libote:fix/setup-front-door

Conversation

@0libote

@0libote 0libote commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Strengthen the Setup entry points while retaining existing deployment options:

  • Require explicit confirmDatabase: true before starting a public tunnel for a database-like port.
  • Apply a bounded, growing per-address lockout after repeated setup-key failures, without letting locked-out requests occupy shared authentication slots.
  • Trust forwarding headers from the in-container loopback router by default. Direct TLS proxies can opt in with T3_TRUST_PROXY_HEADERS=1; scheme, host, prefix and visitor-address handling use the same trust decision.
  • Reject flag-like TTL and pairing label arguments before invoking the native CLI. Unicode device labels remain supported; control characters are refused.

Document the proxy setting for both the single-port router and direct Setup deployments. The port-exposure regression fixture uses /bin/false for cloudflared, so it cannot publish a real host port.

Validation: all 64 focused front-door, throttle, request-auth, client-address, router and setup-key tests passed; all 9 front-door tests passed again after isolating the tunnel fixture. Current main, including #148's smoke correction, is merged for fresh native and image CI.

Original security work contributed by @0libote; maintainer review fixes retain explicit proxy support, international labels and isolated test behavior.

…pair args

- POST /ports/expose refuses looks-like-database ports without
  {"confirmDatabase": true}
- key throttle locks an address out after 20 failures for a growing
  window, rejecting at once without holding shared slots
- X-Forwarded-Proto/Host/Prefix only believed from loopback peers;
  router warns loudly when T3_TRUST_PROXY_HEADERS is set
- /pair validates ttl against the CLI duration grammar and label
  against printable text without a leading dash
@0libote 0libote closed this Nov 14, 2026
@0libote 0libote reopened this Nov 14, 2026
@0libote

0libote commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Third (3 of 8), after #148 and #145. No conflicts with the stack, checked.

@dizys
dizys merged commit 9453d44 into dizys:main Nov 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants