Scan Report
25 /100
imap-idle-watcher
Real-time email monitoring using IMAP IDLE with systemd service integration and user-defined command triggers
A legitimate IMAP IDLE email watcher that requires explicit user configuration; shell command execution is not explicitly declared in SKILL.md and uses plaintext credential storage, but no malicious behavior or hidden exfiltration is present.
Safe to install
Declare shell:WRITE in SKILL.md capabilities. Consider encrypting stored credentials or using a secrets manager instead of plaintext env files at /etc/. Review subprocess.run(shell=True) usage — prefer shell=False with argument lists where possible.
Findings 5 items
| Severity | Finding | Location |
|---|---|---|
| Medium | Shell execution capability not declared Doc Mismatch | SKILL.md:1 |
| Low | Plaintext app password storage in /etc/ Credential Theft | scripts/setup_service.sh:185 |
| Low | subprocess.run with shell=True for user-supplied commands RCE | scripts/imap_idle_daemon.py:161 |
| Low | Fake --preflight-only flag silently ignored Doc Mismatch | scripts/imap_idle_daemon.py:1 |
| Info | Inline Python test embeds credentials via string interpolation RCE | scripts/setup_service.sh:148 |
| Resource | Declared | Inferred | Status | Evidence |
|---|---|---|---|---|
| Filesystem | WRITE | WRITE | ✓ Aligned | SKILL.md (implicit) / setup_service.sh writes /etc/{service}.env and systemd uni… |
| Network | READ | READ | ✓ Aligned | IMAP4_SSL connections to IMAP servers (imap.gmail.com etc.) |
| Shell | NONE | WRITE | ✗ Violation | imap_idle_daemon.py:161 subprocess.run(ON_NEW_MAIL_CMD, shell=True) — not declar… |
| Environment | NONE | READ | ✓ Aligned | Daemon reads IMAP_ACCOUNT, IMAP_PASSWORD, ON_NEW_MAIL_CMD, FILTER_* from os.envi… |
8 findings
Medium External URL 外部 URL
https://myaccount.google.com/apppasswords references/gmail.md:8 Medium External URL 外部 URL
https://myaccount.google.com/signinoptions/two-step-verification references/gmail.md:15 Medium External URL 外部 URL
https://account.live.com/proofs/AppPassword references/outlook.md:5 Medium External URL 外部 URL
https://account.live.com/proofs/manage/additional references/outlook.md:10 Medium External URL 外部 URL
https://login.yahoo.com/account/security/app-passwords references/yahoo.md:5 Medium External URL 外部 URL
https://my-webhook.com/notify scripts/setup_service.sh:148 Info Email 邮箱地址
[email protected] SKILL.md:31 Info Email 邮箱地址
[email protected] references/troubleshooting.md:35 File Tree
7 files · 30.1 KB · 932 lines Shell 1f · 347L
Python 1f · 327L
Markdown 5f · 258L
├─
▾
references
│ ├─
gmail.md
Markdown
│ ├─
outlook.md
Markdown
│ ├─
troubleshooting.md
Markdown
│ └─
yahoo.md
Markdown
├─
▾
scripts
│ ├─
imap_idle_daemon.py
Python
│ └─
setup_service.sh
Shell
└─
SKILL.md
Markdown
Dependencies 4 items
| Package | Version | Source | Known Vulns | Notes |
|---|---|---|---|---|
imaplib | stdlib | Python standard library | No | No third-party dependencies |
email | stdlib | Python standard library | No | No third-party dependencies |
ssl | stdlib | Python standard library | No | No third-party dependencies |
subprocess | stdlib | Python standard library | No | Used for ON_NEW_MAIL_CMD execution |
Security Positives
✓ No network exfiltration or C2 communication detected
✓ No credential harvesting or theft — passwords used only for IMAP authentication
✓ No obfuscation, base64-encoded payloads, or anti-analysis techniques
✓ No suspicious filesystem access (no ~/.ssh, ~/.aws, .env scanning)
✓ No supply chain risks — only standard library Python imports used
✓ App passwords (not OAuth tokens) are scoped to Mail only, limiting blast radius
✓ SSL/TLS enforced for all IMAP connections via ssl.create_default_context()
✓ Debounce mechanism prevents command flooding
✓ IDLE capability is verified before daemon starts (preflight check)
✓ Systemd service uses Restart=always with exponential backoff reconnect