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

@documentdb-js/shell-runtime

Latest version: v0.9.1

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
npm package Publisher: sivethe, tnaum-developer, xgerman
33 Stars
22 Forks
2 Versions
714 Downloads
TypeScript Repo language

Scan summary

@documentdb-js/shell-runtime was last scanned on 24 Nov 2026 at version 0.9.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions; the latest was published on 24 Nov 2026.
  • Findings: No rules fired in version 0.9.1.
  • Downloads: 714 downloads.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.9.1 LATEST 24 Nov 2026 No rules fired
0.8.1 21 May 2026 Not shown

No rules fired in 0.9.1

Findings

Findings for v0.9.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.

The score describes 0.9.1; other versions have their own rules, not their own score.

README

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

@documentdb-js/shell-runtime

DocumentDB is an open-source document database built on PostgreSQL, with native BSON support, rich indexing, and vector search. It uses the MongoDB-compatible wire protocol, runs locally with Docker, and is MIT licensed.

This package is a sandboxed JavaScript evaluation engine for DocumentDB — provides shell command handling, result transformation, and help generation. Supports both single-shot evaluation (playground/scratchpad style) and persistent REPL sessions (interactive shell style).

Pre-1.0 notice — The API may change between minor versions until 1.0.0 is released. If you depend on this package and need stability guarantees sooner, please open an issue and let us know.

Features

  • JavaScript evaluation — executes user code in a sandboxed vm.Context against a target database
  • Command interception — routes shell commands (help, exit, cls) before evaluation
  • Result transformation — normalizes evaluation results into a protocol-agnostic ShellEvaluationResult
  • Help text — generates DocumentDB-specific help output
  • Service provider — bridges the evaluation engine to the MongoDB Node.js driver

Installation

npm install @documentdb-js/shell-runtime

Requires mongodb ≥ 6.0.0 as a peer dependency.

Migrating to 0.9.0

  • ESM-only. The package declares "type": "module" and an exports map. The allowed entry points are . and ./package.json. Deep imports into dist/ are no longer allowed.
  • Node.js >=22.18.0 required. This is the engines.node floor. CommonJS consumers can still use require(): Node.js supports loading ESM from 20.19+ and 22.12+, and this package has no top-level await. That runtime support does not lower the package's Node.js requirement.
  • TypeScript (tested with 6.0.3). Static imports from CommonJS-format .ts files fail with TS1479 under module: node16 or node18. The same imports compile under node20 and nodenext. Under node16, await import() inside an async function also compiles. Use that dynamic import or convert the consumer to ESM (.mts or "type": "module").

Eval Modes

The runtime supports two modes via the persistent option:

Mode persistent Behavior
Fresh context false (default) New ShellInstanceState + vm.Context per evaluate() call. No variable leakage between runs.
Persistent context true Reuses the same ShellInstanceState, ShellEvaluator, and vm.Context across calls. Variables, cursor state (it), and the db reference persist between evaluations.

Usage

import { MongoClient } from 'mongodb';
import { DocumentDBShellRuntime } from '@documentdb-js/shell-runtime';

// The caller owns the MongoClient — create, connect, and close it yourself.
// The runtime never opens or closes the connection.
const mongoClient = new MongoClient(connectionString);
await mongoClient.connect();

// Constructor signature:
//   new DocumentDBShellRuntime(mongoClient, callbacks?, options?)
//
//   callbacks: { onConsoleOutput?, onLog? }
//   options:   { persistent?, productName?, displayBatchSize? }

// Fresh context (playground mode — default)
const playground = new DocumentDBShellRuntime(mongoClient, {
  onConsoleOutput: (output) => console.log(output),
});
const result = await playground.evaluate('db.users.find({})', 'myDatabase');

// Persistent context (interactive shell mode)
const shell = new DocumentDBShellRuntime(
  mongoClient,
  { onConsoleOutput: (output) => console.log(output) }, // callbacks
  { persistent: true }, // options
);
await shell.evaluate('const x = 1', 'myDatabase');
await shell.evaluate('x + 1', 'myDatabase'); // returns 2 — variable survived

// Dispose the runtime when done — this does NOT close the MongoClient.
shell.dispose();

// Close the MongoClient when the session is over.
// The runtime intentionally never closes it, so the same client
// can be reused across multiple evaluate() calls and runtime instances.
await mongoClient.close();

Components

File Role
DocumentDBShellRuntime Main entry point — evaluate(code, databaseName, options)
CommandInterceptor Pre-eval command routing (regex-based detection)
ResultTransformer Post-eval result normalization (cursor iteration, cursorHasMore extraction)
DocumentDBServiceProvider Evaluation engine ↔ MongoDB driver bridge (leverages @mongosh internals)
HelpProvider Help text generation
types.ts Public API types (ShellEvaluationResult, ShellRuntimeOptions, etc.)

Origin

This package was developed while building features for the DocumentDB VS Code extension, which remains the primary consumer. The runtime is designed to work with any Node.js application that has a MongoClient and needs to evaluate shell-style JavaScript against a DocumentDB database.

License

MIT

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 @documentdb-js/shell-runtime

References

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

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

PHP2Shell, Day 5 93.6% of Measurable Instances Still Unpatched (1)
Vulnerability Insights

PHP2Shell, Day 5: The Panic Hasn’t Turned Into Patching

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Frame 2085668439 (1)
Group 1261154229