Back to skill

Security audit

Qwen Portal Auth Helper

Security checks for vulnerabilities and agentic risk

Overview

The skill has a real Qwen OAuth troubleshooting purpose, but it also creates persistent cron jobs, logs OAuth material in shared temp files, and can modify OpenClaw scheduler state unsafely.

Review carefully before installing. Use only if you understand and accept that it can read OpenClaw cron/task state, write reports, reset scheduler state, and optionally install a persistent weekly cron job. Avoid setup-monitoring until it has explicit confirmation and removal support, and do not use reset-task with untrusted task IDs.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (5)

T06 · System Persistence

Error
Location
index.js:177
Finding

Persistent Weekly Task Installation Through User Crontab

Content
View full analysis
> ~/.openclaw/logs/qwen-check.log 2>&1'; try { // Check whether it already exists const existingCron = execSync('crontab -l 2>/dev/null || echo ""', { encoding: 'utf-8' }); if (existingCron.includes('check-qwen-auth')) { return { success: true, alreadyExists: true, message: 'Monitoring task already exists' }; } // Add a new task const newCron = existingCron.trim() + '\n' + cronJob + '\n'; execSync(`echo '${newCron}' | crontab -`, { encoding: 'utf-8' }); return { success: true, alreadyExists: false, message: 'Monitoring task added', cronJob: cronJob }; } catch (error) { return { success: false, error: error.message }; } } ``` Related documentation also recommends commands such as: ```bash echo "0 9 * * 1 $(pwd)/scripts/check-qwen-auth.sh" | crontab - ``` ### Technical Analysis The `setup-monitoring` command modifies the current user's crontab and causes code from the installed Skill directory to run every Monday across login sessions and system restarts. This is a genuine persistence mechanism. Periodic monitoring is part of the declared feature set and the registration is user-triggered rather than silently performed during installation. Nevertheless, persistent execution is not required for the core OAuth-link extraction functionality and expands the Skill's execution lifetime and attack surface. If the installed script is subsequently modified or replaced, the modified code will automatically ...[truncated 1152 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
index.js:151
Finding

Arbitrary Shell Command Injection Through Task ID

Content
View full analysis
; #`. 3. `resetTaskState()` concatenates this value into the `python3` command string. 4. `execSync` invokes a shell to parse the resulting string. 5. The injected command executes with the privileges of the user running the Skill. ### Impact Assessment Successful exploitation provides arbitrary local command execution as the invoking user. The attacker can read or modify OpenClaw configuration, OAuth credentials accessible to that account, cron task state, user files, and the Skill installation. The attacker could also establish additional u ...[truncated 199 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/get-qwen-oauth-link.sh:14
Finding

Predictable Temporary Files and Plaintext OAuth Material in Shared Storage

Content
View full analysis
"$REPORT_FILE" << EOF # qwen-portal authentication status report ... EOF ``` ### Technical Analysis The scripts create files in the shared `/tmp` directory using predictable timestamp- or date-based names. They do not set a restrictive `umask`, use `mktemp`, request exclusive creation, verify ownership, or prevent symbolic-link traversal. Although the temporary OAuth output file is removed during cleanup, the daily log intentionally retains the complete OAuth authorization link and device code. The health-check report can retain task identifiers and error details. Default permissions may allow other local users to read these files, depending on the environment. Shell redirection follows existing symbolic links. A local attacker who predicts a file name can pre-create a symbolic link before execution, potentially causing the script to append to or overwrite another file writable by the victim. ### Attack Path **Confidentiality path:** 1. A local attacker predicts the date-based OAuth log or report name. 2. The victim runs the OAuth or health-check script. 3. The script writes OAuth device-flow information or task details to the shared path. 4. The attacker reads the file while the material remains useful or collects operation ...[truncated 952 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/reset-task-state.py:13
Finding

Non-Atomic Direct Rewrite of OpenClaw Scheduler State

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
PUBLISH_GUIDE.md:43
Finding

Publishing Test Replaces the Live Scheduler Database

Content
View full analysis
/tmp/test-jobs.json cp ~/.openclaw/cron/jobs.json ~/.openclaw/cron/jobs.json.backup cp /tmp/test-jobs.json ~/.openclaw/cron/jobs.json ./scripts/reset-task-state.py test-123 cp ~/.openclaw/cron/jobs.json.backup ~/.openclaw/cron/jobs.json ``` ### Technical Analysis The documented test procedure is described as a simulation, but it replaces the live OpenClaw scheduler database with test data. Restoration depends on every preceding command completing and on the user reaching the final `cp`. There is no shell trap, scheduler shutdown or lock, isolated home directory, permission validation, or atomic restoration. If the reset command fails, the shell session is interrupted, or the user stops after inspecting the result, the test database can remain installed. In addition, legitimate scheduler updates made after the backup are discarded when the old backup is restored. The test fixture also lacks fields accessed by the reset script, such as `lastStatus` and `lastError`, which increases the chance of an intermediate failure before restoration. ### Attack Path 1. A publisher follows the documented pre-release test procedure. 2. The live `~/.openclaw/cron/jobs.json` is copied aside and replaced with a one-job fixture. 3. The reset script fails, the terminal closes, or the procedure is interrupted before the restoration command. 4. OpenClaw reads the fixture instead of the real scheduler configuration. 5. Alternatively, OpenClaw writes legitimate updates during the test, and the final restoration command discards those updates. ### Impact Assessment The procedure can temporarily or permanently remove the user's configured jobs, corrupt scheduler operation, or discard concurrent ...[truncated 158 chars]
Remediation
View remediation
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
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The second mismatch is more serious because the documented workflow includes resetting arbitrary task state by task ID and modifying local OpenClaw cron/job state, which is operationally different from OAuth assistance. A user seeking auth troubleshooting could instead grant the skill effective maintenance authority over unrelated jobs, potentially causing denial of service, masking failures, or corrupting scheduler state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The second mismatch is more serious because the documented workflow includes resetting arbitrary task state by task ID and modifying local OpenClaw cron/job state, which is operationally different from OAuth assistance. A user seeking auth troubleshooting could instead grant the skill effective maintenance authority over unrelated jobs, potentially causing denial of service, masking failures, or corrupting scheduler state.

Content

No source excerpt is available for this finding.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

th-link.sh

Output: Link and code to give to user

3. After user authenticates, verify

openclaw cron run 71628635-03e3-414b-865b-e427af4e804f openclaw cron runs --id 71628635-03e3-414b-865b-e427af4e804f

4. Reset task states if needed

./scripts/reset-task-state.py 71628635-03e3-414b-865b-e427af4e804f

text

### Example 2: Proactive Maintenance
```bash
# Add to crontab for Monday morning checks
crontab -l | grep -q "check-qwen-auth" || echo "0 9 * * 1 ~/.openclaw/skills/qwen-portal-auth-helper/scripts/check-qwen-auth.sh >> ~/.openclaw/logs/qwen-check.log" | crontab -

# Review weekly reports
cat /tmp/qwen-auth-report-*.md | less

Example 3: Integration with AI Assistant

markdown
When user reports news tasks failing:
1. Run check-qwen-auth.sh to confirm qwen-portal issue
2. Run get-qwen-oauth-link.sh to get authentication link
3. Provide link and code to user
4. Guide user through browser authentication
5. Verify fix with test run
6. Reset task states if needed

⚠�

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · index.js (reported line 200)May include surrounding context.

js
-l 2>/dev/null || echo ""', { 
        encoding: 'utf-8' 
      });
      
      if (existingCron.includes('check-qwen-auth')) {
        return {
          success: true,
          alreadyExists: true,
          message: '监控任务已存在'
        };
      }
      
      // 添加新任务
      const newCron = existingCron.trim() + '\n' + cronJob + '\n';
      execSync(`echo '${newCron}' | crontab -`, { encoding: 'utf-8' });
      
      return {
        success: true,
        alreadyExists: false,
        message: '监控任务已添加',
        cronJob: cronJob
      };
    } catch (error) {
      return {
        success: false,
        error: error.message
      };
    }
  }

  /**
   * 获取使用示例
   */
  getExamples() {
    const examples = [];
    
    try {
      const exampleFiles = fs.readdirSync(this.examplesPath);
      
      for (const file of exampleFiles) {
        if (file.endsWith('.md')) {
          const content = fs.readFileSync(
            path.joi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guide instructs users to overwrite ~/.openclaw/cron/jobs.json with test data and then restore it, but it does not clearly warn that this manipulates live scheduler state and can disrupt or erase current job information if the backup/restore flow fails. In an automation/auth-recovery skill, users are likely to copy-paste commands directly, so missing safety guidance increases the chance of accidental state corruption or service interruption.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill documents scripts that read local task/configuration state and also reset task state, but the manifest declares no explicit tool scope or permissions. That creates a transparency and trust problem: users and platforms cannot easily constrain or review the file read/write behavior before installation or execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill encourages users to install recurring cron health checks without clearly warning that this creates persistence, writes logs, and may trigger follow-on recovery actions. Hidden or poorly disclosed persistence is dangerous because it changes the host's future behavior beyond the immediate troubleshooting session.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation describes automatic task-state reset behavior without adequately warning that task metadata and operational state will be modified. State resets can hide genuine failures, interfere with incident response, or cause jobs to rerun in unexpected ways if applied too broadly.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The crontab command establishes persistent scheduled execution on the user's machine. Although presented as monitoring, persistence mechanisms are security-relevant because they survive the current session and can later be abused if the referenced script is modified or the skill directory is replaced.

Content

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

Example 2: Proactive Maintenance

bash
# Add to crontab for Monday morning checks
crontab -l | grep -q "check-qwen-auth" || echo "0 9 * * 1 ~/.openclaw/skills/qwen-portal-auth-helper/scripts/check-qwen-auth.sh >> ~/.openclaw/logs/qwen-check.log" | crontab -

# Review weekly reports
cat /tmp/qwen-auth-report-*.md | less

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language command descriptions are written only in Chinese ("获取", "检查", "设置") while the rest of the manifest is in English, which suggests the skill may impose a specific language/locale on users without offering a choice. This matches the policy category for language/locale constraints that are not explicitly optional or justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The guide explicitly tells the user to log in and authorize an OAuth application, but it does not explain what scopes or data access are being granted, who operates the app, or how to verify the authorization target. In an auth-helper skill, this is materially risky because users are being coached through a sensitive consent flow and may grant broader access than intended.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · examples/quick-recovery.md (reported line 90)May include surrounding context.

安装 tmux

brew install tmux # macOS

或

sudo apt install tmux # Ubuntu/Debian

text

### **问题2: OAuth 链接无效**

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% 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 · examples/quick-recovery.md (reported line 127)May include surrounding context.

echo "0 9 * * 1 ~/.openclaw/skills/qwen-portal-auth-helper/scripts/check-qwen-auth.sh >> ~/.openclaw/logs/qwen-check.log 2>&1" | crontab -

验证添加成功

crontab -l | grep check-qwen-auth

text

### **预期维护频率**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The reset operation invokes an external reset script on a provided task ID without any warning about side effects. If the reset script alters task state or deletes data, users can trigger a destructive administrative action without clear notice or safeguards.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill is presented as an OAuth auth helper, but it also establishes recurring monitoring by modifying the user's crontab. That behavior expands scope from one-time authentication assistance to persistence on the host, which is security-relevant because users may not expect installation of scheduled tasks from a helper skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code modifies the user's cron configuration, creating a persistent scheduled execution path. Even though the scheduled job appears operational rather than overtly malicious, cron modification is a privileged persistence capability that can be abused if the script path or monitored script is later altered.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The monitoring setup changes crontab with no interactive warning, confirmation, or dry-run output. Silent persistence increases the chance of unauthorized long-term execution and makes the skill more dangerous in an agent environment where users may assume commands are limited to the advertised auth workflow.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

Reading and then updating crontab is a classic session-persistence mechanism. In this skill's context, the persistence is not inherently malware, but it does create recurring execution on the user's system, which increases risk if the underlying script, skill directory, or log redirection target is later tampered with.

Content

Scanner excerpt · index.js (reported line 186)May include surrounding context.

js
try {
      // 检查是否已存在
      const existingCron = execSync('crontab -l 2>/dev/null || echo ""', { 
        encoding: 'utf-8' 
      });

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script writes logs and Markdown reports containing task names, task IDs, error counts, and filtered error details to predictable files in /tmp. On multi-user systems or environments where /tmp is broadly readable or susceptible to symlink/race issues, this can expose operational metadata and potentially sensitive authentication-related error text to other local users.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script writes operational logs to /tmp and later records the extracted OAuth authorization link and device code in those logs. These artifacts are authentication secrets for an in-progress login flow, and placing them in a world-accessible temporary area can allow other local users or processes to read or race on them, exposing the account session initiation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

At these lines, the script explicitly logs the OAuth link and device code, which are sensitive authentication artifacts, into a log file under /tmp without warning the user. In the context of an auth helper, this is more dangerous because the script's purpose is to capture exactly the secrets needed to complete login, so disclosure can let another local actor hijack or interfere with the authentication flow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes a skill focused on automating qwen-portal OAuth authentication and handling the interactive TTY problem with monitoring and recovery tools. This file directly edits OpenClaw cron scheduler state by clearing error counters and changing job status in ~/.openclaw/cron/jobs.json, which is a separate local task-management operation rather than OAuth authentication itself.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The document instructs users to install a persistent weekly cron job that will continue running after the guide is completed, but it does not clearly warn that this changes scheduled task state on the host. While the command itself is not obviously malicious, silent persistence-oriented changes are security-relevant because they can surprise users and create an ongoing execution path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The file's user-facing descriptions, command help text, and operational messages are presented in Chinese, while the main description is partly in English, with no indication that users may choose another language. This can violate a language/locale policy when a skill effectively enforces one language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script's comments, logs, prompts, and help output are consistently written in Chinese, and there is no option to select another language or locale. 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.