Sanic 25.12
Last reviewed Sep 25, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- Sanic 25.1279 lines · 3.8K tokens
Total234 lines · 7.6K tokens
CWE Coverage
- 15
- 20
- 22
- 23
- 36
- 59
- 78
- 79
- 89
- 95
- 113
- 117
- 201
- 208
- 209
- 214
- 250
- 287
- 288
- 295
- 306
- 319
- 328
- 338
- 347
- 352
- 367
- 379
- 384
- 409
- 416
- 426
- 427
- 470
- 488
- 502
- 524
- 532
- 552
- 601
- 611
- 613
- 614
- 639
- 674
- 732
- 770
- 772
- 776
- 807
- 829
- 862
- 916
- 918
- 942
- 1004
- 1104
- 1275
- 1333
- 1395
Prompt Preview
Apply python/python/3 first. These rules cover the Sanic 25.12 LTS line, checked against 25.12.1, on maintained Python 3.10–3.14 runtimes. Distinguish the native Sanic server from ASGI deployments and review optional extensions at their installed versions.
Version and application setup
- Keep HTTP/1.1 parsing and response serialization in Sanic's native implementation rather than a custom protocol class or serializer: in 25.12.1 the native server rejects a chunked request that carries trailer fields and closes the connection, so trailer bytes can't be reparsed as a smuggled second request, and the serializer strips CR, LF, and NUL from response header names and values.
- Load route handlers, blueprints, listeners,
app.update_config()files, and configuration converters only from trusted application code; Python configuration files execute code, and automatically loadedSANIC_environment values can change security settings. - Decide explicitly whether to enable Sanic Extensions:
AUTO_EXTEND=Trueautomatically activates an installedsanic-ext. Set it toFalsewhen unused, and review generated documentation routes, extra HTTP methods, CORS, validation, and serializers when enabled.
Authentication, routes, and middleware
- Verify credentials before assigning an identity to
request.ctx;request.tokenandrequest.credentialsonly extract authorization data and do not authenticate it. Reject duplicateAuthorizationheaders, enforce the intended authentication scheme, and authorize the requested tenant, object, and operation in each protected