@goodandready/dsh-clinebot 0.6.27 → 0.6.28

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/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to `@goodandready/dsh-clinebot` will be documented in this f
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.28] - 2026-11-05
9
+
10
+ ### Security
11
+ - **Loopback hostname bypass (#294)**: URL hostnames are now matched exactly as `localhost`, `::1` or a valid `127.0.0.0/8` address; names such as `127.0.0.1.evil.example` no longer pass the HTTPS gate.
12
+
8
13
  ## [0.6.27] - 2026-11-05
9
14
 
10
15
  ### Security
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <h3>Native ClineBot / ClinePass Provider Companion for DeepSeek Harness</h3>
6
6
 
7
- <p><b>0.6.27</b> completes the native-settings security boundary: HTTPS-only remote endpoints, allowlisted credential names, path-safe telemetry/price writes, dangling-symlink rejection and a Windows-safe updater environment. It keeps DSH <code>0.2.2-rc.1</code> support, automatic model/free/dated catalog backfill, model-scoped credit cooldowns and 402/413 errors. Chat runs on the native <code>ctx.llm</code> adapter; the legacy <code>llm-pi-ai</code>, loopback proxy and <code>llm/stream</code> path are removed.</p>
7
+ <p><b>0.6.28</b> fixes the loopback hostname check so names like <code>127.0.0.1.evil.example</code> cannot bypass the HTTPS gate. It keeps the complete native-settings security boundary from 0.6.27, DSH <code>0.2.2-rc.1</code> support, automatic model/free/dated catalog backfill, model-scoped credit cooldowns and 402/413 errors. Chat runs on the native <code>ctx.llm</code> adapter; the legacy <code>llm-pi-ai</code>, loopback proxy and <code>llm/stream</code> path are removed.</p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/@goodandready/dsh-clinebot"><img src="https://img.shields.io/npm/v/@goodandready/dsh-clinebot.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
package/README.ru.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <h3>Нативное подключение провайдера ClineBot / ClinePass для DeepSeek Harness</h3>
6
6
 
7
- <p><b>0.6.27</b> завершает security-границу native settings: HTTPS-only внешние endpoints, allowlist имён credentials, безопасные пути telemetry/price, отклонение dangling symlink и Windows-safe окружение updater. Сохраняются поддержка DSH <code>0.2.2-rc.1</code>, автодобор каталога моделей/FREE/dated, cooldown недостатка кредитов для конкретной модели и ошибки 402/413. Чат работает через нативный адаптер <code>ctx.llm</code>; старые <code>llm-pi-ai</code>, loopback-прокси и <code>llm/stream</code> удалены.</p>
7
+ <p><b>0.6.28</b> исправляет проверку loopback-hostname: имена вроде <code>127.0.0.1.evil.example</code> больше не обходят HTTPS-гейт. Сохраняются полная security-граница native settings из 0.6.27, поддержка DSH <code>0.2.2-rc.1</code>, автодобор каталога моделей/FREE/dated, cooldown недостатка кредитов для конкретной модели и ошибки 402/413. Чат работает через нативный адаптер <code>ctx.llm</code>; старые <code>llm-pi-ai</code>, loopback-прокси и <code>llm/stream</code> удалены.</p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/@goodandready/dsh-clinebot"><img src="https://img.shields.io/npm/v/@goodandready/dsh-clinebot.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
package/README.zh.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <h3>适用于 DeepSeek Harness 的 ClineBot / ClinePass 原生模型提供商伴侣插件</h3>
6
6
 
7
- <p><b>0.6.27</b> 完善 native settings 安全边界:远程端点仅允许 HTTPS、凭据名称白名单、遥测/价格安全路径、拒绝悬空符号链接,以及 Windows 安全的 updater 环境。保留 DSH <code>0.2.2-rc.1</code> 支持、模型/免费/日期变体自动补齐、按模型隔离的余额不足冷却和明确的 402/413 错误。聊天使用原生 <code>ctx.llm</code> 适配器;旧的 <code>llm-pi-ai</code>、回环代理和 <code>llm/stream</code> 已删除。</p>
7
+ <p><b>0.6.28</b> 修复 loopback 主机名检查,<code>127.0.0.1.evil.example</code> 之类的名称不再绕过 HTTPS 限制。保留 0.6.27 的完整 native settings 安全边界、DSH <code>0.2.2-rc.1</code> 支持、模型/免费/日期变体自动补齐、按模型隔离的余额不足冷却和明确的 402/413 错误。聊天使用原生 <code>ctx.llm</code> 适配器;旧的 <code>llm-pi-ai</code>、回环代理和 <code>llm/stream</code> 已删除。</p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/@goodandready/dsh-clinebot"><img src="https://img.shields.io/npm/v/@goodandready/dsh-clinebot.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
package/lib/http.js CHANGED
@@ -53,11 +53,19 @@ function isLoopbackAddress(value) {
53
53
  || address.startsWith('::ffff:127.')
54
54
  }
55
55
 
56
+ function isLoopbackHostname(value) {
57
+ const host = String(value || '').toLowerCase().replace(/^\[|\]$/g, '')
58
+ if (host === 'localhost' || host === 'localhost.' || host === '::1') return true
59
+ const parts = host.split('.')
60
+ if (parts.length !== 4 || parts[0] !== '127') return false
61
+ return parts.every((part) => /^\d{1,3}$/.test(part) && Number(part) <= 255)
62
+ }
63
+
56
64
  export function isSecureRemoteBaseUrl(value) {
57
65
  try {
58
66
  const url = new URL(String(value || ''))
59
67
  return url.protocol === 'https:'
60
- || (url.protocol === 'http:' && isLoopbackAddress(url.hostname))
68
+ || (url.protocol === 'http:' && isLoopbackHostname(url.hostname))
61
69
  } catch {
62
70
  return false
63
71
  }
@@ -113,7 +121,7 @@ export function isTrustedSettingsRequest(request, ctx = null) {
113
121
  if (host && url.host.toLowerCase() === host.toLowerCase()) {
114
122
  return true
115
123
  }
116
- if (isLoopbackAddress(url.hostname) && remoteLoopback) {
124
+ if (isLoopbackHostname(url.hostname) && remoteLoopback) {
117
125
  return true
118
126
  }
119
127
  return false
@@ -129,7 +137,7 @@ export function isTrustedSettingsRequest(request, ctx = null) {
129
137
  if (host && url.host.toLowerCase() === host.toLowerCase()) {
130
138
  return true
131
139
  }
132
- if (isLoopbackAddress(url.hostname) && remoteLoopback) {
140
+ if (isLoopbackHostname(url.hostname) && remoteLoopback) {
133
141
  return true
134
142
  }
135
143
  return false
@@ -10,7 +10,7 @@ import { createRequire } from 'node:module'
10
10
  import { isSecureRemoteBaseUrl } from '../http.js'
11
11
 
12
12
  const require = createRequire(import.meta.url)
13
- let packageVersion = '0.6.27'
13
+ let packageVersion = '0.6.28'
14
14
  try {
15
15
  packageVersion = require('../../package.json').version || packageVersion
16
16
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-clinebot",
3
- "version": "0.6.27",
3
+ "version": "0.6.28",
4
4
  "description": "DeepSeek Harness companion for ClineBot / ClinePass: dynamic subscription models sync, quota exhaustion warnings, session metrics, dedicated settings page, live usage limits, and /cline slash-command.",
5
5
  "license": "MIT",
6
6
  "type": "module",