unstale

pypi / litestar

litestar

What changed in litestar 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

3 breaking5 security2 new APIs and options18 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

litestar 228 changes

Breaking changes 3

  • OPTIONS and HEAD requests are no longer authenticated by default.

    2.0.0release notes

  • OpenAPI responses now prefer aliased fields.

    2.0.0release notes

  • OPTIONS and HEAD requests are no longer authenticated by default.

    2.0.0release notes

Security 5

  • Litestar: AllowedHostsMiddleware bypasses host validation via client-controlled X-Forwarded-Host header

    2.22.0security advisory

  • Litestar has HTML Injection Through its CSRF Token

    2.22.0security advisory

  • Litestar's AllowedHosts has a validation bypass due to unescaped regex metacharacters in configured host patterns

    2.20.0security advisory

  • Litestar's CORS origin allowlist has a bypass due to unescaped regex metacharacters in allowed origins

    2.20.0security advisory

  • Litestar's FileStore key canonicalization collisions allow response cache mixup/poisoning (ASCII ord + Unicode NFKD)

    2.20.0security advisory

New APIs and options 2

Fixes and other changes 18

  • Improved the typing for Accept.best_match.

    2.19.0release notes

  • Fixed serialization support for Pydantic's AwareDatetime.

    2.19.0release notes

  • Stopped checking for Path in the default deserializer.

    2.19.0release notes

  • Fixed KeyError swallowing in the default serializer.

    2.19.0release notes

  • Fixed passing guards to the underlying websocket handler.

    2.19.0release notes

  • Added support for Python 3.14.

    2.19.0release notes

  • Added sniffio as a dependency.

    2.19.0release notes

  • Fixed required-field handling for TypedDict on Python 3.8.

    2.19.0release notes

  • App debug settings now propagate to exception handling middleware.

    2.0.0release notes

  • OpenAPI uses contentMediaType rather than contentEncoding for application/octet-stream.

    2.0.0release notes

  • Excluded attributes are no longer accessed during transfer.

    2.0.0release notes

  • create_instance now honors renaming.

    2.0.0release notes

  • The receive and send parameters now have default values.

    2.0.0release notes

  • Error responses now include media_type.

    2.0.0release notes

  • Example generation is now deterministic.

    2.0.0release notes

  • Example generation for Pydantic models is fixed.

    2.0.0release notes

  • The repository now handles dialects that do not support JSON.

    2.0.0release notes

  • Static files are served when a route handler with the same base path is registered.

    2.0.0release notes