Back to skill

Security audit

Bbs Bot

Security checks for vulnerabilities and agentic risk

Overview

This forum skill mostly does what it says, but it handles account credentials and public posting/deletion with weak safeguards, so it needs careful review before installation.

Install only if you trust this publisher and are comfortable giving the skill authority to act as a BBS.BOT account. Avoid putting real passwords on command lines or in shared logs, review ~/.bbsbot/config.json permissions, do not run the config command with real secrets, keep baseUrl fixed to the intended HTTPS BBS.BOT origin, and use extra caution with delete, auto-reply, batch registration, or bulk posting workflows.

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

T09 · Insecure Skill Coding Practices

Error
Location
index.js:265
Finding

Sensitive credentials and tokens are exposed through configuration command output

Content
View full analysis

Vulnerability Details

File Location: index.js:265-281
Vulnerability Type: Sensitive information exposure through command output
Risk Level: High

Vulnerable Code

javascript
// Config commands
program
  .command('config')
  .description('Show current configuration')
  .action(() => {
    console.log('Current configuration:');
    console.log(JSON.stringify(config, null, 2));
  });

program
  .command('config-set')
  .description('Set configuration value')
  .requiredOption('-k, --key <key>', 'Configuration key')
  .requiredOption('-v, --value <value>', 'Configuration value')
  .action((options) => {
    configManager.setConfig(options.key, options.value);
    console.log(`Configuration updated: ${options.key} = ${options.value}`);
  });

The configuration object printed by the config command is populated through ConfigManager.loadConfig(). That method includes sensitive values loaded from both environment variables and the configuration file:

javascript
const envMappings = {
  BBS_BOT_BASE_URL: 'baseUrl',
  BBS_BOT_USERNAME: 'username',
  BBS_BOT_PASSWORD: 'password',
  BBS_BOT_EMAIL: 'email',
  BBS_BOT_DISPLAY_NAME: 'displayName',
  BBS_BOT_TOKEN: 'token',
  BBS_BOT_TIMEOUT: 'timeout',
  BBS_BOT_RETRY_ATTEMPTS: 'retryAttempts',
  BBS_BOT_RETRY_DELAY: 'retryDelay'
};

Technical Analysis

The config command serializes the complete configuration object without redacting authentication data. If BBS_BOT_PASSWORD or BBS_BOT_TOKEN is present, the command discloses it in plaintext.

The config-set command independently echoes the supplied value. A command such as bbsbot config-set --key token --value ... therefore prints the token even if its storage permissions are otherwise secure.

Terminal output is commonly retained in shell scrollback, CI/CD logs, process supervisors, OpenClaw transcripts, remote support captures, and ...[truncated 1216 chars]

Remediation
View remediation

Remediation Suggestions

  1. Redact all known sensitive fields before displaying configuration:

    javascript
    function redactConfig(config) {
      const redacted = { ...config };
    
      for (const key of ['password', 'token', 'secret', 'apiKey']) {
        if (redacted[key] !== undefined) {
          redacted[key] = '[REDACTED]';
        }
      }
    
      return redacted;
    }
    
    console.log(JSON.stringify(redactConfig(config), null, 2));
    
  2. Do not echo values supplied to config-set. Confirm only the key:

    javascript
    configManager.setConfig(options.key, options.value);
    console.log(`Configuration updated: ${options.key}`);
    
  3. Maintain a centralized secret-field denylist or schema so future credential fields are also redacted.

  4. Prefer an allowlist of non-sensitive fields that may be displayed, such as baseUrl, timeout, and retry settings.

  5. Add automated tests asserting that password and token values never appear in standard output or error output.

  6. Treat previously captured logs as potentially compromised and rotate any credentials that may already have been printed.

T09 · Insecure Skill Coding Practices

Error
Location
src/api/client.js:9
Finding

Configurable API destination allows credential and bearer-token exfiltration

Content
View full analysis

Vulnerability Details

File Locations: src/api/client.js:9-29, src/utils/config.js:119-133, and src/utils/config.js:162-181
Vulnerability Type: Unrestricted authentication endpoint and insecure transport acceptance
Risk Level: High

Vulnerable Code

The API client accepts an arbitrary configured base URL and attaches its bearer token to requests:

javascript
constructor(config = {}) {
  this.baseUrl = config.baseUrl || 'https://bbs.bot';
  this.token = config.token;
  this.timeout = config.timeout || 30000;
  
  // Create axios instance
  this.client = axios.create({
    baseURL: `${this.baseUrl}/api`,
    timeout: this.timeout,
    headers: {
      'Content-Type': 'application/json',
      'User-Agent': 'BBS.BOT-Skill/1.0.0'
    }
  });
  
  // Add request interceptor for auth
  this.client.interceptors.request.use(
    (config) => {
      if (this.token) {
        config.headers.Authorization = `Bearer ${this.token}`;
      }
      return config;
    },
    (error) => Promise.reject(error)
  );
}

Arbitrary configuration keys and values can be set through the CLI:

javascript
setConfig(key, value) {
  const config = this.loadConfig();
  
  // Convert string to appropriate type
  let typedValue = value;
  if (['timeout', 'retryAttempts', 'retryDelay'].includes(key)) {
    typedValue = parseInt(value, 10);
  } else if (value === 'true' || value === 'false') {
    typedValue = value === 'true';
  } else if (!isNaN(value) && value !== '') {
    typedValue = Number(value);
  }
  
  config[key] = typedValue;
  this.saveConfig(config);
}

URL validation checks only whether the value is syntactically valid:

javascript
isValid() {
  const config = this.loadConfig();
  
  // Check required fields for API operations
  if (!config.baseUrl) {
    console.error('Missing baseUrl in configuration');
    return fals
...[truncated 2634 chars]
Remediation
View remediation

Remediation Suggestions

  1. For a BBS.BOT-specific Skill, allowlist the expected origin:

    javascript
    const allowedOrigin = 'https://bbs.bot';
    const parsed = new URL(config.baseUrl || allowedOrigin);
    
    if (parsed.origin !== allowedOrigin) {
      throw new Error('Unapproved BBS.BOT API origin');
    }
    
  2. If self-hosted servers are a required feature:

    • Require HTTPS.
    • Reject URLs containing embedded usernames or passwords.
    • Maintain an explicit administrator-controlled origin allowlist.
    • Require clear user approval before credentials are sent to a newly configured origin.
    • Display the destination origin without displaying any credentials.
  3. Validate the endpoint in the ApiClient constructor so validation cannot be bypassed accidentally:

    javascript
    const parsed = new URL(config.baseUrl || 'https://bbs.bot');
    
    if (parsed.protocol !== 'https:') {
      throw new Error('HTTPS is required for authenticated API requests');
    }
    
  4. Restrict setConfig() to an allowlist of recognized configuration keys and apply key-specific validation.

  5. Disable cross-origin redirects for login and authenticated requests, or verify the final redirect origin before forwarding authentication headers.

  6. Consider using separate unauthenticated and authenticated Axios clients so bearer tokens are only attached to approved origins.

  7. Add tests proving that HTTP URLs, unapproved hosts, credential-bearing URLs, and redirect-based origin changes are rejected.

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:51
Finding

Passwords are accepted directly as command-line arguments

Content
View full analysis

Vulnerability Details

File Location: index.js:51-61
Vulnerability Type: Local credential exposure through process arguments and shell history
Risk Level: Medium

Vulnerable Code

javascript
program
  .command('login')
  .description('Login and get token')
  .requiredOption('-u, --username <username>', 'Username or email')
  .requiredOption('-p, --password <password>', 'Password')
  .action(async (options) => {
    try {
      const result = await apiClient.login({
        identifier: options.username,
        password: options.password
      });

Registration uses the same pattern at index.js:30-42:

javascript
program
  .command('register')
  .description('Register a new user')
  .requiredOption('-u, --username <username>', 'Username')
  .requiredOption('-e, --email <email>', 'Email address')
  .requiredOption('-p, --password <password>', 'Password')
  .option('-n, --name <name>', 'Display name')
  .action(async (options) => {
    try {
      const result = await apiClient.register({
        username: options.username,
        email: options.email,
        password: options.password,
        name: options.name || options.username
      });

Technical Analysis

Passwords supplied as command-line arguments can be exposed through multiple local channels:

  • Shell history files may permanently retain the full command.
  • Process inspection tools may display command-line arguments while the process is running.
  • Terminal recording and auditing systems may capture the command.
  • Wrapper scripts, job schedulers, and CI systems may log the invoked command.
  • Agent transcripts may preserve the full generated command.

The project documentation repeatedly recommends commands such as bbsbot login --username ... --password ..., making exposure likely during normal use rather than only through unsupported behavio ...[truncated 1069 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace required password arguments with an interactive hidden-input prompt.
  2. Read the password from the terminal without echoing it and avoid retaining it longer than required.
  3. For noninteractive automation, support a protected standard-input or file-descriptor mechanism rather than a command-line argument.
  4. If environment-variable support remains available, document that environment access must be restricted and avoid printing inherited environment values.
  5. Remove literal --password usage from README.md, SKILL.md, manifest examples, and packaging instructions.
  6. If backward compatibility requires retaining --password, mark it as deprecated and emit a warning explaining that process arguments and shell history may expose the value.
  7. Add tests ensuring passwords are never logged through success messages, error messages, debug output, or configuration-display commands.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (38)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTRIBUTING.md (reported line 55)May include surrounding context.

  1. Set up development environment:
    bash
    cp .env.example .env
    # Edit .env with your configuration
    

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CONTRIBUTING.md (reported line 56)May include surrounding context.

  1. Set up development environment:

    bash
    cp .env.example .env
    # Edit .env with your configuration
    
  2. Link the skill for development:

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · CONTRIBUTING.md (reported line 106)May include surrounding context.

md
### Writing Documentation
- Update README.md for user-facing changes
- Update SKILL.md for skill-specific documentation
- Add JSDoc comments for all functions and classes
- Include examples for new features
- Update CHANGELOG.md for all releases

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

代码块仅包含 pack.sh 打包脚本,没有看到任何与 BBS.BOT 论坛通信、账号注册登录、发帖或回复相关的实现。其主要行为是删除旧包、复制目录、创建压缩文件、拷贝输出文件并输出安装说明。这与声明的核心用途存在明显且实质性的偏差,因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description says the skill supports full forum interactions like registration, login, posting, and replying. However, the supplied code chunk only manages configuration: it creates a local config directory, reads/writes config files, handles environment-variable overrides, stores tokens, and validates configuration. While configuration management could support a forum client, this chunk does not itself perform the declared forum operations. It also uses local filesystem persistence and credential/token handling, which are not mentioned in the declared purpose. Therefore the code chunk's actual behavior does not accurately match the declared description.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
- `POST /topics` - 创建帖子
- `GET /topics/{id}` - 获取帖子详情
- `PATCH /topics/{id}` - 更新帖子
- `DELETE /topics/{id}` - 删除帖子

### 回复相关 API
- `GET /posts` - 获取回复列表(可筛选)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
- `GET /posts` - 获取回复列表(可筛选)
- `POST /posts` - 创建回复
- `PATCH /posts/{id}` - 更新回复
- `DELETE /posts/{id}` - 删除回复

## 使用示例

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The entire skill-related document is written in Chinese and does not indicate that the skill is region-specific or that users may choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill is presented as supporting automated posting, auto-replying, and scheduled tasks without clear warnings about consent, rate limits, moderation policies, or the risk of generating unsolicited forum activity. In a forum-integration skill, this can facilitate spammy or abusive behavior and accidental misuse by operators who treat the examples as safe defaults.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The batch-creation examples encourage repeated posting to the target forum without any caution about using test environments, quotas, or cleanup. This materially increases the risk of forum spam, pollution of production data, and account sanctions if copied directly into real deployments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The configuration example stores username, password, and a bearer token in plaintext, and the README does not warn about file permissions, secret managers, or repository leakage. Because this skill authenticates to a live forum service, exposed credentials could let an attacker impersonate the user, post content, access account data, or maintain session access via the token.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README asserts security properties such as token auto-refresh, encrypted password storage, request signing, replay protection, and rate limiting, but this file provides no substantiation or caveats. Misrepresenting security controls can cause users to deploy the skill under false assumptions, leading to unsafe credential handling or overtrust in protections that may not exist.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill asks users to set credentials via environment variables and store config locally, but the manifest shown in this file does not declare any explicit tool scope or permissions. That makes the skill's access expectations opaque and increases the risk of unintended secret exposure or broader runtime access than users expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation advertises delete operations for topics and posts without any warning about irreversibility, confirmation, or scope checks. In an agentic context, users may invoke destructive actions accidentally, causing content loss or unauthorized moderation-like behavior on their own accounts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The auto-reply bot example continuously monitors content and posts replies on the user's behalf without clear consent, rate-limit, or moderation warnings. This can lead to spam, reputational harm, and unintended automated actions if adapted directly by users or agents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The batch-registration and bulk-posting examples facilitate mass account creation and automated content generation without any caution about abuse, policy violations, or anti-spam implications. In practice, this could be used to flood a forum, evade moderation, or create sockpuppet accounts.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
# 批量发布测试帖子
for i in {1..3}; do
    bbsbot topic create \
        --title "测试帖子 $i" \
        --content "这是第 $i 个测试帖子" \
        --category 2

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The topic-delete command performs an irreversible destructive action immediately with no confirmation prompt, dry-run mode, or safety interlock. In a CLI/agent skill context, this increases the chance of accidental deletion from user error, prompt confusion, or unintended automation behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The post-delete command also executes an irreversible delete without warning or confirmation. Because this skill is intended for automated forum interaction, lack of guardrails makes accidental or mass content removal more likely if commands are issued incorrectly or by an over-privileged caller.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill exposes broad configuration read and write operations that are not tightly scoped to the forum actions advertised by the skill. In this file, config prints the full loaded configuration and config-set allows arbitrary key/value updates, which can reveal secrets such as auth tokens and let a caller alter security-relevant settings beyond normal forum interaction.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes a 'complete skill' for interacting with the forum and automating forum interactions, but it does not define specific invocation conditions, limits, or exclusion cases. In a manifest file, this broad capability description can contribute to unintended invocation because there is no narrow trigger scope or negative examples to distinguish when the skill should or should not be used.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This shell script includes user-facing text such as status messages and installation instructions in Chinese throughout the file. Forcing a specific language in user-visible content without offering an opt-in or documenting a locale-specific scope matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code persists the authentication token to ~/.bbsbot/config.json via saveToken(), which creates a long-lived local secret on disk. Although the file is chmod'd to 0600, storing bearer tokens unencrypted increases the risk of credential theft from local compromise, backups, or accidental exposure, and users are not warned that login state will be persisted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

exportAsEnv() reconstructs and returns environment variables for all configured values, including sensitive fields such as password and token. This creates an easy exfiltration path because callers may log, print, serialize, or propagate the returned object into subprocess environments, broadening secret exposure beyond the original configuration boundary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

Line L013 quotes the error message "用户不存在" alongside its English translation, indicating the skill surfaces Chinese-language output. For a general-purpose skill changelog, this suggests a fixed language behavior without any stated user opt-in or locale justification, which matches the language/locale policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.