T09 · Insecure Skill Coding Practices
- Location
scripts/cookie_manager.py:45- Finding
Authentication Cookies Are Persisted Without Restrictive File Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Xiaohongshu automation skill is disclosed as an operations tool, but it combines account-changing actions, bulk engagement, browser stealth, and plaintext session persistence without enough enforced user control.
Review this skill carefully before installing. It can automate real Xiaohongshu account actions, store login material locally, scrape and save platform data, and hide browser automation signals. Use only with an account you are willing to risk, avoid bulk actions unless you have manually reviewed every target, and treat the stored cookie/profile files as sensitive credentials.
scripts/cookie_manager.py:45Authentication Cookies Are Persisted Without Restrictive File Permissions
scripts/cookie_manager.py:27User-Controlled Profile Name Allows Filesystem Path Traversal
scripts/cli.py:219Mandatory Confirmation and Login Safeguards Are Not Enforced for Account-Changing Operations
The declared purpose frames the skill as a Xiaohongshu operations assistant, but the documentation also includes browser automation startup, CDP connectivity, stealth injection, and profile isolation. Those capabilities materially expand the attack surface into anti-detection automation and privileged browser control, which are more sensitive than ordinary search or analytics and can enable covert account actions or evasion of platform safeguards.
The declared purpose frames the skill as a Xiaohongshu operations assistant, but the documentation also includes browser automation startup, CDP connectivity, stealth injection, and profile isolation. Those capabilities materially expand the attack surface into anti-detection automation and privileged browser control, which are more sensitive than ordinary search or analytics and can enable covert account actions or evasion of platform safeguards.
The declared purpose frames the skill as a Xiaohongshu operations assistant, but the documentation also includes browser automation startup, CDP connectivity, stealth injection, and profile isolation. Those capabilities materially expand the attack surface into anti-detection automation and privileged browser control, which are more sensitive than ordinary search or analytics and can enable covert account actions or evasion of platform safeguards.
The declared purpose frames the skill as a Xiaohongshu operations assistant, but the documentation also includes browser automation startup, CDP connectivity, stealth injection, and profile isolation. Those capabilities materially expand the attack surface into anti-detection automation and privileged browser control, which are more sensitive than ordinary search or analytics and can enable covert account actions or evasion of platform safeguards.
The launcher explicitly advertises and implements stealth/evasion to bypass browser automation detection, including disabling AutomationControlled and concealing automation fingerprints. In the context of a bulk XHS operations skill that performs likes, comments, follows, and account operations, this materially increases abuse capability by helping the agent evade platform defenses and operate deceptive automation at scale.
The code tampers with navigator.webdriver, plugins, languages, window.chrome, and known automation marker properties to disguise automated control from websites. This is a direct concealment mechanism, and within a social-media growth/interaction skill it enables deceptive engagement, account farming, or policy-violating automation while making detection harder.
The skill advertises capabilities that imply file access, cookie persistence, and network/browser automation, but it does not declare any explicit tool scope or permission boundaries. This makes the effective authority of the skill opaque, increasing the risk of over-privileged execution and making it harder for users or the platform to constrain sensitive actions.
The skill advertises data collection, cookie persistence, and account interaction, but it does not present a clear up-front warning about privacy risks, stored authentication material, or the consequences of automated likes/comments/follows. In this context, weak disclosure is dangerous because users may unknowingly authorize scraping and account actions that affect personal data, account integrity, or platform compliance.
The trigger phrases are broad enough to match ordinary discussion about Xiaohongshu operations, analytics, or content, which can cause the skill to activate unexpectedly. Because the skill includes account-affecting actions and data collection, overbroad routing increases the chance of unintended invocation of sensitive capabilities.
The skill's safety section forbids generic browser-based operation, yet the same file endorses Playwright/Chrome automation and Selenium injection. This contradiction weakens operator trust, makes safeguards unenforceable, and may normalize hidden browser automation despite ostensibly restrictive policy language.
Recommending Selenium-based signature injection explicitly introduces an anti-detection and request-forging capability. In the context of a social-platform automation skill, this can be used to bypass platform protections, automate actions under a user's account, and conceal activity that would otherwise be blocked or rate-limited.
Forcing Chinese-preferred browser languages without user choice modifies the browser fingerprint to impersonate a regional user profile and may be used to blend automated traffic into a target platform's expected locale. In this skill's context, that strengthens evasion and deceptive targeting rather than serving a clearly documented functional requirement.
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.
try:
import aiohttp
async with aiohttp.ClientSession() as session:
async with session.get(
f"http://localhost:{self.port}/json/version"
) as resp:
if resp.status == 200:
The module docstring and command/help text throughout the CLI are written exclusively in Chinese, with no indication that users can choose another language or locale. This imposes a language constraint on all users rather than offering an opt-in or clearly documenting a justified region-specific limitation.
The interact comment command triggers a real external account action using the authenticated Xiaohongshu account and accepts arbitrary comment text without any confirmation, dry-run mode, or explicit warning that it will post publicly. In a skill explicitly designed for bulk social-media operations, this increases the risk of accidental posting, spammy automation, or misuse of the user's account and reputation.
The code persists authentication cookies, including likely session tokens such as web_session and a1, to a predictable plaintext file under the user's home directory without encryption, permission hardening, or an explicit user warning. In the context of an automation skill that supports multi-account operation and browser login reuse, theft of this file could allow session hijacking and unauthorized access to Xiaohongshu accounts.
This code performs remote collection of platform content and related data without any built-in notice, consent, or purpose limitation. In a scraping/operations skill, silent collection increases privacy and compliance risk because users and operators may not be clearly informed that third-party content and metadata are being harvested over the network.
The file’s documented scope is search/detail/comment collection, but it also implements bulk collection of arbitrary users’ posted notes via user_id. In the context of an account-operations and bulk-interaction skill, this broadens surveillance capability and enables targeted profiling or mass harvesting beyond what a user may reasonably expect from the module description.
Collected notes are persisted locally to a predictable directory under the user’s home folder without an explicit warning, retention control, or access protections. This creates a privacy and data-governance risk because scraped content may remain on disk longer than intended and be accessible to other local processes or users depending on system configuration.
The batch interaction methods enable automated likes, collects, and comments against an external platform with no built-in confirmation, authorization gate, scope limit, or stronger anti-abuse controls beyond a simple delay. In the context of an XHS运营/批量互动 skill, this directly facilitates mass engagement actions that can violate platform rules, cause account sanctions, and be abused for spam or inauthentic engagement at scale.
The parser explicitly exposes an xsec-token from embedded page state without any access control, purpose limitation, auditability, or user disclosure. In the context of a XiaoHongShu automation skill that also supports search, data collection, and batch interactions, surfacing a request/authentication token increases the risk of unauthorized API use, session abuse, and bypass of intended platform controls.
The client persists cookies and authentication-related values (including X-s, X-t, device_id, and a1) to a predictable file under the user's home directory without any access-control hardening, encryption, or explicit user consent. In the context of a bulk-operation XiaoHongShu automation skill, these values can enable session reuse or account takeover if another local process, user, or backup/sync system can read the file.
The request method attaches cookies to outbound headers and sends POST bodies to remote endpoints, which can include user content and session identifiers. The code contains no visible prompt, logging, or user-facing notice that account/session data and request content will be transmitted over the network.
The natural-language description identifies the skill specifically as '小红书运营专家技能', which implies a Chinese-language and China-platform focus without stating that this locale/language constraint is optional or user-selected. Under the policy, forced language or locale behavior should be documented as opt-in or clearly justified as region-specific.
The manifest specifies httpx with only a minimum version, so dependency resolution may select a release with known advisories or an unreviewed future release. In a skill that performs network access and likely processes remote content, leaving the version range open increases supply-chain and runtime exposure because the deployed package version cannot be verified as safe from the manifest alone.