T09 · Insecure Skill Coding Practices
- Location
internal/imap/client.go:38- Finding
IMAP and SMTP credentials may be transmitted without authenticated encryption
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real email, calendar, contacts, tasks, and files CLI, but it needs review because it has under-documented command execution and credential-safety risks.
Install only if you are comfortable giving this tool access to the configured mail, calendar, contacts, task, and WebDAV accounts. Use keychain storage, HTTPS/TLS-only endpoints, and a pinned reviewed version; avoid --no-tls, --insecure, http:// DAV URLs, --storage file, and sog idle --exec unless you intentionally want those risks. Treat delete, clear, send, upload, move, and contact/calendar update commands as real remote account mutations.
internal/imap/client.go:38IMAP and SMTP credentials may be transmitted without authenticated encryption
internal/webdav/client.go:35DAV Basic Authentication credentials can be sent to plaintext HTTP endpoints
internal/config/keyring.go:84Optional file credential backend stores account passwords in plaintext JSON
internal/cli/idle.go:74Undocumented IMAP IDLE option executes arbitrary shell commands
SKILL.md:5Recommended installation uses a mutable remote version
internal/smtp/client.go:91Unvalidated SMTP header fields permit email header injection
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
- `sog mail reply` — Reply to a message
- `sog mail forward` — Forward a message
- `sog mail move` — Move message to folder
- `sog mail copy` — Copy message to folder
- `sog mail flag` — Set message flag
- `sog mail unflag` — Remove message flag
- `sog mail delete` — Delete a message
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).
sog drive mkdir /New-Folder sog drive move /old.pdf /new.pdf sog drive copy /src.pdf /dst.pdf sog drive delete /file.pdf
**Alias:** `sog files` → `sog drive`
The code is consistent with part of the declared domain—CalDAV calendar/task operations over open standards—but it does not reflect the full declared scope. The declared description presents a general-purpose CLI covering IMAP, SMTP, CalDAV, CardDAV, and WebDAV, whereas this specific code chunk only provides CalDAV client logic for calendars, events, and tasks. There is no evidence here of IMAP, SMTP, CardDAV, generic WebDAV, or CLI trigger/command behavior. This is a description-versus-behavior mismatch at the chunk level because the actual behavior is a narrower CalDAV library component than the declared overall skill purpose.
The IMAP mail-watching behavior fits the general declared scope of an open-standards CLI for IMAP. However, this code also includes a significant undeclared capability: it can run an arbitrary shell command via sh -c whenever new mail arrives. That is materially broader than a normal IMAP/SMTP/CalDAV/CardDAV/WebDAV client function and introduces local code execution behavior not reflected in the description. The trigger model is also more specific than declared: it reacts to incoming mail events via IMAP IDLE. Signal handling itself is just implementation detail, but the shell execution on mail arrival is a meaningful description/behavior mismatch.
The declared description presents a broad multi-protocol CLI covering IMAP, SMTP, CalDAV, CardDAV, and WebDAV. The supplied code chunk is narrowly focused on IMAP only. That is a material description-to-behavior mismatch for this chunk because the actual implemented behavior does not represent the broader stated capability set. Additionally, the code is not just passive access; it performs full mailbox management operations including mutation and deletion of messages and folders, plus draft creation and IDLE monitoring. While these are related to IMAP and may fit within a larger standards-ops tool, they are more specific and powerful than the high-level description suggests. No evidence in this chunk supports SMTP, CalDAV, CardDAV, or WebDAV behavior.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
Accounts map[string]Account `json:"accounts"`
DefaultAccount string `json:"default_account,omitempty"`
Storage string `json:"storage,omitempty"` // keychain or file
path string
}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
Accounts map[string]Account `json:"accounts"`
DefaultAccount string `json:"default_account,omitempty"`
Storage string `json:"storage,omitempty"` // keychain or file
path string
}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
Accounts map[string]Account `json:"accounts"`
DefaultAccount string `json:"default_account,omitempty"`
Storage string `json:"storage,omitempty"` // keychain or file
path string
}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
Accounts map[string]Account `json:"accounts"`
DefaultAccount string `json:"default_account,omitempty"`
Storage string `json:"storage,omitempty"` // keychain or file
path string
}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
Accounts map[string]Account `json:"accounts"`
DefaultAccount string `json:"default_account,omitempty"`
Storage string `json:"storage,omitempty"` // keychain or file
path string
}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
Accounts map[string]Account `json:"accounts"`
DefaultAccount string `json:"default_account,omitempty"`
Storage string `json:"storage,omitempty"` // keychain or file
path string
}
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
c.DefaultAccount = acct.Email
}
// Store password in keyring
if err := SetPassword(acct.Email, password); err != nil {
return fmt.Errorf("failed to store password: %w", err)
}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"path/filepath"
"strings"
"github.com/zalando/go-keyring"
)
const serviceName = "sog"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type StorageType string
const (
StorageKeyring StorageType = "keychain"
StorageFile StorageType = "file"
)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type StorageType string
const (
StorageKeyring StorageType = "keychain"
StorageFile StorageType = "file"
)
No suspicious patterns detected.