open-webui/backend/open_webui
Classic298 f0a4dd9668 fix: reject skill IDs that are not URL path safe
A skill ID goes straight into the path of every mutating skill endpoint (/api/v1/skills/id/{id}/...), but create only replaced spaces with hyphens. An ID containing a "/" was stored verbatim as the primary key, so the route never matched, the request fell through to the SPA static mount and the client got 405 Method Not Allowed. The skill could not be opened, edited, toggled or deleted, by admins either, and since skill.name is UNIQUE it could not be recreated under a corrected ID. Percent-encoding does not help: uvicorn decodes the path before Starlette routes it, so the only remaining fix was a direct database write.

Create now rejects any ID outside [a-z0-9_-] with 400 instead of silently storing an unreachable one. Two frontend paths that fed unsanitized IDs into it are fixed as well: the manual "Skill ID" field, which was bound with no sanitization at all and is the path that reproduces on every version, and the markdown import, which put the raw frontmatter name into the ID before opening the editor in clone mode, where the reactive slugify is disabled.

Existing rows with an unreachable ID are not repaired here; rewriting a primary key would also have to re-point the access grants keyed on it.

Fixes #27655
2026-07-28 19:44:31 +02:00
..
data
internal perf: route native JSON columns through JSONCodec instead of stdlib json (#28396) 2026-08-10 19:39:49 -05:00
migrations refac 2026-08-10 23:22:08 -06:00
models refac 2026-08-11 01:15:05 -06:00
retrieval refac 2026-08-10 23:40:31 -06:00
routers fix: reject skill IDs that are not URL path safe 2026-07-28 19:44:31 +02:00
socket refac 2026-08-10 23:13:10 -06:00
static refac 2026-07-27 19:39:36 -04:00
storage refac 2026-07-31 17:41:14 -04:00
tools refac 2026-08-10 20:13:03 -06:00
utils refac 2026-08-11 01:17:19 -06:00
__init__.py refac 2026-07-27 19:39:36 -04:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-08-11 01:15:05 -06:00
constants.py refac 2026-07-27 19:39:36 -04:00
env.py fix: make the aiodns resolver opt-in and pin aiodns to 3.6.1 (#28242) 2026-08-10 19:52:29 -06:00
events.py refac 2026-08-10 23:13:10 -06:00
functions.py perf: build debug log messages lazily so disabled debug logs cost nothing (#27834) 2026-07-31 19:09:01 -05:00
main.py fix: send stream_options.include_usage for backend-initiated chats (#27661) 2026-08-10 23:30:46 -06:00
tasks.py refac 2026-07-31 17:41:14 -04:00