Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@beetlebug/ztcl

Latest version: v1.0.0-beta.1

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: beetlebugorg
0 Stars
0 Forks
3 Versions
325 Downloads
Zig Repo language

Scan summary

@beetlebug/ztcl was last scanned on 28 Nov 2026 at version 1.0.0-beta.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions, all published within 4 days (25–28 Nov 2026).
  • Findings: 1 rule fired in version 1.0.0-beta.1 (3 instances: 3 low). The score describes this version only.
  • Downloads: 325 downloads.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.0-beta.1 LATEST 28 Nov 2026 1 rule fired
0.2.0-beta 25 Nov 2026 1 rule fired
0.0.0-stage 25 Nov 2026 Not shown

Rules fired in 1.0.0-beta.1: 1

Findings

3 Low

Findings for v1.0.0-beta.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

WebAssembly module included

The package includes a WebAssembly (.wasm) module. It cannot be reviewed as source, but it runs sandboxed inside the JavaScript runtime and can access only what the host code gives it. WebAssembly is common in parsers, codecs and cryptography libraries. Shown for awareness.

LOW
Checking access…

🔒 Create a free account to see all 3 findings with descriptions and instance counts

The score describes 1.0.0-beta.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@beetlebug/ztcl

ztcl is a Tcl interpreter in Zig. This package has the WebAssembly build and a small ES module over it. A page or a Node.js program runs Tcl scripts with an exact compute limit and a memory limit, so it can run scripts that its users write.

  • The module is 871 KB, or about 300 KB with gzip. It has no imports.
  • It runs in a browser, in a Web Worker, and in Node.js 22.3 or later.
  • It has types for TypeScript.

The docs are at beetlebug.org/ztcl. The source is at github.com/beetlebugorg/ztcl.

Install

npm install @beetlebug/ztcl

In a page with no build step

<script type="module">
import { Interp } from "https://cdn.jsdelivr.net/npm/@beetlebug/ztcl@1.0.0-beta.1/ztcl.mjs";

const tcl = await Interp.create({ computeLimit: 1_000_000, memLimit: 64 << 20 });
console.log(tcl.eval("expr {6 * 7}").result); // 42
</script>

The module loads ztcl.wasm from its own folder on the CDN. WorkerInterp also works from the CDN: it starts its worker from a small blob script that imports ztcl-worker.mjs. The jsDelivr form https://cdn.jsdelivr.net/npm/@beetlebug/ztcl/+esm resolves ztcl.wasm in the same folder, but no test runs it.

With a bundler

import { Interp, WorkerInterp } from "@beetlebug/ztcl";

const tcl = await Interp.create({
  computeLimit: 1_000_000,
  memLimit: 64 << 20,
  onOutput: (text) => console.log(text),
});
const r = tcl.eval("puts hello; expr {6 * 7}");
// r is { ok: true, result: "42", output: "hello\n" }

The module finds ztcl.wasm with new URL("./ztcl.wasm", import.meta.url), and WorkerInterp starts its worker with new Worker(new URL("./ztcl-worker.mjs", import.meta.url)). vite build copies both files. For the Vite dev server, keep the package out of the dependency step, so the two files stay together:

// vite.config.js
export default { optimizeDeps: { exclude: ["@beetlebug/ztcl"] } };

The tests of the package run Vite 7. Webpack 5 and Rollup also have support for the new URL form, but no test runs them. With another tool, copy ztcl.wasm to your site and give its URL to Interp.create(url, options).

In Node.js

import { Interp } from "@beetlebug/ztcl";

const tcl = await Interp.create({ computeLimit: 1_000_000, memLimit: 64 << 20 });
const r = tcl.eval("proc sq {x} {expr {$x * $x}}; sq 12");
console.log(r.result); // 144
tcl.close();

A worker that a person can stop

A script on the main thread blocks the page until it ends or hits a limit. WorkerInterp runs scripts in a Web Worker, and stop() ends the script at once.

import { WorkerInterp } from "@beetlebug/ztcl";

const tcl = new WorkerInterp({ memLimit: 64 << 20 });
const r = await tcl.eval(code);    // the page stays live
cancel.onclick = () => tcl.stop(); // r is { ok: false, result: "stopped" }

The next eval after stop starts a new worker with a new interpreter. @beetlebug/ztcl/worker is the worker script, for a page that makes the worker itself.

API

Export Use
Interp.create(source?, options?) Makes an interpreter in a new WebAssembly instance.
interp.eval(script) Runs a script. Returns { ok, result, output }. result is the value, or the error message when ok is false.
interp.computeLimit, interp.memLimit The limits of the next eval.
interp.memorySize The size of the linear memory in bytes. The memory never shrinks, so this is the peak.
interp.close() Frees the interpreter.
new WorkerInterp(wasmUrl?, options?) An interpreter in a Web Worker. eval returns a promise. reset() makes a new interpreter. stop() ends the worker.
compile(source?) Compiles the module one time, for many interpreters.
wasmURL() The URL of the ztcl.wasm file of the package.
run(source, options?) Runs the scripts of a bundle from ztcl build --wasm in a new interpreter.
interp.run() Runs the scripts of a bundle. Returns { ok, result, output }.

The options are computeLimit, memLimit, onOutput, and allow. allow: ["file"] turns on source and open for reading on the files of a bundle. computeLimit is the compute units of each eval, and null (the default) is no limit. memLimit is in bytes, and the default is 2 GiB. onOutput(text) gets the text of puts when each eval ends.

A source is a URL, a file path in Node.js, a Response, bytes, or a WebAssembly.Module. With no source, the module is the ztcl.wasm file of the package.

One interpreter keeps its procs and variables from one eval to the next. Each Interp has its own instance and its own memory, so close and a new Interp give the memory back.

A bundle

ztcl build --wasm -o app.wasm app.tcl writes a copy of the ztcl.wasm of the package with the script in it. --embed PATH adds read-only files under //zipfs:/app/. The limits apply as for eval. See Bundle a script.

import { run } from "@beetlebug/ztcl";

const r = await run(new URL("./app.wasm", import.meta.url), { computeLimit: 1_000_000, allow: ["file"] });
console.log(r.output);

Threads

The entry @beetlebug/ztcl/threads runs the capability thread with one worker for each ztcl thread. In Node.js and on a cross-origin isolated page, each command of the Thread package works. On a page without cross-origin isolation, only the commands that do not wait work. The option allow turns on capabilities: thread is the default, and clock, package, interp, and in the shared mode event can also be on. clock and the event loop read the clock of the host. See WebAssembly.

import { ThreadInterp } from "@beetlebug/ztcl/threads";

const t = await ThreadInterp.create({ allow: ["thread"] });
const r = await t.eval("thread::send [thread::create] {expr {6 * 7}}");
t.close();

Limits and capabilities

  • Compute units. Each command and each loop pass uses one compute unit. At the limit, the script stops with the error compute limit reached. catch and try cannot catch it. The same script stops at the same point in each browser and in Node.js.
  • Memory. At the limit, the script stops with the error the script used too much memory. catch cannot catch it. The linear memory can grow to about twice the limit.
  • No host access. The module has the interpreter only, with no JIT. It has no command that reaches the host: no files, sockets, exec, clock, interp, or event loop. coroutine returns an error.
  • Output. puts goes into a buffer. eval returns the text, and onOutput gets it when the script ends.

Put only numbers or quoted lists into the text of a command. A value from a user can contain [, $, or ;.

License

BSD-2-Clause. ztcl.wasm contains the Zig standard library, with ports of code from musl, Go, and ARM optimized-routines. See NOTICE and the licenses folder.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @beetlebug/ztcl

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Frame 2085668439 (1)
Group 1261154229