Back to skill

Security audit

alibabacloud-qianwenai-support

Security checks for vulnerabilities and agentic risk

Overview

Review is needed because troubleshooting can change local settings and update checks can execute an unspecified neighboring skill.

Before installing, require approval for configuration repairs and verify the exact sibling script before allowing update checks. Review ticket drafts, including their language and sensitive details. Confirm the ticket and its current status before closure. The publisher should also correct the manifest version mismatch.

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

Warning
Location
scripts/qianwen_support.py
Finding

Irreversible ticket closure bypasses the required confirmation gate

Content
View full analysis

Impact

An active support ticket can be closed before the user approves the target and action. references/operations-guide.md:130 states that closed tickets cannot be reopened.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (20)

Tainted flow: 'req' from os.environ.get (line 219, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/qianwen_support.py (reported line 230)May include surrounding context.

python
method="POST"
        )
        try:
            with urllib.request.urlopen(req, timeout=API_TIMEOUT) as resp:
                raw = json.loads(resp.read().decode("utf-8"))
        except urllib.error.HTTPError as e:
            return {"error": f"HTTP {e.code}", "detail": e.read().decode("utf-8", errors="replace")}

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

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

md
- API Key / AccessKey: `sk-****xxxx`
- User ID: `08****94`

## Output Display Rules

Parse the JSON output and present a human-readable summary — never dump raw JSON. Add analysis AFTER the summary, separated with `---`. Full rules and examples: see `references/operations-guide.md`.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · references/operations-guide.md (reported line 44)May include surrounding context.

md
3. Always use the user's original text as the comment value
4. If the user says "skip" or equivalent, skip rating entirely

## Output Display Rules

### JSON mode (recommended)

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 · scripts/qianwen_support.py (reported line 12)May include surrounding context.

python
API backend:
    POST https://cli.qianwenai.com/data/v2/api.json
    Body: {"product":"Workorder","action":"<Action>","region":"cn-beijing","params":{...}}
    Auth: Bearer token (env QIANWEN_ACCESS_TOKEN or macOS keychain)

CLI backend:
    qianwen support <list|view|create|reply|close|rate> --format json

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 · scripts/qianwen_support.py (reported line 157)May include surrounding context.

python
def _read_keychain_token() -> Optional[str]:
    """Read QianWen access token from macOS keychain."""
    if platform.system() != "Darwin":
        return None
    try:

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 · scripts/qianwen_support.py (reported line 156)May include surrounding context.

python
print(f"[WARN] {msg}", file=sys.stderr)


def _read_keychain_token() -> Optional[str]:
    """Read QianWen access token from macOS keychain."""
    if platform.system() != "Darwin":
        return None

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 · scripts/qianwen_support.py (reported line 191)May include surrounding context.

python
def _resolve_token() -> Optional[str]:
    """Resolve Bearer token: env var > macOS keychain > evals testconfig."""
    token = os.environ.get("QIANWEN_ACCESS_TOKEN", "").strip()
    if token:
        return token

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 · scripts/qianwen_support.py (reported line 195)May include surrounding context.

python
token = os.environ.get("QIANWEN_ACCESS_TOKEN", "").strip()
    if token:
        return token
    kc = _read_keychain_token()
    if kc:
        return kc
    return _read_testconfig_token()

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 · scripts/qianwen_support.py (reported line 157)May include surrounding context.

python
def _read_keychain_token() -> Optional[str]:
    """Read QianWen access token from macOS keychain."""
    if platform.system() != "Darwin":
        return None
    try:

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
2. **Reply**: draft the reply from user instructions and get confirmation before submitting.
3. **Close / Rate**: state the target ticket ID and the action, then confirm before executing.

Read-only operations (doctor, list, view, categories) need no confirmation.

## Trigger Conditions

Ticket language is forced to the support site's default regardless of the user's language.

Medium
Category
Output Handling
Confidence
97% confidence
Finding

The instruction explicitly requires ticket descriptions in the support site's language regardless of the user's language and prohibits adapting the locale to the user. It provides neither a language choice nor a documented requirement explaining why the support service cannot accept the user's preferred language.

Content

No source excerpt is available for this finding.

The recovery instructions expand ticket management into autonomous product troubleshooting and configuration repair.

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

The auto-resolve table directs the agent to update the CLI and identify and fix configuration errors, extending a ticket request into local software and configuration changes without specifying an approval gate. A user asking for support could therefore receive unrequested environment modifications that disrupt other workflows; unlike diagnostic queries, these actions are not read-only.

Content

No source excerpt is available for this finding.

The ticket-support skill instructs the agent to discover and execute sibling skills' update-check scripts, an unrelated maintenance capability.

Medium
Category
Excessive Agency
Confidence
92% confidence
Finding

The update-check procedure instructs the agent to discover a sibling skill and execute its script without defining a trusted identity, integrity check, or execution boundary. If an attacker can introduce or modify a matching sibling skill, a legitimate update-check request could cause attacker-controlled code to run with the agent's local privileges; approval for an actual update does not validate this earlier script execution.

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/qianwen_support.py (reported line 161)May include surrounding context.

python
if platform.system() != "Darwin":
        return None
    try:
        result = subprocess.run(
            ["security", "find-generic-password",
             "-s", "qianwen-cli", "-a", "cli_credentials", "-w"],
            capture_output=True, text=True, timeout=5

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/qianwen_support.py (reported line 485)May include surrounding context.

python
def _run(self, args: List[str]) -> Dict:
        cmd = ["qianwen"] + args + ["--format", "json"]
        try:
            result = subprocess.run(
                cmd, capture_output=True, text=True, timeout=CLI_TIMEOUT
            )
            stdout = result.stdout.strip()

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/qianwen_support.py (reported line 586)May include surrounding context.

python
env_diag: Dict[str, Any] = {}
        if cli_ok:
            try:
                vr = subprocess.run(["qianwen", "version"],
                                    capture_output=True, text=True, timeout=5)
                # qianwen version outputs JSON: {"version": "1.4.0"}
                try:

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/qianwen_support.py (reported line 596)May include surrounding context.

python
except Exception:
                pass
            try:
                ar = subprocess.run(["qianwen", "auth", "status", "--format", "json"],
                                    capture_output=True, text=True, timeout=5)
                auth_data = json.loads(ar.stdout.strip()) if ar.stdout else {}
                auth_ok = auth_data.get("authenticated", False)

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/qianwen_support.py (reported line 604)May include surrounding context.

python
pass
            # Environment diagnostics (Phase 0 item 4)
            try:
                dr = subprocess.run(["qianwen", "doctor", "--format", "json"],
                                    capture_output=True, text=True, timeout=CLI_TIMEOUT)
                if dr.stdout.strip():
                    env_diag = json.loads(dr.stdout.strip())

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/qianwen_support.py (reported line 641)May include surrounding context.

python
if cli_path:
        # Verify CLI is authenticated
        try:
            r = subprocess.run(
                ["qianwen", "auth", "status", "--format", "json"],
                capture_output=True, text=True, timeout=5
            )

Static analysis

No suspicious patterns detected.