T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/register.mjs:11
- Finding
- Local Hostname Disclosed to External Registration Service by Default## Vulnerability Details **File Location**: `scripts/register.mjs:11-24` **Vulnerability Type**: Unnecessary local system information disclosure **Risk Level**: Medium ### Vulnerable Code ```js import { hostname } from "os"; const BASE_URL = "https://www.citedy.com"; async function main() { const agentName = process.argv[2] || `agent-${hostname()}`; console.log(`Registering agent "${agentName}" with Citedy...`); const res = await fetch(`${BASE_URL}/api/agent/register`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ agent_name: agentName }), }); ``` The behavior is also explicitly documented in `SKILL.md:73-76`: ```markdown node scripts/register.mjs [agent_name] ``` ```markdown The script calls the registration API and prints the approval URL. If `agent_name` is omitted, it defaults to `agent-<hostname>`. ``` ### Technical Analysis When no explicit agent name is supplied, the registration script reads the operating system hostname and embeds it in the `agent_name` field sent to `https://www.citedy.com/api/agent/register`. A machine hostname is not required to establish an application-level agent identity. A random identifier or user-selected label would provide the same functional result with less disclosure. Hostnames can contain usernames, employee names, company identifiers, device roles, deployment environments, or internal infrastructure naming conventions. TLS protects the hostname in transit but does not prevent the receiving service from reading, recording, correlating, or retaining it. The default behavior therefore exceeds the minimum information needed for Skill registration. ### Attack Path 1. A user follows the recommended setup command without providing an optional name: `node scripts/register.mjs`. 2. The script invokes `hostname()` on the local machine. 3. It constructs an identifier such as `agent- ...[truncated 913 chars]
- Remediation
- ## Remediation Suggestions - Replace the hostname-derived default with a random, non-identifying value, for example: ```js import { randomUUID } from "node:crypto"; const agentName = process.argv[2] || `agent-${randomUUID()}`; ``` - Alternatively, require the user to provide an explicit agent name and terminate safely if none is supplied. - Do not read or transmit local device identifiers unless they are strictly required. - If a hostname-based name remains available as an option, clearly disclose what will be transmitted and obtain explicit consent before reading it. - Document the service's retention and deletion policy for registration metadata.
