Skip to content

Commit b221b6c

Browse files
waleedlatif1claude
andcommitted
fix(obsidian): drop allowHttp to restore HTTPS enforcement in hosted mode
allowHttp: true permitted plaintext HTTP for all hosts in all deployment modes, contradicting the documented policy. The default validateExternalUrl behavior already allows http://localhost in self-hosted mode (the actual Obsidian Local REST API use case) via the built-in carve-out, while correctly rejecting HTTP for public hosts in hosted mode — which prevents leaking the Bearer access token over plaintext. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5d26e7b commit b221b6c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/sim/connectors/obsidian/obsidian.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ interface NoteJson {
3030
* is no SaaS domain to allowlist — the vault URL is fully user-controlled. We
3131
* defer to the shared `validateExternalUrl` policy:
3232
* - hosted Sim: blocks localhost, private IPs, HTTP (forces HTTPS)
33-
* - self-hosted Sim: allows localhost + HTTP, still blocks non-loopback
34-
* private IPs and dangerous ports (22, 25, 3306, 5432, 6379, 27017, 9200)
33+
* - self-hosted Sim: allows http://localhost (built-in carve-out), still
34+
* blocks non-loopback private IPs and dangerous ports (22, 25, 3306,
35+
* 5432, 6379, 27017, 9200)
3536
*
3637
* This does not defend against DNS rebinding; for hosted deployments the user
3738
* must expose the plugin through a public URL (tunnel, port-forward).
@@ -41,7 +42,7 @@ function resolveVaultEndpoint(rawUrl: string | undefined): string {
4142
if (url && !url.startsWith('https://') && !url.startsWith('http://')) {
4243
url = `https://${url}`
4344
}
44-
const validation = validateExternalUrl(url, 'vaultUrl', { allowHttp: true })
45+
const validation = validateExternalUrl(url, 'vaultUrl')
4546
if (!validation.isValid) {
4647
throw new Error(validation.error || 'Invalid vault URL')
4748
}

0 commit comments

Comments
 (0)