T09 · Insecure Skill Coding Practices
- Location
scripts/register.mjs:10- Finding
Default Registration Discloses the Local Hostname to a Third Party
- Content
View full analysis
Vulnerability Details
File Location:
scripts/register.mjs, lines 10–24
Vulnerability Type: Unnecessary local system information disclosure
Risk Level: LowVulnerable 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 }), });Technical Analysis
When no agent name is supplied, the registration script reads the local machine hostname and incorporates it into the
agent_namefield. That value is then transmitted to the external Citedy registration API.A hostname can contain identifying or operational information, including an employee name, organization name, internal asset identifier, environment role, project name, or deployment stage. Registration only needs a logical agent identifier, so transmitting a real hostname is not necessary for the documented functionality.
The recommended setup command in
SKILL.mdpermits omission of the agent name:bash node scripts/register.mjs [agent_name]Consequently, users following the default setup path may disclose local system metadata without understanding that the generated name is derived from their machine.
Attack Path
- A user follows the documented setup instructions.
- The user runs
node scripts/register.mjswithout an explicit agent name. - The script calls the Node.js
hostname()function. - The hostname is embedded in a value such as
agent-internal-prod-cms-01. - The value is sent to
https://www.citedy.com/api/agent/register. - Citedy or any party with access to the relevant registration records can observe and retain th ...[truncated 750 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not use the local hostname as the default agent identifier.
- Generate a neutral random identifier, for example with
crypto.randomUUID(). - Alternatively, require the user to provide an explicit agent name and terminate with a clear error if it is omitted.
- If hostname-based naming is retained, clearly disclose the external transmission and obtain informed user consent before registration.
- Validate and length-limit any user-supplied agent name before transmission.
- Update
SKILL.mdso the setup instructions accurately explain what information is sent to Citedy.
A safer default would be:
js import { randomUUID } from "crypto"; const agentName = process.argv[2] || `agent-${randomUUID()}`;
