T05 · Unauthorized Access and Privilege Escalation
- Location
templates/CORE_MODULES.md:257- Finding
Object-Level Authorization Result Is Discarded
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This code-generation skill is not deceptive, but its generated admin/security code contains unsafe authorization and default-password patterns that need review before use.
Use this only in a disposable branch or sandbox. Before merging generated code, fix the object-permission return path, remove the 0000 default password, validate module names and output paths, avoid automatic overwrites, pin the upstream project and dependencies, and run security-focused tests for authentication, authorization, and destructive CRUD actions.
templates/CORE_MODULES.md:257Object-Level Authorization Result Is Discarded
templates/CORE_MODULES.md:486New Accounts Receive a Predictable Default Password
templates/generator.py:281Unsanitized Module Name Enables Output Path Traversal and File Overwrite
SKILL.md:371Setup Instructions Install Code from Mutable and Unverified Third-Party Sources
Referenced artifact was not completely inspected
| `templates/LOGIC_FLOW.md` | 流程逻辑(登录/权限校验/数据权限) |
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
<!-- 1. 菜单权限 (路由守卫) -->
<el-menu>
<el-menu-item v-if="hasPermission('user')">用户管理</el-menu-item>
</el-menu>
The object-level permission hook calls has_obj_perm(request.user, obj) but ignores its return value and then unconditionally returns True. As a result, any authenticated user can access objects that should be blocked by department or data-scope restrictions, defeating the intended row-level authorization checks.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
| | POST /api/system/user/ | user_create | 创建用户 |
| | GET /api/system/user/{id}/ | * | 用户详情 |
| | PUT /api/system/user/{id}/ | user_update | 更新用户 |
| | DELETE /api/system/user/{id}/ | user_delete | 删除用户 |
| | GET /api/system/user/info/ | - | 当前用户信息 |
| | PUT /api/system/user/password/ | - | 修改密码 |
| 角色 | GET /api/system/role/ | * | 角色列表 |
The skill explicitly tells users they can directly copy generated code into their project, but it provides no warning to review the code, validate security controls, or avoid overwriting existing files. In a code-generation skill that emits backend routes, serializers, models, and frontend code, this can lead to unsafe or integrity-impacting changes being introduced into production codebases without scrutiny.
The workflow presents generated backend and frontend files as ready to drop into specific project paths, culminating in direct use by the user, without any caution about destructive edits, overwriting application files, or introducing insecure patterns. Because the skill generates full-stack CRUD code that touches models, views, URLs, and client logic, the lack of review guidance increases the risk of accidental integrity loss and deployment of insecure code.
This markdown file contains skill instructions and descriptions exclusively in Chinese, including headings, comments, and API documentation. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified, which is not present here.
The signal claims to refresh permission caches when roles change, but it only listens to User.roles membership changes and only for post_add/post_remove. Changes to a Role's permissions, or cache staleness after other relevant updates, can leave users with outdated authorization data, causing privilege retention or incorrect denials until cache expiry.
The table describes /api/token/black/ as GET for logout while stating it adds the token to a blacklist. A GET request is conventionally read-only, and token blacklisting is a server-side state change that normally requires a POST with the refresh token payload; the documentation therefore contradicts the actual semantics of the operation.
This markdown file is titled entirely in Chinese and presents all instructional content in Chinese without indicating that language selection is optional. Under the policy rule for language or locale constraints, this can be treated as a natural-language policy issue because users are not offered an explicit opt-in or alternative locale.
This markdown template consistently prescribes Chinese field names, comments, verbose_name values, and UI labels such as '名称', '产品', and '订单'. Under the policy, forcing a specific language without user opt-in is a natural-language locale constraint and should be documented as optional or region-specific.
This markdown file is written as a skill template and its title immediately establishes Chinese-only output/usage context. Under the policy rule, forcing a specific language without user opt-in is a natural-language locale violation because no alternative language option or justification is provided anywhere in the file.
The inline comment 所有人可访问 (需登录) is internally contradictory because 'everyone can access' is not true if authentication is still required. The surrounding configuration shows global IsAuthenticated enforcement, so the real behavior is 'any authenticated user' rather than literally everyone.
The natural-language strings in the template docstring are written only in Chinese ("模块 URL 路由模板" and "自动生成时间"), which indicates a fixed language choice in generated output. For a general backend template, this can violate language/locale policy when no user opt-in or region-specific justification is provided.
This code template includes natural-language strings exclusively in Chinese, such as the module docstring and generated-time label. Under the policy for language/locale constraints, this can constitute a forced language choice when the skill does not offer any user opt-in or locale selection.
The module-level documentation states this is a code generator that automatically generates '完整 CRUD 代码' from models. In implementation, the script writes serializers.py, views.py, urls.py, and a frontend API JS file, but does not generate templates/views/components that would ordinarily make the CRUD output 'complete'. This is an intent/documentation overclaim rather than a security-relevant capability expansion.
The module docstring is entirely in Chinese and presents the skill as a Chinese-language code generator, with no indication that other languages are supported or that the locale is region-specific by design. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.