Repository navigation
fix(mcp): require HTTPS for remote proxy endpoints #1779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,8 +42,19 @@ export function secretTransportAllowed(url: string): boolean { | |
| } | ||
| } | ||
|
|
||
| export function pinLoopbackUrl(value: string): string { | ||
| try { | ||
| const url = new URL(value); | ||
| if (url.hostname === "localhost.") { | ||
| url.hostname = "127.0.0.1"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve the HTTPS certificate identity when pinning the connection. For The returned URL reaches the hook and bridge requests without a TLS identity override. These HTTPS configurations therefore stop working. Pin the connection destination while preserving the configured hostname for TLS verification. Add a request-level test with a trusted DNS-only certificate; the current string assertion does not check this behavior.
|
||
| return url.href.replace(/\/$/, ""); | ||
| } | ||
| } catch {} | ||
| return value; | ||
| } | ||
|
|
||
| export function resolveHookEndpoint(env: NodeJS.ProcessEnv = process.env): HookEndpoint { | ||
| const url = hookSetting("AGENTMEMORY_URL", env) || DEFAULT_URL; | ||
| const url = pinLoopbackUrl(hookSetting("AGENTMEMORY_URL", env) || DEFAULT_URL); | ||
| const secret = resolveSettingSecret(url, env); | ||
| const blocked = !secretTransportAllowed(url); | ||
| return { url, secret: blocked ? "" : secret, blocked }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Missing sign-off blocks merging
Commit
c4e57408lacks aSigned-off-bytrailer. The DCO requirements prohibit merging commits without sign-off.Was this helpful? React with 👍 or 👎 to provide feedback.