T08 · Insecure Dependencies
- Location
xhs_publisher.py:15- Finding
Callable publishing module executes mutable external scripts outside the audited project
- Content
View full analysis
Vulnerability Details
File Location:
xhs_publisher.py:15-17, with execution sites atxhs_publisher.py:41-51,xhs_publisher.py:98-129, andxhs_publisher.py:204-282
Vulnerability Type: Unverified external dependency execution
Risk Level: MediumEvidence
python XHS_SKILLS_DIR = Path(__file__).parent.parent.parent / "XiaohongshuSkills" PUBLISH_SCRIPT = XHS_SKILLS_DIR / "scripts" / "publish_pipeline.py" LOGIN_SCRIPT = XHS_SKILLS_DIR / "scripts" / "cdp_publish.py"The publishing path is executed as follows:
python cmd = [ "python", str(PUBLISH_SCRIPT), "--account", account, "--title", title, "--content", content, ] if preview: cmd.append("--preview") else: cmd.append("--headless") if images: for img in images: if img.startswith("http"): cmd.extend(["--image-urls", img]) else: cmd.extend(["--images", img]) try: result = subprocess.run( cmd, capture_output=True, text=True, timeout=120 )Other functions similarly execute
LOGIN_SCRIPTto perform login, account management, feed retrieval, commenting, liking, and bookmarking.Technical Analysis
The module resolves executable Python scripts from a sibling directory outside the audited project. The external
XiaohongshuSkillscheckout is not pinned to a reviewed version and is not validated with a signature, cryptographic digest, or trusted installation manifest before execution.Consequently, the effective code executed by this project can change independently of the reviewed artifact. The local
check_xhs_skills()function verifies only that the directory and publishing script exist; it does not establish their authenticity or integrity.The use of an argument list rather than
shell=Truelimits conventional shell metacharacter injection. It does not, however, protect against r ...[truncated 1641 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
xhs_publisher.pyfrom releases advertised as content-generation-only. Do not rely on documentation or lack of imports as a security control. - If publishing support is intentionally retained, require explicit administrative opt-in and clearly document every supported account action.
- Vendor the required implementation inside the reviewed package or install it as a version-pinned dependency from a controlled source.
- Maintain approved cryptographic hashes or signatures for executable dependency files and verify them immediately before every invocation.
- Resolve scripts only from a trusted, permission-restricted installation directory. Reject symlinks and paths writable by untrusted users.
- Execute publishing automation under a dedicated low-privilege account or sandbox with narrowly scoped filesystem and network access.
- Add tests that verify the safe release cannot invoke login, publishing, commenting, liking, bookmarking, or account-management functionality.
- Update
README.mdandSKILL.mdso their capability and risk statements accurately match the shipped code.
- Remove
