Back to skill

Security audit

Api Gateway

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed API-gateway integration, but it includes unsafe credential-handling examples and broad local command/file authority that need review before use.

Install only if you trust Maton and are comfortable granting it access to connected third-party services. Before use, correct the api.maton.0 example, avoid embedding MATON_API_KEY in trigger destination JSON or command history, prefer scoped or short-lived credentials, and consider installing the CLI in an isolated, pinned environment rather than globally.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:201
Finding

Bearer Token Exposed Through Command-Line Arguments and Persistent Trigger Configuration

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 201–205
Vulnerability Type: Credential exposure through command arguments and stored configuration
Risk Level: High

Vulnerable Code

bash
maton trigger create --source google-mail --event-type email.received \
  --connection-id {connection_id} \
  --parameter labels=INBOX \
  --destination '{"url":"https://api.maton.ai/slack/api/chat.postMessage","method":"POST","name":"slack","headers":{"Authorization":"Bearer '"$MATON_API_KEY"'","Content-Type":"application/json"},"body_template":"{\"channel\": \"C0123456789\", \"text\": \"New email: <dynamic configuration>\"}"}'

Technical Analysis

The shell expands MATON_API_KEY before invoking the Maton CLI. The resulting bearer token becomes part of the process argument vector and the trigger destination configuration.

Depending on the operating system, shell, CLI implementation, and gateway behavior, the expanded secret may be exposed through:

  • Process inspection tools and process accounting
  • Shell command history
  • CLI diagnostic or error output
  • Local audit and telemetry logs
  • Remotely persisted trigger definitions
  • Gateway administration interfaces or configuration exports

Authentication to the declared gateway is required for the Skill's functionality, but embedding a reusable credential in a command argument and persistent JSON configuration is not necessary. This also conflicts with the Skill's instruction at line 128 not to print or log MATON_API_KEY.

Attack Path

  1. A user or Agent follows the documented trigger-creation example.
  2. The shell replaces $MATON_API_KEY with the actual bearer token.
  3. The expanded token is supplied as part of the CLI process arguments.
  4. The CLI may transmit and persist the token inside the trigger definition.
  5. An attacker with access to process metadata, shell history, logs, trigger configuration, or gateway administration da ...[truncated 785 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not place bearer tokens in command-line arguments or serialized trigger definitions.
  • Use a server-side connection or secret reference, such as a connection ID whose credentials are resolved only at execution time.
  • If direct secret transfer is unavoidable, use a protected standard-input channel, operating-system credential store, or restricted file descriptor rather than the process argument vector.
  • Ensure trigger APIs reject literal authorization secrets and accept only opaque credential references.
  • Redact authorization values from CLI errors, debug output, telemetry, audit logs, and administrative interfaces.
  • Prevent shell-history persistence for commands handling sensitive values.
  • Encrypt stored trigger configuration and tightly restrict access to it.
  • Rotate any token previously used with this example and review gateway logs and trigger definitions for exposure.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:188
Finding

Bearer Token Sent to an Incorrect and Undeclared Hostname

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 188–193
Vulnerability Type: Sensitive credential transmission to an invalid destination
Risk Level: High

Vulnerable Code

python
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.0/query?q=SELECT+Id,Name+FROM+Contact+LIMIT+10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))

Technical Analysis

The Skill declares https://api.maton.ai/ as its fixed gateway, but this example sends the request to https://api.maton.0/. The code explicitly attaches MATON_API_KEY as an Authorization bearer token before opening the URL.

The malformed hostname will generally fail normal public DNS resolution, causing a denial of functionality rather than immediate credential disclosure. However, security must not depend on resolution failure. Local DNS search behavior, proxy infrastructure, host overrides, or a compromised resolver could route this unintended hostname to an attacker-controlled service. In that case, the bearer token would be transmitted directly to the unintended endpoint over HTTPS if certificate validation succeeds for the resolved name.

This behavior exceeds the Skill's declared network scope because the credential is intended only for api.maton.ai, while the example targets a different origin.

Attack Path

  1. A user or Agent executes the documented Python example with MATON_API_KEY configured.
  2. The code constructs a request for the unintended api.maton.0 hostname.
  3. The bearer token is attached to the request before destination validation.
  4. An attacker influences DNS, proxy routing, or local hostname resolution so that the unintended hostname reaches infrastructure under the attacker's control.
  5. The attacker presents a certificate accepted by the client for that hostname.
  6. The request is t ...[truncated 651 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace https://api.maton.0/ with the exact approved gateway origin, https://api.maton.ai/, and use the correct Salesforce route.
  • Centralize the gateway base URL rather than duplicating literal hostnames across examples.
  • Validate the request origin against a strict allowlist before attaching Authorization.
  • Reject URLs with unexpected schemes, hosts, ports, user-information fields, or ambiguous hostname encodings.
  • Disable automatic cross-origin redirects for authenticated requests, or explicitly remove the Authorization header whenever the origin changes.
  • Add tests that assert credentials are attached only to the exact approved HTTPS origin.
  • Rotate the affected token if this example has previously been executed in an environment where the unintended hostname could resolve.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:229
Finding

Unpinned Global Installation of Third-Party CLI Dependencies

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 229
Vulnerability Type: Unpinned executable dependency and unsafe global installation
Risk Level: Medium

Vulnerable Code

text
A: NPM installation: `npm install -g @maton/cli`; Homebrew installation: `brew install maton-ai/cli/maton`. Run `maton whoami` after installation to verify it.

Technical Analysis

The Skill instructs users or Agents to install mutable third-party packages globally without specifying a reviewed version, integrity hash, signature, or verified source revision.

A global npm installation may execute package lifecycle scripts with the invoking user's privileges. The Homebrew command similarly trusts the current state of an external tap and formula. Because no version or integrity constraint is provided, the effective executable can change after this Skill has been audited.

The dependency is related to the declared gateway functionality, so requiring a CLI is not inherently excessive. The risk arises from globally installing an unpinned executable that will handle MATON_API_KEY and sensitive third-party service data.

Attack Path

  1. An attacker compromises the npm package, publisher account, Homebrew tap, formula source, or an upstream dependency.
  2. A malicious release becomes the version resolved by the unpinned installation command.
  3. A user or Agent follows the Skill and installs that release globally.
  4. Package lifecycle scripts or the installed executable run with the user's local privileges.
  5. The malicious component reads environment variables, including MATON_API_KEY, or intercepts API requests and returned third-party data.
  6. The component exfiltrates credentials or data and may modify files accessible to the user.

Impact Assessment

A compromised dependency could execute arbitrary code with the privileges of the user performing the installation. This may permit access to environment variabl ...[truncated 334 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin the CLI to a specifically reviewed version rather than resolving the latest release.
  • Verify package integrity with a documented cryptographic hash, signed provenance, or trusted lockfile.
  • Document the expected npm publisher, package source repository, Homebrew tap owner, and release-signing process.
  • Prefer a project-local or isolated installation over a global installation.
  • Run the CLI in a least-privileged sandbox or container with access only to the required credential and files.
  • Disable npm lifecycle scripts during installation where supported and compatible, then explicitly review any required scripts.
  • Use short-lived, narrowly scoped credentials so a compromised dependency cannot access unrelated services.
  • Establish an update-review process before changing the pinned dependency version.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

System command execution is a powerful capability that is not justified by the stated API routing use case. In an agent skill, unnecessary exec materially increases risk of arbitrary command execution, secret exposure, environment discovery, and chaining with remote inputs from third-party APIs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown explicitly states the skill provides Chinese interaction, and elsewhere the metadata emphasizes Chinese-only style without presenting an opt-in or alternative language option. This creates a natural-language locale policy concern because it steers usage toward a specific language by default rather than letting the user choose.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 43)May include surrounding context.

md
# API 网关集成路由

托管式 API 网关路由服务。通过统一的 API 路由地址 `https://api.maton.ai/` 连接第三方服务,提供连接管理、触发器管理与安全审批流程.
**范围外**(本技能不做): 自建 API 代理服务器、OAuth 服务端部署、API Key 生成与分发.
## 参数说明
| 参数名 | 类型 | 必填 | 说明 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 84)May include surrounding context.

md
# API 网关集成路由

托管式 API 网关路由服务。通过统一的 API 路由地址 `https://api.maton.ai/` 连接第三方服务,提供连接管理、触发器管理与安全审批流程.
**范围外**(本技能不做): 自建 API 代理服务器、OAuth 服务端部署、API Key 生成与分发.
## 参数说明
| 参数名 | 类型 | 必填 | 说明 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 108)May include surrounding context.

md
# API 网关集成路由

托管式 API 网关路由服务。通过统一的 API 路由地址 `https://api.maton.ai/` 连接第三方服务,提供连接管理、触发器管理与安全审批流程.
**范围外**(本技能不做): 自建 API 代理服务器、OAuth 服务端部署、API Key 生成与分发.
## 参数说明
| 参数名 | 类型 | 必填 | 说明 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 109)May include surrounding context.

md
# API 网关集成路由

托管式 API 网关路由服务。通过统一的 API 路由地址 `https://api.maton.ai/` 连接第三方服务,提供连接管理、触发器管理与安全审批流程.
**范围外**(本技能不做): 自建 API 代理服务器、OAuth 服务端部署、API Key 生成与分发.
## 参数说明
| 参数名 | 类型 | 必填 | 说明 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 110)May include surrounding context.

md
# API 网关集成路由

托管式 API 网关路由服务。通过统一的 API 路由地址 `https://api.maton.ai/` 连接第三方服务,提供连接管理、触发器管理与安全审批流程.
**范围外**(本技能不做): 自建 API 代理服务器、OAuth 服务端部署、API Key 生成与分发.
## 参数说明
| 参数名 | 类型 | 必填 | 说明 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 111)May include surrounding context.

md
# API 网关集成路由

托管式 API 网关路由服务。通过统一的 API 路由地址 `https://api.maton.ai/` 连接第三方服务,提供连接管理、触发器管理与安全审批流程.
**范围外**(本技能不做): 自建 API 代理服务器、OAuth 服务端部署、API Key 生成与分发.
## 参数说明
| 参数名 | 类型 | 必填 | 说明 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 246)May include surrounding context.

md
# API 网关集成路由

托管式 API 网关路由服务。通过统一的 API 路由地址 `https://api.maton.ai/` 连接第三方服务,提供连接管理、触发器管理与安全审批流程.
**范围外**(本技能不做): 自建 API 代理服务器、OAuth 服务端部署、API Key 生成与分发.
## 参数说明
| 参数名 | 类型 | 必填 | 说明 |

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill claims a narrowly scoped API-gateway purpose and explicitly excludes self-hosted proxy/server functions, yet elsewhere advertises broader exec/read/write capabilities. This scope drift is dangerous because it normalizes higher-risk local capabilities that are not required for the stated function, increasing the chance an agent will access local resources or execute commands unnecessarily.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

The Python example hardcodes an apparently malformed host (https://api.maton.0/) while attaching the bearer token from the environment. Incorrect or typo-prone external endpoints in auth-bearing examples are dangerous because they can send credentials to unintended destinations or train users to trust unvalidated hosts.

Content

Scanner excerpt · SKILL.md (reported line 191)May include surrounding context.

Python:

python
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.0/query?q=SELECT+Id,Name+FROM+Contact+LIMIT+10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The trigger example embeds Authorization: Bearer $MATON_API_KEY inside a destination configuration for an automated workflow. This is dangerous because it propagates a sensitive token into trigger definitions and potentially logs, stored configs, downstream systems, or accidental disclosure paths, especially in a cross-service automation context.

Content

Scanner excerpt · SKILL.md (reported line 204)May include surrounding context.

maton trigger create --source google-mail --event-type email.received
--connection-id {connection_id}
--parameter labels=INBOX
--destination '{"url":"https://api.maton.ai/slack/api/chat.postMessage","method":"POST","name":"slack","headers":{"Authorization":"Bearer '"$MATON_API_KEY"'","Content-Type":"application/json"},"body_template":"{"channel": "C0123456789", "text": "New email: <动态配置>"}"}'

text

**说明**: 创建触发器监听 Gmail 收件事件,新邮件到达时自动向 Slack 频道发送通知。触发器支持事件检查点,中断后从上次位置恢复.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation advertises local file read/write features even though the skill's stated role is remote API gateway integration. Unnecessary filesystem access expands the attack surface and could enable leakage, tampering, or persistence through local files unrelated to the user’s intended API task.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill claims a narrowly scoped API-gateway purpose and explicitly excludes self-hosted proxy/server functions, yet elsewhere advertises broader exec/read/write capabilities. This scope drift is dangerous because it normalizes higher-risk local capabilities that are not required for the stated function, increasing the chance an agent will access local resources or execute commands unnecessarily.

Content

No source excerpt is available for this finding.