T06 · System Persistence
Error
- Location
- SKILL.md:89
- Finding
- Persistent System-Wide API Proxy Service<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 89-116 **Vulnerability Type**: System persistence through a boot-enabled systemd service **Risk Level**: High ### Vulnerable Code ```bash # 1. Pastewatch proxy (starts first) cat > /etc/systemd/system/pastewatch-proxy.service << 'EOF' [Unit] Description=Pastewatch API Proxy (secret redaction) After=network-online.target Before=chainwatch-intercept.service [Service] Type=simple ExecStart=/usr/local/bin/pastewatch-cli proxy \ --port 9998 --upstream https://api.anthropic.com \ --severity high --audit-log /var/log/pastewatch-proxy.log Restart=always RestartSec=3 MemoryMax=128M [Install] WantedBy=multi-user.target EOF # 2. Update chainwatch to forward to pastewatch (not Anthropic directly) # Change --upstream from https://api.anthropic.com to http://localhost:9998 # 3. Enable and start systemctl daemon-reload systemctl enable pastewatch-proxy systemctl start pastewatch-proxy systemctl restart chainwatch-intercept ``` ### Technical Analysis The instructions create a system-level service under `/etc/systemd/system`, enable it for automatic startup, and configure it to restart continuously. They also direct the user to modify another proxy service so that API requests are routed through the downloaded `pastewatch-cli` executable. Continuous execution is relevant to an API proxy, but a root-managed, boot-enabled service is not required for the Skill's basic MCP scanning and redaction functionality. A foreground process or unprivileged per-user service would provide the relevant functionality with a smaller privilege and persistence footprint. Because the proxy is positioned in the outbound LLM request path, it can inspect and modify prompts, credentials, API headers, responses, and other data sent between the agent and its upstream provider. The reviewed project contains no source code for the executable, so its actual handling of intercepted traffic cannot be independently verified from ...[truncated 1834 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not make system-wide persistence the recommended default. Run the proxy interactively or provide an explicitly opt-in deployment procedure. - Prefer a per-user systemd service with a dedicated, unprivileged account. - If a system service is operationally necessary, add an explicit `User` and `Group` and apply systemd hardening such as: - `NoNewPrivileges=true` - `PrivateTmp=true` - `ProtectSystem=strict` - `ProtectHome=true` - `PrivateDevices=true` - `RestrictSUIDSGID=true` - `CapabilityBoundingSet=` - `RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6` - narrowly scoped `ReadWritePaths` for required logs or state - Bind the proxy only to loopback and authenticate or otherwise constrain local clients where supported. - Pin and verify the executable before allowing it to run as a service. - Document the security implications of proxying authorization headers and sensitive prompts. - Provide a complete rollback procedure: ```bash systemctl stop pastewatch-proxy systemctl disable pastewatch-proxy rm -f /etc/systemd/system/pastewatch-proxy.service systemctl daemon-reload systemctl reset-failed ``` - Require restoration and verification of the original Chainwatch upstream as part of rollback. ]]>
