Back to skill

Security audit

Fastadmin创建插件

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent FastAdmin plugin-development guide, but users should tighten the example access-control defaults before using generated controllers in production.

Before installing or using this skill, treat its generated FastAdmin code as a scaffold: review file overwrites before copying into an existing site, test in staging, and change controller authentication/authorization defaults so only intentionally public read-only actions are exempted.

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

Error
Location
SKILL.md:132
Finding

Controller Template Disables Authentication and Authorization for All Actions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 132–133
Vulnerability Type: Wildcard authentication and authorization bypass
Risk Level: High

Complete Code Snippet:

php
protected $noNeedLogin = ['*'];  // No login required for any method
protected $noNeedRight = ['*'];  // No authorization required for any method

Technical Analysis

The documented frontend controller template uses wildcard exemptions for both authentication and authorization. In FastAdmin, these properties indicate which controller actions may execute without a logged-in user and without permission checks. The '*' value applies those exemptions to every action in the controller.

Although an intentionally public, read-only index action may not require authentication, this template establishes an insecure default that also applies automatically to future actions. If a developer copies the template and later adds an endpoint that reads private information, changes application state, uploads files, or performs an administrative operation, that endpoint can remain publicly accessible unless the wildcard settings are explicitly removed.

Attack Path

  1. A developer generates or copies the controller pattern from SKILL.md.
  2. The resulting controller inherits wildcard exemptions for login and permission checks.
  3. The developer adds a sensitive action without changing the two properties.
  4. An attacker identifies or predicts the route, such as /addons/mydemo/index/<action>.
  5. The attacker invokes the action without authenticating.
  6. FastAdmin skips both login validation and authorization checks because each exemption contains '*'.
  7. The sensitive operation executes with the application privileges available to the controller.

Exploitation depends on a sensitive action being added to a controller that retains this template. The supplied index() example alone only renders a view, so the documented pattern cre ...[truncated 739 chars]

Remediation
View remediation

Remediation Suggestions

  • Use secure defaults by setting both exemption lists to empty:
    php
    protected $noNeedLogin = [];
    protected $noNeedRight = [];
    
  • If the landing page must be public, exempt only that explicitly reviewed action:
    php
    protected $noNeedLogin = ['index'];
    protected $noNeedRight = ['index'];
    
  • Keep state-changing, data-export, upload, and administrative actions behind authentication and explicit authorization checks.
  • Document that every newly added action requires a review of authentication, object-level authorization, and role permissions.
  • Require appropriate HTTP methods and CSRF protection for state-changing operations.
  • Add automated tests confirming that protected routes reject unauthenticated users and users lacking the required permission.
  • Avoid wildcard exemptions in reusable examples because copied templates commonly persist into production code.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly states that plugin files under application/ and public/ will overwrite existing site files, but it does not warn the user about backup, change review, or integrity risks. In a plugin-development skill, normalizing overwrite behavior without safeguards can lead to accidental replacement of trusted code or assets, causing service disruption or introducing insecure functionality.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The example front-end controller sets both noNeedLogin and noNeedRight to ['*'], making all controller methods publicly accessible without authentication or authorization. In the context of a plugin scaffold, developers may copy this pattern into production endpoints, unintentionally exposing sensitive actions or data to anonymous users.

Content

No source excerpt is available for this finding.