{{ message }}
fix: always verify TLS on aibridgeproxyd upstream transport#26131
Merged
Conversation
Contributor
Author
Contributor
|
Are we worried that this might cause issues in real world deployments?
If so, should we perhaps adjust the docs to mention that explicitly? |
jdomeracki-coder
approved these changes
Jun 8, 2026
jdomeracki-coder
left a comment
Contributor
There was a problem hiding this comment.
Approving setting potential doc adjustments aside
aaae0b6 to
71062aa
Compare
Docs preview📖 View docs preview for |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Problem
aibridgeproxyd's HTTP transport (
proxy.Tr) was configured with secure TLS defaults only when an upstream proxy was set. Without one, it fell back to goproxy's default transport, which hasInsecureSkipVerify: true, leaving the connection between the proxy and aibridge vulnerable to MITM on HTTPS deployments.This PR moves the secure transport assignment outside the upstream proxy branch so it applies unconditionally.
Changes
proxy.Trunconditionally (verifiedRootCAs,MinVersion: TLS 1.2).TestProxy_AIBridgeTLSVerificationto cover the verification path between the proxy and aibridge.Notes
HTTPS_PROXYenv var: previously, whenUpstreamProxywas unset,proxy.TrhonoredHTTP_PROXYandHTTPS_PROXYenv vars. After this PR it does not, since MITM'd requests now always go directly to aibridge. This matches the behavior whenUpstreamProxyis configured, which already ignored env vars.CoderAccessURLis HTTPS and its TLS certificate (or the load balancer's certificate fronting it) is signed by a CA not in the system trust store, the proxy will now fail withx509: certificate signed by unknown authority.Closes https://linear.app/codercom/issue/AIGOV-386/ai-bridge-proxy-uses-goproxy-default-with-tls-verification-disabled
Note
Initially generated by Claude Opus 4.7, modified and reviewed by @ssncferreira