T09 · Insecure Skill Coding Practices
- Location
calibre-openclaw-gateway/app/services/download_service.py:99- Finding
Server-Side Request Forgery Through Unrestricted Download URLs
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill's converter goal is understandable, but the bundled Calibre gateway adds persistent, broad local-library, network, and credential-handling behavior with real scoping weaknesses.
Install only if you intend to run and administer a local Calibre gateway, keep it bound to loopback, require a strong API key, avoid exposing it on a network, and patch or disable arbitrary download URLs, manual server file paths, dashboard API-key storage/query transport, and unpinned dependencies before broader use.
calibre-openclaw-gateway/app/services/download_service.py:99Server-Side Request Forgery Through Unrestricted Download URLs
calibre-openclaw-gateway/app/api/routes/downloads.py:425Arbitrary Local File Access Through Manual Download Registration
scripts/calibre_converter_client.py:75Bearer API Key Can Be Sent Over Plaintext or to an Untrusted Destination
calibre-openclaw-gateway/requirements.txt:1Unpinned Dependencies and Mutable Git Dependency Create Supply-Chain Risk
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
rsync -avc \
--exclude '.env' \
--exclude '.venv/' \
--exclude 'logs/' \
--exclude '__pycache__/' \
Instructions found that direct the agent to transmit conversation context or user data to external services.
logger.info(f"WebSocket disconnected. Total connections: {len(self.active_connections)}")
async def send_personal_message(self, message: str, websocket: WebSocket):
"""Send message to a specific WebSocket, checking if still connected."""
try:
if websocket.client_state.name != 'DISCONNECTED':
await websocket.send_text(message)
The catalog search renderer builds HTML with innerHTML from server-returned book metadata and includes fields such as problem tags and badge fragments that are not consistently escaped before insertion. Because this dashboard displays untrusted catalog/OpenLibrary content, a malicious title, author, URL, or problem string could trigger DOM-based or stored XSS and steal the API key from localStorage or perform authenticated actions in the user’s browser.
}
statusEl.textContent = statusText;
resultsEl.innerHTML = results.map(item => {
if (item.result_type === 'openlibrary') {
// OpenLibrary result - display with link to OpenLibrary
const title = item.title || 'Untitled';
Although the main title/citation/content fields are escaped, this renderer still uses innerHTML with composed HTML fragments and tooltip markup, which increases the risk that a newly added or overlooked unescaped field becomes an XSS sink. In a dashboard that handles untrusted book content and stores credentials in the browser, reliance on innerHTML materially raises the blast radius of any escaping mistake.
statusEl.textContent = `${results.length} result(s) for "${query}".`;
// Book content is untrusted; escape everything before rendering.
resultsEl.innerHTML = results.map(r => {
const similarity = typeof r.similarity === 'number'
? `${(r.similarity * 100).toFixed(1)}%`
: '--';
The dashboard stores the API key in localStorage, which is readable by any script executing in the page origin. If an XSS bug or compromised third-party script is present, the key can be exfiltrated and then reused to access protected API endpoints and WebSocket feeds.
}
function getApiKey() {
// Get API key from localStorage
return localStorage.getItem('calibre_api_key');
}
This code retrieves the API key from localStorage and appends it to the WebSocket URL as a query parameter. Query-string credentials are especially dangerous because they can be exposed in browser history, logs, monitoring systems, reverse proxies, and referrer-like telemetry, compounding the theft risk already created by localStorage storage.
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${protocol}//${window.location.host}/ws/stats`;
// Try to get API key from localStorage or prompt user
let apiKey = localStorage.getItem('calibre_api_key');
if (!apiKey) {
// Only prompt if user explicitly wants to provide an API key
Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Calibre OpenClaw Server - Run Script
# This script checks for .env file and installed dependencies before running the server
set -e