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

@neargate/cli

Latest version: v0.2.1

Overview

Last scanned
12 Nov 2026
Published
12 Nov 2026
npm package Publisher: freeairdropid
0 Stars
0 Forks
2 Versions
TypeScript Repo language

Scan summary

@neargate/cli was last scanned on 12 Nov 2026 at version 0.2.1. Risk score 45 of 100 (medium). High-severity rules fired.

  • Releases: 2 versions, all published on 12 Nov 2026.
  • Findings: 1 rule fired in version 0.2.1 (1 high). The score describes this version only.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.1 LATEST 12 Nov 2026 1 rule fired
0.0.0-stage 12 Nov 2026 Not shown

Rules fired in 0.2.1: 1

Findings

1 High

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

Encoded data placed in a DNS lookup

A DNS lookup command (nslookup, dig or host) takes its query name from a subshell that first encodes the data, for example with base64 or xxd. Encoding the name turns a lookup into a way to send data to the nameserver of the queried domain. Ordinary diagnostic lookups have no encoding step.

HIGH
Checking access…

🔒 Create a free account to see all 1 finding with descriptions and instance counts

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

README

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

@neargate/cli — the neargate CLI

Wrap any HTTP API into a paid x402 service on NEAR: HTTP 402 micropayments in native NEAR, with on-chain discovery and a payment-backed reputation score kept by the neargate-registry contract. One command turns your endpoint into a machine-payable service that AI agents can discover, pay and rate on their own.

The package installs one binary, neargate, and a library entry with the same commands as functions.

npm install -g @neargate/cli
neargate list

From a clone of the repository: npm install, then npm run neargate -- <command>. Without --mode mock the CLI works on NEAR testnet against the deployed registry neargate-app-registry.testnet and the hosted gateway. To pay from your own code instead, use @neargate/sdk.

How a paid call works

  1. The gateway answers an unpaid request with HTTP 402 and an x402 invoice: the price, a fixed 0.002 NEAR storage fee (the registry stores a record of every payment), the total to attach, a one-time nonce and the registry contract id.
  2. The buyer calls the registry's pay method with that nonce, attaching price + storage fee. The registry forwards the price to the seller's payment target.
  3. The buyer retries with the pay transaction as its X-PAYMENT proof. The gateway checks the payment on chain, serves the call and attests the outcome on chain; the score counts those attestations. A call the owner pays for itself is served but never attested.

Read the catalog

neargate list            # id  name  price(NEAR)  calls  tier  active
neargate status 1        # one service: record, price, trust tier, recent attestations

The read commands need no key.

Wrap your API (seller)

neargate wrap https://api.example.com/gold --price 0.5 --name "Gold Spot Feed" \
  --account seller.testnet --key-file ~/.near-credentials/testnet/seller.testnet.json \
  --gateway https://neargate-gateway-production.up.railway.app \
  --attestor neargate-app-gateway.testnet

--gateway is the base URL your gateway is reached at. The registry stores it for good. Without it, live wrap uses the hosted NearGate gateway, https://neargate-gateway-production.up.railway.app.

--attestor is the account allowed to record the service's attestations. It defaults to --account, but a live gateway attests as its own account, so name the gateway's account (the hosted gateway's is neargate-app-gateway.testnet); otherwise every attestation it sends is rejected and paid calls never count toward the score.

Before anything goes on chain, wrap resolves your key and checks that the payment target exists (it defaults to --account; a missing account would strand every payment). It then registers the service (registering attaches a 0.12 NEAR deposit) and maps your upstream on the gateway by signing an ownership challenge with the same key — no shared admin token. The upstream URL is only ever sent to the gateway. In mock mode the mapping goes through the gateway admin token instead.

Buy a call (buyer)

neargate buy 2 --account buyer.testnet --max 1

buy runs the whole exchange: fetch the 402 invoice, pay it with a registry pay call (price + 0.002 NEAR storage attached), retry with the transaction as proof, and print the result — the response body on stdout (pipeable), the receipt on stderr (what was paid, the payment tx, an explorer link).

--max caps the total a call attaches, price plus storage fee: above it the CLI refuses with BUDGET_EXCEEDED before anything is paid. Unknown or paused services also fail before any payment.

Use from any MCP agent

neargate mcp --account buyer.testnet

mcp serves NearGate as a Model Context Protocol stdio server. Tools: neargate_list_services, neargate_get_service, neargate_get_invoice (read-only, no key), neargate_escrow_balance (read-only: the prepaid escrow left, for the buyer account or any account) and neargate_buy (pays the 402 invoice in NEAR from the buyer key, capped by maxNear on the total attached; with fromEscrow: true it pays out of the prepaid escrow instead, which is what a key restricted by agent-key add can do). The buyer key is resolved only when neargate_buy runs (and by neargate_escrow_balance without an account), so the catalog tools work without one. Claude Desktop (claude_desktop_config.json):

{ "mcpServers": { "neargate": { "command": "neargate", "args": ["mcp", "--account", "buyer.testnet"] } } }

(With the global install. From a clone, use "command": "node" with "/path/to/repo/packages/cli/dist/bin.js" as the first argument; npm run build -w @neargate/cli produces it.)

Flags & environment

Precedence is flag > env var > built-in default.

Flag Env var Used by
--mode <mock\|live> AGENTGATE_MODE all (the CLI defaults to live)
--rpc <url> NEAR_RPC_URL live (default: the NEAR_NETWORK RPC)
--registry <contract id> REGISTRY_CONTRACT_ID live: the registry contract account
— NEAR_NETWORK testnet (default) or mainnet: default RPC and explorer, and the ~/.near-credentials/<network> folder
--account <id> SELLER_ACCOUNT_ID (wrap/pause/resume) · BUYER_ACCOUNT_ID (buy/mcp) live writes: the account you act as (mock: MOCK_SELLER_ACCOUNT / MOCK_BUYER_ACCOUNT)
--key-file <path> SELLER_KEY_PATH · BUYER_KEY_PATH live writes: that account's near-cli credentials JSON
— SELLER_PRIVATE_KEY · BUYER_PRIVATE_KEY live writes: an ed25519:… secret key instead of a file
--price <near> — wrap: price per call in NEAR (at least 0.000001; buyers also attach the 0.002 NEAR storage fee)
--max <near> — buy: cap on the total a call attaches (price + storage fee)
--gateway <url> — wrap (default in live mode: the hosted gateway; http://localhost:4021 in mock) · buy (default: the service's on-chain endpoint)
--admin-token <token> AGENTGATE_ADMIN_TOKEN mock wrap only: the gateway admin mapping

Key resolution for live writes, first match wins:

  1. SELLER_PRIVATE_KEY / BUYER_PRIVATE_KEY (ed25519:…). It takes precedence over --key-file, and the CLI notes it when both are set.
  2. --key-file <path>, else SELLER_KEY_PATH / BUYER_KEY_PATH: a near-cli credentials JSON (account_id, public_key, private_key) whose account_id must match the account.
  3. ~/.near-credentials/<NEAR_NETWORK>/<account>.json, where near login writes it.

The CLI warns when a key file is readable by group or others (chmod 600 it) and never prints key material. --key-file is a path, not a secret; --admin-token is a secret (visible in shell history and ps), so prefer its env var.

On an invalid value the CLI fails fast with a one-line message — e.g. error: SIGNER_MISSING: live mode needs a seller account — pass --account <id> or set SELLER_ACCOUNT_ID (…) — never a stack trace.

Commands

  • list — the on-chain catalog with scores and trust tiers
  • status <id> — one service: record, price, trust tier, recent attestations
  • wrap <url> --price <near> --name <name> — register a service and put a 402 paywall in front of an API (name up to 64 bytes, description up to 280 bytes)
  • buy <id> — pay a service's 402 invoice and print the response (--max caps the total; --from-escrow pays out of your prepaid escrow with pay_from_escrow, attaching nothing)
  • escrow deposit <near> / escrow withdraw <near> / escrow balance [account] — fund, drain and read your prepaid registry escrow (the first deposit keeps 0.002 NEAR as storage; withdrawing needs the full-access key)
  • agent-key add --allowance <near> — live only: add a function-call key restricted to pay_from_escrow on the registry, so an AI agent can spend your escrow and nothing else. The secret goes to ~/.near-credentials/<network>/<account>.neargate-agent.json (mode 0600, never overwritten); only the public key and the path are printed. The agent then runs neargate buy <id> --from-escrow --account <account> --key-file <that path>
  • mcp — serve NearGate as an MCP stdio server (agent tools: list / inspect / invoice / buy, with fromEscrow, and neargate_escrow_balance)
  • pause <id> / resume <id> — toggle a service you own
  • demo-accounts — mint faucet-funded buyer/seller accounts on the mock devnet (mock mode only)

Use it as a library

import { listServices, buyService } from '@neargate/cli';

The library entry exports every command as a function (wrapService, mapService, listServices, buyService, serviceStatus, setServiceActive, the escrow and agent-key functions) with its types. They take a chain client and a signer; the lower-level paying client and createNearGateChain are in @neargate/sdk.

Try it offline

From a clone, npm run demo runs the whole loop on an in-process mock chain — register, 402 invoice, pay, serve, attest, score — with no network access and no keys. npm run dev keeps the same mock stack up for the CLI (--mode mock), the buyer agent and the dashboard.

Notes

  • Node ≥ 22.22.2 required.

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 @neargate/cli

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

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

PolinRider Returns
Research

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

Frame 2085668439 (1)
Group 1261154229