Back to skill

Security audit

Otpforge

Security checks for vulnerabilities and agentic risk

Overview

OtpForge appears to be a legitimate local TOTP manager, but it handles long-lived 2FA secrets in ways users should review carefully before installing.

Review this skill before installing if you would store real account MFA seeds. Avoid entering TOTP seeds on the command line, do not place the vault in shared or synced folders, restrict access to the vault file, and prefer an encrypted password manager or OS-backed authenticator for important accounts.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
cli.py:22
Finding

TOTP Secret Exposure Through Command-Line Arguments

Content
View full analysis
--issuer --digits 6 --period 30` ``` ### Technical Analysis The application accepts a TOTP seed as a positional command-line argument. Command-line arguments are not an appropriate channel for authentication secrets because they may be exposed through: - Shell history files. - Process inspection utilities while the command is running. - Operating-system process accounting or auditing. - Terminal session recording and command telemetry. - Diagnostic logs that capture executed command lines. A TOTP seed is a long-lived credential rather than a single-use code. Anyone who obtains it can generate future valid codes for the associated account, subject only to the configured time period and clock synchronization. ### Attack Path 1. A user follows the documented command and runs `python3 cli.py add account BASE32_SECRET`. 2. The shell records the complete command in its history, or a local process-monitoring facility captures the process arguments. 3. An attacker with access to that history, telemetry, or process information extracts the Base32 seed. 4. The attacker imports the seed into another TOTP implementation. 5. The attacker generates valid current and future TOTP codes and uses them with separately obtained account credentials. ### Impact Assessment Successful exploitation discloses the second-factor seed for the account being added. The a ...[truncated 316 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
core.py:86
Finding

TOTP Seeds Stored Unencrypted in the Local JSON Vault

Content
View full analysis
None: self._ensure_parent() temp = self.path.with_suffix(".tmp") with temp.open("w", encoding="utf-8") as fh: json.dump(data, fh, indent=2) fh.write("\n") os.replace(temp, self.path) os.chmod(self.path, 0o600) ``` ### Technical Analysis The application writes long-lived TOTP seeds directly to a human-readable JSON file. Applying mode `0600` after replacement is a useful access-control measure, but it is not encryption and does not protect the secrets from: - Malware or an attacker operating under the same user account. - Accidental copies, archives, or backups of the vault. - Offline disk or filesystem acquisition. - Privileged local users. - Other processes that read the file before permissions are corrected after replacement. The temporary file is created using the process's current `umask`, and restrictive permissions are applied only to the destination after `os.replace`. Consequently, the temporary plaintext file may briefly have broader permissions than intended under a permissive `umask`. ### Attack Path 1. The user adds one or more TOTP accounts. 2. `_write_raw` serializes every seed into a plaintext temporary JSON file and replaces the configured vault file with it. 3. An attacker obtains user-context file access, privileged local access, access to a backup, or access to the temporary file w ...[truncated 695 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

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 · SKILL.md (reported line 24)May include surrounding context.

md
if override:
        return Path(override).expanduser().resolve()
    home = Path.home()
    return home / ".config" / APP_NAME / "secrets.json"


def _normalize_secret(secret: str) -> str:

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 · SKILL.md (reported line 25)May include surrounding context.

md
if override:
        return Path(override).expanduser().resolve()
    home = Path.home()
    return home / ".config" / APP_NAME / "secrets.json"


def _normalize_secret(secret: str) -> str:

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 · SKILL.md (reported line 26)May include surrounding context.

md
if override:
        return Path(override).expanduser().resolve()
    home = Path.home()
    return home / ".config" / APP_NAME / "secrets.json"


def _normalize_secret(secret: str) -> str:

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 · core.py (reported line 24)May include surrounding context.

python
if override:
        return Path(override).expanduser().resolve()
    home = Path.home()
    return home / ".config" / APP_NAME / "secrets.json"


def _normalize_secret(secret: str) -> str:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises capabilities that clearly involve reading environment variables, reading and writing local files, and invoking Python from the shell, but it does not declare any tool scope or permission boundaries. This weakens least-privilege controls and makes it easier for an agent runtime to grant broader access than users expect, especially because the skill handles highly sensitive TOTP secrets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill description and usage notes instruct users to store TOTP seeds in a local JSON vault but do not warn that these secrets are equivalent to second-factor credentials and require strong local protection. Users may unknowingly place reusable MFA secrets in plaintext or weakly protected storage, increasing the chance of account compromise if the host or file is exposed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The vault writes TOTP secrets directly into a JSON file in plaintext, which means any local user, malware, backup system, or process with filesystem access can recover the underlying 2FA seeds and generate valid codes indefinitely. Although the file permissions are tightened to 0600 after writing, the data is still unencrypted at rest and the temporary file may briefly exist before replacement, so the skill context of storing authentication factors locally makes this especially sensitive.

Content

No source excerpt is available for this finding.