mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-20 17:34:59 +00:00
Secrets: reject exec SecretRef traversal ids across schema/runtime/gateway (#42370)
* Secrets: harden exec SecretRef validation and reload LKG coverage * Tests: harden exec fast-exit stdin regression case * Tests: align lifecycle daemon test formatting with oxfmt 0.36
This commit is contained in:
24
src/test-utils/secret-ref-test-vectors.ts
Normal file
24
src/test-utils/secret-ref-test-vectors.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export const VALID_EXEC_SECRET_REF_IDS = [
|
||||
"vault/openai/api-key",
|
||||
"vault:secret/mykey",
|
||||
"providers/openai/apiKey",
|
||||
"a..b/c",
|
||||
"a/.../b",
|
||||
"a/.well-known/key",
|
||||
`a/${"b".repeat(254)}`,
|
||||
] as const;
|
||||
|
||||
export const INVALID_EXEC_SECRET_REF_IDS = [
|
||||
"",
|
||||
" ",
|
||||
"a/../b",
|
||||
"a/./b",
|
||||
"../b",
|
||||
"./b",
|
||||
"a/..",
|
||||
"a/.",
|
||||
"/absolute/path",
|
||||
"bad id",
|
||||
"a\\b",
|
||||
`a${"b".repeat(256)}`,
|
||||
] as const;
|
||||
Reference in New Issue
Block a user