T09 · Insecure Skill Coding Practices
- Location
protonmail.py:77- Finding
Plaintext IMAP exposes bridge credentials and mailbox data in the ProtonMail CLI
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is coherent for reading ProtonMail, but its setup and credential handling create review-worthy risk around private email access.
Review before installing. Prefer an official Proton Bridge setup when possible, pin any Docker image or source revision, bind bridge ports to 127.0.0.1 only, avoid remote plaintext IMAP, and protect or avoid plaintext credential files with restrictive permissions such as 0600. Expect email headers and message bodies to be printed in the terminal when commands are run.
protonmail.py:77Plaintext IMAP exposes bridge credentials and mailbox data in the ProtonMail CLI
daily-scan.py:146Daily scanner transmits credentials and email metadata over plaintext IMAP
protonmail.py:135Unescaped search input permits IMAP search-criteria injection
SKILL.md:18Setup executes an unpinned third-party ProtonMail Bridge container
Most of the declared purpose matches the code: it does read, search, and scan ProtonMail via an IMAP bridge. However, the description specifically claims 'Includes daily digest for important emails,' which is not implemented anywhere in the supplied code. There is no scheduler, digest generation, importance classification, summarization, or trigger-based automation. The code only provides interactive CLI commands for mailbox listing, inbox viewing, unread listing, search, and reading individual messages. This is a material description-to-behavior mismatch because a named user-facing capability is absent.
The skill documentation describes capabilities that access environment variables, local files, and networked email services, but it does not declare any explicit tool scope or permission boundaries. In an agent setting, this increases the risk of overbroad execution and unintended access to sensitive mail content or local credential files because consumers cannot easily constrain what the skill may use.
The Docker instructions reference the image by name without a fixed tag or digest, so users may pull different or compromised image versions over time. For a mail-access bridge that handles account credentials and message contents, supply-chain drift or image takeover could expose highly sensitive data.
The interactive initialization step also uses an unpinned Docker image, which is especially risky because it is the step where users enter Proton credentials and obtain the bridge password. If the image changes or is malicious, credentials could be harvested during setup.
The configuration guidance creates persistent local storage for sensitive connection details under the user's home directory. Persistent session or credential artifacts are more dangerous in this context because the skill accesses private email, so local compromise, backups, or accidental sharing can expose long-lived mailbox access.
Create config file at ~/.config/protonmail-bridge/config.env:
PROTONMAIL_HOST=127.0.0.1
The skill instructs users to store a ProtonMail bridge password in a local config file or environment variables without guidance on file permissions, secret storage, or process-environment exposure. Because this credential grants access to mailbox contents, careless storage can lead to credential theft through local compromise, backups, logs, or other tools reading the environment.
This code accesses sensitive authentication material from both environment variables and local files, including a bridge password, but only documents the configuration mechanism rather than warning the user that stored credentials will be read. Under SQP-2 for code files, sensitive credential access should have some visible disclosure unless clearly covered as a warned behavior.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
if not CONFIG['user'] or not CONFIG['password']:
raise ValueError(
"Missing credentials. Set PROTONMAIL_USER and PROTONMAIL_PASS "
"environment variables or create ~/.config/protonmail-bridge/config.env"
)
imap = imaplib.IMAP4(CONFIG['host'], CONFIG['port'])
This code retrieves inbox metadata, search results, unread message headers, and full message bodies from an IMAP account, then prints them directly to stdout. While the behavior is core to the tool, there is no explicit user disclosure in the CLI help or command output warning that sensitive personal email data will be displayed in the terminal.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
shenxn/protonmail-bridge
docker run --rm -it -v protonmail:/root shenxn/protonmail-bridge init
No suspicious patterns detected.