schema-hardening
Expert review of Pydantic and data transfer schema validation constraints to prevent mass assignment vulnerabilities.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert review of Pydantic and data transfer schema validation constraints to prevent mass assignment vulnerabilities.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Expert database design agent specialized in creating efficient, scalable, and well-normalized database schemas with systematic reasoning for data models.
Comprehensive software architecture skill for designing scalable systems using Clean Architecture/DDD. Includes dependency analysis for layer enforcement.
Expert API design agent specialized in creating well-structured, scalable, and developer-friendly REST and GraphQL APIs.
Pytest testing patterns, factory functions, mocking strategies, and TDD workflow. Use when writing unit tests, creating test factories, following TDD red-green-refactor cycle, or determining test coverage priorities.
Expert review of multi-tenant and branch isolation safety, ensuring no query data leaks or cross-tenant access.
Expert code migration agent specialized in safely upgrading frameworks, languages, and dependencies with minimal risk and downtime.
| name | schema-hardening |
| description | Expert review of Pydantic and data transfer schema validation constraints to prevent mass assignment vulnerabilities. |
| skill_type | universal |
| version | 1.0.0 |
Expert guidelines to check input schemas (Pydantic models, JSON schemas) and prevent mass-assignment (CWE-915) or field-injection vulnerabilities.
model_config = ConfigDict(extra="forbid") or inherit from a project-wide hardened base class.EmailStr, PositiveInt, Field(max_length=...) instead of raw str or int attributes).| Excuse / Rationalisation | Why it fails / Rebuttal |
|---|---|
| "Pydantic ignores extra parameters by default, so we don't need extra='forbid'." | Ignoring parameters allows clients to send unvalidated inputs that could silently bind to backend models or logic. Hard-failing is the safe poka-yoke design. |
| "I will add validation logic directly inside the repository layer later." | Input schemas at the boundary must validate payloads first before they reach any service or database layer. |