Back to skill

Security audit

Civic Nexus

Security checks for vulnerabilities and agentic risk

Overview

This looks like a real Nexus bridge, but it gives agents very broad access to connected services and handles a bearer token without enough destination or action safeguards.

Install only if you trust Civic Nexus, the configured MCP URL, and every connected service profile exposed through the token. Use a least-privilege Nexus token/profile, keep NEXUS_URL on the official HTTPS Nexus endpoint, avoid unpinned global or npx execution paths, and require explicit review before the agent performs write, delete, posting, database, email, or storage actions.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
nexus-tool-runner.ts:33
Finding
Bearer Token May Be Transmitted to an Arbitrary or Plaintext Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `nexus-tool-runner.ts`, lines 33-42 and 209-216 **Vulnerability Type**: Unvalidated credential destination **Risk Level**: High ### Vulnerable Code ```ts constructor(url: string, token: string) { const userAgent = `openclaw/1.0.0 node/${process.version.slice(1)} (${process.platform}; ${process.arch})`; this.transport = new StreamableHTTPClientTransport(new URL(url), { requestInit: { headers: { Authorization: `Bearer ${token}`, "User-Agent": userAgent, }, }, }); ``` ```ts const url = process.env.NEXUS_URL ?? "https://nexus.civic.com/hub/mcp"; const token = process.env.NEXUS_TOKEN; if (!token) { console.error("Error: NEXUS_TOKEN environment variable is required"); console.error("\nSet it with:"); console.error(' export NEXUS_TOKEN="your-token-here"'); process.exit(1); } ``` ### Technical Analysis The application obtains the server URL directly from the `NEXUS_URL` environment variable and constructs a transport from it without validating its protocol, hostname, port, or network destination. The `NEXUS_TOKEN` credential is then unconditionally inserted into the `Authorization` header. Consequently, a manipulated configuration can cause the token to be sent to an attacker-controlled endpoint. The code also accepts an `http://` URL, which can expose the bearer token to passive or active network interception. Destinations such as loopback, link-local, or private-network addresses are not rejected either. Exploitation requires the attacker to influence the environment or configuration that supplies `NEXUS_URL`, or to convince the user to configure a malicious endpoint. ### Attack Path 1. An attacker changes the configured `NEXUS_URL` or provides setup instructions containing an attacker-controlled URL. 2. The user or agent invokes `nexus-tool-runner.ts` with a valid `NEXUS_TOKEN`. 3. The script reads the malicious URL without validating its scheme or hostn ...[truncated 1050 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require `https:` for every endpoint that receives `NEXUS_TOKEN`; reject plaintext HTTP. 2. Allowlist the expected Civic Nexus hostname, such as `nexus.civic.com`, by default. 3. If custom MCP servers are a legitimate feature, require explicit user approval before sending credentials to a non-default hostname. 4. Bind credentials to approved origins and never reuse the Civic Nexus token for arbitrary custom endpoints. 5. Reject loopback, link-local, private-network, and otherwise restricted destinations unless a documented use case explicitly requires them. 6. Revalidate the destination after redirects and prevent credentials from being forwarded across origins. 7. Consider implementing a validation function similar to: ```ts function validateNexusUrl(rawUrl: string): URL { const url = new URL(rawUrl); if (url.protocol !== "https:") { throw new Error("NEXUS_URL must use HTTPS"); } if (url.hostname !== "nexus.civic.com") { throw new Error("NEXUS_URL must use the approved Nexus hostname"); } return url; } ``` 8. Use the validated `URL` object when creating the transport, and add automated tests covering HTTP URLs, deceptive subdomains, alternate ports, redirects, loopback addresses, and private-network destinations. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:42
Finding
Unpinned Package Installation and Potential On-Demand Registry Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 42 and lines 76-85 **Vulnerability Type**: Unsafe dependency installation and execution guidance **Risk Level**: Medium ### Vulnerable Code ```bash npm install -g mcporter ``` ```bash # List tools npx tsx {baseDir}/nexus-tool-runner.ts --list # Search tools npx tsx {baseDir}/nexus-tool-runner.ts --search gmail # Get tool schema npx tsx {baseDir}/nexus-tool-runner.ts --schema google-gmail-search_gmail_messages # Call a tool npx tsx {baseDir}/nexus-tool-runner.ts --call google-gmail-search_gmail_messages --args '{"query": "is:unread"}' ``` ### Technical Analysis The setup instructions install `mcporter` globally without specifying an exact reviewed version or integrity constraint. The installed code therefore depends on whichever package release the registry resolves at installation time. The fallback instructions repeatedly invoke `npx tsx`. When a trusted local `tsx` installation is present, `npx` normally resolves that binary locally. If the dependency has not been installed or is unavailable, however, `npx` may offer to retrieve and execute the package from the configured registry. The documented command does not enforce frozen-lockfile installation, offline execution, or local-only binary resolution. The project lockfile contains integrity information for its resolved dependencies, but the documented global installation and possible on-demand `npx` retrieval do not guarantee use of those locked artifacts. ### Attack Path 1. A user follows the Skill setup or fallback instructions without first performing a frozen-lockfile installation. 2. The global installation resolves the current `mcporter` release, or `npx` cannot find a local `tsx` binary and retrieves one from the configured registry. 3. An attacker has compromised the relevant package, package maintainer account, registry path, or dependency resolution environment. 4. The package manager installs or executes the attacker- ...[truncated 975 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `mcporter` to an exact reviewed version instead of installing an unconstrained latest release. 2. Avoid global installation. Declare required tools as project dependencies and execute their local binaries. 3. Require dependency installation through the committed lockfile: ```bash pnpm install --frozen-lockfile ``` 4. Replace potentially downloading `npx` commands with local-only execution, for example: ```bash pnpm exec --offline tsx {baseDir}/nexus-tool-runner.ts --list ``` 5. Configure CI and deployment environments to reject lockfile changes and unexpected registry sources. 6. Use a trusted registry configuration, package integrity verification, dependency review, and automated vulnerability scanning. 7. Avoid running package installation commands with administrative privileges. 8. Document that package execution must stop rather than download code when the expected local binary is missing. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (31)

Credential Access

High
Category
Privilege Escalation
Content
### 1. Get your Nexus credentials

1. Go to [nexus.civic.com](https://nexus.civic.com) and sign in
2. Get your **MCP URL** and **access token** from your profile settings

### 2. Configure in OpenClaw
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. Get your Nexus credentials

1. Go to [nexus.civic.com](https://nexus.civic.com) and sign in
2. Get your **MCP URL** and **access token** from your profile settings

### 2. Configure in OpenClaw
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 1. Get your Nexus credentials

1. Go to [nexus.civic.com](https://nexus.civic.com) and sign in
2. Get your **MCP URL** and **access token** from your profile settings

### 2. Configure in OpenClaw
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill requests sensitive environment variables and instructs the agent to execute external commands, but it does not declare explicit tool scope or allowed-tools constraints. That makes the skill's operational boundaries ambiguous and increases the chance an agent will use broader execution capabilities than intended when handling credentials and remote integrations.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The instruction to use Nexus whenever the user asks to interact with external services is broad and lacks clear boundaries on which services, operations, or trust checks are permitted. In a bridge to 100+ integrations, vague activation criteria can lead an agent to overuse the skill, access unrelated data, or perform unintended actions on high-value services.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
Using `npx tsx` without pinning a specific package version introduces a supply-chain risk because package resolution may fetch whatever version is current at execution time. If a compromised or malicious release is published, the agent could execute attacker-controlled code in the local environment with access to Nexus credentials.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
This invocation again relies on unpinned `npx tsx`, which can download and run an unverified package version at runtime. In a skill that handles bearer tokens and external service access, that creates a meaningful path to credential theft or arbitrary code execution.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The schema lookup command still depends on unpinned `npx tsx`, preserving the same supply-chain execution risk. Even read-only seeming operations are dangerous because the package itself executes before the script and can access environment variables and filesystem contents.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
Calling tools through `npx tsx` without version pinning exposes the host to arbitrary code from the npm ecosystem at the moment of use. Because this command may run with access to `NEXUS_TOKEN`, compromise could lead directly to unauthorized access to Gmail, databases, or other connected systems.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The continuation flow also uses unpinned `npx tsx`, so the same supply-chain vulnerability applies during OAuth follow-up operations. That is especially sensitive because these flows often occur after privileged authorization has just been granted.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Content
* - List all available tools
 * - Search tools by name/description
 * - View tool schemas
 * - Call any tool with arguments
 *
 * Usage:
 *   npx tsx nexus-tool-runner.ts --list
Confidence
97% confidence
Finding
The stated design goal is to 'Call any tool with arguments,' which indicates unrestricted access to all server-exposed capabilities using the holder's Nexus token. Because this skill connects to a large integration hub, broad tool access can enable execution of destructive database actions, inbox/search access, external API operations, or other sensitive actions without local authorization controls.

Static analysis

No suspicious patterns detected.