惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
P
Privacy International News Feed
Security Latest
Security Latest
H
Hacker News: Front Page
T
Tenable Blog
The Hacker News
The Hacker News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Security @ Cisco Blogs
Project Zero
Project Zero
O
OpenAI News
AI
AI
Spread Privacy
Spread Privacy
C
CERT Recently Published Vulnerability Notes
The Last Watchdog
The Last Watchdog
G
GRAHAM CLULEY
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Scott Helme
Scott Helme
Application and Cybersecurity Blog
Application and Cybersecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
CXSECURITY Database RSS Feed - CXSecurity.com
NISL@THU
NISL@THU
A
Arctic Wolf
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
C
Cyber Attacks, Cyber Crime and Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
Simon Willison's Weblog
Simon Willison's Weblog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Know Your Adversary
Know Your Adversary
Google Online Security Blog
Google Online Security Blog
罗磊的独立博客
L
LINUX DO - 最新话题
U
Unit 42
S
Security Affairs
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 【当耐特】
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
月光博客
月光博客
Engineering at Meta
Engineering at Meta
腾讯CDC
F
Full Disclosure
Cyberwarzone
Cyberwarzone
S
SegmentFault 最新的问题
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 司徒正美
The Cloudflare Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(secrets): enforce canonical secret refs · openclaw/openclaw@6bfe7a2
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -30,31 +30,37 @@ const secretInputSchema = z

3030

.union([

3131

z.string(),

3232

z.discriminatedUnion("source", [

33-

z.object({

34-

source: z.literal("env"),

35-

provider: providerSchema,

36-

id: z

37-

.string()

38-

.regex(

39-

ENV_SECRET_REF_ID_RE,

40-

'Env secret reference id must match /^[A-Z][A-Z0-9_]{0,127}$/ (example: "OPENAI_API_KEY").',

41-

),

42-

}),

43-

z.object({

44-

source: z.literal("file"),

45-

provider: providerSchema,

46-

id: z

47-

.string()

48-

.refine(

49-

isValidFileSecretRefId,

50-

'File secret reference id must be an absolute JSON pointer (example: "/providers/openai/apiKey"), or "value" for singleValue mode.',

51-

),

52-

}),

53-

z.object({

54-

source: z.literal("exec"),

55-

provider: providerSchema,

56-

id: z.string().refine(isValidExecSecretRefId, formatExecSecretRefIdValidationMessage()),

57-

}),

33+

z

34+

.object({

35+

source: z.literal("env"),

36+

provider: providerSchema,

37+

id: z

38+

.string()

39+

.regex(

40+

ENV_SECRET_REF_ID_RE,

41+

'Env secret reference id must match /^[A-Z][A-Z0-9_]{0,127}$/ (example: "OPENAI_API_KEY").',

42+

),

43+

})

44+

.strict(),

45+

z

46+

.object({

47+

source: z.literal("file"),

48+

provider: providerSchema,

49+

id: z

50+

.string()

51+

.refine(

52+

isValidFileSecretRefId,

53+

'File secret reference id must be an absolute JSON pointer (example: "/providers/openai/apiKey"), or "value" for singleValue mode.',

54+

),

55+

})

56+

.strict(),

57+

z

58+

.object({

59+

source: z.literal("exec"),

60+

provider: providerSchema,

61+

id: z.string().refine(isValidExecSecretRefId, formatExecSecretRefIdValidationMessage()),

62+

})

63+

.strict(),

5864

]),

5965

])

6066

.register(sensitive);

Original file line numberDiff line numberDiff line change

@@ -47,6 +47,34 @@ describe("provider auth env trust", () => {

4747

});

4848

});

4949
50+

it("buildApiKeyCredential rejects malformed object SecretRefs", async () => {

51+

const { buildApiKeyCredential } = await import("./provider-auth-helpers.js");

52+

const malformedRefs = [

53+

{ source: "env", provider: "default", id: "OPENAI_API_KEY", extra: "x" },

54+

{ source: "env", provider: "Default", id: "OPENAI_API_KEY" },

55+

{ source: "env", provider: "default", id: "openai_api_key" },

56+

{ source: "file", provider: "default", id: "providers/openai/apiKey" },

57+

{ source: "exec", provider: "vault", id: "vault/../api-key" },

58+

];

59+
60+

for (const ref of malformedRefs) {

61+

expect(() => buildApiKeyCredential("openai", ref as never)).toThrow(

62+

"API key SecretRef is invalid.",

63+

);

64+

}

65+

});

66+
67+

it("buildApiKeyCredential keeps invalid env-template strings as plaintext", async () => {

68+

const { buildApiKeyCredential } = await import("./provider-auth-helpers.js");

69+

const overlongEnvRef = `\${A${"B".repeat(128)}}`;

70+
71+

expect(buildApiKeyCredential("openai", overlongEnvRef)).toEqual({

72+

type: "api_key",

73+

provider: "openai",

74+

key: overlongEnvRef,

75+

});

76+

});

77+
5078

it("resolveRefFallbackInput excludes untrusted workspace plugin env vars", async () => {

5179

const { resolveRefFallbackInput } = await import("./provider-auth-ref.js");

5280

const config = { plugins: {} };

Original file line numberDiff line numberDiff line change

@@ -11,15 +11,16 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";

1111

import {

1212

coerceSecretRef,

1313

DEFAULT_SECRET_PROVIDER_ALIAS,

14+

parseEnvTemplateSecretRef,

1415

type SecretInput,

1516

type SecretRef,

1617

} from "../config/types.secrets.js";

1718

import type { OAuthCredentials } from "../llm/oauth.js";

1819

import { getProviderEnvVars } from "../secrets/provider-env-vars.js";

20+

import { isValidSecretRef } from "../secrets/ref-contract.js";

1921

import { normalizeSecretInput } from "../utils/normalize-secret-input.js";

2022

import type { SecretInputMode } from "./provider-auth-types.js";

2123
22-

const ENV_REF_PATTERN = /^\$\{([A-Z][A-Z0-9_]*)\}$/;

2324

type UpsertAuthProfileParams = Parameters<typeof upsertAuthProfileWithLock>[0];

2425
2526

const resolveAuthAgentDir = (agentDir?: string, config?: OpenClawConfig) =>

@@ -40,14 +41,6 @@ function buildEnvSecretRef(id: string): SecretRef {

4041

return { source: "env", provider: DEFAULT_SECRET_PROVIDER_ALIAS, id };

4142

}

4243
43-

function parseEnvSecretRef(value: string): SecretRef | null {

44-

const match = ENV_REF_PATTERN.exec(value);

45-

if (!match) {

46-

return null;

47-

}

48-

return buildEnvSecretRef(match[1]);

49-

}

50-
5144

function resolveProviderDefaultEnvSecretRef(provider: string, config?: OpenClawConfig): SecretRef {

5245

const envVars = getProviderEnvVars(provider, {

5346

...(config ? { config } : {}),

@@ -67,15 +60,25 @@ function resolveApiKeySecretInput(

6760

input: SecretInput,

6861

options?: ApiKeyStorageOptions,

6962

): SecretInput {

63+

if (input !== null && typeof input === "object") {

64+

const coercedRef = coerceSecretRef(input);

65+

if (!coercedRef || !isValidSecretRef(coercedRef)) {

66+

throw new Error("API key SecretRef is invalid.");

67+

}

68+

return coercedRef;

69+

}

7070

if (options?.secretInputMode === "plaintext") {

7171

return normalizeSecretInput(input);

7272

}

7373

const coercedRef = coerceSecretRef(input);

7474

if (coercedRef) {

75+

if (!isValidSecretRef(coercedRef)) {

76+

throw new Error("API key SecretRef is invalid.");

77+

}

7578

return coercedRef;

7679

}

7780

const normalized = normalizeSecretInput(input);

78-

const inlineEnvRef = parseEnvSecretRef(normalized);

81+

const inlineEnvRef = parseEnvTemplateSecretRef(normalized, DEFAULT_SECRET_PROVIDER_ALIAS);

7982

if (inlineEnvRef) {

8083

return inlineEnvRef;

8184

}

Original file line numberDiff line numberDiff line change

@@ -57,6 +57,21 @@ describe("exec SecretRef id parity", () => {

5757

return result.ok;

5858

}

5959
60+

function configAcceptsRef(ref: unknown): boolean {

61+

const result = validateConfigObjectRaw({

62+

models: {

63+

providers: {

64+

openai: {

65+

baseUrl: "https://api.openai.com/v1",

66+

apiKey: ref,

67+

models: [{ id: "gpt-5", name: "gpt-5" }],

68+

},

69+

},

70+

},

71+

});

72+

return result.ok;

73+

}

74+
6075

function planAcceptsExecRef(id: string): boolean {

6176

return isSecretsApplyPlan({

6277

version: 1,

@@ -75,7 +90,7 @@ describe("exec SecretRef id parity", () => {

7590

});

7691

}

7792
78-

function planAcceptsRef(ref: { source: "env" | "file" | "exec"; provider: string; id: string }) {

93+

function planAcceptsRef(ref: unknown) {

7994

return isSecretsApplyPlan({

8095

version: 1,

8196

protocolVersion: 1,

@@ -128,6 +143,19 @@ describe("exec SecretRef id parity", () => {

128143

expect(pluginSdkSecretInput.safeParse(ref).success).toBe(false);

129144

});

130145
146+

for (const ref of [

147+

{ source: "env", provider: "default", id: "OPENAI_API_KEY", extra: "x" },

148+

{ source: "file", provider: "default", id: "value", extra: "x" },

149+

{ source: "exec", provider: "vault", id: "vault/openai/api-key", extra: "x" },

150+

]) {

151+

it(`rejects non-canonical ${ref.source} refs with extra properties across config/plan/gateway/plugin`, () => {

152+

expect(configAcceptsRef(ref)).toBe(false);

153+

expect(planAcceptsRef(ref)).toBe(false);

154+

expect(validateGatewaySecretRef.Check(ref)).toBe(false);

155+

expect(pluginSdkSecretInput.safeParse(ref).success).toBe(false);

156+

});

157+

}

158+
131159

for (const id of [...VALID_EXEC_SECRET_REF_IDS, ...INVALID_EXEC_SECRET_REF_IDS]) {

132160

it(`keeps config/plan/gateway/plugin parity for exec id "${id}"`, () => {

133161

const expected = isValidExecSecretRefId(id);

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ import {

99

import {

1010

isValidExecSecretRefId,

1111

isValidFileSecretRefId,

12+

isValidSecretRef,

1213

validateExecSecretRefId,

1314

} from "./ref-contract.js";

1415

@@ -52,3 +53,19 @@ describe("exec secret ref id validation", () => {

5253

});

5354

});

5455

});

56+
57+

describe("secret ref validation", () => {

58+

it("rejects non-canonical refs with extra properties", () => {

59+

expect(isValidSecretRef({ source: "env", provider: "default", id: "OPENAI_API_KEY" })).toBe(

60+

true,

61+

);

62+

expect(

63+

isValidSecretRef({

64+

source: "env",

65+

provider: "default",

66+

id: "OPENAI_API_KEY",

67+

extra: "x",

68+

} as never),

69+

).toBe(false);

70+

});

71+

});

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,7 @@

11

/** Shared SecretRef grammar and validation helpers for config, schema, SDK, and gateway parity. */

22

import {

33

DEFAULT_SECRET_PROVIDER_ALIAS,

4+

isSecretRef,

45

isValidEnvSecretRefId,

56

type SecretRef,

67

type SecretRefSource,

@@ -135,6 +136,9 @@ export function isValidExecSecretRefId(value: string): boolean {

135136
136137

/** Validates a complete SecretRef against the shared provider/source/id grammar. */

137138

export function isValidSecretRef(ref: SecretRef): boolean {

139+

if (!isSecretRef(ref)) {

140+

return false;

141+

}

138142

if (!isValidSecretProviderAlias(ref.provider)) {

139143

return false;

140144

}