Commit Graph
117 Commits
Author SHA1 Message Date
nocobase[bot] 7dffcf42d9 chore(versions): 😊 publish v2.1.0-beta.36 2026-05-21 16:45:24 +00:00
nocobase[bot] 1cf7650c8e chore(versions): 😊 publish v2.1.0-beta.35 2026-05-19 16:38:51 +00:00
nocobase[bot] 874200448b chore(versions): 😊 publish v2.1.0-beta.34 2026-05-18 17:19:35 +00:00
Junyi 7050e1754c fix(plugin-workflow-javascript): bundle quickjs runtime package (#9503) 2026-05-17 17:44:07 +08:00
nocobase[bot] 834b5a9398 chore(versions): 😊 publish v2.1.0-beta.33 2026-05-15 15:43:03 +00:00
nocobase[bot] a7f112525b chore(versions): 😊 publish v2.1.0-beta.32 2026-05-13 05:14:47 +00:00
nocobase[bot] d558825b82 chore(versions): 😊 publish v2.1.0-beta.30 2026-05-11 22:57:52 +00:00
nocobase[bot] afa65997c8 chore(versions): 😊 publish v2.1.0-beta.29 2026-05-10 14:55:37 +00:00
chenos 4b08e40d86 fix: version 2.1.0-beta.28 2026-05-10 21:53:19 +08:00
nocobase[bot] e3c0f6ea8f chore(versions): 😊 publish v2.1.0-beta.27 2026-05-09 06:16:41 +00:00
nocobase[bot] dfc05449de Merge branch 'next' into develop 2026-05-08 09:58:03 +00:00
7b505bc7d8 refactor(plugin-workflow-javascript): change to quickjs to avoid compatible issues in isolated-vm (#9250)
* refactor(plugin-workflow-javascript): change to quickjs to avoid compatible issues in isolated-vm

* fix(plugin-workflow-javascript): add missed engine file

* docs(workflow-javascript): update QuickJS default engine docs

Agent-Logs-Url: https://github.com/nocobase/nocobase/sessions/d490091a-3d75-4d30-beaf-994201cf2a4c

Co-authored-by: mytharcher <525658+mytharcher@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mytharcher <525658+mytharcher@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-08 17:57:29 +08:00
nocobase[bot] 1340547cbb chore(versions): 😊 publish v2.1.0-beta.26 2026-05-07 16:11:59 +00:00
nocobase[bot] 695a2bd196 chore(versions): 😊 publish v2.1.0-alpha.30 2026-05-06 10:07:02 +00:00
nocobase[bot] 1352db9524 chore(versions): 😊 publish v2.1.0-beta.25 2026-05-06 07:28:52 +00:00
nocobase[bot] 59c78ce2aa chore(versions): 😊 publish v2.1.0-alpha.29 2026-05-04 14:17:25 +00:00
nocobase[bot] 17f23f7b27 chore(versions): 😊 publish v2.1.0-alpha.28 2026-05-03 23:50:08 +00:00
nocobase[bot] b6745c63f5 chore(versions): 😊 publish v2.1.0-alpha.27 2026-05-03 08:37:29 +00:00
nocobase[bot] cbc65da19c Merge branch 'next' into develop 2026-04-30 09:32:19 +00:00
mytharcher 423d017767 fix(plugin-workflow-javascript): update version of isolated-vm for node 22 compatibility 2026-04-30 17:31:37 +08:00
nocobase[bot] 6672710792 chore(versions): 😊 publish v2.1.0-beta.24 2026-04-29 08:05:44 +00:00
nocobase[bot] cbbe8c14b6 chore(versions): 😊 publish v2.1.0-beta.23 2026-04-28 15:44:30 +00:00
nocobase[bot] 727032ecd5 chore(versions): 😊 publish v2.1.0-alpha.26 2026-04-28 15:07:11 +00:00
nocobase[bot] 3827ed0145 Merge branch 'next' into develop 2026-04-28 12:20:56 +00:00
mytharcher b2639988e3 fix(plugin-workflow-javascript): use mock url for axios test 2026-04-28 20:19:52 +08:00
nocobase[bot] 164da6b891 chore(versions): 😊 publish v2.1.0-beta.22 2026-04-28 10:07:01 +00:00
nocobase[bot] 80b6c7ce97 chore(versions): 😊 publish v2.1.0-alpha.25 2026-04-27 21:54:34 +00:00
nocobase[bot] 89c7e100ab chore(versions): 😊 publish v2.1.0-beta.21 2026-04-27 16:51:42 +00:00
nocobase[bot] a0ef97ea60 chore(versions): 😊 publish v2.1.0-beta.20 2026-04-27 01:11:47 +00:00
nocobase[bot] faa671263c chore(versions): 😊 publish v2.1.0-alpha.24 2026-04-26 11:15:28 +00:00
nocobase[bot] a4fb537261 chore(versions): 😊 publish v2.1.0-beta.19 2026-04-26 10:39:38 +00:00
chenos d560d0ac7e chore(versions): 😊 publish v2.1.0-beta.18 2026-04-26 15:12:30 +08:00
nocobase[bot] 5606fd73fe chore(versions): 😊 publish v2.1.0-alpha.23 2026-04-25 01:17:32 +00:00
nocobase[bot] 90dcddc6cd chore(versions): 😊 publish v2.1.0-beta.17 2026-04-24 15:17:08 +00:00
nocobase[bot] 6da6997799 chore(versions): 😊 publish v2.1.0-beta.16 2026-04-24 10:26:31 +00:00
nocobase[bot] 31f72666e0 chore(versions): 😊 publish v2.1.0-alpha.22 2026-04-24 09:55:55 +00:00
nocobase[bot] 789d5ed345 chore(versions): 😊 publish v2.1.0-alpha.21 2026-04-23 22:10:43 +00:00
nocobase[bot] afe3409b03 Merge branch 'next' into develop 2026-04-21 01:57:55 +00:00
nocobase[bot] 9469ded2e5 Merge branch 'main' into next 2026-04-21 01:57:22 +00:00
Junyi 46fd9be1d3 Revert "fix(plugin-workflow-javascript): fix security issue (#9084)" (#9176)
This reverts commit f73f0d76cd.
2026-04-21 09:56:52 +08:00
Junyi 9c76d8bbad fix(plugin-workflow-javascript): fix error thrown from editor (#9169) 2026-04-20 21:34:40 +08:00
nocobase[bot] d8ac1e3339 chore(versions): 😊 publish v2.1.0-alpha.20 2026-04-20 10:33:38 +00:00
nocobase[bot] 80669c438d chore(versions): 😊 publish v2.1.0-beta.14 2026-04-20 09:04:05 +00:00
nocobase[bot] d87f4c0971 chore(versions): 😊 publish v2.0.40 2026-04-20 00:52:04 +00:00
nocobase[bot] 171cb7d51c chore(versions): 😊 publish v2.1.0-alpha.19 2026-04-19 04:03:09 +00:00
nocobase[bot] 0e810ddcb2 Merge branch 'next' into develop 2026-04-18 11:57:00 +00:00
nocobase[bot] b30ec62ff7 Merge branch 'main' into next 2026-04-18 11:56:29 +00:00
JunyiandClaude Sonnet 4.6 f73f0d76cd fix(plugin-workflow-javascript): fix security issue (#9084)
* fix(plugin-workflow-javascript): fix security issue

* fix(plugin-workflow-javascript): fix path assertion under windows in test case

* fix(plugin-workflow-javascript): sanitize module function return values to close return-value bypass

Extend the sandbox hardening to also sanitize objects returned by wrapped
module functions (including Promise resolutions), so that prototype-chain
traversal via return values (e.g. crypto.createHash().update.constructor)
cannot reach the host Function constructor.

- Add sanitizeReturnValue() that sanitizes sync return values and
  thenable resolutions before they re-enter the sandbox
- Wire sanitizeReturnValue() into the function wrapper inside
  sanitizeForSandbox() so every module function call goes through it
- Walk the prototype chain up to MAX_PROTO_DEPTH=3 in the object branch
  so methods defined on the object's own prototype (e.g.
  Hash.prototype.update, Stats.prototype.isFile) are also exposed as
  hardened null-proto wrappers rather than raw host-realm functions
- Add resolveProperty() helper that reads accessor-descriptor properties
  (getters) by invoking desc.get — required for lazy-getter module
  exports such as mathjs.evaluate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(plugin-workflow-javascript): sanitize exceptions and Promises from module calls

Address two P1 bypasses reported in PR review:

P1.1 — Module function exceptions: the function wrapper now wraps fn(...args)
in try/catch and calls sanitizeError() before re-throwing, so a host-realm
Error caught inside the sandbox (e.g. from path.join(null)) no longer exposes
e.constructor.constructor → host Function.

P1.2 — Host Promise exposed to sandbox: sanitizeReturnValue() no longer returns
the raw host Promise (whose .constructor chain reaches host Function). It now
builds a null-prototype clean thenable that intercepts onFulfilled/onRejected
callbacks, sanitizing resolved values via sanitizeForSandbox() and errors via
sanitizeError() before they reach sandbox code.

Also adds sanitizeError() helper shared by both fixes, and extends the test
suite with:
- P1.1 security test: path.join(null) throw chain is blocked
- P1.2 security test: fs.promises.readdir Promise constructor chain is blocked
- Functional regression: fs.promises.readdir still returns usable data after
  sanitization (note: result is a null-proto object; Array.isArray returns false
  but indexed access and .length work — raw Arrays cannot be returned safely as
  their __proto__.constructor chain leads back to host Function)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(plugin-workflow-javascript): restore array iteration for sanitized module return values

Arrays returned by module functions were converted to null-prototype plain
objects, which broke for...of, spread ([...arr]), and destructuring — the
three most common ways to consume arrays in modern JavaScript.

Add a special-case Array branch in sanitizeForSandbox() that:
- copies indexed elements and length to a null-proto object (preserving
  security: no Array.prototype.constructor chain exposure)
- attaches a safe Symbol.iterator backed by a null-proto iterator whose
  .next() results are also null-proto objects — no host-realm chain at any
  level, so the iterator cannot be used to reach the host Function constructor

After this change:
  const entries = await fs.promises.readdir('.')
  for (const e of entries) { ... }   // works
  const arr = [...entries]           // works; arr is a real sandbox Array
  const [first] = entries            // works
  entries.length / entries[0]        // works (unchanged)
  Array.isArray(entries)             // still false (by design, host Array is unsafe)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(plugin-workflow-javascript): json round-trip script return value before postMessage

The script node result is always stored in the database as JSON and re-parsed
by subsequent workflow nodes, so JavaScript-specific semantics (null prototypes,
Symbols, functions) carry no meaning at the postMessage boundary.

Add toJsonResult() that applies JSON.parse(JSON.stringify(value)) to the final
script return value before postMessage, ensuring:
- null-prototype objects produced by sanitizeForSandbox are converted to proper
  plain objects / Arrays (Array.isArray works correctly in downstream nodes)
- function-valued properties are silently dropped (expected for serialized data)
- the result is always structured-clone compatible

Note: sanitizeForSandbox + Symbol.iterator are still required for values used
within the script during execution (e.g. iterating a module-returned array
before returning the result). toJsonResult() only normalises the boundary value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(plugin-workflow-javascript): fix security issues

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 19:55:54 +08:00
nocobase[bot] b03cab07e7 chore(versions): 😊 publish v2.0.39 2026-04-17 22:30:52 +00:00
nocobase[bot] 4ee6379274 chore(versions): 😊 publish v2.1.0-alpha.18 2026-04-17 05:03:11 +00:00