Back to skill

Security audit

orchestration, telegram, cron

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent automation purpose, but its included executor can perform high-impact skill and cron changes without enforcing the Telegram authorization checks it documents.

Review before installing. This is suitable only for a tightly controlled Dev server where Telegram identity checks are enforced before any text reaches the executor, the executor account has limited privileges, and skill installs/updates are restricted to approved, pinned packages. Do not deploy the included script as a production Telegram bridge without adding structured chat/from verification and safer temporary-file handling.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/dev_executor.py:190
Finding

Declared Telegram sender and group authorization is not enforced

Content
View full analysis
tuple[bool, str]: line = line.strip() if not line.startswith("DEV "): return False, "SKIP" parts = shlex.split(line) # parts[0] = DEV if len(parts) < 2: return False, "ERR: missing command" cmd = parts[1] rest = parts[2:] if cmd == "skill": return handle_skill(rest) if cmd == "cron": return handle_cron(rest) return False, f"ERR: unknown command: {cmd}" def main(): ap = argparse.ArgumentParser() ap.add_argument("--group", required=True, help="Allowed Telegram group chat id") ap.add_argument("--pm-from", required=True, help="Allowed PM bot numeric from.id") ap.add_argument("--stdin", action="store_true", help="Read commands from stdin (for testing)") args = ap.parse_args() if args.stdin: for line in sys.stdin: ok, msg = handle_line(line) if msg != "SKIP": print(msg) return ``` ### Technical Analysis The executor accepts trusted Telegram group and sender identifiers through `--group` and `--pm-from`, but these values are never used to authorize commands. The command handler receives only an unstructured text line, so it has no access to the originating `chat.id` or `from.id`. Consequently, every input source that can write to the process's standard input is treated as authorized as long as the line begins with `DEV ` and contains an allowlisted command type. This contradicts the security contract in `SKILL.md`, which requires commands to be accepted only when both the Telegram group and sender match configured identifiers. Although the script is described as a scaffold, any wrapper that forwards Telegram text without independently and correctly enforcing identity checks would expose ...[truncated 1394 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
scripts/dev_executor.py:66
Finding

Remote skills can be installed or updated without source, version, or integrity controls

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/dev_executor.py:173
Finding

Predictable cron-job temporary file allows symlink overwrite attacks

Content
View full analysis
target-file-writable-by-executor ``` 3. The attacker or another authorized user triggers: ```text DEV cron add every=10m name="job" message="controlled content" ``` 4. The executor opens the predictable path with write-and-truncate semantics. 5. The operating system follows the symbolic link, and the target file is overwritten with the generated cron JSON. 6. Th ...[truncated 802 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (8)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
`scripts/dev_executor.py` is included as a parser/executor scaffold for testing, but the primary path is the Dev bot behavior above.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The module claims it only accepts commands from a specific Telegram group and PM sender, but the implementation never verifies either property when processing commands. In context, this script is explicitly intended to bridge chat messages into local clawhub/openclaw administrative actions, so missing authentication/authorization enables unauthorized skill installation and cron management if any untrusted input reaches handle_line.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill defines behavior that can trigger shell-like command execution (clawhub, openclaw cron ...) and access local configuration/workspace state, but it does not declare an explicit tool scope or permission boundary. In a skill that bridges Telegram messages to server-side actions, missing tool restrictions increases the risk of overbroad execution, accidental capability exposure, and unsafe deployment assumptions.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/dev_executor.py (reported line 37)May include surrounding context.

python
def run(cmd: list[str], cwd: str | None = None) -> tuple[int, str]:
    p = subprocess.run(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
    out = (p.stdout or "").strip()
    return p.returncode, out

Tainted flow: 'tmp' from os.environ.get (line 179, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
81% confidence
Finding

The temp file path is derived from the workspace path, which can come from the OPENCLAW_WORKSPACE environment variable, and the code writes to a predictable filename. If an attacker can influence that environment or workspace contents, they may cause file overwrite or symlink-based writes to unintended locations with the script's privileges.

Content

Scanner excerpt · scripts/dev_executor.py (reported line 180)May include surrounding context.

python
# Use openclaw cron add via stdin json (if supported) else via temp file.
        # We'll write a temp file.
        tmp = os.path.join(ws, "tmp-cron-job.json")
        with open(tmp, "w", encoding="utf-8") as f:
            json.dump(job, f)
        rc, out = run(["openclaw", "cron", "add", "--file", tmp], cwd=ws)
        try:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instruction 'PM speaks natural Russian to the human' imposes a specific language requirement in the skill description. Under the stated policy, forcing a language or locale without user opt-in is a natural-language policy violation unless the constraint is explicitly optional or justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The code invokes local subprocess commands to remove or run cron jobs, which can alter scheduled task state or trigger actions, but there is no confirmation prompt or direct user-facing warning at those call sites. The top-level docstring states the script executes allowlisted operations, but it does not clearly warn that these specific operations may modify or trigger system behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The code writes a cron job definition to a local file and then deletes it, but there is no confirmation prompt or user-facing notice at the point of execution. Although the module docstring describes local CLI execution generally, it does not specifically disclose this file write behavior near the operation itself.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.