Back to skill

Security audit

Quark

Security checks for vulnerabilities and agentic risk

Overview

This Quark cloud-drive skill mostly matches its stated purpose, but it handles reusable account cookies and powerful file actions with under-hardened credential storage and broad user-directed upload/delete/share capabilities.

Review before installing. Use an isolated environment, prefer QUARK_COOKIE over passing cookies on the command line, protect or remove ~/.hermes/skills/cloud-drive/quark/config.json, and avoid batch-uploading broad directories such as ~/.hermes unless you have checked for secrets. Be careful with share, delete, clear, permanent shares, and --yes because they can expose or remove cloud-drive data.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/quark_cli.py:100
Finding

Quark Session Cookie Stored in a Plaintext File Without Enforced Access Restrictions

Content
View full analysis
None: """保存 Cookie 到配置文件""" cls.CONFIG_DIR.mkdir(parents=True, exist_ok=True) config = {} if cls.CONFIG_FILE.exists(): try: with open(cls.CONFIG_FILE, 'r') as f: config = json.load(f) except: pass config["cookie"] = cookie config["updated_at"] = int(time.time()) with open(cls.CONFIG_FILE, 'w') as f: json.dump(config, f, indent=2) ``` ### Technical Analysis The QR login flow obtains a reusable Quark authentication cookie and writes it in plaintext to: ```text ~/.hermes/skills/cloud-drive/quark/config.json ``` The implementation does not explicitly create the containing directory with owner-only permissions, create the credential file with mode `0600`, or correct the permissions of an existing file. The effective permissions therefore depend on the user's umask and any pre-existing filesystem object. The code also follows an existing path without checking whether the configuration file is a symbolic link. In an environment where another local principal can manipulate the parent directory or pre-create the target, this could expose the credential or redirect the write. This cookie authorizes sensitive cloud-drive operations, including reading file metadata, downloading and uploading files, creating public shares, and deleting data. ### Attack Path 1. The user invokes `pytho ...[truncated 1088 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/quark_cli.py:963
Finding

Authentication Cookie Exposed Through Command-Line Arguments

Content
View full analysis
...[truncated 852 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/quark_cli.py:371
Finding

Unvalidated Server-Supplied Upload Destination Receives Local File Contents

Content
View full analysis
\n\n' for i, e in enumerate(etag_list, 1): xml += f'{i}{e}\n' xml += '' cmd5 = base64.b64encode(hashlib.md5(xml.encode()).digest()).decode() cb64 = base64.b64encode(json.dumps(callback).encode()).decode() cts = datetime.now(timezone.utc).strftime('%a, %d %b %Y %H:%M:%S GMT') cmeta = f"POST\n{cmd5}\napplication/xml\n{cts}\nx-oss-callback:{cb64}\n ...[truncated 2956 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:21
Finding

Unpinned Third-Party Dependency Installation Instructions

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (46)

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 · README.md (reported line 67)May include surrounding context.

md
| `search` | 搜索文件 | `search "关键词"` |
| `upload` | 上传文件 | `upload /本地 /远程` |
| `download` | 下载文件 | `download /远程 /本地` |
| `delete` | 删除文件 | `delete /路径 -y` |
| `clear` | 清空目录 | `clear /目录 -y` |
| `mkdir` | 创建文件夹 | `mkdir "文件夹名" --parent /父目录` |
| `share` | 分享文件 | `share /文件 --expire 7d --passcode 1234` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **首次使用必须先登录**:运行 `python3 scripts/quark_cli.py login` 获取 Cookie