Back to skill

Security audit

Setv.Wang

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its advertised purpose, but it stores reusable ad-platform login cookies in plaintext for high-value advertising accounts, so it belongs in Review before installation.

Install only if you are comfortable with this skill saving ad-platform session cookies locally. Treat the saved data file like a password vault: keep it out of shared folders, backups, logs, and source control, and prefer a version that uses encrypted OS-backed secret storage with explicit delete and reauthentication controls.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
ad_manager.py:78
Finding

Reusable Authentication Cookies Stored in Plaintext

Content
View full analysis

Vulnerability Details

File Location: ad_manager.py:29-42, ad_manager.py:61-85, and ad_manager.py:106-133
Vulnerability Type: Plaintext storage of sensitive authentication data
Risk Level: High

Vulnerable Code

python
@dataclass
class AdAccount:
    """广告账户数据结构"""
    id: str
    platform: str
    account_type: str
    name: str
    cookies: List[Dict]
    created_at: float
    last_used: float
    balance: float = 0.0
    daily_cost: float = 0.0
    budget: float = 0.0
    status: str = "normal"  # normal, warning, error
python
self.accounts_file = self.storage_dir / "accounts.json"
self.accounts: Dict[str, AdAccount] = {}

# 加载已保存的账户
self._load_accounts()

def _load_accounts(self):
    """从文件加载账户数据"""
    if self.accounts_file.exists():
        try:
            with open(self.accounts_file, 'r', encoding='utf-8') as f:
                data = json.load(f)
                for account_id, account_data in data.items():
                    self.accounts[account_id] = AdAccount(**account_data)
        except Exception as e:
            print(f"加载账户数据失败: {e}")

def _save_accounts(self):
    """保存账户数据到文件"""
    data = {}
    for account_id, account in self.accounts.items():
        data[account_id] = asdict(account)

    with open(self.accounts_file, 'w', encoding='utf-8') as f:
        json.dump(data, f, ensure_ascii=False, indent=2)
python
def add_account(self, platform: Platform, account_type: AccountType,
                name: str, cookies: List[Dict]) -> str:
    """
    添加新账户
    """
    account_id = f"{platform.value}_{account_type.value}_{int(time.time())}"

    account = AdAccount(
        id=account_id,
        platform=platform.value,
        account_type=account_type.value,
        name=name,
        cookies=cookies,
        created_at=time.time(),
        last_used=time.time()
    )

    self.a
...[truncated 3143 chars]
Remediation
View remediation

Remediation Suggestions

  1. Store cookies in an operating-system credential manager or a dedicated encrypted secret store. Keep only an opaque credential reference in accounts.json.
  2. If local file storage is unavoidable, encrypt cookie values with authenticated encryption. Protect the encryption key separately from the encrypted data.
  3. Create credential files with explicit owner-only permissions, such as mode 0600 on POSIX systems, rather than relying on the process umask.
  4. Use atomic writes through a securely created temporary file, apply restrictive permissions before writing secrets, and atomically replace the destination.
  5. Retain only cookies strictly required for authentication and discard unrelated tracking or cross-domain cookies.
  6. Exclude credential files from source control, diagnostic archives, logs, and ordinary backups.
  7. Add explicit logout and credential-revocation functionality so deletion also invalidates the server-side session where supported.
  8. Validate cookie expiration before reuse and require reauthentication for expired or suspicious sessions.
  9. Remove the standalone plaintext save_cookies_to_file() helper or replace it with the same protected secret-storage mechanism.
  10. Add automated tests that verify credential files are encrypted, permission-restricted, and never included in ordinary account metadata.

T08 · Insecure Dependencies

Note
Location
requirements.txt:2
Finding

Unpinned Playwright Dependency and Browser Artifact Installation

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-2 and README.md:12-16
Vulnerability Type: Unbounded third-party dependency installation
Risk Level: Low

Vulnerable Code

text
# 广告账户管理 Skill 依赖
playwright>=1.40.0

The documented installation process is:

bash
pip install -r requirements.txt
playwright install chromium

Technical Analysis

The Playwright dependency has a minimum version but no exact version, upper bound, lock file, or package hash. Consequently, installations performed at different times can resolve to materially different Playwright releases from the one reviewed during this audit.

The subsequent playwright install chromium command downloads browser artifacts selected by the resolved Playwright version. Those artifacts are therefore also not reproducibly identified by project-controlled version or integrity metadata.

There is no evidence that Playwright is a typosquatted or intentionally malicious package, and the project does not configure an unsafe custom package repository. The risk arises from non-reproducible dependency resolution and execution of future, unaudited package and browser versions.

Attack Path

  1. A user follows the documented installation instructions.
  2. pip resolves any available Playwright release satisfying version 1.40.0 or later.
  3. Package installation executes and makes the resolved third-party code available locally.
  4. The Playwright command downloads the Chromium build associated with that resolved release.
  5. If a future release or its distribution channel is compromised, malicious or altered dependency code could execute with the installing user's privileges.
  6. Even without a compromise, an incompatible future release could change browser security behavior or break assumptions made by the Skill.

Impact Assessment

The potential privilege level is that of the user installing or running the depende ...[truncated 391 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin Playwright to an exact version that has been tested and reviewed, for example playwright==<approved-version>.
  2. Generate and commit a dependency lock file containing cryptographic hashes for approved distributions.
  3. Install dependencies with hash verification, such as pip install --require-hashes, using a fully resolved requirements file.
  4. Pin and document the corresponding Chromium revision through Playwright's supported versioning workflow.
  5. Use a trusted package index and prevent unreviewed fallback to additional package sources.
  6. Perform dependency updates through a controlled review process that includes vulnerability scanning and functional testing.
  7. Run installation and browser automation under a dedicated, least-privileged account or isolated environment.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (20)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly states that login cookies are saved locally, but it provides no warning, consent flow, retention policy, or protection requirements for that credential material. Authentication cookies are effectively bearer tokens; if they are stored insecurely or reused improperly, an attacker or another process could hijack ad-platform sessions and gain access to billing, budgets, balances, or campaign controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README explicitly promotes saving advertising-platform login cookies locally for reuse but does not warn that these cookies are highly sensitive bearer credentials. If stored insecurely or copied from disk, an attacker could hijack ad accounts without needing usernames, passwords, or MFA, which is especially risky given the skill targets financial/advertising administration systems.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill describes behavior that necessarily involves local cookie persistence and likely filesystem access, but it declares no explicit tool scope or permissions boundaries. In an agent environment, missing scope declarations can allow the skill to be invoked without clear guardrails, increasing the chance of unintended file reads/writes involving sensitive session material.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The invocation text is broad enough to match generic requests like managing ad accounts or viewing status, which can cause the skill to trigger in situations the user did not clearly intend. Because this skill handles authentication and account access, over-broad matching raises the risk of unintended login flows or exposure of sensitive account data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example trigger phrase '管理广告账户' is very general and lacks constraints around platform, account, or operation. In a credential-sensitive browser automation skill, such broad examples can encourage accidental invocation and actions affecting real ad accounts without sufficient user confirmation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manager stores authentication cookies as part of each AdAccount object and persists them to a local JSON file, creating a reusable credential store. Session cookies for ad platforms can often be used to hijack authenticated sessions, so local plaintext storage materially increases compromise risk if the host, workspace, logs, backups, or shared filesystem are accessed.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This code loads and saves the full account database, including cookies, from a local JSON file without protection. That turns the skill into a local credential/database manager beyond simple browser automation, and anyone who can read the file or its backups may recover live authentication material for advertising accounts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Updating account cookies writes sensitive session data to persistent storage without any visible warning, consent flow, or disclosure to the user. In a skill managing high-value ad accounts, silent persistence increases the chance that users do not realize credentials remain on disk after the session ends.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This helper persists browser session cookies to disk in plaintext JSON without any warning, consent flow, access control, or encryption. In this skill’s context, those cookies likely grant access to ad-platform accounts, so local theft or accidental reuse of the file could enable account takeover, spending abuse, or exposure of sensitive business data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill captures authenticated session cookies after login and stores them for later one-click reuse, but the shown flow provides no explicit notice, consent, retention policy, or protection details before persistence. Because these cookies likely grant direct access to ad platforms, theft or misuse of the stored cookie jar could let someone hijack advertiser or agency accounts, view billing data, or spend budget without re-authentication.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The user-facing strings and invocation example are entirely in Chinese, including the trigger phrase shown to users. This indicates a language-specific interaction model without any visible opt-in or alternative language support, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

All user-facing documentation in this file is presented exclusively in Chinese, with no indication that the skill supports other languages or that the Chinese-only constraint is intentional and justified. Under SQP-3, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

The user-facing skill title, functionality description, and usage examples are all in Chinese, and the file does not indicate that the skill is region-specific or provide an opt-in language choice. This may violate a language/locale policy when skills are expected to avoid forcing a language without user consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The file contains a natural-language comment only in Chinese ("广告账户管理模块"). This may indicate a language-specific constraint without any stated user choice or opt-in, which matches the policy category for forced language or locale usage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

The module's user-facing descriptive text and comments are entirely in Chinese, with no indication that the skill is intentionally region-specific or that users may choose another language. Under the stated policy, forcing a specific language without opt-in can be a locale-policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

delete_account() removes the account from memory and then persists the deletion to disk by rewriting accounts.json. The function has no confirmation prompt, visible user disclosure, or warning comment indicating that the deletion is destructive and updates stored account data permanently.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The top-level module description and in-code user-facing text are exclusively in Chinese, which reflects a fixed language choice. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring and all interactive prompts are written exclusively in Chinese, which imposes a specific language on all users. There is no indication that the skill is region-specific or that users can choose their preferred language, so this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This file contains natural-language text in Chinese ("广告账户管理 Skill 依赖") with no indication that the skill offers a language choice or that the locale restriction is intentional and documented. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

Using an unpinned dependency range for Playwright allows future versions to be installed without review, which can introduce breaking changes or unexpected security regressions into a browser-automation skill that handles ad-account access via cookie login. In this context, dependency drift is more sensitive because the skill interacts with authenticated browser sessions and external web content, increasing the blast radius if a compromised or vulnerable version is pulled.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
# 广告账户管理 Skill 依赖
playwright>=1.40.0