Back to skill

Security audit

frp-tunnel

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent FRP tunnel setup guide, but it gives an AI long-lived root VPS access and exposes internet-facing services with under-scoped safety guidance.

Review this carefully before installing. Use a non-root VPS user with limited sudo instead of a passphrase-free root key, restrict or disable the FRP dashboard, verify downloaded binaries before installing them, store the Cloudflare token with stricter permissions or systemd credentials, and only expose local services that are meant to be reachable from the public internet.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
setup-guide.md:42
Finding

Passwordless SSH Key Grants Unrestricted Root Access to an AI Agent

Content
View full analysis
``` ### Technical Analysis The guide directs the user to generate an unencrypted SSH private key specifically for use by an AI agent and authorize that key for direct login as `root`. Although privileged access is needed for portions of the initial installation, unrestricted and continuing root access exceeds the minimum privileges required for routine tunnel management. The absence of a passphrase means that possession of `~/.ssh/frp-vps` is sufficient to authenticate. No server-side restrictions such as `from=`, `restrict`, `command=`, or limited `sudo` rules are specified. Any process, extension, agent, or user capable of reading the private key can therefore obtain full administrative access to the VPS. ### Attack Path 1. An attacker compromises the local user account, AI-agent context, development tool, backup, or another process with read access to `~/.ssh/frp-vps`. 2. The attacker copies the unencrypted private key. 3. The attacker identifies the VPS address from the SSH configuration, command history, or Skill documentation. 4. The attacker runs: ```bash ssh -i frp-vps root@ ``` 5. Because the key is authorized directly for root and has no passphrase, the attacker receives an unrestricted root shell. 6. The attacker can replace FRP or Caddy, intercept tunneled traffic, extract configuration and credentials, or establish additional persistence. ### Impact Assessment Successful exploitation grants full root privile ...[truncated 448 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
setup-guide.md:117
Finding

Downloaded Executables Are Installed and Run Without Integrity Verification

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
setup-guide.md:93
Finding

FRP Administrative Dashboard Is Exposed to the Public Internet

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
setup-guide.md:213
Finding

Cloudflare DNS API Token Is Persisted in Plaintext Systemd Configuration

Content
View full analysis
/etc/systemd/system/caddy.service.d/override.conf << EOF [Service] Environment="CF_API_TOKEN=Paste your token here" EOF ``` Caddy then consumes the environment variable: ```caddyfile *.tunnel.your-domain.com { tls { dns cloudflare {env.CF_API_TOKEN} } reverse_proxy localhost:8080 } ``` The same storage pattern appears in `SKILL.md`: ```ini [Service] Environment="CF_API_TOKEN=your-token" ``` ### Technical Analysis The guide persists a Cloudflare API token directly in a systemd unit override. The token must remain available to Caddy for DNS-01 certificate operations, but embedding it in service configuration increases the likelihood of accidental disclosure through configuration backups, diagnostic bundles, file collection, support output, or overly permissive file permissions. The guide appropriately recommends restricting the token to `Zone > DNS > Edit` for one zone, which limits but does not eliminate the impact. An attacker who obtains this credential can modify DNS records within the authorized zone. ### Attack Path 1. An attacker obtains local file-read access, an improperly protected backup, a diagnostic archive, or copied systemd configuration. 2. The attacker reads: ```text /etc/systemd/system/caddy.service.d/override.conf ``` 3. The plaintext `CF_API_TOKEN` value is recovered. 4. The attacker submits authenticated requests to the Cloudflare API. 5. The attacker modifies DNS records in the permitted zone to redirect traffic, disrupt service, or support phishing and certificate-related attacks. ### Impact Assessment The attacker gains the Cloudflare permissions ass ...[truncated 442 chars]
Remediation
View remediation
DNS > Edit` for only the required zone. 2. Store the secret in a dedicated root-owned file with mode `0600` rather than embedding it directly in a unit override. 3. Prefer systemd credential facilities such as `LoadCredential=` where supported. 4. Ensure the token is not printed by diagnostics, committed to version control, or included in general configuration backups. 5. Limit access to the service configuration and credential directories. 6. Rotate the token immediately if the override file has been exposed. 7. Audit Cloudflare DNS changes and configure alerts for unexpected record modifications. 8. Consider per-domain HTTP-01 validation when a persistent DNS-edit token is not acceptable. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill’s core purpose is to expose local development services to the public internet, but it does not prominently warn users about privacy, authentication, or unintended data exposure risks before doing so. In this context, local dev servers commonly expose debug endpoints, test data, admin panels, or unauthenticated APIs that are safe only on localhost, so omission of a clear warning materially increases the chance of accidental exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation instructs users to provision and store a Cloudflare API token for DNS-01 certificate issuance, but it does not clearly emphasize that this credential is highly sensitive or provide secure handling guidance. A leaked DNS-edit token can allow an attacker to modify DNS records for the zone, potentially enabling domain takeover scenarios, traffic interception, service disruption, or fraudulent certificate issuance workflows depending on zone configuration.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The skill directs users to persist the Cloudflare API token in a systemd override as an environment variable, which creates a long-lived credential on disk and in service configuration. While this may be operationally convenient, persistent credential storage increases exposure through backups, misconfigured file permissions, administrative inspection commands, or later accidental disclosure, especially on a VPS that also hosts internet-facing services.

Content

Scanner excerpt · SKILL.md (reported line 85)May include surrounding context.

md
caddy list-modules | grep cloudflare

# 3. 設定 CF token
mkdir -p /etc/systemd/system/caddy.service.d
cat > /etc/systemd/system/caddy.service.d/override.conf << EOF
[Service]
Environment="CF_API_TOKEN=你的token"

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The guide explicitly instructs generating an SSH private key with no passphrase so an AI agent can log into a root account unattended. That removes an important protection for a highly privileged credential; if the key file is copied, exposed in backups, or accessed by another local process, the attacker gets immediate root access to the VPS.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document tells users to create a passphrase-free SSH key for AI access without a prominent warning about the security tradeoff. In context, this is especially risky because the instructions also use the root account, magnifying the consequences of key theft or unintended agent access.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-guide.md (reported line 165)May include surrounding context.

EOF

systemctl daemon-reload systemctl enable frps systemctl start frps systemctl status frps

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-guide.md (reported line 273)May include surrounding context.

EOF

systemctl daemon-reload systemctl enable frps systemctl start frps systemctl status frps

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guide directs users to paste a Cloudflare API token into a systemd override file as an environment variable, but does not explain secret exposure risks. Secrets stored this way may be readable by privileged users, leaked through backups or configuration sharing, and mishandled because the guide normalizes direct inline placement.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-guide.md (reported line 295)May include surrounding context.

建立本地設定檔

bash
mkdir -p ~/.frp

cat > ~/.frp/frpc.toml << 'EOF'
serverAddr = "<VPS_IP>"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The title and operational instructions are presented in Chinese, effectively forcing a specific language for users of the skill. There is no opt-in, bilingual alternative, or statement that the skill is intentionally region/language-specific.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.