{"record":{"id":"3d4e2d8ec152970b","repo":"zylon-ai/private-gpt","slug":"path-must-be-relative-and-cannot-contain","errorCode":null,"errorMessage":"path must be relative and cannot contain '..'","messagePattern":"path must be relative and cannot contain '\\.\\.'","errorType":"validation","errorClass":"ValueError","httpStatus":422,"severity":"error","filePath":"private_gpt/server/skills/skill_models.py","lineNumber":24,"sourceCode":"\nfrom private_gpt.components.skills.models.skill_entities import SkillFilter\nfrom private_gpt.components.storage.models import StoredFile\n\n\nclass SkillFileInput(BaseModel):\n    path: str = Field(\n        description=\"Relative path from skill root\",\n        min_length=1,\n        max_length=512,\n    )\n    content_base64: str = Field(description=\"Base64 content\", min_length=1)\n    mime_type: str | None = Field(default=None, description=\"Optional mime type\")\n\n    @field_validator(\"path\")\n    @classmethod\n    def validate_path(cls, value: str) -> str:\n        if value.startswith(\"/\"):\n            raise ValueError(\"path must be relative and cannot contain '..'\")\n        if \"\\\\\" in value:\n            raise ValueError(\"path must use '/' separators only\")\n        if \"..\" in value.split(\"/\"):\n            raise ValueError(\"path must be relative and cannot contain '..'\")\n        return value\n\n    def to_payload(self) -> StoredFile:\n        return StoredFile(\n            path=self.path,\n            content=base64.b64decode(self.content_base64),\n            mime_type=self.mime_type,\n        )\n\n\nclass CreateSkillBody(BaseModel):\n    display_title: str = Field(\n        description=\"Display title for the skill.\",\n        min_length=1,","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/server/skills/skill_models.py#L6-L42","documentation":"Error \"path must be relative and cannot contain '..'\" thrown in zylon-ai/private-gpt.","triggerScenarios":"Raised during skill file path validation when the path is absolute or contains '..' traversal segments.","commonSituations":"Uploading a skill bundle whose file entries use absolute paths or parent-directory references; paths must be relative within the bundle.","solutions":["Provide a relative path without any '..' segments.","Remove leading slashes and parent-directory references from the path before submitting.","Sanitize client-supplied paths to reject or normalize traversal sequences."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}