Back to skill

Security audit

iHub日报自动填写

Security checks for vulnerabilities and agentic risk

Overview

This iHub daily-report skill is purpose-aligned, but it handles real login passwords unsafely and can submit external records automatically.

Review this carefully before installing. Use it only for the intended iHub daily-report workflow, avoid passing passwords on the command line, do not run it where terminal output is logged, and confirm the account, date, target person, and report content before allowing any final submission. A safer version should use a protected password prompt or delegated authentication and must never print or return the password.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
index.js:97
Finding

Credentials Exposed Through Command-Line Arguments and Standard Output

Content
View full analysis

Vulnerability Details

File Location: index.js, lines 97, 118, 134, 145–146, and 158
Vulnerability Type: Plaintext credential exposure
Risk Level: High

Vulnerable Code

js
const password = args.password || DEFAULT_PASSWORD;
js
return {
  username,
  password,
  content,
  name,
  targetDate,
  weekInfo,
  dayOfWeek,
  dayName,
  steps: [
    { action: 'open', url: BASE_URL },
    { action: 'wait', ms: 2000 }
  ]
};
js
const args = process.argv.slice(2);
js
} else if (args[i] === '--password' || args[i] === '-p') {
  params.password = args[i + 1];
  i++;
}
js
executeDailyReport(params).then(result => {
  console.log(JSON.stringify(result, null, 2));
}).catch(err => {
  console.error('Error:', err.message);
  process.exit(1);
});

Technical Analysis

The script accepts the iHub password through a command-line option and retains it in the object returned by executeDailyReport. The entire object is subsequently serialized to standard output without redaction.

Command-line secrets can be exposed through shell history, process inspection facilities, diagnostic tooling, and process-monitoring systems. Printing the returned object creates an additional disclosure channel through terminal scrollback, redirected output, CI/CD logs, orchestration logs, and centralized log collectors.

Because the returned object contains the original plaintext password, callers that log or otherwise persist the result may also disclose the credential even when the CLI entry point is not used.

Attack Path

  1. A user runs the script with a password, such as node index.js --username USER --password SECRET.
  2. The plaintext password is stored in the process argument vector and may be recorded in shell history or observed through local process-monitoring mechanisms.
  3. The argument parser assigns the plaintext value to `params. ...[truncated 1087 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove support for supplying passwords through command-line arguments. Read the password from a protected secret manager, a narrowly scoped environment mechanism where appropriate, or an interactive hidden-input prompt.

  2. Never include passwords in returned execution metadata. Keep the credential in the smallest possible scope and discard the reference immediately after authentication.

  3. Redact all sensitive fields before logging or serializing objects. Prefer an explicit allowlist of safe output properties rather than attempting to remove known secret fields afterward.

  4. Change the returned object to omit password, for example:

    js
    return {
      username,
      content,
      name,
      targetDate,
      weekInfo,
      dayOfWeek,
      dayName,
      steps: [
        { action: 'open', url: BASE_URL },
        { action: 'wait', ms: 2000 }
      ]
    };
    
  5. Ensure diagnostic and error paths do not serialize argument objects, authentication request data, headers, cookies, tokens, or credentials.

  6. Review existing shell histories, CI/CD output, terminal captures, and centralized logs for previously exposed credentials. Remove accessible copies where feasible and rotate any password that may have been logged.

  7. Add automated tests that fail if result objects or log output contain fields named password, token, secret, or equivalent sensitive values.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill requires users to provide a login username and password directly, but it does not describe secure credential handling, storage limits, masking, or safer alternatives. This is dangerous because it normalizes plaintext credential entry into an automation workflow, creating risk of exposure in logs, prompts, screenshots, browser state, or downstream systems.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger list includes broad natural-language phrases such as '填写日报' and 'daily report', which can overlap with ordinary user requests and cause the skill to activate unintentionally. In a skill that performs authenticated browser automation and submits data to a remote system, accidental activation increases the chance of unintended actions or credential collection prompts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The workflow explicitly saves content and submits a report to the remote iHub system, but the skill does not clearly warn users that it will modify external system records. In the context of automated browser actions, this can lead to unintended or mistaken submissions, especially if the content, date, or target record is wrong.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script accepts a password via the --password/-p command-line argument, which can expose credentials through shell history, process listings, and job-control tools on the local system. In this skill’s context, the password is for a real login workflow, so the exposure can directly compromise the user’s iHub account rather than being a theoretical issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code formats dates using toLocaleDateString('zh-CN'), forcing Chinese locale output regardless of user preference. This is a natural-language/locale policy concern because the skill does not offer any language or locale choice or document a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.