Back to skill

Security audit

小红书长文-谷歌浏览器

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it uses a persistent shared logged-in Chrome session and real posting automation in ways users should review carefully before installing.

Install only if you are comfortable giving the skill control of a logged-in Chrome profile that may also contain Zhihu sessions. Prefer a dedicated Chrome profile, avoid running it as root or with sudo, disable pyautogui unless needed, review posts before using --submit, and close the debug Chrome session when finished.

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

T08 · Insecure Dependencies

Warning
Location
scripts/install_chromedriver.sh:63
Finding

Third-Party Dependencies and ChromeDriver Are Installed Without Integrity Verification

Content
View full analysis
=4.15.0; python_version >= '3.7' selenium>=3.141.0,<4.0.0; python_version < '3.7' # Optional (publish fallback on VNC): pip3 install pyautogui ``` ```bash ZIP_URL="https://storage.googleapis.com/chrome-for-testing-public/${FULL_VERSION}/linux64/chromedriver-linux64.zip" TMPDIR=$(mktemp -d) trap 'rm -rf "$TMPDIR"' EXIT echo "Downloading: $ZIP_URL" if ! curl -fL "$ZIP_URL" -o "$TMPDIR/chromedriver.zip"; then echo "Download failed for version $FULL_VERSION." >&2 exit 1 fi unzip -o -q "$TMPDIR/chromedriver.zip" -d "$TMPDIR" DEST="$INSTALL_DIR/chromedriver" cp -f "$TMPDIR/chromedriver-linux64/chromedriver" "$DEST" chmod 755 "$DEST" ``` ### Technical Analysis The setup process installs Selenium from the active Python package index using broad version ranges and without cryptographic hashes. Consequently, the precise code installed can change over time without any modification to the reviewed Skill. The documentation also recommends installing `pyautogui` without a pinned version or hash. ChromeDriver is retrieved from Google's official HTTPS storage, but the downloaded archive is neither checksum-verified nor signature-verified before its executable is installed and subsequently launched. HTTPS protects transport under normal circumstances but does not provide an independent artifact-integrity guarantee against a compromised package release, package index, repository, certificate trust chain, or upstream account. ### Attack Path 1. An attacker compromises an applicable package release, package index, upstream account, download repository, or tra ...[truncated 1090 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/install_chromedriver.sh:22
Finding

Arbitrary Shell Execution Through Generated chromedriver.env File

Content
View full analysis
"$ENV_FILE" <
Remediation
View remediation
"$ENV_FILE" ``` 4. Reject newlines, carriage returns, NUL-equivalent input, and unexpected control characters in `CHROMEDRIVER_INSTALL_DIR`. 5. Canonicalize the directory and restrict it to approved locations such as `$HOME/.local/bin` or `/usr/local/bin`. 6. Ensure the generated file is owned by the expected user and is not writable by group or others. 7. Avoid recommending execution of the entire installer as root. If privileged copying is necessary, separate the verified download from a narrowly scoped privileged installation step. 8. Modify `load_chromedriver_env.sh` to parse a strict key/value format instead of using `source`. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/start_chrome_debug.sh:37
Finding

Chrome Sandbox Is Disabled When the Skill Runs as Root

Content
View full analysis
Remediation
View remediation
&2 exit 1 fi ``` 2. Remove `--no-sandbox` and `--disable-setuid-sandbox`. 3. Run VNC, Chrome, Selenium, and the publishing scripts under a dedicated account with access only to the automation profile and required content files. 4. Apply restrictive permissions to the browser profile, such as mode `0700`. 5. Avoid sharing the automation account with unrelated services or interactive workloads. 6. Where containerization is required, configure user namespaces, seccomp, capability dropping, and a non-root container user rather than disabling the browser sandbox. 7. Keep Chrome and ChromeDriver patched and version-compatible. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to publish to Xiaohongshu, but it also launches a remotely debuggable Chrome instance and reuses a shared browser profile tied to Zhihu automation. Sharing browser state across platforms increases the risk of session crossover, token exposure, and unintended access to other logged-in services beyond the stated purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The skill claims to publish to Xiaohongshu, but it also launches a remotely debuggable Chrome instance and reuses a shared browser profile tied to Zhihu automation. Sharing browser state across platforms increases the risk of session crossover, token exposure, and unintended access to other logged-in services beyond the stated purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to publish to Xiaohongshu, but it also launches a remotely debuggable Chrome instance and reuses a shared browser profile tied to Zhihu automation. Sharing browser state across platforms increases the risk of session crossover, token exposure, and unintended access to other logged-in services beyond the stated purpose.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares powerful capabilities including shell, file access, environment access, and network-related setup behavior, but does not constrain them with an explicit tool scope. In an agent setting, this weakens containment and can let the skill invoke more system functionality than users would reasonably expect from a publishing helper.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include broad natural-language terms such as '发小红书' and 'xhs publish' without clear activation boundaries. In an autonomous agent environment, that can cause accidental invocation of a real-posting workflow, especially because the documented default path includes '--submit' for actual publication.

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 · scripts/install_chromedriver.sh (reported line 10)May include surrounding context.

sh
#
# Override:
#   CHROME_VERSION=148.0.7778.215 bash install_chromedriver.sh
#   CHROMEDRIVER_INSTALL_DIR=/usr/local/bin   # use: sudo env CHROMEDRIVER_INSTALL_DIR=... bash ...

set -euo pipefail

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 · scripts/install_chromedriver.sh (reported line 53)May include surrounding context.

sh
#
# Override:
#   CHROME_VERSION=148.0.7778.215 bash install_chromedriver.sh
#   CHROMEDRIVER_INSTALL_DIR=/usr/local/bin   # use: sudo env CHROMEDRIVER_INSTALL_DIR=... bash ...

set -euo pipefail

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 · scripts/install_chromedriver.sh (reported line 70)May include surrounding context.

sh
#
# Override:
#   CHROME_VERSION=148.0.7778.215 bash install_chromedriver.sh
#   CHROMEDRIVER_INSTALL_DIR=/usr/local/bin   # use: sudo env CHROMEDRIVER_INSTALL_DIR=... bash ...

set -euo pipefail

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 · scripts/install_chromedriver.sh (reported line 71)May include surrounding context.

sh
#
# Override:
#   CHROME_VERSION=148.0.7778.215 bash install_chromedriver.sh
#   CHROMEDRIVER_INSTALL_DIR=/usr/local/bin   # use: sudo env CHROMEDRIVER_INSTALL_DIR=... bash ...

set -euo pipefail

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 · scripts/install_chromedriver.sh (reported line 83)May include surrounding context.

sh
#
# Override:
#   CHROME_VERSION=148.0.7778.215 bash install_chromedriver.sh
#   CHROMEDRIVER_INSTALL_DIR=/usr/local/bin   # use: sudo env CHROMEDRIVER_INSTALL_DIR=... bash ...

set -euo pipefail

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · scripts/install_chromedriver.sh (reported line 90)May include surrounding context.

sh
unzip -o -q "$TMPDIR/chromedriver.zip" -d "$TMPDIR"
DEST="$INSTALL_DIR/chromedriver"
cp -f "$TMPDIR/chromedriver-linux64/chromedriver" "$DEST"
chmod 755 "$DEST"

ENV_FILE="$SCRIPTS_DIR/chromedriver.env"
cat >"$ENV_FILE" <<EOF

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · scripts/install_chromedriver.sh (reported line 97)May include surrounding context.

sh
# Auto-generated by install_chromedriver.sh — sourced by xhs_publish.sh
export CHROMEDRIVER_PATH=$DEST
EOF
chmod 644 "$ENV_FILE"

echo ""
echo "Installed: $DEST"

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script explicitly uses a shared Chrome profile for both Zhihu and Xiaohongshu, which expands the skill's effective access beyond its declared Xiaohongshu-only publishing scope. In an attach/automation context, shared authenticated browser state can expose unrelated sessions, cookies, and account actions to downstream automation or misuse.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

Running Chrome detached with persistent authenticated state and an exposed DevTools debug port creates session persistence that can outlive the immediate task. In this skill context, that is more dangerous because the agent is designed to attach to Chrome and drive logged-in publishing workflows, so a lingering browser can be reused for unintended actions or access to active sessions.

Content

Scanner excerpt · scripts/start_chrome_debug.sh (reported line 52)May include surrounding context.

sh
)

if [[ "$DETACH" -eq 1 ]]; then
  nohup "${CHROME_CMD[@]}" >/tmp/chrome-zhihu-automation.log 2>&1 &
  sleep 2
  if curl -sf "http://127.0.0.1:${DEBUG_PORT}/json/version" >/dev/null; then
    echo "OK: port ${DEBUG_PORT} up."

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Telling the user to log in to Zhihu as well as Xiaohongshu broadens the set of authenticated accounts present in the automated browser, despite the skill's stated purpose being Xiaohongshu publishing. This unnecessarily increases blast radius if the debug session is misused, compromised, or controlled by other automation components.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · scripts/xhs_attach_standalone.py (reported line 802)May include surrounding context.

python
}
  return false;
}
function xhsDeepListCeBtns() {
  var list = [];
  function scan(root) {
    if (!root || !root.querySelectorAll) return;

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code changes browser permissions for geolocation and notifications using DevTools APIs, which alters persistent security settings unrelated to the core task of publishing text content. Modifying site permissions can weaken browser safeguards, affect future browsing sessions, and mask or auto-dismiss prompts the user would normally review.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script performs OS-level clicking via pyautogui, which can send mouse input to whatever window is currently focused rather than being constrained to the attached Chrome tab. In a privileged agent environment, this expands control from browser automation to arbitrary desktop interaction, creating risk of unintended clicks, confirmation of unrelated dialogs, or interaction with sensitive applications if focus changes.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: selenium has 2 known advisory(ies) (CVE-2022-28108 (Selenium Server (Grid) before 4 allows CSRF because it permits non-JSON content ); CVE-2023-5590 (NULL Pointer Dereference in GitHub repository seleniumhq/selenium prior to 4.14.)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The dependency specification for Selenium on Python >=3.7 uses a lower-bound only constraint (>=4.15.0) rather than a pinned version, which makes builds non-reproducible and prevents verifying exactly which release will be installed. In this case the cited known advisories affect older Selenium releases, and the lower bound appears to exclude them, so the immediate exploitability is limited; however, leaving the package unpinned still creates supply-chain risk and weakens assurance for a browser-automation skill that may handle authenticated sessions.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: selenium has 2 known advisory(ies) (CVE-2022-28108 (Selenium Server (Grid) before 4 allows CSRF because it permits non-JSON content ); CVE-2023-5590 (NULL Pointer Dereference in GitHub repository seleniumhq/selenium prior to 4.14.)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The Python <3.7 dependency constraint allows any Selenium version from 3.141.0 up to but excluding 4.0.0, which overlaps with versions affected by the cited Selenium Grid CSRF advisory. Although this skill may not directly expose Selenium Grid, the manifest does permit installation of versions with known advisories, and the broad range makes it impossible to guarantee a safe resolved version in older environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The script performs a persistent environment-changing operation by running pip install --user, which writes packages into the user's local Python environment. Although there is a brief status message, it does not clearly warn the user that the command will modify their system by installing dependencies.

Content

No source excerpt is available for this finding.