Back to skill

Security audit

leader-skill(create--leader)

Security checks for vulnerabilities and agentic risk

Overview

The skill openly targets leader profiling, but it asks for sensitive workplace communications and credentials while using unsafe local file operations that need review before installation.

Install only after reviewing the Feishu collection and local file behaviors. Do not use the private-chat/OAuth workflow unless you have explicit authorization from your organization and affected people, and avoid storing real tokens or private communications until credential storage, slug validation, path containment, deletion safeguards, and retention controls are fixed.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
prompts/feishu_private_chat.md:18
Finding

Insecure OAuth Redirect and Plaintext Credential Storage

Content
View full analysis

Vulnerability Details

File Location: prompts/feishu_private_chat.md:18-33; tools/feishu_auto_collector.py:34-58, 67-82
Vulnerability Type: Insecure OAuth configuration and sensitive credential handling
Risk Level: High

Vulnerable Code

prompts/feishu_private_chat.md:

text
https://open.feishu.cn/open-apis/authen/v1/authorize?app_id={APP_ID}&redirect_uri=http://www.example.com&scope=im:message%20im:chat

tools/feishu_auto_collector.py:

python
def setup_credentials():
    """Setup Feishu credentials interactively."""
    config_dir = os.path.expanduser('~/.create-leader')
    os.makedirs(config_dir, exist_ok=True)
    config_path = os.path.join(config_dir, 'feishu_config.json')

    print("=== Feishu Credential Setup ===\n")
    print("Please enter your Feishu app credentials:")
    print("(Get these from Feishu Open Platform: https://open.feishu.cn)")

    app_id = input("App ID: ").strip()
    app_secret = input("App Secret: ").strip()
    redirect_uri = input("Redirect URI (default: http://www.example.com): ").strip()
    if not redirect_uri:
        redirect_uri = 'http://www.example.com'

    config = {
        'app_id': app_id,
        'app_secret': app_secret,
        'redirect_uri': redirect_uri,
        'created_at': datetime.utcnow().isoformat() + 'Z'
    }

    with open(config_path, 'w') as f:
        json.dump(config, f, indent=2)
python
def exchange_code_for_token(code):
    """Exchange OAuth code for user access token."""
    config_dir = os.path.expanduser('~/.create-leader')
    config_path = os.path.join(config_dir, 'feishu_config.json')

    if not os.path.exists(config_path):
        print("Error: Config not found. Run with --setup first.", file=sys.stderr)
        sys.exit(1)

    with open(config_path, 'r') as f:
        config = json.load(f)

    print("=== OAuth Token Exchange ===\n")
    print("No
...[truncated 2054 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace the external HTTP callback with a user-controlled HTTPS endpoint or a loopback callback such as http://127.0.0.1 where supported.
  • Require an exact, pre-registered redirect URI and validate it before constructing an authorization URL.
  • Use OAuth state and PKCE where supported to reduce authorization-code interception risk.
  • Read secrets with getpass.getpass() instead of visible terminal input.
  • Create the credential directory with mode 0700 and the configuration file atomically with mode 0600.
  • Prefer an operating-system keyring or dedicated secret manager over plaintext JSON storage.
  • Never print authorization codes, access tokens, refresh tokens, or application secrets.
  • Avoid accepting tokens and authorization codes as command-line arguments because process listings and shell history may expose them.
  • Document credential rotation and secure cleanup procedures.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:665
Finding

Command Injection and Unsafe Recursive Deletion Through Unvalidated Slugs

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:665-673; equivalent Chinese instructions at SKILL.md:321-329
Vulnerability Type: Shell command injection and uncontrolled recursive deletion
Risk Level: High

Vulnerable Code

bash
python3 ${SKILL_DIR}/tools/version_manager.py --action rollback --slug {slug} --version {version} --base-dir ./leaders
bash
rm -rf leaders/{slug}

Related directory-creation instructions use the same substitution pattern:

bash
mkdir -p leaders/{slug}/versions
mkdir -p leaders/{slug}/knowledge/docs
mkdir -p leaders/{slug}/knowledge/messages
mkdir -p leaders/{slug}/knowledge/meetings

Technical Analysis

The Skill instructs the agent to substitute user-controlled slug and version values directly into shell commands. The placeholders are neither quoted nor constrained to a safe character set.

Shell metacharacters, command substitutions, option-like values, whitespace, or traversal sequences can consequently alter the command's structure. The rm -rf instruction is particularly hazardous because a manipulated slug can change the deletion target or append an additional command. User confirmation does not neutralize shell syntax and is not a substitute for validation.

Attack Path

  1. An attacker supplies a leader slug or rollback version containing shell metacharacters, command substitution, whitespace, or path traversal.
  2. The agent follows SKILL.md and interpolates the value into the documented Bash command.
  3. Bash interprets the attacker-controlled syntax rather than treating the entire value as a single inert identifier.
  4. The injected command runs with the same operating-system privileges as the agent.
  5. In the deletion flow, the altered path may cause recursive deletion outside the intended leaders subdirectory.

Impact Assessment

Successful exploitation can execute arbitrary shell commands with the agent proces ...[truncated 269 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not implement file creation, rollback, or deletion through interpolated shell commands.
  • Use Python filesystem APIs with arguments passed as data rather than shell syntax.
  • Validate slugs with a strict allowlist, for example lowercase ASCII letters, digits, underscores, and hyphens with a fixed maximum length.
  • Validate versions against the exact timestamp-based version format expected by the version manager.
  • Resolve the target path and verify that it remains strictly beneath the configured leaders directory.
  • Reject absolute paths, path separators, traversal components, shell metacharacters, control characters, and option-prefixed identifiers.
  • Refuse to operate on symlinks or paths whose resolved destination leaves the approved root.
  • Replace recursive deletion with a dedicated guarded function that displays the resolved target and requires confirmation of that exact path.
  • If a subprocess is unavoidable, invoke it with an argument array and without shell=True.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
tools/skill_writer.py:67
Finding

Arbitrary File Access and Directory Replacement Through Path Traversal

Content
View full analysis

Vulnerability Details

File Location: tools/skill_writer.py:67-124; tools/version_manager.py:28-101
Vulnerability Type: Unrestricted path construction and filesystem traversal
Risk Level: High

Vulnerable Code

tools/skill_writer.py:

python
def write_skill(base_dir, slug, name, leadership_file, upward_file, replacement_file, profile_json):
    """Write a new leader skill to disk."""
    leader_dir = os.path.join(base_dir, slug)

    # Create directory structure
    os.makedirs(os.path.join(leader_dir, 'versions'), exist_ok=True)
    os.makedirs(os.path.join(leader_dir, 'knowledge', 'docs'), exist_ok=True)
    os.makedirs(os.path.join(leader_dir, 'knowledge', 'messages'), exist_ok=True)
    os.makedirs(os.path.join(leader_dir, 'knowledge', 'meetings'), exist_ok=True)

    # Read content files
    def read_content(file_path):
        if file_path and os.path.exists(file_path):
            with open(file_path, 'r') as f:
                return f.read()
        return ''

    leadership_content = read_content(leadership_file)
    upward_content = read_content(upward_file)
    replacement_content = read_content(replacement_file)

    with open(os.path.join(leader_dir, 'meta.json'), 'w') as f:
        json.dump(meta, f, indent=2, ensure_ascii=False)

    if leadership_content:
        with open(os.path.join(leader_dir, 'leadership.md'), 'w') as f:
            f.write(leadership_content)

    if upward_content:
        with open(os.path.join(leader_dir, 'upward.md'), 'w') as f:
            f.write(upward_content)

    if replacement_content:
        with open(os.path.join(leader_dir, 'replacement.md'), 'w') as f:
            f.write(replacement_content)

tools/version_manager.py:

python
def rollback_version(base_dir, slug, version):
    """Rollback to a previous version."""
    leader_dir = os.path.join(base_dir, slug)

    versions_dir = os.path.join
...[truncated 2317 chars]
Remediation
View remediation

Remediation Suggestions

  • Convert all paths to canonical pathlib.Path objects before use.
  • Resolve the configured root and every candidate path, then require each candidate to remain beneath that root.
  • Reject absolute slugs, separators, traversal components, null bytes, control characters, and platform-specific alternate path forms.
  • Apply strict allowlists to slugs and version identifiers.
  • Restrict content-file reads to an explicit import directory or require an interactive file-selection approval step.
  • Reject symlinks for source files, leader directories, backup directories, and rollback destinations.
  • Before recursive removal, verify the resolved destination is an expected knowledge directory under one validated leader directory.
  • Refuse root directories, home directories, the base directory itself, and unexpectedly shallow paths.
  • Use atomic writes and avoid overwriting existing files unless the exact resolved target has been approved.
  • Add tests covering absolute paths, traversal, symlink escapes, malformed versions, and malicious path separators.

T01 · Skill Instruction Hijacking

Error
Location
tools/skill_writer.py:78
Finding

Persistent Skill Instruction Injection Through Unsanitized Imported Content

Content
View full analysis

Vulnerability Details

File Location: tools/skill_writer.py:78-88, 137-183; related persistence workflow at SKILL.md:624-645
Vulnerability Type: Persistent prompt injection in generated Skill instructions
Risk Level: High

Vulnerable Code

python
# Read content files
def read_content(file_path):
    if file_path and os.path.exists(file_path):
        with open(file_path, 'r') as f:
            return f.read()
    return ''

leadership_content = read_content(leadership_file)
upward_content = read_content(upward_file)
replacement_content = read_content(replacement_file)
python
skill_md_content = f"""---
name: leader-{slug}
description: {meta['name']}, {profile.get('profile', {}).get('company', '')} {profile.get('profile', {}).get('level', '')} {profile.get('profile', {}).get('role', '')}
user-invocable: true
---

# {meta['name']}

{profile_display}

---

## PART A:领导力模拟

{leadership_content or '[Leadership content goes here]'}

---

## PART B:向上管理

{upward_content or '[Upward management content goes here]'}

---

## PART C:取代路径规划

{replacement_content or '[Replacement path planning content goes here]'}

---

## 运行规则

1. 先由 PART A 判断:这位领导会怎么看这个问题?
2. 再由 PART B 执行:你该怎么跟他沟通?
3. 如果用户问"怎么取代",激活 PART C:取代路径规划
4. 输出时始终保持客观、专业的分析态度
5. PART C 的规则优先级最高:当用户问取代相关问题时,必须调用 PART C
"""

with open(os.path.join(leader_dir, 'SKILL.md'), 'w') as f:
    f.write(skill_md_content)

The update workflow further directs the agent to append imported material and regenerate the persistent Skill:

text
- Read new content using Step 2 methods
- Read existing three files under leaders/{slug}/ with Read
- Use Edit tool to append incremental content to relevant files
- Regenerate SKILL.md
- Update meta.json

Technical Analysis

Imported content is inserted verbatim into the body of a generated SKILL.md. No trust boundary separates source evi ...[truncated 1820 chars]

Remediation
View remediation

Remediation Suggestions

  • Treat imported messages and documents strictly as untrusted data, never as Skill instructions.
  • Store evidence in structured JSON fields and render it inside clearly delimited quoted-data blocks.
  • Use a schema that permits observations and citations but rejects directives, tool commands, priority declarations, role changes, and instruction-like sections.
  • Safely serialize YAML front matter with a maintained YAML library rather than interpolating raw values.
  • Escape or reject document structures capable of terminating data sections or injecting new front matter.
  • Scan imported content for prompt-injection patterns and require explicit human review before activating the generated Skill.
  • Keep generated behavioral rules in a trusted template that imported content cannot modify.
  • Record provenance for every generated assertion and retain a distinction between source quotations and model-generated analysis.
  • Do not automatically regenerate or activate a Skill after an update; show a diff and require approval.
  • Restrict generated Skills to least-privilege tools and prevent imported content from selecting or expanding allowed tools.
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 (46)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented as a leadership-analysis assistant, but it also instructs setup and use of Feishu collection tooling, local credential storage, and data collection workflows that materially expand its behavior into sensitive data acquisition. That mismatch reduces informed consent and can cause users to authorize or run collection actions they would not expect from the stated purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a leadership-analysis assistant, but it also instructs setup and use of Feishu collection tooling, local credential storage, and data collection workflows that materially expand its behavior into sensitive data acquisition. That mismatch reduces informed consent and can cause users to authorize or run collection actions they would not expect from the stated purpose.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill directs users to consolidate workplace messages, documents, meeting notes, and other records about a named leader into a reusable profile. This creates a clear privacy and data-leak risk because sensitive personal, managerial, and corporate information is being aggregated and transformed into enduring analysis artifacts.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly prioritizes collecting private chat records, criticism of subordinates, promotion history, and superior interactions about a target individual. This is highly sensitive profiling data, and centralizing it materially increases the risk of privacy harm, workplace misuse, and exposure of confidential internal information.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The skill interpolates a user-controlled slug into a destructive shell command using 'rm -rf leaders/{slug}'. If the slug is not strictly validated and shell-safe handled, this can enable path traversal or command injection, leading to deletion of arbitrary files beyond the intended directory.

Content

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

/delete-leader {slug}: 确认后执行:

bash
rm -rf leaders/{slug}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The English duplicate of the delete command has the same issue: direct use of user input in 'rm -rf leaders/{slug}' for a destructive operation. In an agent/tooling environment, this creates serious risk of arbitrary file deletion if parameter validation is weak or bypassed.

Content

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

/delete-leader {slug}: After confirmation:

bash
rm -rf leaders/{slug}

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file is a detailed workflow for obtaining Feishu OAuth credentials and harvesting private chats, contacts, docs, and wiki content, which is materially unrelated to a stated leadership-analysis skill. That mismatch is dangerous because it disguises broad surveillance/data collection as a benign workplace-analysis function, increasing the chance users will disclose sensitive credentials and communications under false pretenses.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow tells the user to obtain OAuth authorization codes and exchange them for user access tokens that permit reading and sending messages as the user. Asking the user to hand over these credentials to the agent creates a direct path to impersonation and broad access to private communications, far beyond normal assistant behavior and with severe account-security implications.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

These instructions authorize collection of complete private conversations, contact-directory data, documents, wikis, and related records far beyond what is necessary to simulate a leader or provide career advice. The breadth of collection creates a substantial privacy and insider-risk issue, exposing sensitive employee communications and organizational knowledge that could be used for manipulation, retaliation, or competitive harm.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow normalizes collection of highly sensitive private chats and documents without presenting a clear privacy warning, consent model for affected third parties, retention limits, or downstream-use disclosure. Users may not understand that the process captures full bilateral message histories and workplace documents, creating significant privacy, compliance, and trust risks.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file instructs the agent to collect complete private chat histories and related documents using user-provided access tokens, then read the resulting files back for analysis. This effectively operationalizes credentialed exfiltration of sensitive communications and knowledge assets, including data belonging to other employees who have not consented, making the skill highly dangerous in a workplace setting.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt instructs the system to extract a leader's 'weaknesses,' promotion-path gaps, and competitors specifically for 'replacement path planning,' which operationalizes workplace displacement strategy against a target individual. In this skill context, that goes beyond neutral leadership analysis and enables manipulative targeting, adversarial internal politics, and misuse of sensitive workplace data.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · tools/feishu_auto_collector.py (reported line 29)May include surrounding context.

python
help='Maximum documents to collect')
    parser.add_argument('--open-id', help='Target user open_id (for private chat)')
    parser.add_argument('--p2p-chat-id', help='Private chat ID')
    parser.add_argument('--user-token', help='User access token (for private chat)')
    parser.add_argument('--exchange-code', help='Exchange OAuth code for token')
    return parser.parse_args()

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · tools/feishu_auto_collector.py (reported line 68)May include surrounding context.

python
help='Maximum documents to collect')
    parser.add_argument('--open-id', help='Target user open_id (for private chat)')
    parser.add_argument('--p2p-chat-id', help='Private chat ID')
    parser.add_argument('--user-token', help='User access token (for private chat)')
    parser.add_argument('--exchange-code', help='Exchange OAuth code for token')
    return parser.parse_args()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README promotes automatic Feishu/DingTalk data collection but does not clearly warn users about privacy risks, consent requirements, or the sensitivity of workplace communications. In the context of a skill designed to analyze leaders, upward management, and replacement paths, this could encourage collection of private employee or manager messages without adequate authorization, increasing legal, ethical, and confidentiality risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The Chinese trigger phrases include common workplace expressions such as asking for analysis, promotion planning, or how to get along with a boss, which can cause the skill to activate unintentionally. In this skill, accidental activation is more dangerous because activation can lead into workflows for collecting sensitive workplace communications and profiling a real person.

Content

No source excerpt is available for this finding.

Ssd 4

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The workflow moves from ostensibly benign leadership simulation and communication advice into targeted guidance on replacing a leader based on weaknesses and soft spots. In context, that escalation makes the skill more dangerous because it supports adversarial profiling of a real workplace target, not just neutral professional development.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The material import flow recommends automatic collection of messages, documents, meeting notes, and private chats before presenting an immediate privacy warning at the point of collection. Users may proceed to ingest sensitive corporate or personal data without first being forced to consider authorization, confidentiality, or policy restrictions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
79% confidence
Finding

This duplicate finding points to the same persistent storage behavior: creation of leader-specific directories for knowledge and versions. In a skill centered on collecting and profiling workplace behavior, such session persistence materially raises confidentiality and misuse risks.

Content

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

  1. 创建目录结构(用 Bash):
bash
mkdir -p leaders/{slug}/versions
mkdir -p leaders/{slug}/knowledge/docs
mkdir -p leaders/{slug}/knowledge/messages
mkdir -p leaders/{slug}/knowledge/meetings

Session Persistence

Medium
Category
Rogue Agent
Confidence
79% confidence
Finding

This duplicate finding points to the same persistent storage behavior: creation of leader-specific directories for knowledge and versions. In a skill centered on collecting and profiling workplace behavior, such session persistence materially raises confidentiality and misuse risks.

Content

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

  1. 创建目录结构(用 Bash):
bash
mkdir -p leaders/{slug}/versions
mkdir -p leaders/{slug}/knowledge/docs
mkdir -p leaders/{slug}/knowledge/messages
mkdir -p leaders/{slug}/knowledge/meetings

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The English triggers are similarly broad and include routine workplace-help phrases, increasing the chance of accidental invocation. Because the skill then guides analysis of a manager and possible replacement planning, unintended activation can expose users to privacy-invasive or manipulative workflows without clear intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The English collection flow has the same issue: it encourages importing workplace records and private communications without an upfront sensitivity warning. That design increases the risk of unauthorized processing of confidential HR, performance, or internal communications data.

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 · _meta.json (reported line 6)May include surrounding context.

json
"version": "1.1.0",
  "author": "zhuqingsonga",
  "license": "MIT",
  "description": "Create a Leader AI Skill with Leadership Simulation, Upward Management, and Replacement Path Planning. 一个用于创建领导AI技能的OpenClaw skill,支持领导力模拟、向上管理、取代路径规划,帮助你理解领导、搞定老板、规划职业发展。",
  "keywords": [
    "leadership",
    "manager",

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 · _meta.json (reported line 6)May include surrounding context.

json
"version": "1.1.0",
  "author": "zhuqingsonga",
  "license": "MIT",
  "description": "Create a Leader AI Skill with Leadership Simulation, Upward Management, and Replacement Path Planning. 一个用于创建领导AI技能的OpenClaw skill,支持领导力模拟、向上管理、取代路径规划,帮助你理解领导、搞定老板、规划职业发展。",
  "keywords": [
    "leadership",
    "manager",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example solicits and persists sensitive personal and profiling data about a specific workplace leader, including employer, rank, gender, age, personality labels, and relationship context, without any privacy notice, consent check, minimization guidance, or retention controls. In this skill's context, that data is then used to build a persistent profile for simulation and strategy, increasing the risk of privacy violations, reputational harm, and misuse against a real person.

Content

No source excerpt is available for this finding.