Commit 2ae621777b

2ae621777bacad86f9d4aceeb33ed24f29300c56

parent: 702b2432b0

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-20 17:37 UTC

Refuse more node-only js in JavaScriptCore

Refuse top-level await and import/export, Error.stack, node's remaining
globals, unknown members of require and module, listing guarded objects,
inspecting the global object, and timers left by a session block. Report
an error thrown while inspecting a session's value. Leave a :cmd with
arguments to the runner.

Layout: unified · split

Sources/OrgApp/JavaScriptBlocks.swift +102 −21
@@ -145,7 +145,8 @@ public enum JavaScriptBlocks {
145145 }
146146
147147 /// Runs `source` where the session's earlier scripts ran, as `vm.runInThisContext` does;
148 /// with `value`, the result is its completion value as `util.inspect` prints it.
148 /// with `value`, the result is its completion value as `util.inspect` prints it. A block
149 /// that leaves a timer is refused.
149150 func session(_ source: String, value: Bool, run: Run) throws -> BabelOutput {
150151 try lock.withLock {
151152 output.stdout = ""
@@ -157,9 +158,15 @@ public enum JavaScriptBlocks {
157158 if let exception = output.exception {
158159 node.invokeMethod("failed", withArguments: [exception])
159160 } else if value, let completion {
160 result = node.invokeMethod("inspect", withArguments: [completion]).toString()
161 let inspected = node.invokeMethod("inspect", withArguments: [completion])
162 if let exception = output.exception {
163 node.invokeMethod("failed", withArguments: [exception])
164 } else {
165 result = inspected?.toString()
166 }
161167 }
162 runTimers(run)
168 // node's session returns before its timers run, and they print later.
169 node.invokeMethod("settle", withArguments: [])
163170 return try finish(result: result)
164171 }
165172 }
@@ -196,16 +203,25 @@ public enum JavaScriptBlocks {
196203 function out(fd, text) {
197204 if (!state.dead) write(fd, text.toWellFormed());
198205 }
199 // Members a script may use; any other is refused rather than answered differently.
200 const guarded = new WeakSet();
201 function guard(target, name) {
206 // Members a script may use, its own and those in `extra`; any other, and listing them, is
207 // refused rather than answered differently.
208 const ownProperty = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
209 const guarded = new WeakMap();
210 function guard(target, name, extra = []) {
211 const known = (t, key) => typeof key === 'symbol' || ownProperty(t, key) || extra.includes(key);
212 const member = (t, key) => { if (!known(t, key)) refuse(`${name}.${String(key)}`); };
202213 const proxy = new Proxy(target, {
203 get(t, key, receiver) {
204 if (typeof key === 'symbol' || key in t) return Reflect.get(t, key, receiver);
205 refuse(`${name}.${key}`);
206 },
214 get(t, key, receiver) { member(t, key); return Reflect.get(t, key, receiver); },
215 has(t, key) { member(t, key); return Reflect.has(t, key); },
216 set(t, key, value, receiver) { member(t, key); return Reflect.set(t, key, value, receiver); },
217 defineProperty(t, key, descriptor) { member(t, key); return Reflect.defineProperty(t, key, descriptor); },
218 deleteProperty(t, key) { member(t, key); return Reflect.deleteProperty(t, key); },
219 getOwnPropertyDescriptor(t, key) { member(t, key); return Reflect.getOwnPropertyDescriptor(t, key); },
220 ownKeys() { refuse(`the members of ${name}`); },
221 getPrototypeOf() { refuse(`the prototype of ${name}`); },
222 setPrototypeOf() { refuse(`the prototype of ${name}`); },
207223 });
208 guarded.add(proxy);
224 guarded.set(proxy, name);
209225 return proxy;
210226 }
211227 // The script's proxies, target and handler, or null once revoked: JavaScriptCore can't tell
@@ -339,7 +355,8 @@ public enum JavaScriptBlocks {
339355 function formatValue(ctx, value, recurseTimes, typedArray) {
340356 if (typeof value !== 'object' && typeof value !== 'function') return formatPrimitive(value, ctx);
341357 if (value === null) return 'null';
342 if (guarded.has(value)) refuse('util.inspect of console, process or util');
358 if (guarded.has(value)) refuse(`util.inspect of ${guarded.get(value)}`);
359 if (value === globalThis) refuse('util.inspect of the global object');
343360 const context = value;
344361 let proxyCount = 0;
345362 let proxy = proxies.get(value);
@@ -1207,24 +1224,25 @@ public enum JavaScriptBlocks {
12071224 },
12081225 }, name);
12091226 }
1210 const process = guard({ stdout: stream(1, 'process.stdout'), stderr: stream(2, 'process.stderr') }, 'process');
1227 const process = guard({ stdout: stream(1, 'process.stdout'), stderr: stream(2, 'process.stderr'), [Symbol.toStringTag]: 'process' }, 'process');
12111228 const util = guard({
12121229 inspect,
12131230 format: (...args) => formatWithOptions(undefined, args),
12141231 formatWithOptions: (options, ...args) => formatWithOptions(options, args),
12151232 }, 'util');
12161233 const modules = { process, util };
1217 function require(id) {
1234 const require = guard(function require(id) {
12181235 const name = typeof id === 'string' && id.startsWith('node:') ? id.slice(5) : id;
12191236 if (Object.prototype.hasOwnProperty.call(modules, name)) return modules[name];
12201237 const error = new Error(`Cannot find module '${id}'`);
12211238 error.code = 'MODULE_NOT_FOUND';
12221239 throw error;
1223 }
1240 }, 'require', ['call', 'apply', 'bind']);
12241241 const print = (fd) => (...args) => out(fd, formatWithOptions(undefined, args) + '\n');
12251242 const console = guard({
12261243 log: print(1), info: print(1), debug: print(1), warn: print(2), error: print(2),
12271244 dir(object, options) { out(1, inspect(object, { customInspect: false, ...options }) + '\n'); },
1245 [Symbol.toStringTag]: 'console',
12281246 }, 'console');
12291247
12301248 // Timers run after the script, in order of when they are due, as Node's event loop runs them.
@@ -1269,8 +1287,15 @@ public enum JavaScriptBlocks {
12691287 try { return `Uncaught ${inspect(error)}`; } catch { return 'Uncaught exception'; }
12701288 }
12711289
1290 const AsyncFunction = (async function () {}).constructor;
1291 function moduleOnly(source) {
1292 if (/^\s*(import\s*[\w{*'"]|export\s)|\bimport\s*\.\s*meta\b/m.test(source)) return true;
1293 try { new AsyncFunction(source); } catch { return false; }
1294 try { new Function(source); return false; } catch { return true; }
1295 }
1296
12721297 const globals = {
1273 require, console, process, global: globalThis, Proxy: ProxyConstructor, module: { exports: {} }, __filename: '[stdin]', __dirname: '.',
1298 require, console, process, global: globalThis, Proxy: ProxyConstructor, module: guard({ exports: {} }, 'module'), __filename: '[stdin]', __dirname: '.',
12741299 setTimeout: (callback, delay, ...args) => schedule(callback, delay, args, false),
12751300 setInterval: (callback, delay, ...args) => schedule(callback, delay, args, true),
12761301 clearTimeout: clear, clearInterval: clear,
@@ -1283,19 +1308,69 @@ public enum JavaScriptBlocks {
12831308 for (const [name, value] of Object.entries(globals)) {
12841309 Object.defineProperty(globalThis, name, { value, writable: true, configurable: true, enumerable: false });
12851310 }
1286 for (const name of ['Buffer', 'setImmediate', 'clearImmediate', 'structuredClone', 'atob', 'btoa', 'performance', 'fetch',
1287 'crypto', 'navigator', 'URL', 'URLSearchParams', 'TextEncoder', 'TextDecoder', 'AbortController', 'AbortSignal',
1288 'Event', 'EventTarget', 'Blob', 'Headers', 'Request', 'Response', 'FormData', 'WebSocket', 'MessageChannel',
1289 'BroadcastChannel']) {
1311 // Node 26's globals that JavaScriptCore lacks.
1312 for (const name of [
1313 'AbortController', 'AbortSignal', 'AsyncDisposableStack', 'atob', 'Blob', 'BroadcastChannel', 'btoa', 'Buffer',
1314 'ByteLengthQueuingStrategy', 'clearImmediate', 'CloseEvent', 'CompressionStream', 'CountQueuingStrategy', 'Crypto',
1315 'crypto', 'CryptoKey', 'CustomEvent', 'DecompressionStream', 'DisposableStack', 'DOMException', 'ErrorEvent', 'Event',
1316 'EventTarget', 'fetch', 'File', 'FormData', 'Headers', 'localStorage', 'MessageChannel', 'MessageEvent', 'MessagePort',
1317 'Navigator', 'navigator', 'Performance', 'performance', 'PerformanceEntry', 'PerformanceMark', 'PerformanceMeasure',
1318 'PerformanceObserver', 'PerformanceObserverEntryList', 'PerformanceResourceTiming', 'QuotaExceededError',
1319 'ReadableByteStreamController', 'ReadableStream', 'ReadableStreamBYOBReader', 'ReadableStreamBYOBRequest',
1320 'ReadableStreamDefaultController', 'ReadableStreamDefaultReader', 'Request', 'Response', 'sessionStorage',
1321 'setImmediate', 'SharedArrayBuffer', 'Storage', 'structuredClone', 'SubtleCrypto', 'SuppressedError', 'Temporal',
1322 'TextDecoder', 'TextDecoderStream', 'TextEncoder', 'TextEncoderStream', 'TransformStream',
1323 'TransformStreamDefaultController', 'URL', 'URLPattern', 'URLSearchParams', 'WebSocket', 'WritableStream',
1324 'WritableStreamDefaultController', 'WritableStreamDefaultWriter'
1325 ]) {
12901326 if (!(name in globalThis)) {
12911327 Object.defineProperty(globalThis, name, { get() { refuse(name); }, configurable: true });
12921328 }
12931329 }
12941330
1331 // JavaScriptCore's stack text isn't V8's, so errors get none and reading one is refused. In
1332 // node an error's own keys include `stack`.
1333 Error.stackTraceLimit = 0;
1334 const refusing = (name) => ({ get() { refuse(name); }, set() { refuse(name); }, configurable: true });
1335 Object.defineProperty(Error, 'stackTraceLimit', { ...refusing('Error.stackTraceLimit'), enumerable: true });
1336 Object.defineProperty(Error, 'captureStackTrace', refusing('Error.captureStackTrace'));
1337 Object.defineProperty(Error.prototype, 'stack', {
1338 get() { refuse('Error.stack'); },
1339 set(value) { Object.defineProperty(this, 'stack', { value, writable: true, configurable: true }); },
1340 configurable: true,
1341 });
1342 const errorLike = (v) => v === Error.prototype || isError(v);
1343 function refuseErrors(object, name, test) {
1344 object[name] = new RealProxy(object[name], {
1345 apply(target, self, args) {
1346 if (test(self, args)) refuse("an error's own properties");
1347 return Reflect.apply(target, self, args);
1348 },
1349 });
1350 }
1351 for (const [object, name] of [[Object, 'getOwnPropertyNames'], [Object, 'getOwnPropertyDescriptors'], [Reflect, 'ownKeys']]) {
1352 refuseErrors(object, name, (self, [v]) => errorLike(v));
1353 }
1354 for (const [object, name] of [[Object, 'getOwnPropertyDescriptor'], [Object, 'hasOwn'], [Reflect, 'getOwnPropertyDescriptor']]) {
1355 refuseErrors(object, name, (self, [v, key]) => key === 'stack' && errorLike(v));
1356 }
1357 for (const name of ['hasOwnProperty', 'propertyIsEnumerable']) {
1358 refuseErrors(Object.prototype, name, (self, [key]) => key === 'stack' && errorLike(self));
1359 }
1360
12951361 return {
12961362 // A script run as `node` runs standard input; an uncaught error ends it.
12971363 main(source) {
1298 try { evaluate(source); } catch (error) { uncaught(error); }
1364 try {
1365 evaluate(source);
1366 } catch (error) {
1367 // node runs a script that doesn't parse as one as an ES module, when that parses.
1368 if (error instanceof SyntaxError && moduleOnly(source)) {
1369 if (!state.refused) state.refused = 'top-level await, import or export';
1370 } else {
1371 uncaught(error);
1372 }
1373 }
12991374 },
13001375 begin() {
13011376 state.dead = false;
@@ -1305,6 +1380,12 @@ public enum JavaScriptBlocks {
13051380 },
13061381 // After a session's script: its error, or its value as the session writes it.
13071382 failed(error) { uncaught(error); },
1383 // Drops a session's timers, which would print after the block in node, and refuses the block.
1384 settle() {
1385 if (state.timers.length === 0) return;
1386 state.timers = [];
1387 if (!state.refused) state.refused = 'a timer in a session';
1388 },
13081389 inspect(value) { return inspect(value); },
13091390 // Runs the next timer that is due: the milliseconds until one is, 0 after running one,
13101391 // or -1 when none is left to wait for.
Sources/OrgPrograms/Programs.swift +3 −2
@@ -8,10 +8,11 @@ public struct Programs: ProgramRunning {
88 public init() {}
99
1010 public func runBabel(_ job: BabelJob, fileDirectory: URL) async throws -> BabelOutput {
11 // js in JavaScriptCore when node (or `:cmd`) isn't installed.
11 // js in JavaScriptCore when node (or `:cmd`) isn't installed. A `:cmd` with arguments runs
12 // as written, since JavaScriptCore can't take node's options.
1213 switch job.runner {
1314 case .process(let executable, _), .session(_, let executable, _):
14 if !BabelRunner.installed(executable), let output = try await JavaScriptBlocks.run(job, directory: fileDirectory) { return output }
15 if !executable.contains(where: \.isWhitespace), !BabelRunner.installed(executable), let output = try await JavaScriptBlocks.run(job, directory: fileDirectory) { return output }
1516 case .emacs:
1617 break
1718 }
Tests/OrgAppTests/JavaScriptBlocksTests.swift +42 −5
@@ -66,6 +66,12 @@ struct JavaScriptBlocksTests {
6666 "setTimeout(() => { throw new TypeError('in timer'); }, 1); setTimeout(() => console.log('not reached'), 5)",
6767 "var x = 5; console.log(globalThis.x, this === globalThis, typeof module, __filename, global === globalThis)",
6868 "console.log(JSON.stringify({a: 1, b: [1, 2]}, null, 2), [3, 1, 2].sort(), 0.1 + 0.2)",
69 // Every global of node's is here or refused.
70 "console.log(Object.getOwnPropertyNames(globalThis).sort().join(' '))",
71 "console.log(Object.prototype.toString.call(process), Object.prototype.toString.call(console), typeof require, require.name, require.length)",
72 "module.exports = 5; console.log(module.exports, exports, typeof module)",
73 "const e = new TypeError('x'); e.stack = 's'; console.log(e.stack, 'stack' in e, Object.keys(e), JSON.stringify(e), String(e))",
74 "class Stack { constructor() { this.stack = []; } }; const s = new Stack(); s.stack.push(1); console.log(s.stack, s)",
6975 ]
7076
7177 /// The values a block returns, printed by `util.inspect`, and what `console` and timers
@@ -137,13 +143,33 @@ struct JavaScriptBlocksTests {
137143
138144 @Test func whatNodeAloneHasIsRefused() async throws {
139145 let folder = FileManager.default.temporaryDirectory
140 for (body, what) in [("return new Error('x')", "util.inspect of an Error"), ("return Promise.resolve(1)", "util.inspect of a Promise"),
141 ("return Buffer.from('a')", "Buffer"), ("return process.env.HOME", "process.env"),
142 ("console.table([1])", "console.table")] {
143 await #expect(throws: Babel.Failure.message("This block uses \(what), which runs only in node.")) {
144 try await JavaScriptBlocks.run(Self.plan("#+begin_src js\n\(body)\n#+end_src\n"), directory: folder)
146 let module = "top-level await, import or export", stack = "an error's own properties"
147 for (header, body, what) in [
148 ("", "return new Error('x')", "util.inspect of an Error"), ("", "return Promise.resolve(1)", "util.inspect of a Promise"),
149 ("", "return Buffer.from('a')", "Buffer"), ("", "return process.env.HOME", "process.env"), ("", "console.table([1])", "console.table"),
150 (" :results output", "console.log(await Promise.resolve(5))", module), (" :results output", "for await (const x of [1]) console.log(x)", module),
151 (" :results output", "import util from 'util'; console.log(util.format('%d', 3))", module),
152 (" :results output", "console.log(import.meta.url)", module), (" :results output", "export const x = 1", module),
153 ("", "return new Error('x').stack", "Error.stack"), (" :results output", "try { null.x } catch (e) { console.log(e.stack) }", "Error.stack"),
154 ("", "return Error.stackTraceLimit", "Error.stackTraceLimit"), ("", "const o = {}; Error.captureStackTrace(o); return o", "Error.captureStackTrace"),
155 ("", "return Object.getOwnPropertyNames(new Error('x'))", stack), ("", "return Reflect.ownKeys(new RangeError('x'))", stack),
156 ("", "return new Error('x').hasOwnProperty('stack')", stack), ("", "return Object.hasOwn(new Error('x'), 'stack')", stack),
157 ("", "return require('util').inspect(Error.prototype, {showHidden: true})", stack),
158 ("", "return typeof Temporal", "Temporal"), ("", "return new SharedArrayBuffer(2)", "SharedArrayBuffer"),
159 ("", "return typeof DOMException", "DOMException"), ("", "return typeof ReadableStream", "ReadableStream"),
160 ("", "return 'env' in process", "process.env"), ("", "return Object.keys(console).length", "the members of console"),
161 ("", "return Object.getPrototypeOf(process)", "the prototype of process"), ("", "process.exitCode = 1", "process.exitCode"),
162 ("", "return process.toString()", "process.toString"), ("", "return typeof require.resolve", "require.resolve"),
163 ("", "return require.cache", "require.cache"), ("", "return module.id", "module.id"), ("", "return typeof module.paths", "module.paths"),
164 (" :results output", "console.log(globalThis)", "util.inspect of the global object"), ("", "return this", "util.inspect of the global object"),
165 ("", "return require", "util.inspect of require"), ("", "return module", "util.inspect of module"),
166 ] {
167 await #expect(throws: Babel.Failure.message("This block uses \(what), which runs only in node."), "\(body)") {
168 try await JavaScriptBlocks.run(Self.plan("#+begin_src js\(header)\n\(body)\n#+end_src\n"), directory: folder)
145169 }
146170 }
171 // A syntax error that isn't a module's is reported, as node reports it.
172 #expect(try await JavaScriptBlocks.run(Self.plan("#+begin_src js :results output\nconsole.log(1); return 2\n#+end_src\n"), directory: folder)?.status == 1)
147173 #expect(try await JavaScriptBlocks.run(Self.plan("#+begin_src python\n1\n#+end_src\n"), directory: folder) == nil)
148174 await #expect(throws: Babel.Failure.message("No folder \(folder.appendingPathComponent("nowhere").path) for :dir.")) {
149175 try await JavaScriptBlocks.run(Self.plan("#+begin_src js :dir nowhere\nreturn 1\n#+end_src\n"), directory: folder)
@@ -160,6 +186,17 @@ struct JavaScriptBlocksTests {
160186 #expect(try await run("", "throw new Error('boom')") == BabelOutput(stdout: "", stderr: "Error: boom\n", status: 1))
161187 #expect(try await run("", "[x, {y}]")?.resultFile == "[ 41, { y: 2 } ]")
162188 #expect(try await run(" :results output", "console.log(x); x") == BabelOutput(stdout: "41\n"))
189 // node's session returns before a timer runs, and it prints later; a block that leaves one is refused.
190 await #expect(throws: Babel.Failure.message("This block uses a timer in a session, which runs only in node.")) {
191 try await run(" :results output", "var z = 1; setInterval(() => console.log('tick'), 10)")
192 }
193 await #expect(throws: Babel.Failure.message("This block uses a timer in a session, which runs only in node.")) {
194 try await run("", "setTimeout(() => {}, 1).unref(); 2")
195 }
196 #expect(try await run("", "const t = setTimeout(() => {}, 1); clearTimeout(t); z")?.resultFile == "1")
197 // An error while printing the value is reported, and there is no result.
198 let thrown = try await run("", "({[Symbol.for('nodejs.util.inspect.custom')]() { throw new TypeError('boom') }})")
199 #expect(thrown == BabelOutput(stdout: "", stderr: "TypeError: boom\n", status: 1))
163200 let other = try Folder()
164201 #expect(try await JavaScriptBlocks.run(Self.plan("#+begin_src js :session work\ntypeof x\n#+end_src\n"), directory: other.url)?.resultFile == "'undefined'")
165202 }
Tests/OrgProgramsTests/ProgramsTests.swift +8
@@ -187,6 +187,14 @@ struct JavaScriptFallbackTests {
187187 #expect(try await run("#+begin_src js :cmd no-such-node :session s\n6 * 7\n#+end_src\n").resultFile == "42")
188188 }
189189
190 /// A `:cmd` with arguments isn't run in JavaScriptCore, which can't take node's options.
191 @Test func leavesACommandWithArgumentsToTheRunner() async throws {
192 let error = await #expect(throws: BabelRunner.Failure.self) {
193 try await run("#+begin_src js :cmd \"no-such-node --no-warnings\" :results output\nconsole.log(1)\n#+end_src\n")
194 }
195 #expect(error?.description == "no-such-node --no-warnings isn't installed.")
196 }
197
190198 @Test(.enabled(if: BabelRunner.installed("node")))
191199 func usesNodeWhenInstalled() async throws {
192200 #expect(try await run("#+begin_src js :results output\nconsole.log(typeof require('fs').readFileSync)\n#+end_src\n").stdout == "function\n")
docs/manual/guide/11-code-blocks.org +3 −3
@@ -107,15 +107,15 @@ The [[file:../install.org][Mac App Store version]] starts no programs, so only E
107107
108108** JavaScript in JavaScriptCore
109109
110In the Mac App Store version and on iOS, =js= and =javascript= blocks run in JavaScriptCore, the JavaScript engine built into macOS and iOS. The download version uses it when =node=, or the program in =:cmd=, isn't installed. A block runs as =node= runs a program on standard input, and its output and result are what node gives:
110In the Mac App Store version and on iOS, =js= and =javascript= blocks run in JavaScriptCore, the JavaScript engine built into macOS and iOS. The download version uses it when =node=, or the program in =:cmd=, isn't installed; a =:cmd= with options, such as =node --no-warnings=, never runs in JavaScriptCore. A block runs as =node= runs a program on standard input, and its output and result are what node gives:
111111
112112- =console.log=, =console.info= and =console.debug= write to the output, =console.warn= and =console.error= to the error output, and =console.dir= prints with =util.inspect=. =process.stdout.write= and =process.stderr.write= write text.
113113- =require('util')= has =inspect=, =format= and =formatWithOptions=, which print values as Node 26 prints them. =require('process')= has =stdout= and =stderr=.
114- =setTimeout=, =setInterval=, their =clear= functions and =queueMicrotask= work. Timers run after the program, in the order node runs them, and the run ends when none is left.
114- =setTimeout=, =setInterval=, their =clear= functions and =queueMicrotask= work. Timers run after the program, in the order node runs them, and the run ends when none is left. In a =:session=, a block that leaves a timer set is refused, since node's session returns before the timer runs and prints its output later.
115115- An uncaught error ends the run with status 1 and writes its name and message to the error output, such as "ReferenceError: hline is not defined".
116116- =require= of any other module fails as it does for a module node can't find: "Error: Cannot find module 'fs'".
117117
118A block that uses something only node has fails with "This block uses /name/, which runs only in node.", rather than giving a different result. That covers other members of =process=, =util= and =console= (=process.env=, =console.table=), Node's other globals (=Buffer=, =fetch=, =URL=, =TextEncoder=, =setImmediate=, =structuredClone=), and printing an =Error=, a =Promise= or an iterator with =util.inspect=, whose text in node comes from its own engine. There is no access to files, the network or other programs.
118A block that uses something only node has fails with "This block uses /name/, which runs only in node.", rather than giving a different result. That covers other members of =process=, =util=, =console=, =require= and =module= (=process.env=, =console.table=, =require.resolve=, =module.id=) and listing their members; Node's other globals (=Buffer=, =fetch=, =URL=, =TextEncoder=, =setImmediate=, =structuredClone=, =SharedArrayBuffer=, =Temporal=, =ReadableStream=); top-level =await= and =import= or =export= statements, which node runs as an ES module; an error's =stack=, =Error.stackTraceLimit=, =Error.captureStackTrace= and listing an error's own properties; and printing an =Error=, a =Promise=, an iterator or the global object with =util.inspect=, whose text in node comes from its own engine. There is no access to files, the network or other programs.
119119
120120Some things still differ from node:
121121