T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/list_notes.py:35
- Finding
- WebDAV Credentials Exposed in Process Arguments and Potentially Transmitted over Cleartext HTTP## Vulnerability Details **File Location**: `scripts/list_notes.py:35-38, 56-57`; `scripts/get_note.py:29-34`; `scripts/upsert_note.py:83-89` **Vulnerability Type**: Credential exposure and insecure transport configuration **Risk Level**: High ### Vulnerable Code `scripts/list_notes.py:35-38`: ```python command = [ "curl", "-s", "-u", f"{JOPLIN_USERNAME}:{password}", "-X", "PROPFIND", "--header", "Depth: infinity", url ] result = subprocess.run(command, capture_output=True, text=True, check=True) ``` `scripts/list_notes.py:56-57`: ```python command = ["curl", "-s", "-u", f"{JOPLIN_USERNAME}:{password}", f"{url}{filename}"] result = subprocess.run(command, capture_output=True, text=True, check=True) ``` `scripts/get_note.py:29-34`: ```python filename = f"{note_id}.md" command = [ "curl", "-s", "-u", f"{JOPLIN_USERNAME}:{password}", f"{url}{filename}" ] result = subprocess.run(command, capture_output=True, text=True) ``` `scripts/upsert_note.py:83-89`: ```python command = [ "curl", "-s", "-u", f"{JOPLIN_USERNAME}:{password}", "-X", "PUT", "-T", "-", f"{url}{filename}" ] result = subprocess.run(command, input=content.encode('utf-8'), capture_output=True) ``` ### Technical Analysis Each WebDAV operation inserts the value of `JOPLIN_PASSWORD` directly into the `curl` process argument list through the `-u username:password` option. Depending on operating-system process visibility and monitoring configuration, another local user or diagnostic service may be able to observe the complete argument list while `curl` is running. The scripts also accept `JOPLIN_WEBDAV_PATH` without validating its scheme. If it begins with `http://`, HTTP Basic authentication credentials and Joplin note contents are sent without transport encryption. Basic authentication only encodes credentials and does not provide confidentiality. ### Attack Path 1. A user configures `JOPLIN_W ...[truncated 840 chars]
- Remediation
- ## Remediation Suggestions - Replace command-line `curl` execution with a maintained HTTP/WebDAV library that accepts credentials through an in-memory authentication API. - Require the configured URL to use the `https` scheme and reject cleartext HTTP. - Preserve TLS certificate and hostname verification; do not add insecure certificate-bypass options. - Validate the configured destination against an explicit host allowlist where deployment permits. - Reject URLs containing embedded credentials, unsupported schemes, fragments, or unexpected redirects. - If `curl` must remain in use, provide credentials through a protected mechanism that does not expose the password in the process argument list. - Use a WebDAV account limited to the required Joplin directory rather than a broadly privileged account.
