@goodandready/dsh-subscriptions 0.7.23 → 0.7.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/http.js +10 -1
- package/package.json +1 -1
package/lib/http.js
CHANGED
|
@@ -103,6 +103,8 @@ function configuredTrustedHosts(targetCtx) {
|
|
|
103
103
|
return out
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
const SHELL_SESSION_COOKIE = /(?:^|;\s*)dsh-auth-[^=;\s]*=/
|
|
107
|
+
|
|
106
108
|
/**
|
|
107
109
|
* Reject cross-site and untrusted writes and sensitive reads.
|
|
108
110
|
* Fail-closed: must be loopback, same-origin/same-site, or authentic host credentials (#374).
|
|
@@ -117,7 +119,14 @@ export function isTrustedSettingsRequest(request, targetCtx) {
|
|
|
117
119
|
// not enough because the LAN bridge rewrites Host and connects over loopback.
|
|
118
120
|
const method = String(request?.method || '').toUpperCase()
|
|
119
121
|
const mutating = method !== '' && method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS'
|
|
120
|
-
if (mutating && !headers.origin && !headers.referer)
|
|
122
|
+
if (mutating && !headers.origin && !headers.referer) {
|
|
123
|
+
// #26: DSH Desktop validates dsh-app://app, then strips Origin/Referer
|
|
124
|
+
// before forwarding. The shell's session cookie is the only positive
|
|
125
|
+
// signal left. Presence is not a signature check: DSH still owns cookie
|
|
126
|
+
// validation, and this only relaxes the mutation gate for loopback.
|
|
127
|
+
const shellForwarded = SHELL_SESSION_COOKIE.test(String(headers.cookie || '')) && isLoopback(request)
|
|
128
|
+
if (!shellForwarded) return false
|
|
129
|
+
}
|
|
121
130
|
|
|
122
131
|
// 1. Explicit cross-site fetch is always rejected
|
|
123
132
|
const secFetchSite = String(headers['sec-fetch-site'] || '').toLowerCase()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-subscriptions",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.24",
|
|
4
4
|
"description": "Use ChatGPT Codex, Claude, Grok, Antigravity, Kimi, GLM, Cursor, Kiro, Copilot, Qwen, ERNIE, Spark, JetBrains, Perplexity, Replit, and Cody subscriptions as DeepSeek Harness LLM providers via OAuth.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|