T09 · Insecure Skill Coding Practices
- Location
SKILL.md:14- Finding
API Token and Sensitive Document Data Can Be Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:14-22; credential transmission sinks also occur inscripts/types.mjs:33-43,scripts/tags.mjs:34-45,scripts/correspondents.mjs:33-44, andscripts/upload.mjs:126-130
Vulnerability Type: Cleartext transmission of credentials and sensitive data
Risk Level: HighThe documented configuration explicitly permits an
http://Paperless endpoint:markdown Set environment variables in `~/.clawdbot/clawdbot.json`: ```json { "env": { "PAPERLESS_URL": "http://your-paperless-host:8000", "PAPERLESS_TOKEN": "your-api-token" } }text The scripts accept this URL without validating its protocol and send the API token in an HTTP authorization header. For example: ```javascript const baseUrl = PAPERLESS_URL.replace(/\/$/, ''); async function run() { if (values.create) { const res = await fetch(`${baseUrl}/api/document_types/`, { method: 'POST', headers: { 'Authorization': `Token ${PAPERLESS_TOKEN}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ name: values.create }) });The upload operation additionally sends the selected document and its metadata over the same unvalidated transport:
javascript const res = await fetch(`${baseUrl}/api/documents/post_document/`, { method: 'POST', headers: { 'Authorization': `Token ${PAPERLESS_TOKEN}` }, body: formData });Technical Analysis
Bearer-style API tokens must only be transmitted through an authenticated, encrypted channel. When
PAPERLESS_URLuses HTTP, theAuthorization: Token ...header, request paths, query text, tag names, correspondent names, document titles, and uploaded document bytes are exposed to any party capable of observing or modifying traffic.This behavior is functionally necessary insofar as the Skill must authenticate to the user-configured Paperless-ngx API. It does not, however, follow least exposure because it neither requires HTTPS ...[truncated 2014 chars]
- Remediation
View remediation
Remediation Suggestions
- Require
PAPERLESS_URLto use HTTPS by parsing it with the standardURLclass and rejectinghttp::javascript const parsedUrl = new URL(PAPERLESS_URL); if (parsedUrl.protocol !== 'https:') { throw new Error('PAPERLESS_URL must use HTTPS'); } - If local plaintext access is an essential compatibility requirement, permit it only through an explicit opt-in such as
PAPERLESS_ALLOW_INSECURE_HTTP=true, and restrict it to loopback addresses by default. - Replace all documented
http://examples withhttps://. - Display a prominent warning that API tokens and documents are exposed when plaintext HTTP is enabled.
- Centralize authenticated request handling so every script applies the same protocol and destination validation.
- Configure Paperless-ngx behind TLS with certificate verification enabled. Do not disable Node.js TLS verification.
- Rotate any token that may already have traversed an untrusted plaintext network.
- Use a dedicated Paperless account and token with only the document permissions required for these operations.
- Require
