Skip to content

feat: add --chat-hook-allow-insecure to allow plain HTTP chat hook URLs - #27896

Merged
ibetitsmike merged 5 commits into
mainfrom
mike/chat-hook-allow-insecure
Aug 5, 2026
Merged

feat: add --chat-hook-allow-insecure to allow plain HTTP chat hook URLs#27896
ibetitsmike merged 5 commits into
mainfrom
mike/chat-hook-allow-insecure

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Adds a hidden --chat-hook-allow-insecure / CODER_CHAT_HOOK_ALLOW_INSECURE deployment option (default false) that allows the chat lifecycle hook URL to use plain HTTP for any host.

The HTTPS requirement is enforced at two points, and the flag relaxes both: DeploymentValues.Validate() rejects http hook URLs at startup, and the hook dispatcher's validateHookURL allows http only for loopback hosts. With the flag set, any-host http is accepted; the host, fragment/userinfo, secret, and timeout checks are unchanged, and non-http(s) schemes still fail. This removes the need for an HTTPS reverse proxy when testing a hook consumer on a trusted network.

Following security review feedback, the flag description and docs state that plain HTTP lets an on-path attacker forge hook responses (which control agent execution), and coder server logs a startup warning (with a redacted hook URL) when hooks run over plain HTTP.

Docs, generated API types, and the server config golden are updated accordingly.

Mux acted on Mike's behalf to create this PR.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 72573e68b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike marked this pull request as ready for review August 5, 2026 17:09
@jdomeracki-coder
jdomeracki-coder self-requested a review August 5, 2026 18:04
@jdomeracki-coder

Copy link
Copy Markdown
Contributor

Security review of 72573e6 — no vulnerability in the default path; the flag is a reasonable opt-in trade-off. Notes:

Done well

  • Default-off, hidden; both enforcement points (DeploymentValues.Validate() and validateHookURL) relaxed consistently and only for scheme http. Non-http(s) schemes, hostless/fragment/userinfo rejection, secret and timeout checks unchanged, with test coverage at both points.
  • Scoped to scheme only — no impact on TLS verification for https URLs.
  • Redirects stay disabled, and JWT claims (aud = exact URL, jti, body SHA-256, ~≤35s expiry) limit token-theft/replay impact.

Suggestions

  1. The warning text undersells the main risk. Hook responses are unauthenticated and control execution: on an untrusted network an on-path attacker can flip denyallow, inject input_override (rewriting prompts/tool inputs), or inject model_context — active integrity compromise of the agent-control channel, not just data/token exposure. Recommend the flag description and docs say responses can be forged.
  2. Consider a startup Warn log when the flag is set with an http URL, so the insecure mode is visible at runtime.
  3. Pre-existing, not from this PR: Validate() rejects loopback http while the dispatcher allows it, so the loopback carve-out is only reachable where startup validation doesn't run.

@jdomeracki-coder jdomeracki-coder left a comment

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.

Non blocking suggestions in the comment above

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Addressed the non-blocking suggestions in 779e11f and 31b466d:

  1. The flag description and the docs now state the real risk: plain HTTP lets an on-path attacker forge hook responses, which allow/deny tool calls and can rewrite prompts and tool inputs.
  2. coder server now logs a startup warning when hooks are active over a plain http URL, with the hook URL redacted (userinfo/query stripped) in the log field.
  3. Left as-is per your note: the loopback carve-out asymmetry between Validate() and the dispatcher predates this PR.

Mux acted on Mike's behalf to post this comment.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31b466d84f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codersdk/deployment.go
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8126f28096

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/admin/setup/chat-lifecycle-hooks.md Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 8bf7fec9f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit 4b9880a into main Aug 5, 2026
32 checks passed
@ibetitsmike
ibetitsmike deleted the mike/chat-hook-allow-insecure branch August 5, 2026 20:41
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants