T09 · Insecure Skill Coding Practices
- Location
runtime/route_referee/client.py:16- Finding
Configurable API endpoint can receive OnchainOS authentication credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real X Layer trading guard, but it handles wallet execution and credentials in ways users should review carefully before installing.
Install only if you are comfortable granting a skill access to OnchainOS API credentials and a logged-in Agentic Wallet. Use proof or --no-execute mode by default, do not rely on mock execute verdicts for real trades, avoid running it in projects with sensitive .env files, pin dependencies yourself, and only enable agentic-wallet mode after independently confirming the exact token pair, amount, wallet, chain, and slippage.
runtime/route_referee/client.py:16Configurable API endpoint can receive OnchainOS authentication credentials
runtime/execution_guard/guard.py:89Real route-check failures fail open to a mock execute verdict
runtime/execution_guard/guard.py:359Unnecessary environment and dotenv secrets are passed to a configurable child executable
requirements.txt:1Unbounded dependency version prevents reproducible installation
A second independent mismatch report indicates the skill may only perform local CLI or wallet availability checks while claiming to block, resize, test, or execute swap intents safely. In the context of an execution guard for financial transactions, overstating defensive behavior is especially risky because it can directly influence automated trading or wallet decisions without the promised safeguards.
A second independent mismatch report indicates the skill may only perform local CLI or wallet availability checks while claiming to block, resize, test, or execute swap intents safely. In the context of an execution guard for financial transactions, overstating defensive behavior is especially risky because it can directly influence automated trading or wallet decisions without the promised safeguards.
Copying the full process environment into a child execution context is classic environment harvesting behavior because it propagates potentially sensitive secrets unrelated to the task. In this skill, those secrets are then combined with additional local credential files and handed to an external executable, expanding the blast radius if the binary, logs, or downstream tooling are compromised.
return values
def _onchainos_env(self) -> Dict[str, str]:
env = os.environ.copy()
env.update(self._read_env_file(Path.home() / ".config" / "onchainos.env"))
env.update(self._read_env_file(Path.cwd() / ".env"))
env.update(self._read_env_file(Path.cwd() / ".env.local"))
Reading ~/.config/onchainos.env and the current directory's .env files is credential access behavior that can capture wallet and API secrets beyond what a route guard strictly needs. In an agent skill, this is especially risky because untrusted prompts or orchestration may cause the skill to use local secrets to perform high-impact actions.
def _onchainos_env(self) -> Dict[str, str]:
env = os.environ.copy()
env.update(self._read_env_file(Path.home() / ".config" / "onchainos.env"))
env.update(self._read_env_file(Path.cwd() / ".env"))
env.update(self._read_env_file(Path.cwd() / ".env.local"))
env["PATH"] = f"{Path.home() / '.local' / 'bin'}:{env.get('PATH', '')}"
return env
Reading .env.local adds another undeclared credential source that may contain sensitive developer or production wallet material. Because the skill can proceed to invoke a fund-moving CLI, this local secret discovery meaningfully increases the chance of unauthorized or surprising use of high-value credentials.
env = os.environ.copy()
env.update(self._read_env_file(Path.home() / ".config" / "onchainos.env"))
env.update(self._read_env_file(Path.cwd() / ".env"))
env.update(self._read_env_file(Path.cwd() / ".env.local"))
env["PATH"] = f"{Path.home() / '.local' / 'bin'}:{env.get('PATH', '')}"
return env
The skill advertises and instructs use of shell, network, filesystem, and environment-dependent operations but does not declare any tool scope or permission boundaries. In an agent setting, this increases the chance the skill will be run with overly broad ambient privileges, making unintended command execution, credential access, file modification, or network actions more likely.
The skill goes beyond analysis and proof generation by spawning a local wallet CLI and executing a swap. In an agent skill context this is dangerous because a seemingly advisory guard can directly move funds, and the same code path can be triggered from intent data once credentials are present.
Live trade execution can occur without a user-facing confirmation checkpoint at the moment funds may move. In an autonomous-agent setting, this increases the risk of unintended or manipulated swaps being executed silently once a prior verdict returns 'execute'.
The skill reads process environment and local .env files to assemble credentials for the OnchainOS CLI. This broad credential-loading behavior exceeds simple route judgment and proof generation, and exposes sensitive wallet/API material to any code path that can invoke the subprocess or inspect resulting errors/output.
The skill invokes a local executable via subprocess to perform wallet status checks and swap execution. Although arguments are passed as a list rather than through a shell, this still grants the skill host command execution capability and can trigger real on-chain actions using local credentials, making compromise or misuse materially dangerous.
def _run_onchainos(self, args: List[str], timeout: int) -> Dict[str, Any]:
try:
completed = subprocess.run(
[self._onchainos_bin(), *args],
env=self._onchainos_env(),
text=True,
The model sets execute_after_verdict=True by default in GuardIntent, which means a swap may proceed automatically unless callers explicitly disable execution. In a skill designed for autonomous agent trading and wallet execution, unsafe defaults materially increase the chance of unintended or unauthorized on-chain transactions, especially if upstream validation, prompting, or policy checks fail.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(args: list[str], timeout: int = 10) -> dict:
try:
completed = subprocess.run(
[onchainos_bin(), *args],
text=True,
capture_output=True,
The dependency is specified as requests>=2.31.0, which allows any future release to be installed without review. This weakens build reproducibility and can unintentionally pull in a vulnerable or breaking version of requests, which is especially relevant for an agent skill that may make network calls as part of transaction or guard logic.
requests>=2.31.0
Because requests is not pinned, there is no way to verify from this manifest whether deployment will use a patched or vulnerable release despite known advisories affecting some versions. In a skill described as performing pre-execution checks and optional wallet execution, uncertain dependency state increases supply-chain and network-handling risk, since HTTP client flaws could affect credential handling, TLS behavior, or request security.
The inline comment claims a specific safety behavior: "Use higher price impact protection to avoid errors." However, the actual quote call only passes amount, token addresses, and dex_ids, with no visible price-impact or slippage protection argument. This is an active documentation/code contradiction, not merely missing detail.
The client sends network requests to an external API using authentication headers derived from API credentials, but this file contains no confirmation prompt, user-facing log, or warning about transmitting request metadata and token-related parameters off-system. Because network transmission of authenticated data is safety-relevant, some form of disclosure is expected unless documented elsewhere.