Skip to content
EXTENDED DOCUMENTATION

Security Audit Notes

This document tracks the current security hardening baseline for NeoOS Services and the checks that must pass before release.

Current Automated Coverage

  • Root dependency audit is guarded by
    text
    scripts/check-root-audit-allowlist.mjs
    so known CityOfZion baseline findings stay explicit instead of silently expanding.
  • Repository verification runs script tests, control-plane tests, worker checks/tests, relayer checks/tests, web consistency checks, web unit tests, and web production build.
  • Web security headers are defined in
    text
    apps/web/next.config.mjs
    and covered by
    text
    apps/web/__tests__/security-headers.test.ts
    .
  • Documentation navigation is covered by
    text
    apps/web/__tests__/docs-navigation.test.ts
    , including static docs routes and extended Markdown-backed
    text
    /docs/r/*
    pages.
  • Contract artifact generation is validated by
    text
    scripts/contract-build-regressions.test.mjs
    when
    text
    dotnet
    and the pinned
    text
    nccs
    compiler are available.

Manual Release Checklist

Before a production release, verify:

  1. text
    npm run verify:repo
    passes in a clean checkout.
  2. The contract CI job installs the pinned Neo C# compiler and runs
    text
    contracts/build.sh
    successfully.
  3. No secrets, private keys, service-role keys, tokens, or connection strings are committed or printed in logs.
  4. Production environment variables are scoped by network and deployment target.
  5. Callback, relayer, paymaster, and txproxy allowlists are reviewed against the intended deployment contracts.
  6. Any live smoke tests use dedicated testnet funds/accounts and do not reuse production signer material.

Public API Route Policy

The following

text
apps/web
routes are intentionally public and are hardened against enumeration and DoS abuse. They are rate-limited by
text
apps/web/lib/rate-limit.ts
(Upstash-backed when configured, in-memory otherwise) and enforce Zod input validation via
text
apps/web/lib/validators.ts
.

RouteAuthenticationRate limitValidation
text
/api/workflows
Runtime/admin token required60 req/minNo unexpected query params
text
/api/policies
Runtime/admin token required60 req/minNo unexpected query params
text
/api/networks
Public (no token)60 req/minNo unexpected query params
text
/api/neodid/resolve
Runtime/admin token required30 req/min
text
did
and optional
text
format

Authentication uses the shared runtime-token check in

text
apps/web/lib/control-plane-auth.ts
(
text
MORPHEUS_RUNTIME_TOKEN
,
text
NITRO_API_TOKEN
, or
text
NITRO_SHARED_SECRET
presented as a Bearer token or
text
x-morpheus-runtime-token
header). Unauthenticated requests to protected routes receive
text
401 { error: 'unauthorized' }
; malformed inputs receive
text
400 { error: 'invalid query parameters' }
; rate-limited requests receive
text
429 { error: 'Too many requests', retryAfter }
. Responses include
text
X-RateLimit-Limit
,
text
X-RateLimit-Remaining
, and
text
X-RateLimit-Reset
headers.

Known Environment Caveat

Local developer machines that do not have

text
dotnet
and
text
~/.dotnet/tools/nccs
installed will skip the contract compilation regression test. CI must still enforce contract compilation using the pinned compiler before release.

TEE Child Process Hardening

The Nitro worker spawns untrusted scripts and WASM modules in child processes. In production the following settings must be enforced:

  • The Node.js permission model is ON by default for script/WASM child processes. It can only be disabled by the explicit dev override
    text
    MORPHEUS_ALLOW_UNSANDBOXED_CHILDREN=1
    , and that override is IGNORED when
    text
    NODE_ENV=production
    (fail closed). The retired
    text
    SCRIPT_CHILD_ENABLE_PERMISSION_MODEL
    toggle no longer has any effect.
  • text
    SCRIPT_CHILD_ALLOW_NET
    must contain specific hostnames or IP addresses. Wildcards (
    text
    *
    ),
    text
    0.0.0.0/0
    ,
    text
    ::/0
    , and CIDR blocks are rejected at startup.
  • text
    SCRIPT_CHILD_ALLOW_FS_READ
    and
    text
    SCRIPT_CHILD_ALLOW_FS_WRITE
    should be limited to the paths required by the workload.
  • The Node.js permission model is applied automatically via
    text
    buildPermissionExecArgv
    in
    text
    workers/nitro-worker/src/platform/script-runner.js
    and
    text
    wasm-runner.js
    .

Cron Diagnostic Policy

The

text
/api/cron/feed
endpoint returns a generic
text
401 { error: 'Unauthorized' }
response to unauthenticated callers. Diagnostic details (header presence, request metadata, and configuration checks) are logged server-side only and never included in the response body.

CURRENT DESIGNUPDATED FOR DUAL-CVM ARCHITECTURE
NeoOS Services