T08 · Insecure Dependencies
Error
- Location
- assets/docker-compose.xiaohongshu-mcp.yml:3
- Finding
- Unpinned Third-Party Container Handles Sensitive Account Data<![CDATA[ ## Vulnerability Details **File Location**: `assets/docker-compose.xiaohongshu-mcp.yml:1-16` **Vulnerability Type**: Unpinned third-party container dependency **Risk Level**: High ### Vulnerable Code ```yaml services: xiaohongshu-mcp: image: xpzouying/xiaohongshu-mcp container_name: xiaohongshu-mcp restart: unless-stopped ports: - "127.0.0.1:18060:18060" environment: TZ: Asia/Shanghai ROD_BROWSER_BIN: /usr/bin/google-chrome volumes: - ./data/xiaohongshu-mcp/cookies.json:/app/cookies.json - ./data/xiaohongshu-mcp/chrome:/root/.config/google-chrome - ./data/xiaohongshu-mcp/pki:/root/.pki - ./data/xiaohongshu-mcp/rod-user-data:/tmp/rod/user-data - ./data/xiaohongshu-mcp/images:/images ``` ### Technical Analysis The Compose configuration references `xpzouying/xiaohongshu-mcp` without an explicit version or immutable image digest. This is effectively a mutable image reference whose contents can change when the image is subsequently pulled or resolved. The container is given access to sensitive persistent data, including: - Xiaohongshu authentication cookies. - The Chrome user profile. - Browser PKI data. - Rod browser automation state. - Files in the mounted image directory. Consequently, trust in the external image publisher and registry directly extends to the user's authenticated Xiaohongshu session and mounted files. If the publisher account, registry, build pipeline, or mutable image tag is compromised, newly downloaded image content could access these resources without any corresponding change to this repository. The service is appropriately bound to `127.0.0.1`, but loopback binding only limits inbound network exposure. It does not protect mounted data from malicious code executing inside the container. ### Attack Path 1. An attacker compromises the image publisher account, registry entry, or upstream image build process. 2. The attacker publishes modified content und ...[truncated 1365 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the image to a reviewed immutable digest: ```yaml image: xpzouying/xiaohongshu-mcp@sha256:<verified-digest> ``` 2. Record the corresponding source version and image provenance in the setup documentation. 3. Verify image signatures or attestations before deployment where supported. 4. Review the upstream source and build process before selecting a digest. 5. Configure a non-root container user if the image supports it: ```yaml user: "<non-root-uid>:<non-root-gid>" ``` 6. Mark mounts as read-only wherever write access is unnecessary. Separate authentication data from general content mounts. 7. Add container hardening controls where compatible: ```yaml read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true ``` 8. Restrict outbound network access to destinations required for legitimate operation. 9. Regularly rotate or invalidate stored sessions after suspected image or supply-chain compromise. 10. Upgrade by explicitly reviewing and replacing the pinned digest rather than automatically following a mutable image reference. ]]>
