Upgrading asgiref 2 to 3
Breaking2.3.2 → 3.13.0Breaking3Security2Platform12Deprecated3New12Changed19Fixed46Other2
SecurityFixes CVE-2025-14550, a DoS vector in WsgiToAsgi from malicious requests with many repeated header values.CVE-2025-14550 ↗
BreakingUpgrade verdict
3 breaking changes and 12 platform requirement changes and 2 security fixes.
In plain terms
- The ASGI_THREADS environment variable no longer configures the thread pool. Servers or applications must set the default executor themselves when setting up the event loop at startup.
- The library now follows a newer version of the ASGI standard, so code written for the old standard may need updating.
- Accessing attributes on Local is now much faster, but you can no longer subclass Local; doing so raises a TypeError.
- The package now works on Python 3.15.
Must act Top 5 of 20 that need code or config changes
Requires Python >=3.11 from 3.13.0 (none stated before).
Drops async-timeout.
Installs 0 packages in all (was 1).
What you must change
Breaking3
Removes support for the ASGI_THREADS environment variable used by SyncToAsync.
ASGI_THREADSSyncToAsyncUpdates the package to match the new ASGI 3.0 spec.
Makes Local attribute access 2-3x faster via internal specialisations and marks Local as @final, raising TypeError on subclassing.
Localthread_criticalSecurity2
Fixes CVE-2025-14550, a DoS vector in WsgiToAsgi from malicious requests with many repeated header values.
asgiref.wsgi.WsgiToAsgiMakes header handling more efficient and adds a duplicate_header_limit parameter to WsgiToAsgi, defaulting to 100.
WsgiToAsgiduplicate_header_limitPlatform12
Adds support for Python 3.15.
Drops support for EOL Python 3.10.
Drops support for end-of-life Python 3.9.
Adds support for Python 3.14.
Adds support for Python 3.13.
Drops support for end-of-life Python 3.8.
Adds support for Python 3.12.
Drops support for end-of-life Python 3.7.
Contextvars are now required for the implementation of sync as Python 3.6 is no longer supported.
syncDrops support for Python 3.6 and switches asyncio calls to modern APIs only.
Drops Python 3.5 support.
Adds support and testing for Python 3.8.
Deprecations to plan for
Deprecated3
Deprecates asgiref.timeout.timeout, to be removed in a future release; use asyncio.timeout() instead.
asgiref.timeout.timeoutasyncio.timeout()Deprecates the loop argument to asgiref.timeout.timeout; the running event loop is used by default.
asgiref.timeout.timeoutloopRenames all Websocket* types to WebSocket; old names work until 3.5.0 but raise deprecation warnings.
WebsocketScopeWebSocketScope