Back to skill

Security audit

Mog

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
internal/config/config.go:131
Finding

OAuth Tokens Stored in Plaintext and Keychain Preference Bypassed

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (61)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/cli/auth.go (reported line 23)May include surrounding context.

go
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.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/cli/auth.go (reported line 29)May include surrounding context.

go
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.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/cli/auth.go (reported line 79)May include surrounding context.

go
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.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/cli/auth.go (reported line 118)May include surrounding context.

go
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.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/config.go (reported line 16)May include surrounding context.

go
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.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 7)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 20)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 34)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 40)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 43)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 45)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 47)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 50)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 60)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 62)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 63)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 64)May include surrounding context.

go
"encoding/json"
	"fmt"

	"github.com/zalando/go-keyring"
)

const (

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/cli/auth.go (reported line 30)May include surrounding context.

go
const (
	StorageFile    StorageType = "file"
	StorageKeyring StorageType = "keyring"
)

// DefaultStorage is the default storage type.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/cli/auth.go (reported line 80)May include surrounding context.

go
const (
	StorageFile    StorageType = "file"
	StorageKeyring StorageType = "keyring"
)

// DefaultStorage is the default storage type.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/cli/auth.go (reported line 119)May include surrounding context.

go
const (
	StorageFile    StorageType = "file"
	StorageKeyring StorageType = "keyring"
)

// DefaultStorage is the default storage type.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 20)May include surrounding context.

go
const (
	StorageFile    StorageType = "file"
	StorageKeyring StorageType = "keyring"
)

// DefaultStorage is the default storage type.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 34)May include surrounding context.

go
const (
	StorageFile    StorageType = "file"
	StorageKeyring StorageType = "keyring"
)

// DefaultStorage is the default storage type.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · internal/config/keyring.go (reported line 35)May include surrounding context.

go
const (
	StorageFile    StorageType = "file"
	StorageKeyring StorageType = "keyring"
)

// DefaultStorage is the default storage type.

Static analysis

No suspicious patterns detected.