Back to skill

Security audit

eframe 框架快速开发技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent documentation for eframe CRUD development, but one reusable backend example omits authorization checks on detail and export endpoints that users may copy into real applications.

Install only if you are comfortable reviewing the generated code. Before using any copied backend controller template, add explicit permission checks to detail, export, update, delete, and other business-data endpoints, and verify authorization tests fail closed for users without the required permissions.

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
references/backend-layers.md:231
Finding
Reusable API Templates Omit Authorization Checks on Detail and Export Endpoints<![CDATA[ ## Vulnerability Details **File Location**: `references/backend-layers.md:231-236` and `references/backend-layers.md:251-258` **Vulnerability Type**: Missing method-level authorization in reusable API templates **Risk Level**: High ### Vulnerable Code ```java // 详情 @GetMapping(value = "dictionary/{dictId}") @Encrypt public ResponseEntity<BaseDictionaryVo> getInfo(@PathVariable Long dictId) { BaseDictionaryDto dto = baseDictionaryService.getDtoById(dictId); return success(BaseDictionaryVo.DTO.apply(dto)); } ``` ```java // 导出:ExcelUtil 泛型 @PostMapping("dictionary/export") @Encrypt public void export(HttpServletResponse response, BaseDictionaryVoParam param) { Page<BaseDictionaryDto> result = baseDictionaryService.getPageDto(param.toModelParam()); List<BaseDictionaryVo> vos = Lists.transform(result.getResult(), BaseDictionaryVo.DTO); ExcelUtil<BaseDictionaryVo> util = new ExcelUtil<>(BaseDictionaryVo.class); util.exportExcel(response, vos, "字典类型"); } ``` ### Technical Analysis The detail and export endpoint templates do not include `@PreAuthorize` checks. This is inconsistent with the Skill's stated requirement that every controller endpoint carry an explicit permission check and with its documented permission format: ```java @PreAuthorize("@ss.hasPerms('{domain}:{entity}:{action}')") ``` The `@Encrypt` annotation only concerns response protection; it does not establish whether the caller is authorized to access the underlying data. Consequently, applications copied or generated from these templates may expose the endpoints to users who do not hold the corresponding business permissions. The actual exploitability depends on the consuming application's global Spring Security configuration. If global route rules only require authentication, or permit these routes without method-level authorization, any user satisfying those broader rules could invoke the affected operations. ### Attack Path 1. A developer copies the docum ...[truncated 1546 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add explicit permission checks to both templates: ```java @GetMapping(value = "dictionary/{dictId}") @PreAuthorize("@ss.hasPerms('system:dictionary:detail')") @Encrypt public ResponseEntity<BaseDictionaryVo> getInfo(@PathVariable Long dictId) { BaseDictionaryDto dto = baseDictionaryService.getDtoById(dictId); return success(BaseDictionaryVo.DTO.apply(dto)); } ``` ```java @PostMapping("dictionary/export") @PreAuthorize("@ss.hasPerms('system:dictionary:export')") @Encrypt public void export(HttpServletResponse response, BaseDictionaryVoParam param) { Page<BaseDictionaryDto> result = baseDictionaryService.getPageDto(param.toModelParam()); List<BaseDictionaryVo> vos = Lists.transform(result.getResult(), BaseDictionaryVo.DTO); ExcelUtil<BaseDictionaryVo> util = new ExcelUtil<>(BaseDictionaryVo.class); util.exportExcel(response, vos, "Dictionary Type"); } ``` 2. Review every reusable controller example and generator template to ensure list, detail, save, update, delete, and export operations each require an operation-specific permission. 3. Configure Spring Security to deny access by default so that an accidentally omitted method annotation does not expose a route. 4. Add automated authorization tests for every endpoint. Verify that: - Requests without authentication are rejected. - Authenticated users without the required permission receive HTTP 403. - Only users with the exact operation-specific permission can retrieve or export data. 5. Apply data-scope authorization in addition to endpoint authorization where users are permitted to access only records belonging to their organization, department, tenant, or ownership scope. 6. Add a static-analysis or review rule that flags controller methods lacking `@PreAuthorize` or an explicitly documented alternative authorization mechanism. ]]>
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 (3)

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The entire skill description is written only in Chinese, and there is no indication that users may choose another language or that the skill is intended exclusively for a Chinese-language audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The title and all instructional content are written exclusively in Chinese, which indicates a fixed language expectation for the skill documentation. Under the policy, forcing a specific language without user opt-in or a documented justification is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
82% confidence
Finding
The title and the entire document are written in Chinese, but the file does not state that the skill or reference is specifically intended for Chinese-speaking users or a China-only environment. Under the language/locale policy, forcing a single language without opt-in or justification is a natural-language policy concern.

Static analysis

No suspicious patterns detected.