Tighten skill name allowlist to exclude '.' (path traversal)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
5a7bc1639d
commit
b7c7c254b0
|
|
@ -133,7 +133,7 @@ def load_json_file(path: Path, default=_MISSING):
|
|||
except (json.JSONDecodeError, OSError, UnicodeDecodeError) as e:
|
||||
raise HTTPException(500, f"Failed to read {path.name}: {e}")
|
||||
|
||||
SKILL_NAME_RE = re.compile(r"^[A-Za-z0-9._-]+$")
|
||||
SKILL_NAME_RE = re.compile(r"^[A-Za-z0-9_-]+$")
|
||||
|
||||
def skill_dir(name: str) -> Path:
|
||||
"""Resolve a user-supplied skill name to its directory, rejecting path traversal."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue