Back to skill

Security audit

Douyin Clean

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to automate Douyin video posting as advertised, but it stores and exposes authenticated browser state in ways users should review before installing.

Install only if you are comfortable letting this skill operate an authenticated Douyin creator session and publish content from your account. Keep the skill directory private, protect or delete chrome_profile/ and screenshots/ when finished, avoid shared machines, and prefer a sandboxed/containerized environment with pinned Playwright versions before using it on a real account.

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
publish.py:57
Finding

Chromium Runs Without Its Security Sandbox

Content
View full analysis

Vulnerability Details

File Location: publish.py:57-60 and publish.py:111-114
Vulnerability Type: Browser sandbox disabled
Risk Level: High

python
subprocess.Popen(
    [str(CHROME_PATH), f"--remote-debugging-port={DEBUG_PORT}",
     f"--user-data-dir={str(USER_DATA_DIR)}",
     "--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage",
     "https://creator.douyin.com/"],
    stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
    env={**os.environ, "DISPLAY": ":99"}
)

The same insecure --no-sandbox option is also used by start_browser():

python
subprocess.Popen(
    [str(CHROME_PATH), f"--remote-debugging-port={DEBUG_PORT}",
     f"--user-data-dir={str(USER_DATA_DIR)}",
     "--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage",
     "https://creator.douyin.com/"],
    stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
    env={**os.environ, "DISPLAY": ":1"}
)

Technical Analysis

Chromium's sandbox separates renderer processes handling untrusted web content from the host operating system. Passing --no-sandbox removes this important security boundary. If malicious or compromised web content exploits a Chromium vulnerability, the resulting code may run directly with the privileges of the user who invoked the Skill rather than remaining confined to a restricted renderer process.

The impact is amplified because the browser uses a persistent profile under chrome_profile/. This profile can contain authenticated Douyin cookies, tokens, local storage, and other account state. The browser is also exposed through a remote debugging port. Although the script connects through 127.0.0.1, the launch command does not explicitly set --remote-debugging-address=127.0.0.1.

Attack Path

  1. The user invokes the Skill, which launches Chromium with --no-sandbox.
  2. Chromium loads the Douyin creator site and its associated web resources.
  3. An attacker ...[truncated 920 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove --no-sandbox and run Chromium with its standard sandbox enabled.
  • Run the browser as a dedicated, unprivileged operating-system user.
  • If the hosting environment cannot support Chromium's sandbox, isolate the entire process in a hardened container or virtual machine with:
    • No privileged mode.
    • Minimal Linux capabilities.
    • A read-only root filesystem where practical.
    • Only explicitly required writable mounts.
    • No access to unrelated host files or credentials.
    • Restricted outbound network access.
  • Explicitly add --remote-debugging-address=127.0.0.1.
  • Use a random or dynamically allocated debugging port and prevent access by unrelated local processes where possible.
  • Restrict the permissions of chrome_profile/ to the owning user.
  • Keep Chromium and Playwright updated to reviewed, pinned security releases.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:12
Finding

Unpinned Playwright and Browser Artifact Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:12-15
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Medium

bash
pip install playwright
python -m playwright install chromium

Technical Analysis

The installation instructions retrieve the latest available Playwright package and its Chromium artifact without pinning reviewed versions or verifying cryptographic hashes. Consequently, the dependency graph and browser binary can change after this Skill has been audited.

This does not demonstrate that the current Playwright package is malicious. The vulnerability is the absence of dependency integrity and reproducibility controls. A compromised package index, compromised upstream release, unsafe index configuration, or unexpectedly changed dependency could introduce executable code into the environment.

Python package installation may execute package-controlled build or installation logic. The downloaded Chromium binary is subsequently launched by the Skill and therefore represents another executable supply-chain component.

Attack Path

  1. A user follows the documented installation commands.
  2. pip resolves whichever Playwright release is current through the user's configured package index.
  3. Playwright retrieves a matching Chromium artifact from its configured distribution source.
  4. An upstream release, package-index response, transitive dependency, or browser artifact is compromised or unexpectedly altered.
  5. Malicious package installation logic or the downloaded browser binary executes locally.
  6. The malicious component obtains the privileges of the user performing installation or running the Skill.

Impact Assessment

A successful supply-chain compromise could execute arbitrary code with the installing or invoking user's privileges. It could access local project files, browser session data, user-selected videos, Douyin credentials, and other resources a ...[truncated 124 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin Playwright to a reviewed exact version instead of installing the latest release.
  • Use a dependency lock file containing cryptographic hashes, such as a hash-locked requirements file.
  • Pin the corresponding Chromium revision and verify its expected integrity.
  • Document the approved package index and avoid untrusted extra indexes.
  • Install dependencies inside a dedicated virtual environment as an unprivileged user.
  • Review dependency updates before changing the pinned versions.
  • Consider distributing a reproducibly built container image with a recorded digest and software bill of materials.

T09 · Insecure Skill Coding Practices

Warning
Location
publish.py:367
Finding

SMS Verification Code Is Exchanged Through a Predictable Plaintext File

Content
View full analysis

Vulnerability Details

File Location: publish.py:39, publish.py:274-287, and publish.py:367-375
Vulnerability Type: Insecure local storage of sensitive authentication data
Risk Level: Medium

python
CODE_FILE = BASE_DIR / ".sms_code.txt"
STATE_FILE = BASE_DIR / ".publish_state.json"
python
CODE_FILE.unlink(missing_ok=True)
code_received = False
for _ in range(code_timeout):
    if CODE_FILE.exists():
        code = CODE_FILE.read_text().strip()
        CODE_FILE.unlink(missing_ok=True)
        code_input = page.locator('input[type="number"]')
        if code_input.count() > 0:
            code_input.first.fill(code)
        else:
            page.locator('input[placeholder*="验证码"]').first.fill(code)
python
def send_code(code):
    """发送验证码到等待中的进程"""
    if not STATE_FILE.exists():
        print("❌ 没有等待验证码的进程")
        return
    
    state = json.loads(STATE_FILE.read_text())
    if state.get("waiting_code"):
        CODE_FILE.write_text(code)
        print("✅ 验证码已投递")
    else:
        print("❌ 进程不在等待状态")

Technical Analysis

The Skill passes an SMS one-time verification code between processes through a fixed, predictable plaintext file in the project directory. Path.write_text() does not explicitly enforce owner-only permissions, exclusive creation, ownership validation, or protection against symbolic-link attacks. Effective access therefore depends on the process umask and directory permissions.

A local process able to access the project directory may read the code while it exists, replace it before the publishing process reads it, or pre-create the path as a symbolic link. The separate state file is also predictable and unauthenticated, so it does not establish that the process submitting the code is authorized.

The code is normally deleted after it is read, but deletion does not mitigate access during the waiting window, failures be ...[truncated 1431 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace file-based code exchange with an authenticated local IPC mechanism, such as a Unix-domain socket restricted to the owning user.
  • If a file must be used:
    • Store it in a private runtime directory owned by the user.
    • Create the directory with mode 0700.
    • Create the file atomically and exclusively with mode 0600.
    • Refuse symbolic links and validate the file owner and type before reading or writing.
    • Include a cryptographically random transaction identifier so unrelated processes cannot predict the path.
    • Associate the code with a specific pending browser session.
    • Delete the file in a finally block on success, timeout, interruption, and exception.
  • Apply equivalent access controls and authenticity checks to .publish_state.json.
  • Avoid logging the code and reject values that do not match the expected numeric format and length.

T09 · Insecure Skill Coding Practices

Note
Location
publish.py:92
Finding

Authenticated Browser Screenshots Are Persisted Without Privacy Controls

Content
View full analysis

Vulnerability Details

File Location: publish.py:92-101, with authenticated-page calls at publish.py:328-344
Vulnerability Type: Persistent storage of potentially sensitive page content
Risk Level: Low

python
def _save_error_screenshot(page, label):
    """出错时自动截图"""
    ts = time.strftime("%Y%m%d_%H%M%S")
    path = str(SCREENSHOTS / f"error_{label}_{ts}.png")
    try:
        page.screenshot(path=path)
        print(f"📸 截图已保存: {path}")
    except:
        pass

The function is used even for successful and management-page checks:

python
if '发布成功' in text:
    publish_ok = True
    print("🎉 发布成功!")
    _save_error_screenshot(page, "success")
    break
python
text = page.evaluate('document.body.innerText')
_save_error_screenshot(page, "check_result")

Technical Analysis

The Skill stores screenshots of authenticated browser pages under the project-local screenshots/ directory. Captures are not limited to errors; they include successful publication and content-management checks. Such pages may display account identity, video titles, thumbnails, unpublished material, publication status, or other creator-account information.

The implementation does not explicitly configure owner-only file permissions, redact sensitive regions, request user consent for successful-operation captures, impose a retention period, or perform cleanup. The screenshots may consequently persist indefinitely and may be included in backups or project archives.

Attack Path

  1. The user publishes content while authenticated to the Douyin creator platform.
  2. The Skill captures the current authenticated page after success or during result verification.
  3. The screenshot remains in the predictable project-local screenshots/ directory.
  4. Another local user, process, backup service, support bundle, or project archive obtains access to that directory.
  5. Private account or c ...[truncated 464 chars]
Remediation
View remediation

Remediation Suggestions

  • Disable screenshots by default and require an explicit diagnostic option.
  • Do not capture successful publication or management pages unless the user expressly requests it.
  • Crop screenshots to the minimum relevant interface region and redact account identifiers, content, phone details, and other sensitive fields.
  • Create the screenshot directory with mode 0700 and screenshot files with mode 0600.
  • Implement a short retention period and automatic deletion.
  • Ensure screenshots are excluded from source control, support bundles, and routine backups where appropriate.
  • Clearly notify the user whenever a screenshot is captured and identify its storage path.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · publish.py (reported line 62)May include surrounding context.

python
"--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage",
         "https://creator.douyin.com/"],
        stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
        env={**os.environ, "DISPLAY": ":99"}
    )
    # 等Chrome启动
    for _ in range(20):

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · publish.py (reported line 116)May include surrounding context.

python
"--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage",
         "https://creator.douyin.com/"],
        stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
        env={**os.environ, "DISPLAY": ":1"}
    )
    time.sleep(8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill describes browser automation that clearly relies on powerful capabilities such as shell execution, filesystem access, network access, and persistent local browser state, but it declares no explicit tool scope or permission boundaries. In an agent setting, this increases the risk of overbroad execution and unintended access to local files, credentials, or network resources because operators cannot easily constrain what the skill is allowed to do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill states that login state is stored locally in chrome_profile/ and screenshots are saved to screenshots/, but it does not clearly warn that these artifacts may contain active session tokens, account identifiers, QR-login remnants, private content, or other sensitive data. If these directories are copied, exposed, or reused by other processes, an attacker or another user on the same system may gain account access or harvest sensitive information.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This Python file contains natural-language instructions, status messages, and command help entirely in Chinese, including the module description and usage guidance. Under the policy rule for language or locale constraints, this is a violation because the skill does not provide user opt-in, multilingual support, or any justification that it is intentionally limited to Chinese-speaking users.

Content

No source excerpt is available for this finding.

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · publish.py (reported line 51)May include surrounding context.

python
"""确保Chrome正在运行,没有则启动(使用xvfb)"""
    try:
        import urllib.request
        urllib.request.urlopen(f"http://127.0.0.1:{DEBUG_PORT}/json/version", timeout=2)
        return True  # 已在运行
    except:
        pass

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · publish.py (reported line 69)May include surrounding context.

python
"""确保Chrome正在运行,没有则启动(使用xvfb)"""
    try:
        import urllib.request
        urllib.request.urlopen(f"http://127.0.0.1:{DEBUG_PORT}/json/version", timeout=2)
        return True  # 已在运行
    except:
        pass

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · publish.py (reported line 122)May include surrounding context.

python
"""确保Chrome正在运行,没有则启动(使用xvfb)"""
    try:
        import urllib.request
        urllib.request.urlopen(f"http://127.0.0.1:{DEBUG_PORT}/json/version", timeout=2)
        return True  # 已在运行
    except:
        pass

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
91% confidence
Finding

This code launches Chromium with a remote debugging port exposed on 9222 and disables the browser sandbox. Any local process able to reach that port can attach via CDP and take over the authenticated browser session, access cookies, and manipulate the user's Douyin account. In an automation skill that persists login state, this meaningfully increases the blast radius.

Content

Scanner excerpt · publish.py (reported line 56)May include surrounding context.

python
except:
        pass
    
    subprocess.Popen(
        [str(CHROME_PATH), f"--remote-debugging-port={DEBUG_PORT}",
         f"--user-data-dir={str(USER_DATA_DIR)}",
         "--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage",

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 · publish.py (reported line 79)May include surrounding context.

python
def _stop_chrome():
    """关闭Chrome"""
    try:
        subprocess.run(["pkill", "-f", "chrome.*9222"], timeout=5,
                       capture_output=True)
    except:
        pass

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
91% confidence
Finding

This second browser-launch path has the same security issue: it starts Chromium with remote debugging enabled and sandboxing disabled, while reusing a persistent profile containing login state. That creates a takeover surface for other local actors and weakens browser containment if malicious web content is loaded.

Content

Scanner excerpt · publish.py (reported line 110)May include surrounding context.

python
print("✅ Chrome已在运行,端口 {DEBUG_PORT}")
        return
    
    subprocess.Popen(
        [str(CHROME_PATH), f"--remote-debugging-port={DEBUG_PORT}",
         f"--user-data-dir={str(USER_DATA_DIR)}",
         "--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage",

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The workflow instructs users to submit SMS verification codes via a CLI argument without explicitly labeling the code as sensitive authentication data. Passing one-time codes through command-line arguments can expose them to shell history, process listings, terminal logs, or orchestration telemetry, which may allow interception during the brief validity window.

Content

No source excerpt is available for this finding.