T09 · Insecure Skill Coding Practices
- Location
internal/config/config.go:131- Finding
OAuth Tokens Stored in Plaintext and Keychain Preference Bypassed
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Microsoft 365 CLI is purpose-aligned, but it needs review because it can modify or delete account data and has misleading token-storage behavior.
Install only if you are comfortable granting a CLI broad delegated Microsoft 365 access, including refresh-token access. Prefer a pinned source version, review commands before allowing an agent to run delete/send/update actions, and treat ~/.config/mog/tokens.json as plaintext sensitive data despite the encryption claim.
internal/config/config.go:131OAuth Tokens Stored in Plaintext and Keychain Preference Bypassed
The delete command performs a destructive remote action immediately with no confirmation, dry-run, or safeguard, increasing the risk of accidental or coerced deletion when invoked by an agent or script. In an agent skill context, this is more dangerous because the tool can be triggered non-interactively, making unintended data loss easier.
The loop deletes all completed tasks in the selected list, which is a destructive bulk operation affecting user data. Although the command name suggests clearing, the implementation provides no confirmation prompt or pre-deletion warning before removing multiple tasks.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
ClientID string `json:"client_id"` // Go format
ClientIDv2 string `json:"clientId"` // Node format
Storage string `json:"storage"` // Token storage: file or keychain
}
// GetClientID returns the client ID, handling both formats.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
ClientID string `json:"client_id"` // Go format
ClientIDv2 string `json:"clientId"` // Node format
Storage string `json:"storage"` // Token storage: file or keychain
}
// GetClientID returns the client ID, handling both formats.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
ClientID string `json:"client_id"` // Go format
ClientIDv2 string `json:"clientId"` // Node format
Storage string `json:"storage"` // Token storage: file or keychain
}
// GetClientID returns the client ID, handling both formats.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
ClientID string `json:"client_id"` // Go format
ClientIDv2 string `json:"clientId"` // Node format
Storage string `json:"storage"` // Token storage: file or keychain
}
// GetClientID returns the client ID, handling both formats.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
type Config struct {
ClientID string `json:"client_id"` // Go format
ClientIDv2 string `json:"clientId"` // Node format
Storage string `json:"storage"` // Token storage: file or keychain
}
// GetClientID returns the client ID, handling both formats.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"encoding/json"
"fmt"
"github.com/zalando/go-keyring"
)
const (
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const (
StorageFile StorageType = "file"
StorageKeyring StorageType = "keyring"
)
// DefaultStorage is the default storage type.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const (
StorageFile StorageType = "file"
StorageKeyring StorageType = "keyring"
)
// DefaultStorage is the default storage type.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const (
StorageFile StorageType = "file"
StorageKeyring StorageType = "keyring"
)
// DefaultStorage is the default storage type.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const (
StorageFile StorageType = "file"
StorageKeyring StorageType = "keyring"
)
// DefaultStorage is the default storage type.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const (
StorageFile StorageType = "file"
StorageKeyring StorageType = "keyring"
)
// DefaultStorage is the default storage type.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const (
StorageFile StorageType = "file"
StorageKeyring StorageType = "keyring"
)
// DefaultStorage is the default storage type.
No suspicious patterns detected.